realchart 0.9.14 → 0.9.15

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.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart v0.9.14
3
+ * RealChart v0.9.15
4
4
  * Copyright (C) 2023-2023 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";let e=0;class s{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(e++))}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 i extends s{wrapper(){return this._wrapper}wrapperOrThis(){return this._wrapper||this}createWrapper(t){const e=this._wrapper=new t;return e.$_c=this,e}setWrapper(t){return this._wrapper=t,t.$_c=this,t}isWrapper(t){return t===this._wrapper}}class r extends s{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 n="http://www.w3.org/2000/svg",a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},h=Array.isArray,o=function(t){return"string"==typeof t},l=function(t){return"number"==typeof t},c=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},u=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},d=function(t,e){return void 0!==t?t:e},_=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},g=(t,e)=>{const s=Object.assign({},t);for(const i in e){const r=e[i];a(r)&&a(t[i])?s[i]=g(t[i],r):s[i]=r}return s};class p{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}p._debugging=!1;const m={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let w=m.ko;const b=void 0,x="%".charCodeAt(0),f=2*Math.PI,y=-Math.PI/2,v=2*Math.PI/360,V=360/Math.PI/2,S=Math.ceil;function P(t){return parseFloat(t.toPrecision(12))}function k(t){return null==t?null:String(t)}function A(t){return t+"px"}function E(t){return null==t||Number.isNaN(t)||""===t}function L(t,e){const s={};return s[t]=e,s}function C(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)===x?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;I(w.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 T(t,e){return C(t,!0)||C(e,!1)}function M(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const N={fill:"fill",stroke:"stroke",strokeWidth:"stroke-width",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},O=function(t){const e=N[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return N[t]=e,e}return e};class D extends Error{}const R=function(t,e){if(!t)throw new D(e)};var B;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(B||(B={}));const I=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var $,F,z,H;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}($||($={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(F||(F={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(z||(z={})),function(t){t.CHART="chart",t.PLOT="plot"}(H||(H={}));const G=function(t,e,s){let i,r;return h(t)&&(i=[],t.forEach((t=>{if(a(t)&&o(t.color)){const n={fromValue:c(t.fromValue,r?r.toValue:e),toValue:c(t.toValue,s),color:t.color};n.fromValue<n.toValue&&(i.push(n),r=n)}})),i=i.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),i.forEach((t=>{t.fromValue=Math.max(t.fromValue,e),t.toValue=Math.min(t.toValue,s)}))),i};let j=651212;class W{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,a=s.pageYOffset||n.scrollTop||r.scrollTop,h=s.pageXOffset||n.scrollLeft||r.scrollLeft,o=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+h-l,u=i.top+a-o;return{x:Math.round(c),y:Math.round(u)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)W.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const a={},h={};return a[e]=s,h[e]=i,t.animate([a,h],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+j++}static stopAnimation(t){if(t)try{t.finish()}catch(t){p.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}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 Y=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});let U=!1,X=!1;"undefined"!=typeof window&&(U=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,X=!!window.chrome&&!U,Object.prototype.toString.call(HTMLElement).indexOf("Constructor")>0||!X&&!U&&navigator.userAgent.indexOf("Safari"),navigator.userAgent.toLocaleLowerCase().indexOf("samsungbrowser"),navigator.userAgent.toLocaleLowerCase().indexOf("miuibrowser"));const q=/"([^"]*(?="))"/,Z=/'([^']*(?='))'/,K='"'.charCodeAt(0),Q="'".charCodeAt(0);class J{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 stopEvent(t,e=!1){t.preventDefault?(t.preventDefault(),t.stopPropagation()):t.returnValue=!1,e&&t.stopImmediatePropagation()}static getErrorStack(t){const e=t.stack;return e?e.split("\n").map((t=>t+"<br/>")):""}static getBaseClassName(t){return Object.getPrototypeOf(t.constructor).name}static isObject(t){return t&&"object"==typeof t&&!h(t)}static assign(t,e){this.isObject(e)&&Object.assign(t,e)}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&&!h(t))return Object.assign({},t)}static checkArray(t){return h(t)?t:void 0}static makeArray(t,e=!1){return null!=t?h(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return h(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(h(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 h(t)?t:null!=t?[t]:null}static copyArray(t){return h(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 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()-Y}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=Math.max(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 cast(t,e){return t instanceof e?t:null}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 irandomExcept(t,e,s){if(0===t&&1===e&&isNaN(s))throw new Error("Invalid irandom2");for(;;){const i=this.irandom(e,s);if(i!==t)return i}}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(J.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 toEven(t){return 1&t?t+1:t}static hex(t,e=2,s="0"){e=Math.max(e||2,1);const i=t.toString(16);return s=s||"0",new Array(e-i.length+1).join(s)+i}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(Math.min(s,J.month_days[J.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 capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=h(t)?[]:{};for(let s of Object.keys(t))e[s]=J.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 hasSetter(t,e){for(;t;){const s=Reflect.getOwnPropertyDescriptor(t,e);if(s)return s.writable||!!s.set;t=Object.getPrototypeOf(t)}return!1}static dataUriToBinary(t){const e=";base64,",s=t.indexOf(e)+8,i=t.substring(s),r=window.atob(i),n=r.length,a=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t++)a[t]=r.charCodeAt(t);return a}static assignProps(t,e){let s=!1;if(e)for(let i in e)e[i]!==t[i]&&(t[i]=e[i],s=!0);return s}static assignStyleAndProps(t,e){let s=!1;if(e)for(let i in e)("style"===i||t.hasOwnProperty(i))&&(t[i]=e[i],s=!0);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 isUnique(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)if(t[s]===t[s-1])return!1;return!0}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),console.log(t,+new Date-s+"ms")}static clamp(t,e,s){return Math.max(e,Math.min(s,t))}static makeIntArray(t,e){const s=new Array(Math.max(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static setInterval(t,e){return setInterval(t,e)}static clearInterval(t){clearInterval(t)}static isStringArray(t){return h(t)&&t.every((t=>"string"==typeof t))}static isNumberArray(t){return h(t)&&t.every((t=>"number"==typeof t))}static makeLineSeparator(t){if(h(t)){if(t.length>0){let e=t[0];for(let s=1,i=t.length;s<i;s++)e+="|"+t[s];return new RegExp(e,"g")}}else if(t)return new RegExp(t,"g")}static stripQuotes(t){const e=t.charCodeAt(0);return e===K?t=t.replace(q,"$1"):e===Q&&(t=t.replace(Z,"$1")),t}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=Math.abs(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}}function tt(t){return{width:t.width,height:t.height}}J.week_days=["일","월","화","수","목","금","토"],J.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],J.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]],J.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();class et{static create(t,e,s,i){return J.isObject(t)?new et(t.x,t.y,t.width,t.height):E(e)?new et(t,t,t,t):E(s)?new et(t,e,t,e):new et(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return t=this,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height));var t}clone(){return new et(this.x,this.y,this.width,this.height)}getInner(){return new et(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}var st;et.Empty=new et,et.Temp=new et,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.RECTANGLE="rectangle",t.SQUARE="square",t.TRIANGLE="triangle",t.ITRIANGLE="itriangle",t.STAR="star"}(st||(st={}));const it=J.getEnumValues(st),rt=.001;class nt{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,"L",t+s,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static square(t,e,s,i){const r=Math.min(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"L",t+r,e,"L",t+r,e+r,"L",t,e+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=Math.cos(r),l=Math.sin(r),c=Math.cos(n-=rt),u=Math.sin(n),d=n-r-Math.PI<rt?0:1,_=a?1:0,g=[];return g.push("M",t+s*o,e+i*l,"A",s,i,0,d,_,t+s*c,e+i*u),h&&g.push("Z"),g}static sector(t,e,s,i,r,n,a,h){const o=2*Math.PI-Math.abs(a-n)<rt;let l=Math.abs(a-n)-Math.PI<rt?0:1;const c=h?1:0,u=Math.cos(n),d=Math.sin(n),_=Math.cos(a-=o?c?rt:-.001:0),g=Math.sin(a),p=s*r,m=i*r,w=[];return w.push("M",t+s*u,e+i*d,"A",s,i,0,l,c,t+s*_,e+i*g),o?w.push("M",t+p*_,e+m*g):w.push("L",t+p*_,e+m*g),isNaN(p)||w.push("A",p,m,0,l,1-c,t+p*u,e+m*d),w.push("Z"),w}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){const r=t+s/2,n=e+i/2,a=s/2,h=i/2,o=s/4,l=i/4,c=2*Math.PI/5,u=c/2,d=[];let _=-Math.PI/2;d.push("M",r+a*Math.cos(_),n+h*Math.sin(_));for(let t=0;t<5;t++)d.push("L",r+a*Math.cos(_),n+h*Math.sin(_)),d.push("L",r+o*Math.cos(_+u),n+l*Math.sin(_+u)),_+=c;return d.push("Z"),d}static setShape(t,e,s){let i;switch(e){case st.SQUARE:case st.RECTANGLE:case st.DIAMOND:case st.TRIANGLE:case st.ITRIANGLE:case st.STAR:i=nt[e](0,0,2*s,2*s);break;default:i=nt.circle(s,s,s)}t.setPath(i)}}var at;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(at||(at={}));const ht={name:"RealChart",version:"0.9.14",license:"enterprise",code:""};class ot{static decode(t){const e=ot.CHARS,s=ot.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}}ot.PAD="=",ot.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class lt{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=lt.xor,i=lt.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=lt.xor,i=lt.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=lt.kb,i=lt._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*lt.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=lt._decryptBlock;let i=lt._init(e),r=[],n=ot.decode(t),a=n.length>>3,h=0,o={left:null,right:null};for(let t=0;t<a;t++){o.left=n[h]*lt.POW24|n[h+1]*lt.POW16|n[h+2]*lt.POW8|n[h+3],o.right=n[h+4]*lt.POW24|n[h+5]*lt.POW16|n[h+6]*lt.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)}}lt.POW2=Math.pow(2,2),lt.POW3=Math.pow(2,3),lt.POW4=Math.pow(2,4),lt.POW8=Math.pow(2,8),lt.POW16=Math.pow(2,16),lt.POW24=Math.pow(2,24),lt.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 ct{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=lt.decrypt(t,"dkdl"+this._getLDKey(lt.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 i{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;try{if(e=realChartLic,!e)throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}catch(t){throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}const s=ct.decrypt(e);if("RealChart"!=s.name||"RealChart"!==ht.name)throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/");try{const e=s.server.toLowerCase(),i=location.pathname.toLowerCase();if(ht.license!=at.Developer&&!ct.includedDomains(e,t.toLowerCase(),i))throw new Error;const r=s.lic.toLowerCase();if(!Object.values(at).includes(r))throw new Error;if(ht.code=s.code,ht.license=s.lic,r==at.Evaluation||r==at.Limited){const t=s.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("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}}(),!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),W.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}setData(t,e,s){E(e)?(delete this._svg.dataset[t],s&&delete this._dom.dataset[t]):(this._svg.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){W.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs,s=e.children;for(let i=0;i<s.length;i++)s[i].hasAttribute(t)&&e.removeChild(s[i])}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)}removeElement(t){this._root.removeChild(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 pt(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)}clipPath(){const t=new wt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(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.getBBounds();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(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||I(w.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden",padding:"20px","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const a=this._svg=i.createElementNS(n,"svg");a.classList.add("rct-root"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const h=i.createElement("desc");h.textContent="Created by RealChart v0.9.14",a.appendChild(h);const o=this._defs=i.createElementNS(n,"defs");this._initDefs(i,o),a.appendChild(o),r.appendChild(a),this._root=new gt(this),a.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(n,"filter");const i=t.createElementNS(n,"feDropShadow");s.setAttribute("id",ut.SHADOW_FILTER),i.setAttribute("dx","1"),i.setAttribute("dy","1"),i.setAttribute("flood-olor","#000"),i.setAttribute("flood-opacity","0.75"),i.setAttribute("stdDeviation","1.5"),s.appendChild(i),e.appendChild(s)}_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{console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;Object.assign(this._htmlRoot.style,{left:A(e.left-t.left),top:A(e.top-t.top)}),this._doRender({x:0,y:0,width:s,height:i}),this._doRenderBackground(this._container.firstElementChild,s,i)}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s){}_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 s{constructor(t,e,s=b){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(n,s||"g"),(this._styleName=e||"")&&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._translateX}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._translateY}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.setVisible(t)}setVisible(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())}setRotaion(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}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}appendElement(t,e){const s=t.createElementNS(n,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(n,e);return this._dom.insertBefore(i,s),i}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return E(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];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.translate(t,e),this.resize(s,i),this}setRect(t){return this.translate(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return et.create(this._translateX,this._translateY,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}getBBounds(){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}movep(t){return this.x=t.x,this.y=t.y,this}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}translate(t,e){return t===this._translateX&&e===this._translateY||(J.isValidNumber(t)&&(this._translateX=t),J.isValidNumber(e)&&(this._translateY=e),this._updateTransform()),this}translatep(t){return this.translate(t.x,t.y)}translateEx(t,e,s=0,i=!0){if(t=J.isNumber(t)?t:this._translateX,e=J.isNumber(e)?e:this._translateY,t!==this._translateX||e!==this._translateY){if(s>0){const r=this._dom.animate([{transform:`translate(${this._translateX}px,${this._translateY}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._translateX=t,this._translateY=e,this._updateTransform()}return this}translateX(t){return t!==this._translateX&&J.isValidNumber(t)&&(this._translateX=t,this._updateTransform()),this}translateY(t){return t!==this._translateY&&J.isValidNumber(t)&&(this._translateY=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&s&&this.setAttr("width",this._width=t),e!==this._height&&s&&this.setAttr("height",this._height=e),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(O(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(O(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(O(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){o(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this._dom.classList.add(t):a(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)}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setData(t,e){this.dom.dataset[t]=d(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.setVisible(!1)}))}else this.setVisible(!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)}_testing(){return dt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._translateX,s=this._translateY,i=[];(J.isValidNumber(e)||J.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),J.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+J.pick(this._originX,t.getAttribute("x"),0)+" "+J.pick(this._originY,t.getAttribute("y")||0)+")");const r=J.getNumber(this._scaleX,1),n=J.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}dt.TESTING=!1,dt.DEBUGGING=!1,dt.ASSET_KEY="_asset_",dt.TEMP_KEY="_temp_";class _t extends dt{constructor(t,e){super(t,e,"g")}}class gt extends dt{constructor(t){super(t.doc(),null),this._control=t}get control(){return this._control}}class pt extends dt{constructor(t,e,s,i,r,n=0,a=0){super(t,b,"clipPath");const h=this._id=J.uniqueKey()+"-";this.setAttr("id",h);const o=this._rect=new dt(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}get id(){return this._id}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),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 mt 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=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}renderShape(t,e,s,i){let r;switch(t){case"squre":case"diamond":case"triangle":case"itriangle":r=nt[t](e-i,s-i,2*i,2*i);break;default:r=nt.circle(e,s,i)}this.setPath(r)}}class wt extends dt{constructor(t){super(t,b,"clipPath");const e=this._id=J.uniqueKey()+"-";this.setAttr("id",e),this._path=new mt(t),this.add(this._path)}get id(){return this._id}setPath(t){this._path.setPath(t)}}class bt{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){}}class xt{constructor(t){this.source=t}}class ft extends xt{_setStops(t,e){const s=t.createElementNS(n,"stop"),i=t.createElementNS(n,"stop"),r=this.source.color,a=E(this.source.opacity)?1:this.source.opacity,o=h(r)?r[0]:r,l=h(r)&&r.length>1?r[1]:"white",c=h(a)?a[0]:a,u=h(a)&&a.length>1?a[1]:a;e.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",l),s.setAttribute("stop-opacity",c),i.setAttribute("offset","1"),i.setAttribute("stop-color",o),i.setAttribute("stop-opacity",u),e.appendChild(s),e.appendChild(i)}}class yt extends ft{getEelement(t,e){const s=t.createElementNS(n,"linearGradient");let{x1:i,x2:r,y1:a,y2:h}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),e.dir){case"up":a=1;break;case"right":r=1;break;case"left":i=1;break;default:h=1}return s.setAttribute("x1",i),s.setAttribute("y1",a),s.setAttribute("x2",r),s.setAttribute("y2",h),s}}yt.TYPE="lineargradient";class vt extends ft{getEelement(t,e){const s=t.createElementNS(n,"radialGradient");return E(e.cx)||s.setAttribute("cx",e.cx),E(e.cy)||s.setAttribute("cy",e.cy),E(e.rd)||s.setAttribute("rd",e.rd),this._setStops(t,s),s}}vt.TYPE="radialgradient";class Vt extends xt{getEelement(t,e){const s=t.createElementNS(n,"pattern"),i=t.createElementNS(n,"path");let r=!1;if(s.setAttribute("id",e.id),s.setAttribute("width",String(e.width||e.height||20)),s.setAttribute("height",String(e.height||e.width||20)),s.setAttribute("patternUnits","userSpaceOnUse"),+e.pattern>=0){const t=Vt.STOCK[+e.pattern%Vt.STOCK.length];i.setAttribute("d",t.path),t.style&&Object.assign(i.style,t.style),r=!t.fill}else o(e.pattern)&&i.setAttribute("d",e.pattern);return a(e.style)&&Object.assign(i.style,e.style),r&&(i.style.fill="none"),s.append(i),s}}Vt.TYPE="pattern",Vt.STOCK=[{path:"M20.03.03-.5 20.45"},{path:"m-.15 8.67 10.16 2.71 10.16-2.71",style:{strokeWidth:"1.24px"}},{path:"M0 20c1.67-1.67 3.49.15 5.15-1.51C6.82 16.82 5 15 6.66 13.34c1.67-1.67 3.49.15 5.15-1.51 1.67-1.67-.15-3.49 1.51-5.16 1.67-1.67 3.49.15 5.16-1.51 1.67-1.67-.15-3.49 1.51-5.16"},{path:"M 10 10 m 5 0 a 5 5 0 1 1 -10 0 a 5 5 0 1 1 10 0",fill:!0},{path:"M.61 7.19h4.95v4.95H.61z m12.38 9.669 3.5-3.5 3.5 3.5-3.5 3.5z",fill:!0},{path:"m18.3 5.18.02.02L10 10 1.68 5.2 10 .39l8.3 4.79M10 19.61 1.68 14.8V5.2 M1.68 5.2 10 10v9.61M10 19.15V10l8.32-4.8M18.32 5.2v9.6L10 19.61"},{path:"M19.64 9.99h-6.46M14.81 1.64l-3.23 5.6M5.17 1.65 8.4 7.26M.36 10.01h6.46M5.19 18.36l3.23-5.6M14.83 18.35l-3.23-5.61"},{path:"M20 5.04H0M0 14.96h20M14.96 20V0M5.04 0v20"},{path:"M.59 18.15 10 1.85l9.41 16.3H.59z"},{path:"m.005 8.165 1.83-3.17 3.17 1.83-1.83 3.17z m5.005 6.825 3.17-1.83 1.83 3.17-3.17 1.83z M.005 1.835l3.17-1.83 1.83 3.17-3.17 1.83z m5.005 3.175 1.83-3.17 3.17 1.83-1.83 3.17z m15.006 6.825 3.17-1.83 1.83 3.17-3.17 1.83z m10.005 8.165 1.83-3.17 3.17 1.83-1.83 3.17zM14.995 3.174l1.83-3.17 3.17 1.83-1.83 3.17z m9.995 1.835 3.17-1.83 1.83 3.17-3.17 1.83z M5 3.2v3.63M15 3.2v3.63M8.17 5h3.66"},{path:"M-.529 13.948 13.203.216l6.562 6.562L6.033 20.51zM9.625 16.928l6.562-6.562L29.92 24.098l-6.562 6.562z"},{path:"m7.98 6.42 7.85-13.59 7.84 13.59H7.98zM27.84 6.42 20 20 12.16 6.42h15.68z"}];class St{constructor(){this._items=[]}count(){return this._items.length}get(t){return this._items[t]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(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)}))}$_loadItem(t){if(a(t)&&t.type&&t.id){if(null!=t.pattern)return new Vt(t);if(t.type)switch(t.type.toLowerCase()){case yt.TYPE:return new yt(t);case vt.TYPE:return new vt(t);case Vt.TYPE:return new Vt(t)}}}}const Pt="0".charCodeAt(0),kt="#".charCodeAt(0),At=",".charCodeAt(0),Et="s".charCodeAt(0),Lt="a".charCodeAt(0);class Ct{static getFormatter(t){let e=Ct.Formatters[t];return e||(Ct.Formatters[t]=e=new Ct(t)),e}static get Default(){return Ct.getFormatter(Ct.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)===Pt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===kt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===Pt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===At){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Et){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===Lt){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}Ct.DEFAULT_FORMAT="",Ct.Formatters={};const Tt="$_TH";class Mt{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e){let i=this.text;for(let r=0;r<s.length;r+=3)i=i.replace(s[r],e(t,s[r+1],s[r+2]));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;){const s=t.indexOf("${",e);if(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(";");a>0?this._literals.push(r,n.substring(0,a),n.substring(a+1)):this._literals.push(r,n,""),e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Nt extends Mt{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 Ot={t:class extends Nt{get type(){return"t"}},b:class extends Nt{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends Nt{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class Dt{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 Mt).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 Ot){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 Ot[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}getText(t,e){let s="";for(let i of this._words)s+=i.getText(t,e);return s}}class Rt{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&(this._format=t,t&&this.$_parse(t))}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=c(this.lineHeight,1),h=this._lines,o=h.length,l=[];let u;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,u=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=Math.max(c,s[Tt]=a.height),u||(u=s)}l.push(u),s[Tt]=c*a}u=h[0][Tt];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(u-t.getAscent(u))+t.getAscent(h[e][Tt]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="&#8203;",u=h[e][Tt]}t.layoutText(h[0][Tt])}$_parse(t){const e=this._lines=[];if(t){const s=t.split(/<br.*?>|\r\n|\n/);for(let t of s)e.push((new Dt).parse(t))}}}let Bt=0;class It extends s{constructor(t,e=!0){super(),this.INVALID={},this.chart=t,this._visible=e,Bt++}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("."),i=e.length-1;let r=this;for(let t=0;t<i;t++)if(r=r[e[t]],!(r instanceof s))return this.INVALID;return{obj:r,prop:e[i]}}}getProp(t){if(o(t)){const e=this.$_parseProp(t);return e?e===this.INVALID?b:e.obj[e.prop]:this[t]}}setProp(t,e,i){if(o(t)){const r=this.$_parseProp(t);if(r)r.obj instanceof It?r.obj.setProp(r.prop,e,i):r.obj instanceof s&&e!==r.obj[r.prop]&&(r.obj[r.prop]=e,i&&this._changed());else if(t in this){const s=this[t];if(s instanceof It)return s.setProps(e,i);if(e!==s)return this[t]=e,i&&this._changed(),!0}}}setProps(t,e){let s=!1;if(a(t))for(const e in t)this.setProp(e,t[e],!1)&&(s=!0);else this._doLoadSimple(t)&&(s=!0);return s&&e&&this._changed(),s}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 e in t){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof It?this[e].load(s):h(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):a(s)?this[e]=Object.assign({},s):this[e]=s)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}_loadStroke(t){if(o(t))return this.visible=!0,this.style={stroke:t},!0}}var $t,Ft,zt,Ht,Gt,jt,Wt;!function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}($t||($t={}));class Yt extends It{constructor(){super(...arguments),this.effect=$t.NONE,this.autoContrast=!0}}class Ut extends Yt{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?Ct.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&(this._text=t,t?(this._richTextImpl||(this._richTextImpl=new Rt),this._richTextImpl.setFormat(t)):this._richTextImpl=null),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r){this._richTextImpl.build(t,e,s,i,r)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(J.isValidNumber(t)){const i=this._numSymbols&&e&&J.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}}class Xt extends It{}!function(t){t.AUTO="auto",t.LINE="line"}(Ft||(Ft={}));class qt extends It{constructor(){super(...arguments),this.minWidth=50}}class Zt extends It{constructor(t){super(t.chart),this.axis=t,this.type=Ft.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.flag=new qt(t.chart),this.visible=!1}isBar(){return!this.axis.isContinuous()&&this.type===Ft.AUTO}getFlag(t,e){const s=this.axis.getValueAt(t,e);return Ct.getFormatter(this.numberFormat).toStr(s)}}class Kt extends It{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class Qt extends Kt{constructor(t){super(t,t._isX)}_doLoadSimple(t){return this._loadStroke(t)||super._doLoadSimple(t)}}!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(zt||(zt={}));class Jt extends Kt{constructor(){super(...arguments),this.align=zt.MIDDLE,this.offset=0,this.gap=5}get rotatin(){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&&!E(this.text)}getRotation(t){return t._isHorz?0:isNaN(this._rotation)?t.position===jt.OPPOSITE?90:270:this._rotation}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}class te extends Kt{constructor(t){super(t,null),this.startVisible=!1,this.endVisible=!t._isX}isVisible(){return null==this.visible?!this.axis._isX:this.visible}getPoints(t){const e=this.axis;return e.hasBreak()?e._ticks.filter((t=>!e.isBreak(t.value))).map((s=>e.getPosition(t,s.value,!1))):e._ticks.map((s=>e.getPosition(t,s.value,!1)))}}class ee extends Ut{constructor(t){super(t,!0),this.align=$.LEFT,this.verticalAlign=F.TOP}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}(Ht||(Ht={}));class se extends Kt{constructor(t){super(t),this.front=!0,this.zindex=0,this.label=new ee(t.chart)}}class ie extends se{}class re extends se{}class ne extends Kt{constructor(t){super(t,!1),this.length=7,this.margin=3,this.integral=!1,this.showFirst=!1,this.showLast=!1}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(Gt||(Gt={}));class ae extends Ut{constructor(t){super(t&&t.chart,!0),this.axis=t,this.step=0,this.startStep=0,this.rows=0,this.autoArrange=Gt.ROTATE,this.wrap=!1,this.numberFormat=null}getRotation(){return this.rotation||0}}!function(t){t.AUTO="auto",t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base",t.BETWEEN="between"}(jt||(jt={}));class he extends Kt{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 oe{constructor(t,e,s){this.axis=t,this.min=t.axisMin(),this.max=t.axisMax(),this.resize(e,s)}get length(){return this.end-this.start}resize(t,e){if(t=isNaN(t)?this.start:Math.max(this.min,Math.min(this.max,t)),e=isNaN(e)?this.end:Math.max(t,Math.min(this.max,e)),t!==this.start||e!==this.end)return this.start=t,this.end=e,!0}}class le extends It{constructor(t,e,s){super(t),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this.guides=[],this.crosshair=new Zt(this),this.scrollBar=new he(this),this.row=0,this.col=0,this.side=!1,this.position=jt.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this._isX=e,this.name=s,this.title=new Jt(this),this.line=new Qt(this),this.tick=this._createTickModel(),this.label=this._createLabelModel(),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}isBased(){return!1}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart._splitted&&this.position===jt.BETWEEN&&this._isX,this._isOpposite=this.position===jt.OPPOSITE,this._doPrepareRender();const t=this._series,e=this._values;this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalcluateRange(e),this._isX&&(this.chart._splitted?[!1,!0]:[!1]).forEach((e=>{let s=0,i=0;t.forEach((t=>{t.isSide()==e&&t.clusterable()&&(s+=c(t.groupWidth,1))})),t.forEach((t=>{if(t.isSide()==e&&t.clusterable()){const e=c(t.groupWidth,1)/s;t.setCluster(e,i),i+=e}}))}))}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t)}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPosition(t,e.value)))}getLabelLength(t,e){return this.getUnitLength(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}parseValue(t){return parseFloat(t)}contains(t){return t>=this._range.min&&t<=this._range.max}resetZoom(){this._zoom&&(this._zoom=null,this._changed())}zoom(t,e){if(t>e){const s=t;t=e,e=s}return this._zoom?this._zoom.resize(t,e)?(this._changed(),!0):void 0:(isNaN(t)&&(t=this._min),isNaN(e)&&(e=this._max),this._zoom=new oe(this,t,e),this._changed(),!0)}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}_doLoadProp(t,e){if("guide"===t)return h(e)?this.$_loadGuides(e):a(e)&&this.$_loadGuides([e]),!0}_createGrid(){return new te(this)}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;if("range"===s.type)i=new re(this);else i=new ie(this);i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalcluateRange(t){return{min:t.length>0?P(Math.min(...t)||0):NaN,max:t.length>0?P(Math.max(...t)||0):NaN}}}class ce{constructor(t,e,s,i){this._items=[],this._map=new Map,this.chart=t,this.isX=e,this.row=s,this.col=i}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=this._items;h(t)?t.forEach(((t,i)=>s.push(this.$_loadAxis(e,t,i)))):a(t)&&s.push(this.$_loadAxis(e,t,0))}contains(t){return this._items.indexOf(t)>=0}get(t){return o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}$_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(this._getLength(e,t))))}_getLength(t,e){return e}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return l(s)&&s>=0&&s<e.length?i=e[s]:o(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&i._connect(t),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,s){var i;let r=t._getAxisType(e.type);if(!r){let n;if(h(e.categories))n="category";else if(this.isX){const i=t._getSeries().internalItems();if(i.length>0){n="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.xAxis===e.name){n=b;break}if(t.xAxis===s){n=b;break}if(E(t.xAxis)&&0===s){n=b;break}}}}else n=null===(i=t._getSeries().first)||void 0===i?void 0:i.defaultYAxisType();n&&(r=t._getAxisType(n))}r||(r=t._getAxisType("linear"));const n=new r(t,this.isX,e.name);return n.load(e),n._index=s,n._isPolar=t.isPolar(),n}}class ue extends ce{split(t){this._splits=t}_getLength(t,e){return this._splits?e*this._splits[t.side?1:0]:e}}class de{constructor(){this._axes=[]}}class _e{constructor(t){this.chart=t}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]))}}class ge extends _e{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 de)}t.forEach((t=>{t._row,t.position===jt.OPPOSITE||t._col<s-1&&(t.position,jt.BETWEEN),i[t.row][t._col]._axes.push(t)}))}}class pe extends _e{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 de)}t.forEach((t=>{let s=t._col;(t.position===jt.OPPOSITE||t._row<e-1&&t.position===jt.BETWEEN)&&s++,i[t._row][s]._axes.push(t)}))}}!function(t){t.NONE="none",t.X="x",t.Y="y",t.BOTH="both"}(Wt||(Wt={}));let me=class extends It{constructor(t){super(t.chart,b),this.body=t}isVisible(){return!1!==this.visible&&this.body.isZoomed()&&this.body.canZoom()}};class we extends It{constructor(t){super(t.chart,!1),this.body=t,this.size=.5}}class be extends It{constructor(t){super(t),this._guides=[],this._frontGuides=[],this.split=new we(this),this.startAngle=0,this.circular=!0,this.image=new Xt(null),this.zoomType=Wt.NONE,this.zoomButton=new me(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=C(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=C(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=C(t,!0))}canZoom(){return this.zoomType===Wt.X||this.zoomType===Wt.Y||this.zoomType===Wt.BOTH}getSplits(){const t=Math.max(0,Math.min(1,c(this.split.size,.5)));return[1-t,t]}calcRadius(t,e){return M(this._radiusDim,Math.min(t,e))}setPolar(t,e){return this._cx=M(this._cxDim,t),this._cy=M(this._cyDim,e),this._rd=M(this._radiusDim,Math.min(t,e)),this}getStartAngle(){return y+v*this.startAngle}getPolar(t){return this.chart.isPolar()?{start:this.getStartAngle(),cx:this._cx,cy:this._cy,rd:this._rd,deg:t?2*Math.PI/t._runPoints.length:0}:b}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._guides=[],s=this._frontGuides=[];t._getXAxes().forEach((t=>{t.guides.forEach((t=>{t.front?s.push(t):e.push(t)}))}))}}class xe extends It{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class fe extends It{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}var ye,ve,Ve,Se;fe.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.PLOT="plot",t.SUBPLOT="subplot"}(ye||(ye={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(ve||(ve={})),function(t){t.START="start",t.CENTER="center",t.END="end"}(Ve||(Ve={}));class Pe extends xe{constructor(t){super(t,void 0),this.location=ye.BOTTOM,this.layout=ve.AUTO,this.alignBase=H.PLOT,this.gap=6,this.itemGap=8,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=Ve.CENTER,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!==ve.AUTO||this._location===ye.PLOT)return this.layout;switch(this._location){case ye.BOTTOM:case ye.TOP:return ve.HORIZONTAL;default:return ve.VERTICAL}}getMaxWidth(t){return M(this._maxWidthDim,t,t)}getMaxHeight(t){return M(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=C(this.maxWidth,!0),this._maxHeightDim=C(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=J.checkEnumValue(ye,this.location,ye.BOTTOM),this._items=this.$_collectItems()}$_collectItems(){return this.chart._getLegendSources().map((t=>new fe(this,t)))}}class ke extends dt{static create(t,e,s,i,r,n,a=0){return new ke(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=b,s=b){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 Ae extends mt{constructor(t,e=b){super(t,e)}setBox(t,e,s,i){return this.setPath(nt.box(t,e,s,i)),this}}!function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(Se||(Se={}));let Ee=0;class Le{static swap(t){const e=[];for(let s=0;s<t.length;s++)e.push({xPos:t[s].yPos,yPos:t[s].xPos});return e}constructor(t){this.pid=Ee++,this.visible=!0,this.getValueOf=(t,e)=>this[e]||this.source[e],this.source=t}get yAbs(){return Math.abs(this.yValue)}get xAbs(){return Math.abs(this.xValue)}ariaHint(){return this.x+", "+this.yValue}labelCount(){return 1}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 e=this.source;h(e)?this._readArray(t,e):a(e)?(this._readObject(t,e),(h(e.drillDown)||a(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e)}getLabel(t){return this.y}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}_assignTo(t){return Object.assign(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue})}_readArray(t,e){if(null==e)this.isNull=!0;else{const s=+t.colorField;isNaN(s)||(this.color=e[s]),e.length>1?(this.x=e[c(t.xField,0)],this.y=e[c(t.yField,1)]):this.y=e[c(t.yField,0)]}}_readObject(t,e){var s,i,r,n;null==e?this.isNull=!0:(this.x=(s=e[t.xField],i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=_(e[t.yField],e.y,e.value),this.color=d(e[t.colorField],e.color))}_readSingle(t){this.y=t}}class Ce{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]}contains(t){return this._points.indexOf(t)>=0}load(t){h(t)?this._points=this._owner.createPoints(t):this._points=[]}getProps(t){return this._points.map((e=>e.getProp(t)))}getValues(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;return s?this._points.slice(Math.floor(s.start),Math.ceil(s.end)+1):this._points}}class Te extends It{constructor(t){super(t.chart),this.series=t,this.text="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.offset=8,this.hideDelay=Te.HIDE_DELAY,this.minWidth=100,this.minHeight=40}getValue(t,e,s,i){const r=t.getPointTooltip(e,s);if(l(r)){const t=i||this.numberFormat;return t?Ct.getFormatter(t).toStr(r):r}return r}}var Me,Ne,Oe,De,Re,Be,Ie,$e;Te.HIDE_DELAY=700,function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}(Me||(Me={}));class Fe extends ne{constructor(){super(...arguments),this.position=Me.POINT,this.step=1}getPosition(){return this.position===Me.POINT||this.position===Me.EDGE?this.position:this.axis._isX?Me.POINT:Me.EDGE}}class ze extends ae{getTick(t,e){return null!=e?this._getText(e,e,!1):""}}class He extends te{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 Ge extends le{constructor(){super(...arguments),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1}getCategories(){return this._cats}getCategory(t){return this._cats[t]}categoryAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return e-2+(this._zoom?Math.floor(this._zoom.start):0);return-1}getWdith(t,e){return 0}categoryPad(){return this._catPad}type(){return"category"}isContinuous(){return!1}_createGrid(){return new He(this)}_createTickModel(){return new Fe(this)}_createLabelModel(){return new ze(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=J.makeIntArray(0,this._categories.length)}_doPrepareRender(){this._cats=[],this._weights=[],this._minPad=u(this.minPadding,this.padding,0),this._maxPad=u(this.maxPadding,this.padding,0),this._catPad=c(this.categoryPadding,0)}_doBuildTicks(t,e,s){const i=this.label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[];for(t=this._min=Math.floor(t),e=this._max=Math.ceil(e);r.length<=e;)r.push(String(r.length)),n.push(1);r=this._cats=r.slice(t,e+1),n=n.slice(t,e+1);const o=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);if(o>0){const s=this._pts=[0];let l=this._minPad;for(let i=t;i<=e;i++)s.push(l/o),l+=n[i-t];s.push(l/o),s.push((l+this._maxPad)/o);for(let e=1;e<s.length-2;e+=a){const s=t+e-1;h.push({pos:NaN,value:s,label:i.getTick(e-1,r[e-1])})}}else this._pts=[];return 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;let i;i=this.tick.getPosition()===Me.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=i}getPosition(t,e,s=!0){e-=this._min,s&&(e+=.5);const i=Math.floor(e),r=this._pts[i+1]+(this._pts[i+2]-this._pts[i+1])*(e-i);return this.reversed?t-r:r}getValueAt(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._min+t-1}getUnitLength(t,e){const s=Math.floor(e-this._min);return this._pts[s+2]-this._pts[s+1]}getValue(t){return l(t)?t:this._map[t]}$_collectCategories(t){const e=this.categories,s=this._categories=[];if(h(e)&&e.length>0)this._len=0,e.forEach((t=>{let e,i=null==t?1:c(t.weight,1);e=null==t?null:o(t)?t:t.name||t.label,this._len+=i,s.push({c:e,w:i})}));else if(h(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)s.find((t=>t.c===e))||s.push({c:e,w:1})}this._map={},s.forEach(((t,e)=>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"}(Ne||(Ne={}));class je extends Ut{constructor(t){super(t,!1),this.position=Ne.AUTO,this.offset=4,this.distance=25}getText(t){if(J.isValidNumber(t)){return this._getText(null,t,Math.abs(t)>1e3,!0)}return t}_doLoad(t){super._doLoad(t)}}!function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(Oe||(Oe={}));class We extends s{constructor(){super(...arguments),this.interval=5,this.type="simple"}}class Ye extends It{constructor(t){super(t.chart),this.series=t,this.type=Oe.LINEAR,this.lineType=Se.DEFAULT,this.movingAverage=new We,this.visible=!1}_doPrepareRender(t){(this["$_"+this.type]||this.$_linear).call(this,this.series._runPoints,this._points=[])}$_linear(t,e){const s=t.length;if(s>1){let i=0,r=0,n=0,a=0,h=0;t.forEach((t=>{i+=t.xValue,r+=t.yValue,n+=t.xValue*t.xValue,a+=t.yValue+t.yValue,h+=t.xValue*t.yValue}));const o=(s*h-i*r)/(s*n-i*i),l=(r-o*i)/s;e.push({x:t[0].xValue,y:o*t[0].xValue+l}),e.push({x:t[s-1].xValue,y:o*t[s-1].xValue+l})}}$_logarithmic(t,e){}$_polynomial(t,e){}$_power(t,e){}$_exponential(t,e){}$_movingAverage(t,e){const s=this.movingAverage,i=t.length,r=Math.max(1,Math.min(i,s.interval));let n=r-1;for(;n<=i;){n+=1;const s=t.slice(n-r,n).reduce(((t,e)=>t+e.yValue),0);n<=i&&e.push({x:t[n-1].xValue,y:s/r})}}}class Ue extends It{static _loadSeries(t,e,s){let i=t._getSeriesType(e.type);i||(i=t._getSeriesType(s||t.type));const r=new i(t,e.name);return r.load(e),r}constructor(t,e){super(t),this.index=-1,this._simpleMode=!1,this.zOrder=0,this.clipped=!1,this.visibleInLegend=!0,this.visibleInNavigator=!1,this.name=e,this.pointLabel=new je(t),this.trendline=new Ye(this),this.tooltip=new Te(this),this._points=new Ce(this),this._pointArgs=this._createPointArgs()}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}isSide(){return this._yAxisObj.side}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,fe.MARKER_SIZE)),this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}ignoreAxisBase(t){return!1}canMixWith(t){return!0}getBaseValue(t){return NaN}canMinPadding(t){return!0}canMaxPadding(t){return!0}hasMarker(){return!1}setShape(t){}createPoints(t){return t.map(((t,e)=>{const s=this._createPoint(t);return s.index=e,s.parse(this),s.isNull||(s.isNull=null==t||null==s.y),s}))}getXStart(){let t=this._xAxisObj.parseValue(this.xStart);const e=isNaN(t)?this._xAxisObj.parseValue(this.chart.options.xStart):t;return this._xAxisObj._zoom?e+Math.floor(this._xAxisObj._zoom.start):e}getXStep(){return d(this.xStep,this.chart.options.xStep)}getValue(t,e){const s=t.source;if(null==s)return NaN;s[this._getField(e)]}prepareRender(){this._calcedColor=void 0,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._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this._runRanges=G(this.ranges,this._xAxisObj.axisMin(),this._xAxisObj.axisMax()),super.prepareRender()}collectCategories(t){if(t instanceof Ge){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getValues(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.getXStart()||0,i=this.getXStep()||1;o(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)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectVisibles(){const t=this._runPoints.filter((t=>t.visible)),e=t.length;if(e>0){let s=t[0].yValue,i=s;t[0].vindex=0;for(let r=1;r<e;r++){const e=t[r];e.vindex=r,e.yValue>i?i=e.yValue:e.yValue<s&&(s=e.yValue)}t.forEach(((t,e)=>{t.vindex=e,i=Math.max(t.yValue,i)})),this._pointArgs.yMin=this._minValue=s,this._pointArgs.yMax=this._maxValue=i}return t}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t)))}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){t.series=this.name||this.index,t.count=this._points.count}_getPointCallbackArgs(t,e){e.assignTo(t)}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointTooltip(t,e){switch(e){case"series":return this.displayName();case"name":return this._xAxisObj instanceof Ge?this._xAxisObj.getCategory(t.index):t.x;case"x":return t.x||(this._xAxisObj instanceof Ge?this._xAxisObj.getCategory(t.index):"");case"y":return t.y;case"xValue":return t.xValue;case"yValue":return t.yValue;default:return e}}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}_createPoint(t){return new Le(t)}_createLegendMarker(t,e){return ke.create(t,Ue.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_getField(t){return t===this._xAxisObj?this.xField:this.yField}_colorByPoint(){return!1}_doLoad(t){super._doLoad(t);const e=this._loadData(t);h(e)&&e.length>0&&this._doLoadPoints(e)}_loadData(t){return t[this.dataProp||"data"]}_doLoadPoints(t){this._points.load(t)}loadPoints(t){this._points.load(t)}_doPrepareRender(){let t,e;!1===this.pointColors?t=this.color:h(this.pointColors)?e=this.pointColors:this._colorByPoint()?e=this.chart.colors:t=this.color,this._runPoints.forEach(((s,i)=>{!s.color&&e&&(s.color=t||e[i%e.length])})),this._preparePointArgs(this._pointArgs)}prepareAfter(){this.trendline.visible&&this.trendline.prepareRender()}}Ue.LEGEND_MARKER="rct-legend-item-marker";class Xe{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)}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}getSeries(t){return this._map[t]}getVisibleSeries(t){return this.chart._splitted?this._visibleSeries.filter((e=>!e._yAxisObj.side==!t)):this._visibleSeries.slice(0)}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 e=this.chart,s=this._items=[],i=this._series=[],r=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach(((t,e)=>{t.index=e,t instanceof ss?i.push(...t.series):t instanceof Ue&&i.push(t)})),this._widget=!0,i.forEach((t=>{!this._widget||t instanceof Ke||(this._widget=!1),t.name&&(r[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}}))}updateData(t){}prepareRender(){const t=this._visibleSeries=[];let e=0;this._series.forEach((s=>{s.visible&&t.push(s),s.hasMarker()&&s.setShape(it[e++%it.length])}));const s=this._visibleSeries.filter((t=>t.clusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof Je&&(t._single=1===s)})),this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=h(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getSeriesType(e.type||t.type),!i)throw new Error("Invalid series type: "+e.type+", "+t.type);const r=new i(t,e.name||`Series ${s+1}`);return r.load(e),r.index=s,r}}!function(t){t.DEFAULT="default",t.VISIBLE="visible",t.HIDDEN="hidden"}(De||(De={}));class qe extends It{constructor(t){super(t.chart),this.series=t,this.radius=3}}class Ze extends Le{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return d(this.x,this.y)}}class Ke extends Ue{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:M(this._centerXDim,t),y:M(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===Ne.AUTO?Ne.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)}_doLoad(t){super._doLoad(t),this._centerXDim=C(_(this.centerX,this.center,Ke.CENTER),!0),this._centerYDim=C(_(this.centerY,this.center,Ke.CENTER),!0)}}Ke.CENTER="50%";class Qe extends Ke{constructor(){super(...arguments),this.radius=Qe.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return M(this._radiusDim,Math.min(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=C(d(this.radius,Qe.DEF_RADIUS),!0)}}Qe.DEF_RADIUS="40%";class Je extends Ue{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===Ne.AUTO?Ne.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 ts extends Je{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=c(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}}class es extends Je{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)}))}}!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(Re||(Re={}));class ss extends It{constructor(){super(...arguments),this.layoutMax=100,this.index=-1,this._series=[],this._visibles=[],this.layout=Re.DEFAULT,this.visibleInLegend=!0}get series(){return this._series.slice(0)}isSide(){return this._yAxisObj.side}needAxes(){return!0}isEmpty(){return this._series.length<1}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}getBaseValue(t){return NaN}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case Re.STACK:this.$_collectStack(t,e);break;case Re.FILL:this.$_collectFill(t,e);break;case Re.DEFAULT:case Re.OVERLAP:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}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}ignoreAxisBase(t){for(const e of this._visibles)if(e.ignoreAxisBase(t))return!0}getLegendSources(t){!1!==this.visibleInLegend&&this._series.forEach((e=>e.getLegendSources(t)))}canMinPadding(t){return!0}canMaxPadding(t){return this.layout!==Re.FILL}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(){this._visibles=this._series.filter((t=>t.visible)),super.prepareRender()}_doPrepareRender(t){const e=this._visibles.sort(((t,e)=>(t.zOrder||0)-(e.zOrder||0)));this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),e.length>0&&(e.forEach((t=>t.prepareRender())),this._doPrepareSeries(e))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,e){const s=this._seriesType();h(e)?e.forEach(((e,i)=>this.$_add(Ue._loadSeries(t,e,s)))):a(e)&&this.$_add(Ue._loadSeries(t,e,s))}$_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()){let s=0;for(const e of t)s+=e.yValue||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()){let r=0;for(const e of t)r+=Math.abs(e.yValue)||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 is extends ss{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class rs extends ss{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 ns extends Ue{}!function(t){t.NORMAL="normal",t.MIXED="mixed",t.RANDOM="random"}(Be||(Be={}));class as extends It{constructor(t){super(null),this.assets=new St,t&&this.load(t)}activate(t){}deactivate(t){}_doLoadProp(t,e){if("assets"===t)return this.assets.load(e),!0}}class hs{constructor(){this._items=[]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}$_loadItem(t){if(a(t)&&t.name)return new as(t)}}class os extends It{constructor(){super(...arguments),this.text="Title",this.alignBase=H.PLOT,this.align=$.CENTER}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(Ie||(Ie={}));class ls extends os{constructor(){super(...arguments),this.position=Ie.BOTTOM,this.verticalAlign=F.BOTTOM,this.text=""}}class cs extends ne{constructor(){super(...arguments),this.stepPixels=72,this.baseRange=!1}buildSteps(t,e,s,i,r=!1){var n;let a;return this._step=NaN,a=r?this._getStepsByPixels(t,c(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?this.steps.slice(0):this._baseAxis instanceof _s?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s,i):this.stepPixels>0?this._getStepsByPixels(t,((null===(n=this.axis)||void 0===n?void 0:n._isPolar)?.5:1)*this.stepPixels,e,s,i):s!==i?[s,i]:[s],a}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 _s&&(this._baseAxis=e,e.tick._baseAxis=null)}}_getStepsByCount(t,e,s,i){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),isNaN(e)&&this.integral;let r=(i-s)/(t-1);const n=Math.pow(10,Math.floor(Math.log10(r))),a=[];if(r=this._step=Math.ceil(r/n)*n,isNaN(e))s>Math.floor(s/n)*n?s=Math.floor(s/n)*n:s<Math.ceil(s/n)*n&&(s=Math.ceil(s/n)*n);else{for(R(s<e&&i>e,"base error"),t=Math.max(3,t);;){if(!(S((e-s)/r)+S((i-e)/r)+1>t))break;r+=n}s=e-S((e-s)/r)*r}a.push(s);for(let e=1;e<t;e++)a.push(P(a[e-1]+r));return a}_getStepsByInterval(t,e,s,i){const r=[];let n;if(isNaN(e))for(r.push(n=s);n<i;)r.push(n+=t);else{for(r.push(n=e);n>s;)r.unshift(n-=t);for(n=e;n<i;)r.push(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=Math.max(1,Math.floor(t/e))+1,o=n/(h-1);const l=Math.pow(10,Math.floor(Math.log10(o))),c=this._getStepMultiples(l);let u,d=0;if(o/=l,c)if(o>c[d]){for(;d<c.length-1;d++)if(o>c[d]&&o<c[d+1]){o=c[++d];break}}else o=c[d];if(o*=l,isNaN(s))i>Math.floor(i/o)*o?i=Math.floor(i/o)*o:i<Math.ceil(i/o)*o&&(i=Math.ceil(i/o)*o);else{for(R(i<=s&&r>=s,"base error"),h=Math.max(3,h);d<c.length;){if(!(S((s-i)/o)+S((r-s)/o)+1>h))break;o=d<c.length-1?c[d+1]*l:2*o,d++}i=s-S((s-i)/o)*o}for(this._step=o,a.push(P(u=i));u<r;)a.push(P(u+=o));return a}}class us extends ae{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100)}}class ds extends Kt{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16,this.gridVisible=!0}getSize(t){return M(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=c(this.space,0),this._sizeDim=C(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}($e||($e={}));class _s extends le{constructor(){super(...arguments),this.nullable=!0,this.padding=.05,this.startFit=$e.DEFAULT,this.endFit=$e.DEFAULT,this.breaks=[]}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===$e.DEFAULT?this._isX?$e.VALUE:$e.TICK:this.startFit}getEndFit(){return this.endFit===$e.DEFAULT?this._isX?$e.VALUE:$e.TICK:this.endFit}isContinuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createTickModel(){return new cs(this)}_createLabelModel(){return new us(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._base=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 _s;let{min:n,max:a}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),h=this._base;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(isNaN(this.strictMin)&&this.getStartFit()!==$e.VALUE){if(!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]}else for(;o.length>1&&n>o[0];)o.shift();if(isNaN(this.strictMax)&&this.getEndFit()!==$e.VALUE){if(!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]}else for(;a<o[o.length-1]&&o.length>1;)o.pop();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}_getTickLabel(t,e){return this.label.getTick(t,e)||String(e)}_createTick(t,e,s){return{pos:NaN,value:s,label:this._getTickLabel(e,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}getPosition(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}}getValueAt(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}getUnitLength(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=!1,i=!1;this._series.forEach((r=>{const n=r.getBaseValue(this);isNaN(n)||(isNaN(this.minValue)&&n<=t?(t=n,s=!0):isNaN(this.maxValue)&&n>=e&&(e=n,i=!0)),s||r.canMinPadding(this)||(s=!0),i||r.canMaxPadding(this)||(i=!0)}));let r=0,n=0;isNaN(this.strictMin)?this.minValue<t?t=this.minValue:s||(r=u(this.minPadding,this.padding,0)):t=this.strictMin,isNaN(this.strictMax)?this.maxValue>e?e=this.maxValue:i||(n=u(this.maxPadding,this.padding,0)):e=this.strictMax;let a=Math.max(0,e-t);return t-=a*(this._minPad=r),e+=a*(this._maxPad=n),{min:t,max:e}}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&t.clusterable()&&e.push(...t.getVisiblePoints())}));const s=this._isX,i=e.map((t=>s?t.xValue:t.yValue)).sort();let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=Math.min(i[t]-i[t-1]);return t*=r/(this._max-this._min),this._unitLen=c(t,1)}$_loadBreak(t){if(a(t)&&"from"in t&&"to"in t)return new ds(this).load(t)}$_loadBreaks(t){if(h(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(Object.assign(new ds(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(Object.assign(new ds(this),a))}}var s}}class gs extends _s{type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return 1===i.length&&i[0]instanceof ss&&i[0].layout===Re.FILL&&(s.max=i[0].layoutMax),s}}class ps extends cs{_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}}const ms=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ws=[".","/","-",":"],bs="Z".charCodeAt(0),xs="z".charCodeAt(0),fs="A".charCodeAt(0),ys="a".charCodeAt(0),vs="y".charCodeAt(0),Vs="M".charCodeAt(0),Ss="m".charCodeAt(0),Ps="W".charCodeAt(0),ks="w".charCodeAt(0),As="d".charCodeAt(0),Es="H".charCodeAt(0),Ls="h".charCodeAt(0),Cs="S".charCodeAt(0),Ts="s".charCodeAt(0),Ms=function(t){return t<10?"0"+t:String(t)},Ns=function(t){return t<10?"00"+t:t<100?"0":String(t)};class Os{static getFormatter(t){let e=Os.Formatters[t];return e||(Os.Formatters[t]=e=new Os(t)),e}static get Default(){return Os.getFormatter(w.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||w.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 vs:i+=h>2?t.getFullYear():Ms(t.getFullYear()%100);break;case Vs:i+=h>1?Ms(t.getMonth()+1):t.getMonth()+1;break;case As:i+=h>1?Ms(t.getDate()):t.getDate();break;case Ps:i+=h>1?Ms(J.weekOfYear(t,e)):J.weekOfMonth(t,e,!0);break;case ks:i+=h>1?J.long_week_days[t.getDay()]:J.week_days[t.getDay()];break;case Es:i+=h>1?Ms(t.getHours()):t.getHours();break;case Ls:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?Ms(e):e}else i+=h>1?Ms(t.getHours()):t.getHours();break;case Ss:i+=h>1?Ms(t.getMinutes()):t.getMinutes();break;case Ts:i+=h>1?Ms(t.getSeconds()):t.getSeconds();break;case ys:case fs:t.getHours()<12?i+=w.am:i+=w.pm;break;case Cs:let s=t.getMilliseconds();i+=3==h?Ns(s):2==h?Ms(s):s.toString().substr(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(ws.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),ms.indexOf(n)<0){let e=n.charCodeAt(0);(e>=fs&&e<=bs||e>=ys&&e<=xs)&&I(w.invalidDateFormat,t)}e.push(n)}if(r<i&&J.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&J.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||w.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Os.Formatters={};const Ds=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Rs=[[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]];class Bs extends cs{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}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Ds[e]&&t<Ds[e+1]/2)return this.scale=e,Rs[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=Math.max(1,Math.floor(a/(l-1)));const u=this._getStepMultiples(c),d=Ds[this.scale];if(c/=d,u)if(c>u[0]){let t=0;for(;t<u.length-1;t++)if(c>u[t]&&c<u[t+1]){c=u[t+1];break}}else c=u[0];const _=h.date(i),g=h.date(r);let p,m=_;if(7===this.scale){const t=o.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=g)}else if(6===this.scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<o&&new Date(t,e+c)>o&&(m=new Date(o.getFullYear(),o.getMonth()));do{n.push(+m),e+=c,m=new Date(t,e)}while(m<=g)}else if(4===this.scale||5===this.scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this.scale?7:1;this._step=c=Math.ceil(c),m=new Date(t,e,s),m<o&&new Date(t,e,s+i*c)>o&&(m=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+m),s+=c*i,m=new Date(t,e,s)}while(m<=g)}else{switch(this._step=c,c*=d,this.scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}p=m.getTime();const t=o.getTime();p<t&&p+c>t&&(p=t);do{n.push(p),p+=c}while(p<=r)}return n}}const Is=[{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 $s extends ae{constructor(){super(...arguments),this.useBeginningFormat=!0,this.startOfWeek=0}_doLoad(t){super._doLoad(t);const e=o(this.timeFormat)?this.timeFormat:void 0,s=o(this.beginningFormat)?this.beginningFormat:void 0,i=this.timeFormats,r=this.useBeginningFormat;if(this._formats=Is.map((t=>Object.assign(t))),h(i))for(let t=0;t<i.length;t++){const n=this._formats[t];if(e)n.format=e,n.beginningFormat=s||e;else{const e=i[t];o(e)?(n.format=e,r||(n.beginningFormat=e)):a(e)&&(o(e.format)&&(n.format=e.format),o(e.beginningFormat)?n.beginningFormat=e.beginningFormat:r||(n.beginningFormat=n.format))}}}getTick(t,e){const s=this.axis,i=this._formats,r=s.tick.scale,n=s.date(e);switch(r){case 7:return Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 6:return 0===t||0===n.getMonth()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 5:case 4:return 0===t||1===n.getDate()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 3:return 0===t||0===n.getHours()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 2:return 0===t||0===n.getMinutes()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 1:return 0===t||0===n.getSeconds()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 0:return 0===t||0===n.getMilliseconds()?Os.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):Os.getFormatter(i[r].format).toStr(n,this.startOfWeek)}}}class Fs extends _s{constructor(t,e,s){super(t,e,s),this.timeOffset=0,this.baseValue=NaN}type(){return"time"}_createTickModel(){return new Bs(this)}_createLabelModel(){return new $s(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*c(this.timeOffset,0)*60*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}parseValue(t){return l(t)?t+this._offset:t instanceof Date?t.getTime():o(t)?new Date(t).getTime():0}getValue(t){return+t}incStep(t,e){if(!o(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"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)}}class zs extends xe{constructor(t){super(t),this.index=-1,this.size="100%"}get left(){return this._left}set left(t){t!==this._left&&(this._leftDim=C(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=C(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=C(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=C(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=C(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=C(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=C(this._size=t,!0))}getSize(t,e){return{width:M(this._widthDim||this._sizeDim,t,t),height:M(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return M(this._leftDim,t)}getRight(t){return M(this._rightDim,t)}getTop(t){return M(this._topDim,t)}getBottom(t){return M(this._bottomDim,t)}}class Hs extends zs{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 Gs extends zs{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,e){const s=this._gaugesType();h(e)?e.forEach(((e,i)=>this.$_add(Hs._loadGauge(t,e,s)))):a(e)&&this.$_add(Hs._loadGauge(t,e,s))}$_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 js{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(t){return this._visibles.filter((e=>!e.side==!t))}getGauge(t){const e=this._map[t];if(e instanceof Hs)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],i=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(i[t.name]=t),t instanceof Gs)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(i[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,s){let i=h(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getGaugeType(e.type||t.gaugeType),!i)throw new Error("Invalid gauge type: "+e.type);const r=new i(t,e.name||`Gauge ${s+1}`);return r.load(e),r.index=s,r}}class Ws extends Hs{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 Ys extends It{constructor(t){super(t.chart),this.scale=t,this.reversed=!1,this.length=7}}class Us extends It{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=Xs.DEFAULT,this.stepPixels=48,this.line=new It(t.chart,!0),this.tick=new Ys(this),this.tickLabel=new It(t.chart)}get gap(){return this._gap}set gap(t){this._gap=c(t,0)}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=c(s,e);const{min:i,max:r}=this._adjustMinMax(Math.min(e,s),Math.max(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(Math.max(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=Math.min(t,e),this._max=Math.max(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=Math.min(...t)),isNaN(i)&&(i=Math.max(...t)),this._min=Math.min(s,i),this._max=Math.max(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(P(e));for(let e=1;e<t;e++)n.push(P(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(P(l=s));;){if(l+=a,l>=i){r.push(P(i));break}r.push(P(l))}return r}}var Xs,qs,Zs,Ks;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}(Xs||(Xs={}));class Qs extends It{}class Js extends It{constructor(t,e=!1){super(t.chart,e),this.gauge=t,this.position=Xs.DEFAULT,this.gap=5,this.itemGap=0,this.rangeLabel=new Qs(t.chart,!1),this.tickLabel=new It(t.chart,!0)}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickDim=C(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?M(this._thickDim,t,0):this.position===Xs.INSIDE?t:Js.DEF_THICKNESS}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=G(this._ranges,t.min,t.max)||[]}return this._runRanges}}Js.DEF_THICKNESS=7;class ti extends Ut{constructor(t){super(t,!0),this.animatable=!0}}class ei extends Us{}class si extends ti{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:M(this._offsetXDim,t,0),y:M(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=C(this.offsetX,!0),this._offsetYDim=C(this.offsetY,!0),this}}class ii{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ri.DEF_CENTER),this.setCenterY(ri.DEF_CENTER),this.setRadius(ri.DEF_RADIUS),this.setInnerRadius(ri.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=C(d(t,ri.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=C(d(t,ri.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=C(d(t,ri.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=C(d(t,ri.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=C(t,!0))}getCenter(t,e){return{x:M(this._centerXDim,t,t/2),y:M(this._centerYDim,e,e/2)}}getExtents(t){const e=M(this._radiusDim,t,t/2),s=Math.min(e,this._innerDim?M(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?M(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=c(t%360,0),i=Math.max(0,Math.min(360,c(e,360)));this._startRad=y+v*s,this._handRad=v*s,this._sweepRad=v*i}}class ri extends Ws{constructor(t){super(t),this.props=new ii,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new si(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 ii)}_doPrepareRender(t){super._doPrepareRender(t);const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}ri.DEF_CENTER="50%",ri.DEF_RADIUS="40%",ri.DEF_INNER="80%";class ni extends Gs{constructor(){super(...arguments),this.props=new ii,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 ai extends It{constructor(t){super(t.chart,!0),this.gauge=t}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=G(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class hi extends ai{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=C(this.segmentThickness,!0))}getSegmentThickness(t){return M(this._thickDim,t,t)}}class oi extends ai{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=C(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class li extends It{constructor(t){super(t.chart,!1)}}class ci extends It{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=C(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=C(t,!0))}getExtents(t){return{radius:M(this._radiusDim,t,0),length:M(this._lengthDim,t,0),offset:M(this._offsetDim,t,0)}}}class ui extends It{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=C(t,!0))}getRadius(t){return M(this._radiusDim,t,0)}}class di extends Us{constructor(){super(...arguments),this.stepPixels=72}_getStepMultiples(t){return[1,2,2.5,5,10]}}class _i extends ni{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class gi extends It{constructor(t){super(t.chart),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=C(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class pi extends It{constructor(t,e,s){super(t.chart),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=C(t,!0))}getLength(t){return M(this._lengthDim,t,t)}}class mi extends pi{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class wi extends It{constructor(t,e){super(t.chart),this.length=e}}class bi extends It{constructor(t){super(t.chart),this.step=1,this.offset=1}}class xi extends It{constructor(t,e){super(t.chart),this.raidus=e}}class fi extends Ut{constructor(t){super(t.chart,!0),this.position="top",this.text="RealChart Clock<br>ver1.0"}}class yi extends Le{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class vi extends Le{}class Vi extends ts{constructor(){super(...arguments),this.borderRaidus=0,this.colorByPoint=!1}_type(){return"bar"}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new vi(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class Si extends rs{constructor(){super(...arguments),this.baseValue=0}_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof Vi}canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:c(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===Re.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,Re.STACK}}class Pi extends mt{constructor(t,e=b,s=b){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){J.isNumber(t)?this.setPath(nt.line(t,e,s,i)):t&&this.setPath(nt.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(nt.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(nt.line(t,e,t,s))}setHLine(t,e,s){this.setPath(nt.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(nt.line(e,t,s,t))}}class ki extends mt{constructor(t,e){super(t,e),this.setStyle("fill","none")}setPoints(...t){this.setPath(nt.lines(...t))}resetStyles(t){const e=super.resetStyles(t);return this.setStyle("fill","none"),e}}class Ai extends dt{constructor(t,e){super(t,Ue.LEGEND_MARKER),this._size=e,this.add(this._marker=new mt(t)),this.setShape(st.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){nt.setShape(this._marker,this._shape,t/2),this._marker.translate(this._markerOffset(t),0)}_markerOffset(t){return 0}}class Ei extends Ai{constructor(t,e){super(t,e),this.insertFirst(this._line=new Pi(t))}_renderShape(t){var e;super._renderShape(t),null===(e=this._line)||void 0===e||e.setHLine(t/2,0,2*t)}_markerOffset(t){return t/2}}class Li extends Le{}class Ci extends qe{constructor(){super(...arguments),this.radius=4,this.firstVisible=De.DEFAULT,this.lastVisible=De.DEFAULT,this.minVisible=De.DEFAULT,this.maxVisible=De.DEFAULT}}class Ti extends Ue{constructor(){super(...arguments),this.marker=new Ci(this),this.nullAsBase=!1}getShape(t){return t&&t.shape||this.marker.shape||this._shape}getRadius(t){return c(t.radius,this.marker.radius)}_createPoint(t){return new Li(t)}hasMarker(){return!0}setShape(t){this._shape=t}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(qs||(qs={}));class Mi extends Ti{constructor(){super(...arguments),this.lineType=Se.DEFAULT,this.stepDir=qs.FORWARD,this.connectNullPoints=!1,this.baseValue=0}_type(){return"line"}getLineType(){return this.lineType}_createLegendMarker(t,e){return new Ei(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.getShape(null),Math.min(fe.MARKER_SIZE,2*this.marker.radius)),e}}class Ni extends Li{}class Oi extends Mi{_type(){return"area"}_createPoint(t){return new Ni(t)}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t._isX?NaN:this._base}}class Di extends Ni{parse(t){super.parse(t),this.y=this.high=d(this.high,this.low),this.lowValue=parseFloat(this.low),this.highValue=this.yValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.high=e[c(t.highField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.high=d(e[t.lowField],e.high)}_readSingle(t){super._readSingle(t),this.low=this.y}}class Ri extends ss{constructor(){super(...arguments),this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof Mi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class Bi extends ss{constructor(){super(...arguments),this.baseValue=0}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof Oi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class Ii extends Ni{}class $i extends Le{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return Object.assign(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})}_readArray(t,e){const s=e.length>5?1:0;this.min=e[c(t.minField,0+s)],this.low=e[c(t.lowField,1+s)],this.mid=e[c(t.midField,2+s)],this.high=e[c(t.highField,3+s)],this.y=e[c(t.yField,4+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.min=d(e[t.minField],e.min),this.low=d(e[t.lowField],e.low),this.mid=d(e[t.midField],e.mid),this.high=d(e[t.highField],e.high),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),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)||isNaN(this.highValue))}}class Fi extends Le{getLabel(t){return this.z}parse(t){super.parse(t),this.zValue=parseFloat(this.z)}_assignTo(t){return Object.assign(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(null===e)this.isNull=!0;else{const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.z=e[c(t.zProp,1+s)],s>0&&(this.x=e[c(t.xField,0)])}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=d(e[t.zProp],e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}}!function(t){t.WIDTH="width",t.AREA="area"}(Zs||(Zs={}));class zi extends Le{parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high})}_readArray(t,e){const s=e.length>4?1:0;this.low=e[c(t.lowField,0+s)],this.open=e[c(t.openField,1+s)],this.close=e[c(t.closeField,2+s)],this.y=this.high=e[c(t.highField,3+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.row),this.open=d(e[t.openField],e.open),this.close=d(e[t.closeField],e.close),this.high=d(e[t.highField],e.high),isNaN(this.high)?isNaN(this.y)||(this.high=this.y):this.y=this.high}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.high=this.y}}class Hi extends es{_type(){return"candlestick"}canCategorized(){return!0}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;case"close":return t.close;case"closeValue":return t.closeValue;case"open":return t.open;case"openValue":return t.openValue;case"high":return t.high;case"highValue":return t.highValue;default:return super.getPointTooltip(t,e)}}_createPoint(t){return new zi(t)}_getBottomValue(t){return t.lowValue}}class Gi extends qe{constructor(){super(...arguments),this.radius=4,this.shape=st.CIRCLE}}class ji extends Le{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.lowValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Wi extends Le{}class Yi extends Le{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],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))}}class Ui extends Ze{}class Xi extends Ke{constructor(t,e){super(t,e),this.width=Xi.DEF_WIDTH,this.height=Xi.DEF_HEIGHT,this.neckWidth=Xi.DEF_NECK_WIDTH,this.neckHeight=Xi.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:Math.max(.1*t,M(this._widthDim,t)),height:Math.max(.1*e,M(this._heightDim,e))}}getNeckSize(t,e){return{width:J.clamp(M(this._neckWidthDim,t),.1*t,t),height:J.clamp(M(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}getPointTooltip(t,e){return"height"===e?t.height:super.getPointTooltip(t,e)}_createPoint(t){return new Ui(t)}load(t){return super.load(t),this._widthDim=T(this.width,Xi.DEF_WIDTH),this._heightDim=T(this.height,Xi.DEF_HEIGHT),this._neckWidthDim=T(this.neckWidth,Xi.DEF_NECK_WIDTH),this._neckHeightDim=T(this.neckHeight,Xi.DEF_NECK_HEIGHT),this}}Xi.DEF_WIDTH="85%",Xi.DEF_HEIGHT="90%",Xi.DEF_NECK_WIDTH="30%",Xi.DEF_NECK_HEIGHT="30%";class qi extends Le{parse(t){super.parse(t),this.heatValue=parseFloat(this.heat),this.isNull||(this.isNull=isNaN(this.heatValue))}_assignTo(t){return Object.assign(super._assignTo(t),{heat:this.heat,heatValue:this.heatValue})}_readArray(t,e){const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.heat=e[c(t.heatField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.heat=d(e[t.heatField],e.color)}_readSingle(t){super._readSingle(t)}getLabel(t){return this.heat}}class Zi extends Le{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,max:this.max})}}!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(Ks||(Ks={}));const Ki={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 Qi extends qe{constructor(){super(...arguments),this.radius=4,this.shape=st.CIRCLE}}class Ji extends Le{}class tr extends zi{}class er extends Le{}class sr extends Ze{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get endAngle(){return this.startAngle+this.angle}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return Object.assign(super._assignTo(t),{sliced:this.sliced})}}class ir extends Ut{constructor(){super(null,!0)}}class rr extends Qe{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new ir}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?M(this._sliceDim,t):0}_type(){return"pie"}_createPoint(t){return new sr(t)}_doLoad(t){super._doLoad(t),this._innerDim=C(this.innerRadius,!0),this._sliceDim=C(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=c(this.startAngle%360,0),e=Math.max(0,Math.min(360,c(this.totalAngle,360)));this._startRad=y+v*t,this._totalRad=v*e,this._groupPos=NaN}}class nr extends ss{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return M(this._polarDim,Math.min(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 rr}_doLoad(t){super._doLoad(t),this._polarDim=C(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=C(this.innerSize,!0)}_doPrepareSeries(t){if(this.layout===Re.STACK||this.layout===Re.FILL){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+c(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=c(t.groupSize,1)/e}))}}}class ar extends Le{}class hr extends Le{_assignTo(t){return Object.assign(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){super._readArray(t,e),this.id=k(e[parseInt(t.idField)]),this.group=k(e[parseInt(t.groupField)])}_readObject(t,e){super._readObject(t,e),this.id=k(e[t.idField]),this.group=k(e[t.groupField])}}class or{constructor(t){this.point=t}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 lr,cr,ur,dr;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(lr||(lr={}));class _r extends Le{_assignTo(t){return Object.assign(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[c(t.yField,0+s)],this.length=e[c(t.lengthField,1+s)],this.angle=e[c(t.angleField,2+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.length=d(e[t.lengthField],e.length),this.angle=d(e[t.angleField],e.angle),this.y=_(e[t.yField],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"}(cr||(cr={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(ur||(ur={}));class gr extends Le{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 pr extends ti{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap="5%"}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=C(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=C(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=C(t,!0))}getWidth(t){return M(this._widthDim,t)}getHeight(t){return M(this._heightDim,t)}getMaxWidth(t){return M(this._maxWidthDim,t)}getMaxHeight(t){return M(this._maxHeightDim,t)}getGap(t){return M(this._gapDim,t,0)}}class mr extends Ws{constructor(t){super(t),this.reversed=!1,this.scale=new ei(this),this.label=new pr(this.chart)}isVertical(){return this.group?!this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}calcedMinMax(){return this.scale.range()}}!function(t){t.BAR="bar",t.needle="needle"}(dr||(dr={}));class wr extends It{constructor(t){super(t.chart,!0),this.gauge=t}}class br extends mr{constructor(t){super(t),this.marker=new wr(this),this.band=new Js(this)}_type(){return"linear"}}class xr extends It{constructor(){super(...arguments),this.opposite=!1,this.gap=10}}class fr extends Gs{constructor(t){super(t),this.vertical=!0,this.itemLabel=new xr(this.chart),this.scale=new ei(this),this.itemGap=10,this.label=new pr(t),this.label.gap=10}calcedMinMax(){return this.scale.range()}}class yr extends fr{constructor(){super(...arguments),this.band=new Js(this,!1)}_type(){return"lineargroup"}_gaugesType(){return"linear"}}class vr extends It{constructor(t){super(t.chart),this.gauge=t,this.vertical=!1}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=C(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=C(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=G(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class Vr extends It{constructor(t){super(t.chart)}}class Sr extends It{constructor(t){super(t.chart)}}class Pr extends fr{getRanges(t,e){return G(this.ranges,t,e)}_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}class kr extends It{}class Ar extends It{}const Er={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Lr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Cr={minPadding:0,maxPadding:0};class Tr extends It{constructor(t){super(t,!1),this._thickness=45,this._gap=8,this._gapFar=3,this._dataChanged=!0,this.liveScroll=!0,this.handle=new kr(t),this.mask=new Ar(t),this.borderLine=new It(t)}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 e=this.chart,s={};a(t.series)?s.series=Object.assign((Er[t.series.type]||Er.area)(),t.series):s.series=Er.area(),a(t.xAxis)?s.xAxis=Object.assign((Lr[t.xAxis.type]||Lr.linear)(),t.xAxis,Cr):s.xAxis=Object.assign(Lr.linear(),Cr),a(t.yAxis)?s.yAxis=Object.assign((Lr[t.yAxis.type]||Lr.linear)(),t.yAxis,Cr):s.yAxis=Object.assign(Lr.linear(),Cr),this._naviChart=this.chart._createChart(s),(this._source=e._getSeries().getSeries(this.source)||e.firstSeries)&&this._naviChart.firstSeries.loadPoints(this._source.getPoints().getProxies())}_doPrepareRender(t){this._vertical=!1,this._naviChart.prepareRender()}}class Mr extends It{constructor(t){super(t.chart),this.pane=t,this.align=$.CENTER}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}class Nr extends It{constructor(t,e,s){super(t),this.row=e,this.col=s,this.title=new Mr(this)}}class Or extends It{constructor(t){super(t,!1),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[]}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]}layoutPanes(t,e,s,i){}_doLoadProp(t,e){if(["panes","cols","rows"].indexOf(t)>=0)return!0}load(t){return super.load(t),a(t)&&(this.$_parsePanes(t.rows,t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._vpanes=this.$_collectPanes(t)}calcSizes(t,e){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(e,this._heights)}$_parseSizes(t){let e;return e=h(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(o(t)){const e=t.trim();return{size:"*"===e?1:parseFloat(e)}}return+t||{size:1}}))}$_parsePanes(t,e){this._widths=this.$_parseSizes(t),this._heights=this.$_parseSizes(e),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const e={};return t=h(t)?t:a(t)?[t]:null,h(t)&&t.forEach((t=>{const s=+t.row||0,i=+t.col||0;if(i>=0&&i<this._cols&&s>=0&&s<this._rows){const r=new Nr(this.chart,s,i);r.load(t),e[s+","+i]=r}})),e}$_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 Nr(t,e,r);s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}const Dr={bar:Si,line:Ri,area:Bi,pie:nr,bargroup:Si,linegroup:Ri,areagroup:Bi,piegroup:nr,bump:class extends is{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof Mi}_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].yValue=s[t].yGroup=t}return J.makeIntArray(0,t.length)}}},Rr={area:Oi,arearange:class extends Ti{constructor(){super(...arguments),this.curved=!1}_type(){return"arearange"}_createPoint(t){return new Di(t)}getLineType(){return this.curved?Se.SPLINE:Se.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}},bar:Vi,barrange:class extends es{_type(){return"barrange"}pointLabelCount(){return 2}_createPoint(t){return new yi(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends Oi{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!1}_type(){return"bellcurve"}getLineType(){return this.curved?Se.SPLINE:Se.DEFAULT}_createPoint(t){return new Ii(t)}_loadData(t){const e=super._loadData(t);if(h(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 es{_type(){return"boxplot"}getPointTooltip(t,e){switch(e){case"min":return t.min;case"minValue":return t.minValue;case"low":return t.low;case"lowValue":return t.lowValue;case"mid":return t.mid;case"midValue":return t.midValue;case"high":return t.high;case"highValue":return t.highValue;default:return super.getPointTooltip(t,e)}}pointLabelCount(){return 2}_createPoint(t){return new $i(t)}_getBottomValue(t){return t.minValue}},bubble:class extends ns{constructor(){super(...arguments),this.sizeMode=Zs.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1}getPixelMinMax(t){return{min:M(this._minDim,t),max:M(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==Zs.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}ignoreAxisBase(t){return!0}getPointTooltip(t,e){switch(e){case"z":return t.z;case"zValue":return t.zValue;default:return super.getPointTooltip(t,e)}}_createPoint(t){return new Fi(t)}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=C(this.minSize,!0),this._maxDim=C(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=Math.min(this._zMin,t.zValue),this._zMax=Math.max(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}},candlestick:Hi,dumbbell:class extends Je{constructor(){super(...arguments),this.marker=new Gi(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;default:return super.getPointTooltip(t,e)}}getLabelOff(t){return super.getLabelOff(t)+Math.max(0,this.marker.radius)}_createPoint(t){return new ji(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 ts{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1,this.backSegments=!1}getSegmentSize(t){return M(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Wi(t)}_doLoad(t){super._doLoad(t),this._segmentDim=C(this.segmentSize,!1)}},errorbar:class extends es{constructor(){super(...arguments),this.pointPadding=.3}_type(){return"errorbar"}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;default:return super.getPointTooltip(t,e)}}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Yi(t)}_getBottomValue(t){return t.lowValue}},funnel:Xi,heatmap:class extends Ue{getColor(t){}_type(){return"heatmap"}getPointTooltip(t,e){switch(e){case"heat":return t.heat;case"heatValue":return t.heatValue;default:return super.getPointTooltip(t,e)}}canMixWith(t){return!1}canCategorized(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new qi(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.heatValue)||(this._heatMin=Math.min(this._heatMin,t.heatValue),this._heatMax=Math.max(this._heatMax,t.heatValue))}))}},histogram:class extends Ue{constructor(){super(...arguments),this.binsNumber=Ks.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=c(this.binWidth,0);if(e>0)return t/e;return c(this.binsNumber,0)<1?Ki[this.binsNumber||Ks.SQURE_ROOT](t):void 0}_type(){return"histogram"}getPointTooltip(t,e){switch(e){case"min":return t.min;case"max":return t.max;default:return super.getPointTooltip(t,e)}}ignoreAxisBase(t){return t===this._xAxisObj}_createPoint(t){return new Zi(t)}_doLoadPoints(t){function e(t){let e;return e=h(t)?t[c(this.yField,0)]:a(t)?_(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=[];let i=[];for(let s=0;s<t.length;s++){const r=e(t[s]);isNaN(r)||i.push(r)}if(i.length>0){i=i.sort(((t,e)=>t-e)),this.minValue<i[0]&&i.unshift(this.minValue),this.maxValue>i[i.length-1]&&i.push(this.maxValue);const t=i.length,e=i[0],r=i[t-1],n=this.getBinCount(t),a=this._binInterval=(r-e)/n;let h=0,o=e,l=o+a;for(let e=0;e<n;e++){let c=0;if(e==n-1)c=t-h;else for(;h<t&&i[h]<l;)c++,h++;s.push({x:o,y:c,min:o,max:e===n-1?r:l}),o=l,l=o+a}}super._doLoadPoints(s)}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=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}},line:Mi,lollipop:class extends ts{constructor(){super(...arguments),this.marker=new Qi(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return t+this.marker.radius}_createPoint(t){return new Ji(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 Hi{_type(){return"ohlc"}_createPoint(t){return new tr(t)}},pareto:class extends Ti{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?Se.SPLINE:Se.DEFAULT}_createPoint(t){return new er(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+c(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:rr,scatter:class extends ns{constructor(){super(...arguments),this.jitterX=0,this.jitterY=0,this.radius=5}_type(){return"scatter"}ignoreAxisBase(t){return!0}_createPoint(t){return new ar(t)}_createLegendMarker(t,e){return new Ai(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.shape,Math.min(fe.MARKER_SIZE,2*this.radius)),e}},treemap:class extends Ue{constructor(){super(...arguments),this.idField="id",this.groupField="group",this.algorithm=lr.SQUARIFY,this.alternate=!0,this._map={}}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}))}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];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._leafs}_type(){return"treemap"}getPointTooltip(t,e){switch(e){case"id":return t.id;case"group":return t.group;default:return super.getPointTooltip(t,e)}}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new hr(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 or(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 u=[];for(;t.length>0;){let d,_,g,p,m;if(d=t.shift(),c+=d.value,p=c*r/i,1===s?(_=p/a,g=a*d.value/c):(g=p/n,_=n*d.value/c),m=Math.max(_/g,g/_),t.length>0&&m>l)return t.unshift(d),c-=d.value,p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),1===s?(e.x+=_,e.width-=_):(e.y+=g,e.height-=g),i-c;if(0===t.length)return p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.push(d),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),0;l=m,u.push(d)}}$_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 Ue{constructor(){super(...arguments),this.origin=cr.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=ur.CLOSE}_type(){return"vector"}getPointTooltip(t,e){switch(e){case"length":return t.length;case"lengthValue":return t.lengthValue;case"angle":return t.angle;case"angleValue":return t.angleValue;default:return super.getPointTooltip(t,e)}}ignoreAxisBase(t){return!0}_createPoint(t){return new _r(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)=>Math.max(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case cr.START:case cr.END:t._off=t._len/2;break;default:t._off=0}}))}}},waterfall:class extends es{constructor(t,e){super(t,e)}_type(){return"waterfall"}getPointTooltip(t,e){switch(e){case"low":return t.low;case"save":return t.save;default:return super.getPointTooltip(t,e)}}canCategorized(){return!0}_createPoint(t){return new gr(t)}_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}}},Br={category:Ge,linear:gs,time:Fs,date:Fs,log:class extends _s{type(){return"log"}_createTickModel(){return new ps(this)}_doCalcluateRange(t){const e=super._doCalcluateRange(t);return e.min=Math.log10(e.min),e.max=Math.log10(e.max),e}_createTick(t,e,s){return super._createTick(t,e,Math.pow(10,s))}getPosition(t,e){return e=e>0?Math.log10(e):0,super.getPosition(t,e)}}},Ir={circle:class extends ri{constructor(){super(...arguments),this.band=new Js(this),this.scale=new di(this,!1),this.rim=new hi(this),this.valueRim=new oi(this),this.marker=new li(this),this.hand=new ci(this),this.pin=new ui(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 Xs.INSIDE:e.band=r-(n-e.bandThick)/2;break;case Xs.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=Math.max(1,s.tick.length||0),e.scaleLabel=16,s.position){case Xs.OPPOSITE:e.scale=e.inner-s.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;break;case Xs.INSIDE:default:e.scale=r+s.gap}return e}},linear:br,bullet:class extends mr{constructor(t){super(t),this.band=new vr(this),this.targetBar=new Vr(this),this.actualBar=new Sr(this)}getRanges(t,e){return G(this.ranges,t,e)}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends Hs{constructor(t){super(t),this._active=!0,this.centerX=ri.DEF_CENTER,this.centerY=ri.DEF_CENTER,this.radius=ri.DEF_RADIUS,this.rim=new gi(this),this.hourHand=new pi(this,7,"60%"),this.minuteHand=new pi(this,5,"85%"),this.secondHand=new mi(this,2,"95%"),this.tick=new wi(this,10),this.minorTick=new wi(this,5),this.tickLabel=new bi(this),this.pin=new xi(this,5),this.label=new fi(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:o(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=Math.min(t,e);return{cx:M(this._centerXDim,t,t/2),cy:M(this._centerYDim,e,e/3),rd:M(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=C(d(this.centerX,ri.DEF_CENTER),!0),this._centerYDim=C(d(this.centerY,ri.DEF_CENTER),!0),this._radiusDim=C(d(this.radius,ri.DEF_RADIUS),!0)}}},$r={circle:_i,linear:yr,bullet:Pr,circlegroup:_i,lineargroup:yr,bulletgroup:Pr};class Fr extends It{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=$.RIGHT,this.verticalAlign=F.BOTTOM,this.offsetX=2,this.offsetY=1}}class zr extends It{constructor(){super(...arguments),this.paletteMode=Be.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new Fr(null)}}class Hr extends r{constructor(t){super(),this.type="bar",this.gaugeType="circle",this.polar=!1,this._assets=new St,this._themes=new hs,this._options=new zr(this),this._title=new os(this),this._subtitle=new ls(this),this._legend=new Pe(this),this._split=new Or(this),this._series=new Xe(this),this._xAxes=new ce(this,!0,0,0),this._yAxes=new ue(this,!1,0,0),this._xPaneAxes=new ge(this),this._yPaneAxes=new pe(this),this._gauges=new js(this),this._body=new be(this),this._navigator=new Tr(this),t&&this.load(t)}_createChart(t){return new Hr(t)}startAngle(){return this.body.getStartAngle()}animatable(){return!1!==this._options.animatable}get assets(){return this._assets}get options(){return this._options}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 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}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}isGauge(){return this._gaugeOnly}isPolar(){return this._polar}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}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)}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){const e=this._xAxes.items,s=this._yAxes.items;let i;if(this.isInverted())switch(t){case z.LEFT:i=e.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.RIGHT:i=e.filter((t=>t._isOpposite));break;case z.BOTTOM:i=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.TOP:i=s.filter((t=>t._isOpposite));break;case z.CENTER:i=e.filter((t=>t._isBetween))}else switch(t){case z.LEFT:i=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.RIGHT:i=s.filter((t=>t._isOpposite));break;case z.BOTTOM:i=e.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.TOP:i=e.filter((t=>t._isOpposite));break;case z.MIDDLE:i=e.filter((t=>t._isBetween))}return i||[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){const e=t.template;if(o(e)){let s=this._templates[e];if(s)return g(s,t)}else h(e)&&e.forEach((e=>{let s=this._templates[e];return s&&(s=g(s,t)),s}));return t}load(t){const e="load chart "+1e6*Math.random();console.time(e),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),this._themes.load(t.themes),this._options.load(t.options),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),this._split.load(t.panes),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(t.xAxes||t.xAxis||{}),this._yAxes.load(t.yAxes||t.yAxis||{})),this._body.load(t.body||t.plot),this._navigator.load(t.seriesNavigator),console.log("chart-items:",Bt),console.timeEnd(e)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}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=!this._polar&&this._body.split.visible)&&(this._splits=this._body.getSplits(),e.split(this._splits)),t.disconnect(),e.disconnect(),this._series.prepareRender(),t.collectValues(),e.collectValues(),t.collectReferentsValues(),e.collectReferentsValues(),t.prepareRender(),e.prepareRender(),s.visible&&!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._navigator.visible&&this._navigator.prepareRender()}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){this.$_calcAxesPoints(t,e,s,1)}$_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=>{let e=r;this._splitted&&(e*=this._splits[t.side?1:0]),t.calcPoints(e,i)}))}update(){}$_loadTemplates(t){if(a(t)){const e=this._templates={};for(const s in t){const i=t[s];a(i)&&(e[s]=Object.assign({},i))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&Dr[t.toLowerCase()]}_getSeriesType(t){return o(t)&&Rr[t.toLowerCase()]}_getAxisType(t){return o(t)&&Br[t.toLowerCase()]}_getGaugeType(t){return o(t)&&Ir[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&$r[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t){this._fireEvent("onModelChanged",t)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}const Gr=function(t){return isNaN(t)?0:t};class jr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return t&&this._path.push("Z"),this._path.join(" ")}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return l(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return l(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return l(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),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 l(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(l(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Gr(t[e]),Gr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Gr(t[e].x),Gr(t[e].y));return this}polygon(...t){return l(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 Wr{static empty(){return new Wr}static create(t=0,e=0){return new Wr(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 Wr(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+"}"}}Wr.EMPTY=new Wr;class Yr{static isBright(t){return new Yr(t).isBright()}static getContrast(t,e,s){return new Yr(t).getContrast(e,s)}static interpolate(t,e,s){const i=(16711680&t)>>16,r=(65280&t)>>8,n=255&t;return(i+(((16711680&e)>>16)-i)*s<<16)+(r+(((65280&e)>>8)-r)*s<<8)+(n+((255&e)-n)*s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(J.startsWith(t,"rgb(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):J.startsWith(t,"rgba(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):J.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 Yr(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 Ur,Xr,qr;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Ur||(Ur={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Xr||(Xr={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(qr||(qr={}));class Zr extends dt{static createCenter(t){const e=new Zr(t);return e._layout=Xr.MIDDLE,e}constructor(t,e=b){super(t,e,"text"),this._layout=Xr.TOP,this._overflow=qr.WRAP,this._dirty=!0,this._text="",this.anchor=Ur.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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}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.getBBounds(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Xr.MIDDLE:i=Math.floor(s/2);break;case Xr.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=Math.max(0,t),(e=Math.min(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(Yr.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}getBBounds(){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}}class Kr{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Kr(t,t,t,t):new Kr(t,t,e,e):new Kr(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 Kr(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=c(t.paddingLeft,0),this.right=c(t.paddingRight,0),this.top=c(t.paddingTop,0),this.bottom=c(t.paddingBottom,0),this}applyMargin(t){return this.left=c(t.marginLeft,0),this.right=c(t.marginRight,0),this.top=c(t.marginTop,0),this.bottom=c(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+"}"}}Kr.Empty=Object.freeze(new Kr),Kr.Temp=new Kr;class Qr extends dt{constructor(t,e=b){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Qr.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Qr.IGNORE_ATTRS={width:"",height:""};class Jr extends dt{constructor(t,e=b){super(t,e,"g"),dt.DEBUGGING&&(this.add(this._debugRect=new ke(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),e!==this.model&&(this.model=e,this._doModelChanged());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 ke(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 tn extends Jr{constructor(t,e,s){super(t,e),this._margins=new Kr,this._paddings=new Kr,this.add(this._background=new ke(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this.setStyleOrClass(e.style),e!==this.model&&(this.model=e,this._doModelChanged()),this._setBackgroundStyle(this._background);const n=this._doMeasure(t,e,s,i,r),a=getComputedStyle(this.dom),h=this._paddings,o=this._margins;return h.applyPadding(a),o.applyMargin(a),this.mw=n.width+=o.left+o.right+h.left+h.right,this.mh=n.height+=o.top+o.bottom+h.top+h.bottom,n}layout(t){super.layout(t);const e=this._margins;return this._background.setBounds(e.left+this._getBackOffset(),e.top,this.width-e.left-e.right,this.height-e.top-e.bottom),this}_getBackOffset(){return 0}}class en extends Qr{measure(t,e,s,i,r){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}}class sn extends tn{constructor(t){super(t,sn.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Zr(t))}_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._textView.text=e.text;const n=tt(this._textView.getBBounds());if(!e.axis._isHorz&&0!==this._angle){const t=n.width;n.width=n.height,n.height=t}return n}_doLayout(t){this._textView.translateY(this._margins.top+this._paddings.top),t||this.setRotaion(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}}sn.TITLE_CLASS="rct-axis-title";class rn extends Jr{constructor(t){super(t,on.TICK_CLASS),this.add(this._lineView=new Pi(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLineC(0,0,this.height):this._lineView.setHLineC(0,0,this.width)}}class nn extends Zr{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}get rotatedWidth(){const t=this.rotation*v,e=this.getBBounds();return Math.abs(Math.sin(t)*e.height)+Math.abs(Math.cos(t)*e.width)}get rotatedHeight(){const t=this.rotation*v,e=this.getBBounds();return Math.abs(Math.cos(t)*e.height)+Math.abs(Math.sin(t)*e.width)}}class an extends dt{constructor(t){super(t,void 0),this.add(this._back=new mt(t,"rct-crosshair-flag")),this.add(this._text=new Zr(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text)return this._text.text=e,!0;if(e){const e=this._text.getBBounds(),s=new jr,i=Math.max(t.flag.minWidth||0,e.width+8);s.rect(0,0,i,e.height+4),this._back.setPath(s.end()),this._text.translate(i/2,2)}}}class hn extends Jr{static isThumb(t){return t.classList.contains(hn.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._max=0,this._page=0,this._pos=0,this.add(this._trackView=new ke(t,hn.TRACK_CLASS)),this.add(this._thumbView=new ke(t,hn.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._max=Math.max(0,e),this._page=Math.min(s,e),this._pos=Math.min(e-s,Math.max(0,t.start))}else this._max=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=Math.max(0,Math.min(t,s)))*(e.max-e.min-(e.end-e.start))/s}_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=this._szThumb=c(e.minThumbSize,32),i=this._max,r=this._page,n=this._pos,a=0===this._max;let h=this.width,o=this.height;if(this._vertical){h-=e.gap+e.gapFar,this._trackView.setBounds(e.gap,0,h,o),o-=s;const t=(a||r===i?o:o*r/i)+s;this._reversed,this._thumbView.setBounds(e.gap+1,a?0:this.height-o*n/i-t,h-2,t)}else{o-=e.gap+e.gapFar,this._trackView.setBounds(0,e.gap,h,o),h-=s;const t=(a||r===i?h:h*r/i)+s;this._reversed,this._thumbView.setBounds(a?0:h*n/i,e.gap+1,t,o-2)}}}hn.TRACK_CLASS="rct-axis-scrollbar-track",hn.THUMB_CLASS="rct-axis-scrollbar-thumb";class on extends Jr{constructor(t){super(t,on.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._labelViews=[],this.add(this._lineView=new Pi(t,on.LINE_CLASS)),this.add(this._titleView=new sn(t)),this.add(this._markContainer=new dt(t,"rct-axis-ticks")),this.add(this._labelContainer=new dt(t,"rct-axis-labels"))}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new hn(t)),this._scrollView.setVisible(!0),this._scrollView.measure(t,e,i,r,1)[s]):this._scrollView?(this._scrollView.setVisible(!1),0):void 0}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsHorz(i,this._labelViews,e)),this._titleView.setVisible(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(t,i)&&(r+=this.$_measureLabelsVert(i,this._labelViews,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){let i=this.model.guides.filter((t=>!t.front));e.addAll(t,i),i=this.model.guides.filter((t=>t.front)),s.addAll(t,i)}showCrosshair(t,e){let s=this._crosshairView;s||this.add(this._crosshairView=s=new an(this.doc)),s.setVisible(!0),s.setText(this.model.crosshair,e);const i=s.getBBounds();this.model._isHorz?s.translate(t-i.width/2,this.model.tick.length):s.translate(this.width-this.model.tick.length-i.width,t-i.height/2)}hideCrosshiar(){this._crosshairView&&this._crosshairView.visible&&this._crosshairView.setVisible(!1)}scroll(t){}_doMeasure(t,e,s,i,r){var n;const a=e._isHorz,h=e._isBetween,o=this._titleView,l=this._labelViews;let c=0;return(this._lineView.visible=e.line.visible)?(this._lineView.setStyleOrClass(e.line.style),h&&(this._lineView2?this._lineView2.setVisible(!0):this.insertChild(this._lineView2=new Pi(t,on.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(e.line.style))):this._lineView2&&this._lineView2.setVisible(!1),this._markLen=e.tick.length||0,this._markLen>0&&(c+=e.tick.margin||0),c+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),h&&(c*=2),this.$_prepareLabels(t,e)?c+=this._labelSize=a?this.$_measureLabelsHorz(e,l,s):this.$_measureLabelsVert(e,l,i):this._labelSize=0,this._simpleMode?o.setVisible(!1):(o.visible&&(c+=a?o.mh:o.mw,c+=+e.title.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(c+=a?this._scrollView.mh:this._scrollView.mw)),Wr.create(a?s:c,a?c: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().translate(n[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().translate(s?0:o-h,l-n[e])})));const c=h+(t.tick.margin||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;let n=0,a=0;if(i.visible){const r=this._labelSize,h=+t.title.offset||0,u=+t.title.gap||0;if(i.resizeByMeasured().layout(e),e){if(a+=s?0:c+r+u,t.reversed)switch(t.title.align){case zt.START:n=o-i.width/2-h;break;case zt.END:n=i.width/2+h;break;case zt.MIDDLE:default:n=o/2-h}else switch(t.title.align){case zt.START:n=i.width/2+h;break;case zt.END:n=o-i.width/2-h;break;case zt.MIDDLE:default:n=o/2+h}i.translate(n,a),a+=i.height}else{const e=0===i._angle?i.width:i.height;if(n=s?c+r+u+e/2:o-c-r-u-e/2,t.reversed)if(0===i._angle)switch(t.title.align){case zt.START:a=0+h;break;case zt.END:a=l-i.height-h;break;case zt.MIDDLE:default:a=(l-i.height)/2+h}else switch(t.title.align){case zt.START:a=i.width/2-i.height/2+h;break;case zt.END:a=l-i.width/2-i.height/2-h;break;case zt.MIDDLE:default:a=(l-i.height)/2+h}else if(0===i._angle)switch(t.title.align){case zt.START:a=l-i.height-h;break;case zt.END:a=0+h;break;case zt.MIDDLE:default:a=(l-i.height)/2-h}else switch(t.title.align){case zt.START:a=l-i.width/2-i.height/2-h;break;case zt.END:a=i.width/2-i.height/2+h;break;case zt.MIDDLE:default:a=(l-i.height)/2-h}i.translate(n,a)}}(null==r?void 0:r.visible)&&(e?(r.translate(0,a).resize(this.width,r.mh),r.setScroll(t._zoom,t.reversed)):(r.translate(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 rn(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}$_prepareLabels(t,e){const s=this._labelContainer;if(s.visible=e.label.visible){const i=e._ticks,r=i.length,n=this._labelViews;for(;n.length<r;){const e=new nn(t,"rct-axis-label");e.anchor=Ur.START,s.add(e),n.push(e)}for(;n.length>r;)n.pop().remove();return n.forEach(((t,e)=>{t.setVisible(!0),t.value=i[e].value,t.text=i[e].label})),n.length}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz(t,e,s,i,r,n){const a=e.length,h=Math.max(1,i)*Math.max(1,r),o=n||0,l=Math.abs(o)*Math.PI/180;let c=!1;e.forEach((t=>t.rotation=o));for(let i=0;i<a-1;i+=h){let r=0;for(let n=i;n<i+h&&n<a-1;n++)r+=t.getLabelLength(s,e[i].value);if(0===o&&e[i].getBBounds().width>=r){c=!0;break}if(0!==o&&(e[i].getBBounds().width+e[i].getBBounds().height)*Math.cos(l)>=r){c=!0;break}}return c}$_applyStep(t,e,s){const i=t.label,r=Math.max(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.setVisible(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s){const i=t.label;let r,n=+i.step>>0,a=+i.rows>>0,h=+i.rotation%360,o=this.$_checkOverlappedHorz(t,e,s,n,a,h);if(e.forEach((t=>t.row=0)),this._labelRowPts=[0],o){switch(n=a=h=0,i.autoArrange){case Gt.ROTATE:h=-45;break;case Gt.ROWS:a=this.$_getRows(e);break;case Gt.STEP:n=this.$_getStep(e)}if(n>1){const i=e.slice(0);for(;i.length>1&&(e=this.$_applyStep(t,i,n),this.$_checkOverlappedHorz(t,i,s,n,1,0));)n++}else if(a>1){for(;e.length>a&&(e.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz(t,e,s,1,a,0));)a++;this._labelRowPts=[]}else h=-45,e.forEach(((t,e)=>{t.rotation=h,t.index=e})),this.$_checkOverlappedHorz(t,e,s,n,a,h)&&(n=Math.max(2,n++),e=this.$_applyStep(t,e,n),this.$_checkOverlappedHorz(t,e,s,n,a,0)&&e.forEach(((t,e)=>{t.rotation=h})))}else e=this.$_applyStep(t,e,n||1);if(a>1){const t=!isNaN(h)&&0!=h,s=this._labelRowPts;a>1&&e.forEach(((t,e)=>t.row=e%a));for(let t=0;t<a;t++)s.push(0);e.forEach((e=>{s[e.row]=Math.max(s[e.row],t?e.rotatedHeight:e.getBBounds().height)})),s.unshift(0);for(let t=2;t<s.length;t++)s[t]+=s[t-1];return s[s.length-1]}if(isNaN(h)||0==h){r=e[0].getBBounds().height;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].getBBounds().height)}else{r=e[0].rotatedHeight;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].rotatedHeight)}return r}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=Math.max(1,i);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].getBBounds().height>=a)return!0}}$_measureLabelsVert(t,e,s){const i=t.label;let r=Math.max(1,+i.step>>0);if(this.$_checkOverlappedVert(t,e,s,r)){const i=e.slice(0);for(;i.length>1&&r<i.length/2&&(e=this.$_applyStep(t,i,++r),this.$_checkOverlappedHorz(t,i,s,r,1,0)););}else e=this.$_applyStep(t,e,r);let n=e[0].getBBounds().width;for(let t=1;t<e.length;t++)n=Math.max(n,e[t].getBBounds().width);return n}$_layoutLabelsHorz(t,e,s,i,r,n,a){const h=this._labelRowPts;t.forEach((t=>{if(t.visible){const s=t.rotation,r=s*v,o=t.getBBounds(),l=Math.floor(t.getAscent(o.height));let c=e[t.index].pos,u=i?n-a-o.height-h[t.row]:a+h[t.row];s<-15&&s>=-90?(t.anchor=Ur.END,c+=-Math.sin(r)*l/2-1,u+=Math.cos(r)*l-l):s>15&&s<=90?(t.anchor=Ur.START,c-=Math.sin(r)*l/2-1,u+=Math.cos(r)*l-l):t.anchor=Ur.MIDDLE,t.translate(c,u)}}))}$_layoutLabelsVert(t,e,s,i,r,n,a){const h=i?a:r-a;t.forEach(((t,a)=>{if(t.visible){const o=t.getBBounds(),l=i?h:s?(r-o.width)/2:h-o.width;t.translate(l,n-e[a].pos-o.height/2)}}))}}on.AXIS_CLASS="rct-axis",on.LINE_CLASS="rct-axis-line",on.TICK_CLASS="rct-axis-tick";class ln extends s{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()}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}reprepare(t,e,s,i,r,n){const a=this._owner.doc,h=this._pool,o=this._views,l=[];for(let t=this._removes.length-1;t>=0;t--)if(!this._removes[t].parent){const e=this._removes.splice(t,1)[0];h.push(e)}for(let i=0,n=e.length;i<n;i++){const h=e[i];let c=-1;if(t)for(let e=0,i=o.length;e<i;e++){const i=o[e][t];if(s&&i===h[s]||!s&&i===h){l.push(o[e]),c=e;break}}if(c>=0){const t=o.splice(c,1)[0];t.parent||this._owner.add(t)}else{const t=this.$_create(a,i,n);l.push(t),null==r||r(t,i,n)}}for(let t=0,e=o.length;t<e;t++){const s=o[t];s.removing||(this.removeDelay>0?this._removes.push(s.removeLater(this.removeDelay)):h.push(s.remove()),null==i||i(s,t,e))}return this._views=l,n&&this.forEach(n),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)}}class cn extends dt{constructor(t,e){super(t,e,"image"),this._dirty=!0,this.setAttr("preserveAspectRatio","none")}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.setAttr("href",t),this.resize(e,s),!0)}getBBounds(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}const un=Math.pow,dn=Math.sqrt,_n=Math.sin,gn=Math.cos,pn=Math.PI,mn=1.70158,wn=1.525*mn,bn=mn+1,xn=2*pn/3,fn=2*pn/4.5,yn=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},vn={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-un(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-un(1-t,3),outCubic2:t=>1-un(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-un(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-un(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-un(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-un(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-un(-2*t+2,5)/2,inSine:t=>1-gn(t*pn/2),outSine:t=>_n(t*pn/2),inOutSine:t=>-(gn(pn*t)-1)/2,inExpo:t=>0===t?0:un(2,10*t-10),outExpo:t=>1===t?1:1-un(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?un(2,20*t-10)/2:(2-un(2,-20*t+10))/2,inCirc:t=>1-dn(1-un(t,2)),outCirc:t=>dn(1-un(t-1,2)),inOutCirc:t=>t<.5?(1-dn(1-un(2*t,2)))/2:(dn(1-un(-2*t+2,2))+1)/2,inBack:t=>bn*t*t*t-mn*t*t,outBack:t=>1+bn*un(t-1,3)+mn*un(t-1,2),inOutBack:t=>t<.5?un(2*t,2)*(7.189819*t-wn)/2:(un(2*t-2,2)*((wn+1)*(2*t-2)+wn)+2)/2,inElastic:t=>0===t?0:1===t?1:-un(2,10*t-10)*_n((10*t-10.75)*xn),outElastic:t=>0===t?0:1===t?1:un(2,-10*t)*_n((10*t-.75)*xn)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-un(2,20*t-10)*_n((20*t-11.125)*fn)/2:un(2,-20*t+10)*_n((20*t-11.125)*fn)/2+1,inBounce:t=>1-yn(1-t),outBounce:yn,inOutBounce:t=>t<.5?(1-yn(1-2*t))/2:(1+yn(2*t-1))/2};class Vn{constructor(){this.delay=0,this.duration=Vn.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=Math.min(1,Math.max(0,P(t/this.duration)));this._easing&&(e=this._easing(e));try{!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=c(t,Vn.DURATION),this.delay=e||0,this._easing=vn[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(){}}Vn.DURATION=700,Vn.SHORT_DURATION=300;class Sn extends Qr{constructor(t,e=b){super(t),this.add(this._text=new Zr(t,e)),this._text.anchor=Ur.START}get text(){return this._text.text}get anchor(){return this._text.anchor}set anchor(t){this._text.anchor=t}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setSvg(t){return this._text.svg=t,this}setModel(t,e,s){var i,r,n,a;const h=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),h===$t.BACKGROUND?(null===(i=this._outline)||void 0===i||i.remove(),this._back||(this._back=new ke(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):h===$t.OUTLINE?(null===(r=this._back)||void 0===r||r.remove(),this._outline||(this._outline=new Zr(t),this._outline.anchor=Ur.START),this.insertFirst(this._outline),this._outline.setStyleOrClass(e.style)):(null===(n=this._back)||void 0===n||n.remove(),null===(a=this._outline)||void 0===a||a.remove()),this._text.setBoolData("outlined",!!this._outline),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=Yr.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:"2px"})}return this}layout(){if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom),e=this._text.getBBounds(),s=parseFloat(t.paddingLeft)||0,i=parseFloat(t.paddingTop)||0;this._back.setBounds(-s,-i,e.width+s+(parseFloat(t.paddingRight)||0),e.height+i+(parseFloat(t.paddingBottom)||0),3)}return this}}class Pn{static slide(t,e){new An(t,e)}static fadeIn(t){new kn(t,{prop:"opacity",start:"0",end:"1"})}static grow(t,e){new Ln(t,e)}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class kn extends Pn{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:Vn.DURATION,fill:"none"})}}class An extends Pn{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:Vn.DURATION,fill:"none"}}$_clipRect(t){return t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height).setTemporary()}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:A(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:A(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class En extends Vn{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_doStop(){this._series=null}}class Ln extends En{_doUpdate(t){return!!this._series.parent&&(this._series.setViewRate(t),!0)}_doStop(){this._series.parent&&this._series.setViewRate(NaN),super._doStop()}}class Cn extends Sn{constructor(t){super(t,"rct-point-label")}}class Tn extends _t{constructor(t){super(t,"rct-point-labels"),this._labels=[new ln(this,Cn),new ln(this,Cn)],this._maps=[],this.setStyle("pointerEvents","none")}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r){const n=r.text,a=r.style;e.point=i,e.setModel(t,r,null),n?(r.buildSvg(e._text,NaN,NaN,r,i.getValueOf),e.setStyles(a),e._outline&&r.buildSvg(e._outline,NaN,NaN,r,i.getValueOf)):e.setText(r.getText(i.getLabel(s))).setStyles(a)}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){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(((s,r)=>{for(let a=0;a<s.labelCount();a++){const o=n[a].get(r);o.setVisible(e.isPointVisible(s))&&(this.prepareLabel(t,o,a,s,i),h[a][s.pid]=o)}})),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 Mn extends Qr{constructor(t){super(t),this.add(this._line=new mt(t))}setLine(t){this._line.setPath(t)}}class Nn extends Qr{constructor(t){super(t,"rct-point-label-lines"),this._lines=new ln(this,Mn)}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 On extends _t{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 Dn extends Jr{constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._inverted=!1,this._animatable=!0,this._viewRate=NaN,this._animations=[],this.add(this._pointContainer=new On(t,"rct-series-points")),this._labelContainer=new Tn(t)}invertable(){return!0}getClipContainer(){return this._pointContainer}setViewRate(t){isNaN(t)&&isNaN(this._viewRate)||t===this._viewRate||(this._viewRate=t,isNaN(t)?this.control.invalidateLayout():this._doViewRateChanged(t))}setPosRate(t){}isPointVisible(t){return t.visible&&!t.isNull}_doViewRateChanged(t){}_setChartOptions(t,e){this._inverted=t,this._animatable=e}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.visible&&this._labelContainer.setVisible(!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)}findPointView(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){}_getColor(){return this.model._calcedColor}prepareSeries(t,e){this.setData("index",e.index%12),this.setBoolData("pointcolors",e._colorByPoint()),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&(this.internalSetStyle("fill",e.color),this.internalSetStyle("stroke",e.color)),e._calcedColor=getComputedStyle(this.dom).fill,this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return this.setClip(void 0),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new mt(t,"rct-series-trendline")),this._trendLineView.setVisible(!0)):this._trendLineView&&this._trendLineView.setVisible(!1),Wr.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(),this._afterRender(),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded)}_collectVisPoints(t){return t.collectVisibles()}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointStyle(t,e,s,i){t.setAttr("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&(t.internalSetStyle("fill",s.color),t.internalSetStyle("stroke",s.color));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVisible(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible&&this._labelContainer}_getViewRate(){return c(this._viewRate,1)}_animating(){return!isNaN(this._viewRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_afterRender(){}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(){const t=this.model,e=t._xAxisObj,s=t._yAxisObj,i=t.trendline._points.map((t=>({x:e.getPosition(e._vlen,t.x),y:s._vlen-s.getPosition(s._vlen,t.y)}))),r=new jr;r.move(i[0].x,i[0].y),r.lines(...i),this._trendLineView.setPath(r.end(!1))}_layoutLabel(t){let{inverted:e,x:s,y:i,hPoint:r,labelView:n,labelOff:a}=t;const h=t.reversed?r<=0:r<0,o=n.getBBounds();let l=!0;switch(e?i-=o.height/2:s-=o.width/2,t.labelPos){case Ne.INSIDE:e?s-=r/2+a:i+=(r-o.height)/2+a;break;case Ne.HEAD:e?h?s+=o.width-a:s-=o.width+a:h?i-=o.height+a:i+=a;break;case Ne.FOOT:e?s-=h?r+o.width+a:r-a:i+=h?r+a:r-o.height-a;break;case Ne.OUTSIDE:default:e?h?s-=o.width+a:s+=a:h?i+=a:i-=o.height+a,l=!1}n.setContrast(l&&t.pointView.dom),n.layout().translate(s,i)}}Dn.POINT_CLASS="rct-point",Dn.DATA_FOUCS="focus",Dn.LEGEND_MARKER="rct-legend-item-marker";class Rn extends mt{constructor(t){super(t,Dn.POINT_CLASS),this.labelViews=[]}}let Bn=class extends Rn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class In extends Dn{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&&Pn.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}}class $n extends In{_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof Ge?2*h.categoryPad():0,u=i?t:e,d=i?e:t,_=i?0:e,g=o.axisMin(),p=o.getPosition(u,g),m=s.getBaseValue(o),w=c(o.getPosition(u,Math.max(g,m)),p),b=!isNaN(m),x=a&&Object.assign(this._labelInfo,{inverted:i,reversed:o.reversed,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const c=h.getUnitLength(d,n.xValue)*(1-l),g=s.getPointWidth(c),p=(o.getPosition(u,n.yValue)-w)*r;let m,f;m=h.getPosition(d,n.xValue)-c/2,f=_,n.xPos=m+=s.getPointPos(c)+g/2,n.yPos=f-=o.getPosition(u,n.yGroup*r),this._layoutPointView(t,e,m,f+p,g,p),x&&(x.labelView=a.get(n,0))&&(i&&(f=d-h.getPosition(d,n.xValue)+c/2,m=_,n.yPos=f-=s.getPointPos(c)+g/2,n.xPos=m+=b?o.getPosition(u,n.yGroup)*r:o.getPosition(u,n.yGroup*r)),x.pointView=t,x.x=m,x.y=f,x.wPoint=g,x.hPoint=p,this._layoutLabel(x))}}))}}class Fn extends In{_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof Ge?2*h.categoryPad():0,c=i?t:e,u=i?e:t,d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const g=h.getUnitLength(u,n.xValue)*(1-l),p=s.getPointWidth(g),m=(o.getPosition(c,n.yValue)-o.getPosition(c,this._getLowValue(n)))*r;let w=h.getPosition(u,n.xValue)-g/2,b=d;n.xPos=w+=s.getPointPos(g)+p/2,n.yPos=b-=o.getPosition(c,n.yGroup)*r,this._layoutPointView(t,e,w,b,p,m),a&&(i&&(b=u-h.getPosition(u,n.xValue)+g/2,w=d,n.yPos=b-=s.getPointPos(g)+p/2,n.xPos=w+=o.getPosition(c,n.yGroup)*r),_.pointView=t,_.hPoint=m,_.x=w,_.y=b,(_.labelView=a.get(n,0))&&(_.hPoint=m,this._layoutLabel(_)),(_.labelView=a.get(n,1))&&(i?_.x-=m:_.y+=m,_.hPoint=-m,this._layoutLabel(_)))}}))}}class zn extends mt{constructor(t){super(t,Dn.POINT_CLASS)}}class Hn extends Dn{constructor(t,e){super(t,e),this._markers=new ln(this._pointContainer,zn)}_getPointPool(){return this._markers}invertable(){return!1}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBounds();e===Ne.AUTO&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVisible(null!=e)&&(e===Ne.INSIDE?t.translate(r-a.width/2,n-a.height/2):e&&t.translate(r-a.width/2,n-i-a.height-s))}}class Gn extends Vn{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.control.invalidateLayout(),this.series=null)}}class jn extends Dn{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 Gn(this),this._zombieAni.start())}_createPointLegendMarker(t,e,s){return ke.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,fe.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class Wn extends dt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Yn extends Wn{constructor(t,e){super(t,e),this.setStyle("fill","none")}resetStyles(t){const e=super.resetStyles(t);return this.setStyle("fill","none"),e}}class Un extends mt{setArc(t,e,s,i,r,n){this.setPath(nt.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Xn extends mt{static create(t,e,s,i,r,n,a,h,o=!0){return new Xn(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 Xn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=b,s=b){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 nt.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 nt.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 qn extends Jr{constructor(t,e){super(t,e),this._inverted=!1,this._animatable=!0,this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new ke(t,qn.PANE_CLASS)),this.add(this._contentContainer=new _t(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return qn.GAUGE_CLASS}_setChartOptions(t,e){this._inverted=t,this._animatable=e}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){super._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=Object.assign(W.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.translate(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof sa)return t;t=t.parent}}}qn.GAUGE_CLASS="rct-gauge",qn.PANE_CLASS="rct-gauge-pane";class Zn extends Vn{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 Kn extends qn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Ct.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_getValue(t){return Math.max(t.minValue,Math.min(t.maxValue,c(this._runValue,t.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new Zn(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class Qn extends Jr{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new _t(t,"rct-gauge-scale-ticks")),this._ticks=new ln(this._tickContainer,Pi),this.add(this._labelContainer=new _t(t,"rct-gauge-scale-tick-labels")),this._labels=new ln(this._labelContainer,Zr)}}class Jn extends Qn{_createLine(t,e){return new Pi(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e._steps,o=h.length;let l=a?e.gap:s,c=a?i:e.gap;if(this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(o)),a?l+=e.tick.length:c+=e.tick.length,this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(o),o>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?s:o-1-s]),t=Math.max(e.getBBounds().width)})),l+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?o-1-s:s]),t=Math.max(e.getBBounds().height)})),c+=t}return{width:l,height:c}}_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===Xs.OPPOSITE,h=a?-r.length:r.length;let o,l=a?s-t.gap:t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLineC(l,0,e)),this._tickContainer.setVisible(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.getBBounds();o=t.getRate(n[r])*e,i.setVisible(o-a.width/2>s)&&(i.translate(o,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===Xs.OPPOSITE,h=a?r.length:-r.length;let o,l=a?t.gap:e-t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLineC(l,0,s)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach(((e,i)=>{o=t.getRate(n[i])*s,e.setHLine(o,l,l+h)})),this._labelContainer.visible){const i=a?Ur.START:Ur.END;l=a?l+h:e-t.gap+h,this._labels.forEach(((e,r)=>{o=t.getRate(n[r])*s,e.anchor=i,e.layout=r<n.length-1?Xr.MIDDLE:Xr.BOTTOM,e.translate(l,o)}))}}}class ta extends Kn{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,e,s,t,this.valueOf),tt(r.getBBounds())}_renderGauge(t,e){const s=this.model,i=c(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=c(this._runValue,t.value),n=Object.assign({},this._rBand);if(this._renderScale(n),n.height>0&&(this.background().setRect(n),this._renderBand(t,n,r),this._rLabel.height=n.height,this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===Xs.OPPOSITE)){const t=i.getBBounds();i.ty+t.height>this.height&&i.translateY(Math.max(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=et.create(0,0,n,a);if(this._vertical=!t.group&&d(r,a>n),e.visible){const r=e._runPos=d(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 u=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const g=o?n:e.getMaxWidth(n),p=o?e.getMaxHeight(a):a,m=this._rLabel=et.create(0,0,n,a);e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,c(u,g),c(_,p),t,this.valueOf);const w=s.getBBounds();switch(o?(m.height=c(_,w.height),h.height=Math.max(0,h.height-(m.height+l))):(m.width=c(u,w.width),this._wLabel=t.group?t.group._labelWidth:m.width,h.width=Math.max(0,h.width-(this._wLabel+l))),r){case"top":h.y=m.height+l;break;case"bottom":m.y=h.height+l;break;case"right":m.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.getBBounds();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=Ur.START,n+=Math.max(0,(t.height-i.height)/2);break;default:s.anchor=Ur.END,r+=this._wLabel,n+=Math.max(0,(t.height-i.height)/2)}s.translate(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.setVisible(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,h=t.y,t.width=Math.max(0,t.width-e.width),i.position===Xs.OPPOSITE?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=Math.max(0,t.height-e.height),i.position===Xs.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().translate(a,h)}}}class ea extends Kn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Ct.getFormatter(s||t.label.numberFormat).toStr(i):i}}}class sa extends qn{_defaultCalss(){return sa.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new _t(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_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))}))}}sa.GAUGE_GROUP_CLASS="rct-gauge-group";class ia extends Qn{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new Un(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.sweepAngle?1:0);return this._line.setVisible(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.internalSetStyleOrClass(e.tickLabel.style),this._labels.prepare(n,(t=>{t.layout=Xr.MIDDLE}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=e.position===Xs.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,c=n._sweepRad,u=n._startRad,d=i.maxValue-i.minValue;let _,g,p,m;if(this._line.visible&&this._line.setArc(a,h,o,u,c,!0),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*c+u;_=a+Math.cos(n)*o,g=h+Math.sin(n)*o,p=a+Math.cos(n)*l,m=h+Math.sin(n)*l,t.setLine(_,g,p,m)})),this._labelContainer.visible){this._labels.get(0).text=String(i.maxValue);const t=l+.5*this._labels.get(0).getBBounds().height*r;this._labels.forEach(((r,n,o)=>{const l=e.getRate(s[n])*c+u;p=a+Math.cos(l)*t,m=h+Math.sin(l)*t,r.text=String(P(i.minValue+e.getRate(s[n])*d)),r.translate(p,m)}))}}}let ra=class extends Jr{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new ln(this,Xn),this.add(this._labelContainer=new _t(t,"rct-circle-gauge-band-tick-labels")),this._labels=new ln(this._labelContainer,Zr)}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,u=r._sweepRad;s.maxValue,s.minValue;let d=r._startRad;this._sectorViews.prepare(c.length).forEach(((t,e)=>{const s=i.getRate(c[e].toValue-c[e].fromValue)*u;t.setSector({cx:n,cy:a,rx:h,ry:h,innerRadius:l,start:d,angle:s,clockwise:o}),t.setStyle("fill",c[e].color),d+=s}))}};class na extends mt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new jr).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class aa extends mt{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 jr;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 ha extends ea{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new Xn(t,"rct-circle-gauge-back")),e.add(this._valueView=new Xn(t,"rct-circle-gauge-value")),e.add(this._innerView=new Xn(t,"rct-circle-gauge-inner")),e.add(this._textView=new Zr(t,"rct-circle-gauge-label")),e.add(this._handContainer=new _t(t,void 0)),e.add(this._scaleView=new ia(t)),e.add(this._bandView=new ra(t))}_prepareGauge(t,e){this._rimView.setVisible(e.rim.visible),this._scaleView.setVisible(e.scale.visible),this._bandView.setVisible(e.band.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new aa(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 na(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(Math.min(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(c(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);this._valueView.setStyleOrClass(e.style),o&&this._valueView.setStyle(e.stroked?"stroke":"fill",o.color),t.valueRim.stroked&&(this._valueView.setStyle("fill","none"),this._valueView.setStyle("strokeWidth",A(h))),this._valueView.setBoolData("stroked",e.stroked),this._valueView.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)*V;this._handView.render(t.hand,a.radius).translatep(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,NaN,NaN,t,this.valueOf),o.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,o,a);else{const e=o.getBBounds(),s=t.label.getOffset(this.width,this.height);o.translate(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.setVisible(t.rim.visible)&&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.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(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).translate(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBounds(),r=this._rimView.getBBounds(),n=+t.group.labelGap||0;e.anchor=Ur.END,e.translate(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class oa extends Vn{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class la extends mt{constructor(t){super(t,Dn.POINT_CLASS)}}class ca extends dt{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.dom.style.transform=`translate(${e}px, ${e}px) rotate(-90deg) scale(1, -1)`:this.dom.style.transform=""),this.inverted}}class ua extends Dn{constructor(t,e){super(t,e),this._needBelow=!1,this.insertFirst(this._lineContainer=new ca(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new mt(t,"rct-line-series-line")),this._markers=new ln(this._pointContainer,la)}getClipContainer(){return null}_getPointPool(){return this._markers}_prepareSeries(t,e){e instanceof Mi&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.model,this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this._layoutLines(this._visPoints)}_runShowEffect(t){this._polar?t&&Pn.grow(this):t&&Pn.slide(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(this._visPoints.slice())}_markersPerPoint(){return 1}_prepareBelow(t){const e=this.control;let s=this._lowLine;if(this._needBelow=t.belowStyle&&t._minValue<t.baseValue,this._needBelow)return s||(this._lineContainer.insertChild(s=this._lowLine=new mt(this.doc),this._line),this._upperClip=e.clipBounds(),this._lowerClip=e.clipBounds()),this._line.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.setClip(),this._line.setClip()}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,e-s,e,t):n.setBounds(0,e-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,e-t,e,t-s):n.setBounds(0,e-s,e,t):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof Mi&&this._needBelow,i=s?t.baseValue:NaN,r=t.marker,n=[r.style,null];if(this._pointContainer.visible=r.visible&&!t._simpleMode){const r=this._markersPerPoint(),a=e.length;this._markers.prepare(a*r,((r,h)=>{const o=e[h%a];o.isNull||(r.point=o,n[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(r,t,o,n))}))}else this._markers.prepare(0)}_layoutMarker(t,e,s){const i=this.model,r=t.point,n=t._radius=i.getRadius(r);nt.setShape(t,i.getShape(r),n),t.translate(e-=n,s-=n)}_layoutMarkers(t,e,s){const i=this.model,r=this._inverted,n=this._polar=i.chart.body.getPolar(i),a=this._getViewRate(),h=i.marker.visible,o=i.pointLabel.offset,l=this._labelViews(),c=i._xAxisObj,u=i._yAxisObj,d=r?e:s,_=r?s:e,g=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];let i,p;if(n){const t=n.start+e*n.deg,r=u.getPosition(n.rd,s.yGroup)*a;i=s.xPos=n.cx+r*Math.cos(t),p=s.yPos=n.cy+r*Math.sin(t)}else i=s.xPos=c.getPosition(_,s.xValue),p=s.yPos=g-u.getPosition(d,s.yGroup),r&&(i=u.getPosition(d,s.yGroup),p=g-c.getPosition(_,s.xValue));const m=this._markers.get(e),w=l&&l.get(s,0);if(m&&m.setVisible(!s.isNull)){if(this._layoutMarker(m,i,p),w){const t=w.getBBounds();w.visible=!0,w.setContrast(null),w.translate(i-t.width/2,p-t.height-o-(h?m._radius:0))}}else w&&(w.visible=!1)}}_layoutLines(t){const e=this.model,s=e instanceof Mi&&this._needBelow,i=new jr;let r,n=0;for(;n<t.length;){const e=t[n++];if(!e.isNull){i.move(e.xPos,e.yPos);break}}if(this._linePts=t,n<t.length-1&&(this._buildLines(t,n,i),this._line.setPath(r=i.end(this._polar)),this._line.clearStyleAndClass(),this._line.setStyle("stroke",e.color),this._line.addStyleOrClass(e.style),W.setImportantStyle(this._line.dom.style,"fill","none"),s)){const t=e._yAxisObj,s=e.baseValue;this._inverted?this.$_resetClips(this.width,this.height,t.getPosition(this.width,s),!0):this.$_resetClips(this.width,this.height,this.height-t.getPosition(this.height,s),!1),this._lowLine.setPath(r),this._lowLine.clearStyleAndClass(),this._lowLine.setStyle("stroke",e.color),this._lowLine.addStyleOrClass(e.style),this._lowLine.addStyleOrClass(e.belowStyle),W.setImportantStyle(this._lowLine.dom.style,"fill","none")}}_buildLines(t,e,s){const i=this.model,r=i.getLineType();r===Se.SPLINE?this._drawCurve(t,e-1,s):i instanceof Mi&&r===Se.STEP?this._drawStep(t,e,s,i.stepDir):this._drawLine(t,e,s)}_drawLine(t,e,s){const i=t.length;let r=e;for(;r<i;)if(t[r].isNull){do{r++}while(r<i&&t[r].isNull);r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else s.line(t[r].xPos,t[r].yPos),r++}_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.$_drawCurve(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else r++;r-1>n&&this.$_drawCurve(t,n,r-1,s)}}$_drawCurve(t,e,s,i){let r=e;if(1===Math.abs(s-e))return void i.line(t[r+1].xPos,t[r+1].yPos);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].xPos-t[r].xPos,y:t[r+1].yPos-t[r].yPos},c={x:0,y:0},u={x:0,y:0},d={x:0,y:0};let _={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].xPos-t[r].xPos,m=t[r].xPos,w=t[r].yPos;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].xPos-t[r].xPos,l.y=t[r+1].yPos-t[r].yPos,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(_.x=o.x-l.x,_.y=o.y-l.y):(_.x=l.x-o.x,_.y=l.y-o.y);const s=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=s,_.y/=s,o.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*p*n,a.y=-_.y*p*n,r===e+1?i.quad(t[r].xPos+a.x,t[r].yPos+a.y,t[r].xPos,t[r].yPos):(c.x=m+h.x,c.y=w+h.y,u.x=t[r].xPos+a.x,u.y=t[r].yPos+a.y,d.x=(c.x+u.x)/2,d.y=(c.y+u.y)/2,i.quad(c.x,c.y,d.x,d.y),i.quad(u.x,u.y,t[r].xPos,t[r].yPos)),p=t[r+1].xPos-t[r].xPos,h.x=_.x*p*n,h.y=_.y*p*n,m=t[r].xPos,w=t[r].yPos}i.quad(m+h.x,w+h.y,t[r].xPos,t[r].yPos)}_drawStep(t,e,s,i){const r=t.length;let n=e;for(;n<r;)if(t[n].isNull){do{n++}while(n<r&&t[n].isNull);n<r&&(s.move(t[n].xPos,t[n].yPos),n++)}else i===qs.BACKWARD?(s.line(t[n-1].xPos,t[n].yPos),s.line(t[n].xPos,t[n].yPos)):(s.line(t[n].xPos,t[n-1].yPos),s.line(t[n].xPos,t[n].yPos)),n++}}class da extends ua{constructor(t){super(t,da.CLASS)}}da.CLASS="rct-line-series";class _a extends ua{constructor(t,e){super(t,e||"rct-area-series"),this._lineContainer.insertFirst(this._area=new mt(t,"rct-area-series-area"))}_layoutLines(t){super._layoutLines(t),this._polar?this._layoutPolar(this._area,t):this._layoutArea(this._area,t)}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._lineContainer.insertChild(e=this._lowArea=new mt(this.doc,"rct-area-series-area"),this._area),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model._yAxisObj,r=s;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.yLow=r-i.getPosition(s,n.yGroup-n.yValue)}}_layoutArea(t,e){const s=this.model,i=this._needBelow?this._lowArea:void 0,r=s.group,n=s.chart.isInverted(),a=s._yAxisObj,h=n?this.width:this.height,o=a.axisMin(),l=s.getBaseValue(a),u=this.height-a.getPosition(h,c(Math.max(o,l),o)),d=new jr;let _,g=0;for(;g<e.length&&e[g].isNull;)g++;if(!r||r.layout!==Re.STACK&&r.layout!==Re.FILL){d.move(e[g].xPos,u),d.line(e[g].xPos,e[g].yPos),this._buildLines(e,g+1,d);const t=d._path;for(g=6;g<t.length;)"M"===t[g]?(t.splice(g,0,"L",t[g-2],u),g+=3,t.splice(g,0,"M",t[g+1],u),t[g+3]="L",g+=6):"Q"===t[g]?g+=4:g+=3;d.line(t[t.length-2],u)}else{const t=g;for(d.move(e[g].xPos,e[g].yLow),d.line(e[g].xPos,e[g].yPos),g++;g<e.length;)d.line(e[g].xPos,e[g].yPos),g++;for(g=e.length-1,d.line(e[g].xPos,e[g].yLow);g>=t;)d.line(e[g].xPos,e[g].yLow),g--}t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.setPath(_=d.end()),t.internalClearStyleAndClass(),s.color&&t.setStyle("fill",s.color),s.style&&t.internalSetStyleOrClass(s.style),i&&(i.setBoolData("simple",this._simpleMode),i.setPath(_),i.internalClearStyleAndClass(),s.color&&i.setStyle("fill",s.color),s.belowStyle&&i.internalSetStyleOrClass(s.belowStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof gs?s.getBaseValue(r):NaN,a=this.height;r.getPosition(a,J.isNotEmpty(n)?n:r.axisMax());const h=new jr;if(!i||i.layout!==Re.STACK&&i.layout!==Re.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.setStyle("fill",s.color),t.addStyleOrClass(s.style)}}class ga extends Xn{constructor(t){super(t,Dn.POINT_CLASS)}}class pa extends Qr{constructor(t){super(t,Dn.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.setStyle("fill",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 Pi(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Pi(t,"rct-boxplot-point-stem")),this.add(this._box=new ke(t,"rct-boxplot-point-box")),this.add(this._mid=new Pi(t,"rct-boxplot-point-mid")),this.add(this._min=new Pi(t,"rct-boxplot-point-min")),this.add(this._max=new Pi(t,"rct-boxplot-point-max"))}}let ma=class extends Qr{constructor(t){super(t,Dn.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue;const r=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i,a=Math.min(n,r),h=Math.max(1,Math.abs(r-n)),o=t.close<t.open;this._body.setStyle("fill",o?"":t.color),this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this._body.setClass(o?"rct-candlestick-point-fall":"")}_doInitChildren(t){this.add(this._wickUpper=new Pi(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Pi(t,"rct-candlestick-point-wick")),this.add(this._body=new ke(t))}};class wa extends Qr{constructor(t){super(t,Dn.POINT_CLASS),this.add(this._line=new Pi(t)),this.add(this._hmarker=new mt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new mt(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setStyle("fill",t.color),this._lmarker.setStyle("fill",t.color)),this._line.setVLineC(i,0,s),this._hmarker.renderShape(t.shape,i,0,t.radius),this._lmarker.renderShape(t.shape,i,s,t.radius)}}let ba=class extends Qr{constructor(t){super(t,Dn.POINT_CLASS),this._backs=new ln(this,mt),this._segments=new ln(this,mt),this._decimal=0}prepareSegments(t,e,s,i,r){this._decimal=i,this._backs.prepare(t?e:0).forEach(((t,e)=>{t.setClass(r)})),this._segments.prepare(Math.round(s)).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._backs.forEach(((e,r)=>{e.setPath(nt.rectangle(0,s-t[2*r],i,n(-1,t[2*r]-t[2*r+1])))})),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(nt.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(nt.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}};let xa=class extends Qr{constructor(t){super(t,Dn.POINT_CLASS),this.add(this._stem=new Pi(t)),this.add(this._whiskerUp=new Pi(t)),this.add(this._whiskerDown=new Pi(t))}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)}};class fa extends mt{constructor(t){super(t,Dn.POINT_CLASS)}}class ya extends ke{constructor(t){super(t,Dn.POINT_CLASS)}}let va=class extends Rn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};let Va=class extends Qr{constructor(t){super(t,Dn.POINT_CLASS),this.add(this._line=new Pi(t)),this.add(this._marker=new mt(t,"rct-lollipop-point-marker"))}layout(){this._line.setVLineC(0,0,this.height),this._marker.renderShape(this.point.shape,0,0,this.point.radius)}};class Sa extends Qr{constructor(t){super(t,Dn.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue,r=-e/2;const n=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,this.width),this._bar.setVLine(0,0,0+s),this._bar.setClass(t.close<t.open?"rct-ohlc-point-bar-fall":"rct-ohlc-point-bar")}_doInitChildren(t){this.add(this._tickOpen=new Pi(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Pi(t,"rct-ohlc-point-tick")),this.add(this._bar=new Pi(t)),this.add(this._back=new ke(t,"rct-ohlc-point-back")),W.setImportantStyle(this._back.dom.style,"fill","transparent")}}class Pa extends Xn{constructor(t){super(t,Dn.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class ka extends mt{constructor(t){super(t,Dn.POINT_CLASS)}get point(){return this.node.point}render(){this.setPath(nt.rect(this.node))}}class Aa extends mt{constructor(t){super(t,Dn.POINT_CLASS)}layout(t,e,s){const i=this.point._len,r=this.point._off,n=.5;let a;switch(t){case ur.NONE:a=[0,-.5*i,0,n*i];break;case ur.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 Ea extends Rn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}}class La extends Jr{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._barViews=new ln(this,ke),this.add(this._labelContainer=new _t(t,"rct-linear-gauge-band-tick-labels")),this._labels=new ln(this._labelContainer,Zr)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof br?n.isVertical():!n.vertical,h=e.position,o=this._thick=e.getThickness(a?s:i)+(h===Xs.INSIDE?0:this._gap=c(e.gap,0));let l=a?o:s,u=a?i:o;const d=this._ranges=e.ranges;if(this._labelContainer.setVisible(e.tickLabel.visible&&d.length>0)){const t=[d[0].fromValue].concat(d.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(d.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().width)})),l+=e}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().height)})),u+=e}}return{width:l,height:u}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVisible(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&e.position!==Xs.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===Xs.OPPOSITE,r=this.width,n=this.height,a=t?n:r,h=this._thick;let o=0;return this._barViews.prepare(s.length).forEach(((r,l)=>{const c=s[l],u=a*(c.toValue-c.fromValue)/e;if(t)r.setBounds(0,n-o-u,h,u);else{const t=i?n-h:0;r.setBounds(o,t,u,this._thick)}r.setStyle("fill",c.color),o+=u})),!0}}$_layoutLabels(t,e,s){const i=this._vertical,r=this.model.position===Xs.OPPOSITE,n=this.width,a=this.height,h=i?a:n,o=r?0:this._thick;let l=this._labels.get(0);i?l.translate(o,0):l.translate(0,o);for(let t=1;t<=s.length;t++){const r=h*s[t-1].toValue/e,n=this._labels.get(t);i?n.translate(o,r):n.translate(r,o)}}}class Ca extends ta{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new ke(t,"rct-linear-gauge-background")),e.add(this._bandView=new La(t)),e.add(this._scaleView=new Jn(t)),e.add(this._valueView=new ke(t,"rct-linear-gauge-value")),e.add(this._labelView=new Zr(t))}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.setVisible(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===Xs.INSIDE?s.translate(t.x,t.y):e.position===Xs.OPPOSITE?(s.translate(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.translate(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===Xs.INSIDE?s.translate(t.x,t.y):e.position===Xs.OPPOSITE?(s.translate(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.translate(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=t.reversed,r=t.group?t.group.scale:t.scale;if(this._valueView.setVisible(!r.isEmpty()&&!isNaN(t.value)))if(this._vertical){const t=e.height*r.getRate(s),n=i?e.y:e.y+e.height-t;this._valueView.setBounds(e.x,n,e.width,t)}else{const t=e.width*r.getRate(s),n=i?e.x+e.width-t:e.x;this._valueView.setBounds(n,e.y,t,e.height)}}}class Ta extends sa{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new Jn(t)),e.insertFirst(this._textView=new Zr(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVisible(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVisible(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=et.create(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,NaN,NaN,r,null);const t=this._textView.getBBounds().height+r.label.getGap(i);a.y+=t,a.height-=t,n.translate(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=Math.max(r._labelWidth,n.width),r._labelHeight=Math.max(r._labelHeight,n.height)}));const h=(o=a)&&Object.assign({},o);var o;const l=r.itemLabel.gap;r.vertical?(h.width-=r._labelWidth+l,r.itemLabel.opposite||(h.x+=r._labelWidth+l)):(h.height-=r._labelHeight+l,r.itemLabel.opposite||(h.x+=r._labelHeight+l)),this._renderScale(r,a,h),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.width:e.height,a=[];let h,o;if(this._gaugeViews.forEach(((e,s)=>{a.push(c(e._runValue,t.get(s).value))})),r.buildGroupSteps(n,a),i.setVisible(r.visible)){if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1);s.height-=t.height,e.height-=t.height,h=s.x,r.position===Xs.OPPOSITE?(o=s.y,s.y+=t.height,e.y+=t.height):o=s.y+s.height}i.resizeByMeasured().layout().translate(h,o)}}$_layoutHorz(t,e,s,i){i.height,i.width,s.count,i.y}$_layoutVert(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.translate(a,h),h+=n+e.itemGap}))}}class Ma extends ta{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new ke(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new _t(t,void 0)),this._barViews=new ln(this._barContainer,ke),e.add(this._valueView=new ke(t,"rct-bullet-gauge-value")),e.add(this._targetView=new ke(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new Jn(t)),e.add(this._labelView=new Zr(t))}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;if(this._barContainer.setVisible(!a.isEmpty())){const s=t.getRanges(a._min,a._max)||(null==i?void 0:i.getRanges(a._min,a._max));if(s)if(this._barContainer.setRect(e),this._barViews.prepare(s.length),n){let t=r?0:e.height;this._barViews.forEach(((i,n)=>{const h=s[n],o=e.height*a.getRate(h.toValue);i.setBounds(0,r?t:t-o,e.width,o),i.setStyle("fill",h.color)}))}else{let t=r?e.width:0;this._barViews.forEach(((i,n)=>{const h=s[n],o=e.width*a.getRate(h.toValue);i.setBounds(r?t-o:t,0,o,e.height),i.setStyle("fill",h.color)}))}}if(this._valueView.setVisible(!a.isEmpty()&&!isNaN(s)))if(n){const t=e.height*a.getRate(s),i=r?e.y:e.y+e.height-t;this._valueView.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;this._valueView.setBounds(i,e.y+e.height/3,t,e.height/3)}if(this._targetView.setVisible(!a.isEmpty()&&!isNaN(t.targetValue)))if(n&&e.width>10){let s=e.height*a.getRate(t.targetValue);s=r?e.y+s:e.y+e.height-s,this._targetView.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,this._targetView.setBounds(s-1,e.y+5,3,e.height-10)}}}class Na extends dt{constructor(t,e,s){super(t,Na.STYLE),this.add(this._back=new ke(t,Na.BACK_STYLE)),this.add(this._textView=new Zr(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 Kr).applyPadding(e),i=this._textView.getBBounds();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.translate(i.width/2+s.left,s.top)}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Na.STYLE="rct-button",Na.BACK_STYLE="rct-button-background";const Oa={area:_a,arearange:class extends ua{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ca(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new mt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new mt(t,"rct-areanrange-series-line")),W.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=this._inverted,n=i._yAxisObj,a=r?e:s,h=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=h-n.getPosition(a,s.lowValue)}if(i.marker.visible){const e=this._markers;for(let s=0,i=t.length;s<i;s++){const h=t[s],o=e.get(s+i);let l,c;h.isNull?o.visible=!1:(o.visible=!0,r?(l=n.getPosition(a,h.lowValue),c=e.get(s).ty):(l=h.xPos,c=h.yLow),this._layoutMarker(o,l,c))}}}_layoutLines(t){super._layoutLines(t);const e=t.map((t=>({xPos:t.xPos,yPos:t.yLow,isNull:t.isNull}))).slice().reverse(),s=new jr;let i=0;for(;i<e.length&&e[i].isNull;)i++;s.move(e[i].xPos,e[i].yPos),this._buildLines(e,i+1,s),this._lowerLine.setPath(s.end(!1)),this._lowerLine.setStyle("stroke",this.model.color),this.$_layoutArea(this._area,this._linePts,e)}$_layoutArea(t,e,s){const i=new jr;let r=0;for(;r<e.length&&e[r].isNull;)r++;const n=e.length;let a,h,o,l=r++;for(;r<n;)if(e[r].isNull){for(a=r,a>l&&(h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i));r<n&&e[r].isNull;)r++;l=r}else r++;r>l&&(a=r,h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i)),t.setPath(i.end())}},bar:class extends $n{constructor(t){super(t,"rct-bar-series"),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,i){super._setPointStyle(t,e,s,i),s.yValue<e.baseValue&&e.belowStyle&&t.addStyleOrClass(e.belowStyle)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}$_parepareBars(t,e,s){this._bars||(this._bars=new ln(this._pointContainer,Bn)),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 ln(this._pointContainer,ga)),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._getViewRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,a=t._yAxisObj,h=r.getPolar(t),o=i&&Object.assign(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.offset)});this._sectors.forEach(((s,r)=>{const l=s.point,c=a.getPosition(h.rd,l.yGroup)*e,u=n.getUnitLength(2*Math.PI,l.xValue),d=t.getPointWidth(u);if(s.setSector({cx:h.cx,cy:h.cy,rx:c,ry:c,start:h.start+r*h.deg,angle:d,clockwise:!0}),i&&(o.labelView=i.get(l,0))){const t=s.start+s.angle,e=s.cx+s.rx/2*Math.cos(t),i=s.cy+s.ry/2*Math.sin(t),r=o.labelView.getBBounds();o.labelView._text.anchor=Ur.MIDDLE,o.labelView.translate(e-r.width/2,i-r.height/2)}}))}},barrange:class extends Fn{constructor(t){super(t,"rct-barrange-series"),this._bars=new ln(this._pointContainer,Bn)}_getPointPool(){return this._bars}_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)}},bellcurve:class extends _a{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends Fn{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new ln(this._pointContainer,pa)}_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 Hn{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&&Pn.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?Ne.OUTSIDE:Ne.INSIDE}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=n.position,h=n.offset,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,u=i?t:e,d=i?e:t,_=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:g,max:p}=s.getPixelMinMax(_),m=e;let w;this._markers.forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull&&!isNaN(n.zValue))){const e=(n.radius=s.getRadius(n.zValue,g,p))*r;let _,b,x;b=n.xPos=l.getPosition(d,n.xValue),x=n.yPos=m-c.getPosition(u,n.yValue),i&&(b=c.getPosition(u,n.yGroup),x=m-l.getPosition(d,n.xValue)),_=nt.circle(0,0,e),t.setPath(_),t.translate(b,x),o&&(w=o.get(n,0))&&(w.setContrast(t.dom),w.layout(),this._layoutLabelView(w,a,h,e,b,x))}}))}},candlestick:class extends Fn{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new ln(this._pointContainer,ma)}_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)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},dumbbell:class extends Fn{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new ln(this._pointContainer,wa)}_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 $n{constructor(t){super(t,"rct-equalizer-series"),this._bars=new ln(this._pointContainer,ba)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=(this._inverted?t:e)*this._getViewRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){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.backSegments,i=t._yAxisObj.axisMax(),r=t.segmented,n=t.segmentGap||0,a=this._pts=[];let h,o,l=0;for(o=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),h=(e-n*(o-1))/o;a.length<2*o;)a.push(l,l+h),l+=h+n;a[a.length-1]=e;const c=a.length/2;this._bars.forEach((n=>{const o=n.point;if(n.setVisible(!o.isNull)){const l=o.yValue/i;let u=-1,d=0;for(let t=0;t<c-1;t++)if(l>=a[2*t]/e&&l<a[2*(t+1)]/e){u=t+1,d=!r&&l<a[2*t+1]/e?l*e-a[2*t]:h;break}u<0&&(u=c,d=h),n.prepareSegments(s,c,u,d,t.backStyle)}}))}},errorbar:class extends Fn{constructor(t){super(t,"rct-errorbar-series"),this._bars=new ln(this._pointContainer,xa)}_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 jn{constructor(t){super(t,"rct-funnel-series"),this._segments=new ln(this._pointContainer,fa),this.add(this._lineContainer=new Nn(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&&Pn.slide(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVisible(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=P(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=P(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+(f-p)*(w-t)/(w-y):p+(f-p)*(t-m)/(y-m)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===Ne.INSIDE,a=i.pointLabel,h=a.offset,o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,u=i.getSize(t,e),d=i.getNeckSize(u.width,u.height),_=new jr,g=i.getCenter(t,e),p=g.x-u.width/2,m=g.y-u.height/2,w=m+u.height,b=p+u.width/2,x=u.height-d.height,f=p+(u.width-d.width)/2,y=c?w-x:m+x;let v;this._lineContainer.setVisible(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVisible(!i.isNull)){const a=i.yPos*u.height,g=(i.yPos+i.height)*u.height,p=c?w-a:m+a,V=c?w-g:m+g;let S,P,k,A;if(a>=x?(S=f,P=S+d.width,_.move(S,p).lines(P,p,P,V,S,V),t.ny=t.nx1=NaN):g<x?(S=s(p),P=S+2*(b-S),k=s(V),A=k+2*(b-k),_.move(S,p).lines(P,p,A,V,k,V),t.ny=NaN,t.nx1=k-S,t.nx2=A-S):(S=s(p),P=S+2*(b-S),k=f,A=k+d.width,_.move(S,p).lines(P,p,A,y,A,V,k,V,k,y),t.ny=y-p,t.nx1=k-S,t.nx2=A-S),t.setPath(_.close(!0)),i.xPos=b,i.yPos=p+(V-p)/2,r&&(v=r.get(i,0))){const e=l.get(i);if(e.setVisible(!n)){const s=t.getBBounds();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):Math.abs(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/Math.abs(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.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBounds();n+=e.width/2,s.setLine((new jr).move(0,0).line(r,0).end()),s.translate(n,a),n+=r+i,t.translate(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBounds();t.translate(e-i.width/2,s-i.height/2)}},heatmap:class extends Dn{constructor(t){super(t,"rct-heatmap-series"),this._cells=new ln(this._pointContainer,ya)}_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&&Pn.slide(this)}$_parepareCells(t,e){this._cells.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutCells(t,e){const s=this.model,i=s.chart.isInverted();s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=new Yr(this._getColor());this._cells.forEach((t=>{const c=t.point;if(t.setVisible(!c.isNull)){const u=n.getUnitLength(o,c.xValue),d=u,_=a.getUnitLength(h,c.yValue),g=_,p=i?0:e;let m,w,b;if(m=(c.xPos=n.getPosition(o,c.xValue))-u/2,w=(c.yPos=p-a.getPosition(h,c.yValue))-_/2,t.setBounds(m,w,d,g),t.setStyle("fill",l.brighten(1-c.heatValue/s._heatMax).toString()),r&&(b=r.get(c,0))){const t=b.getBBounds();i?(w=o-n.getPosition(o,c.xValue),m=p,w-=t.height/2,m+=a.getPosition(h,c.yValue)-t.width/2):(m+=(d-t.width)/2,w+=(g-t.height)/2),b.translate(m,w)}}}))}},histogram:class extends In{constructor(t){super(t,"rct-histogram-series"),this._bars=new ln(this._pointContainer,va)}_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._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=i?t:e,c=i?e:t,u=o.getPosition(l,s.getBaseValue(o)),d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const s=t.point,n=h.getPosition(c,s.min),g=h.getPosition(c,s.max),p=o.getPosition(l,s.yValue),m=g-n+(g>n?-1:1),w=p-u;let b=n+(g-n)/2,x=d;s.xPos=b,s.yPos=x-=p,this._layoutPointView(t,e,b,x+w,m,w*r),_&&(_.labelView=a.get(s,0))&&(i&&(x=c-b,b=d,s.yPos=x,s.xPos=b+=o.getPosition(l,s.yGroup)),_.pointView=t,_.x=b,_.y=x,_.wPoint=m,_.hPoint=w,this._layoutLabel(_))}))}$_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._getViewRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPosition(t,o.min),c=s.getPosition(t,o.max),u=l+(c-l)/2,d=i.getPosition(e,a.point.yValue)*n,_=Math.max(1,c-l-1);o.xPos=u,o.yPos=r-d,a.wPoint=_,a.hPoint=d,a.layout(u,r)}))}},line:da,lollipop:class extends $n{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){this._bars||(this._bars=new ln(this._pointContainer,Va)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}},ohlc:class extends Fn{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new ln(this._pointContainer,Sa)}_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()}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutSticks(t,e){const s=this.model;this._inverted;const i=this._getViewRate(),r=s.pointLabel.offset,n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=this.height;this._sticks.forEach(((l,c)=>{const u=l.point;if(l.setVisible(!u.isNull)){const c=a.getUnitLength(t,u.xValue),d=s.getPointWidth(c),_=(u.xPos=a.getPosition(t,u.xValue))-d/2,g=u.yPos=o-h.getPosition(e,u.yValue)*i,p=d,m=Math.abs(o-h.getPosition(e,u.lowValue)-g)*i;let w;if(l.setBounds(_,g,p,m),l.layout(),n&&(w=n.get(u,0))){const t=w.getBBounds();w.translate(_+(p-t.width)/2,g-t.height-r)}}}))}},pareto:class extends ua{constructor(t){super(t,"rct-pareto-series")}},pie:class extends jn{constructor(t){super(t,"rct-pie-series"),this._sectors=new ln(this._pointContainer,Pa,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Wn(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Sn(t,"rct-pie-series-inner")),this._textView.anchor=Ur.MIDDLE,this.add(this._lineContainer=new Nn(t))}_getPointPool(){return this._sectors}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVisible(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null),e.innerText.buildSvg(this._textView._text,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&&Pn.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.translate(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof Pa){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.control.invalidateLayout()}}_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._getViewRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=P(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._getViewRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,l=this._rd,c=this._rdInner,u=i.pointLabel,d=this._labelViews(),_=i.getLabelPosition()===Ne.INSIDE,g=u.offset,p=u.distance||0,m=this._lineContainer,w=this._slicedOff=i.getSliceOffset(l)*n;let b;if(this._textView.visible){const t=this._textView.getBBounds();this._textView.translate(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.setVisible(!1),d&&(b=d.get(a,0))&&b.setVisible(!1),null===(s=m.get(a))||void 0===s||s.setVisible(!1);else{const s=a.startAngle;let u=0,x=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;u+=Math.cos(t)*w,x+=Math.sin(t)*w}t.translate(u,x).setVisible(!0);const f=a.startAngle+a.angle/2;if(a.xPos=h+Math.cos(f)*(w+.7*l),a.yPos=o+Math.sin(f)*(w+.7*l),t.setPieSector(d,null,{cx:h,cy:o,rx:l,ry:l,innerRadius:c,start:s,angle:Math.abs(a.angle),clockwise:i.clockwise}),d&&(b=d.get(a,0))){const e=m.get(a);e.setVisible(!_)?this.$_layoutLabel(a,b,e,g,p,a.sliced?w:0,r):(e.visible=!1,this.$_layoutLabelInner(a,b,g,0,a.sliced?w:0)),b.setContrast(_&&t.dom).setVisible(!0)}else null===(e=m.get(a))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBounds(),o=t.startAngle+t.angle/2;let l=this._cx,c=this._cy,u=this._rd+.8*r,d=Math.cos(o)*n,_=Math.sin(o)*n,g=l+Math.cos(o)*this._rd,p=c+Math.sin(o)*this._rd,m=l+Math.cos(o)*u,w=c+Math.sin(o)*u;const b=m<l;let x;x=b?m-.2*r:m+.2*r,s&&s.setVisible(u>0)&&(s.setLine((new jr).move(0,0).quad(m-g,w-p,x-g,w-p).end()),s.move(g,p),!e.isDomAnimating()&&s.translate(g+d,p+_)),b?(x-=h.width+i,w-=h.height/2):(x+=i,w-=h.height/2),e.move(x,w),!e.isDomAnimating()&&e.layout().translate(x+d,w+_)}$_layoutLabelInner(t,e,s,i,r){const n=e.getBBounds(),a=this._rdInner*this._rd,h=a>0?a+(this._rd-a)/2:.7*this._rd,o=t.startAngle+t.angle/2;let l=this._cx+Math.cos(o)*h,c=this._cy+Math.sin(o)*h;e.move(l-n.width/2,c-n.height/2),l=this._cx+Math.cos(o)*(r+h),c=this._cy+Math.sin(o)*(r+h),e.layout().translate(l-n.width/2,c-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,h=this._labelViews(),o=i.pointLabel,l=this._lineContainer,c=i.getLabelPosition()===Ne.INSIDE;(n.sliced=e)?t.translateEx(Math.cos(a)*this._slicedOff,Math.sin(a)*this._slicedOff,r):t.translateEx(0,0,r);const u=h.get(n,0);if(u){const t=!c&&l.get(n);if(s&&(c?this.$_layoutLabelInner(n,u,o.offset,o.distance,this._slicedOff):this.$_layoutLabel(n,u,t,o.offset,o.distance,this._slicedOff,i.clockwise)),e){let e=u.tx,s=u.ty;u.translate(u.x,u.y),u.translateEx(e,s,r),t&&(e=t.tx,s=t.ty,t.translate(t.x,t.y),t.translateEx(e,s,r))}else u.translate(u.tx,u.ty),u.translateEx(u.x,u.y,r),t&&(t.translate(t.tx,t.ty),t.translateEx(t.x,t.y,r))}}},scatter:class extends Hn{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&&Pn.slide(this)}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setStyle("fill",s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return Ne.OUTSIDE}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.jitterX,n=s.jitterY,a=s.pointLabel,h=a.position,o=a.offset,l=this._labelViews(),c=s._xAxisObj,u=s._yAxisObj,d=i?t:e,_=i?e:t,g=e;let p;this._markers.forEach(((t,e)=>{const a=t.point;if(t.setVisible(!a.isNull)){const e=s.shape,m=s.radius,w=J.jitter(a.xValue,r),b=J.jitter(a.yGroup,n);let x,f,y;switch(f=a.xPos=c.getPosition(_,w),y=a.yPos=g-u.getPosition(d,b),i&&(f=u.getPosition(d,b),y=g-c.getPosition(_,w)),e){case"square":case"diamond":case"triangle":case"itriangle":case"star":x=nt[e](0-m,0-m,2*m,2*m);break;default:x=nt.circle(0,0,m)}t.setPath(x),t.translate(f,y),l&&(p=l.get(a,0))&&this._layoutLabelView(p,h,o,m,f,y)}}))}},treemap:class extends Dn{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new ln(this._pointContainer,ka)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){const s=this.model;s.pointLabel;const i=this._labelViews(),r=s.buildMap(t,e),n=new Yr(s._calcedColor);let a;i.prepare(this.doc,this),this._nodeViews.prepare(r.length,((t,e,s)=>{const h=r[e],o=h.parent;let l=n;if(o&&(!o._color&&o.point.color?l=o._color=new Yr(o.point.color):o._color&&(l=o._color)),t.node=h,t.setStyle("fill",l.brighten(h.index/s).toString()),t.render(),h.point.xPos=h.x+h.width/2,h.point.yPos=h.y+h.height/2,i&&(a=i.get(h.point,0))){const t=a.getBBounds();a.setVisible(h.width>=t.height&&h.height>=t.height)&&a.translate(h.x+h.width/2-t.width/2,h.y+h.height/2-t.height/2)}}))}_runShowEffect(t){t&&new An(this)}},vector:class extends Dn{constructor(t){super(t,"rct-vector-series"),this._arrows=new ln(this._pointContainer,Aa)}_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;this._arrows.forEach((t=>{const e=t.point;if(t.setVisible(!e.isNull)){const s=e.xPos=n.getPosition(this.width,e.xValue),h=e.yPos=this.height-a.getPosition(this.height,e.yValue);t.translate(s,h),t.layout(r,e.angleValue+i,!1)}}))}_runShowEffect(t){t&&Pn.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 Fn{constructor(t){super(t,"rct-waterfall-series"),this._bars=new ln(this._pointContainer,Ea),this.add(this._lineContainer=new _t(t,"rct-waterfall-series-lines")),this._lines=new ln(this._lineContainer,Pi)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_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),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}))}}},Da={circle:ha,linear:Ca,bullet:Ma,clock:class extends qn{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new Wn(t,"rct-clock-gauge-face")),e.add(this._rimView=new Xn(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Zr(t,"rct-clock-gauge-label")),this._labelView.layout=Xr.MIDDLE,e.add(this._tickContainer=new _t(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new _t(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new mt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new mt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new mt(t,"rct-clock-gauge-second")),e.add(this._pinView=new Wn(t,"rct-clock-gauge-pin")),this._tickViews=new ln(this._tickContainer,Pi,"rct-clock-gauge-tick"),this._minorTickViews=new ln(this._tickContainer,Pi,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new ln(this._tickLabelContainer,Zr,"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/Math.max(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Xr.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),Math.abs(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=y,c=f/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,l=y,c=f/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=c,t++),e.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=f/12*t;l=y,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBounds().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.translate(i+Math.cos(l)*o,r+Math.sin(l)*o),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVisible(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,NaN,NaN,null,null),"bottom"===t.label.position?s.translate(i,r+o/2):s.translate(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 jr;let c,u,d,_;c=t.hourHand,u=this._hourView,u.setVisible(c.visible)&&(_=f*(i/12+r/60/12+n/60/60/12),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V)),c=t.minuteHand,u=this._minuteView,u.setVisible(c.visible)&&(_=f*(r/60+n/60/60),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V)),c=t.secondHand,u=this._secondView,u.setVisible(c.visible)&&(_=this._secRate<1?f*(this._aniSec+this._secRate)/60:f*n/60,d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new oa(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends sa{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new ln(t,ha)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(Math.min(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.translate(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends Ta{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new La(t),this._scaleView)}_createPool(t){return new ln(t,Ca)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVisible(r.visible)){const h=+r.gap||0;if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1).height+h;s.height-=t,e.height-=t,n=s.x,r.position===Xs.OPPOSITE?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+h}i.resizeByMeasured().layout().translate(n,a)}}},bulletgroup:class extends Ta{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new ln(t,Ma)}}};function Ra(t,e){return new(Oa[e._type()])(t)}class Ba extends Jr{constructor(t){super(t,"rct-axis-grid"),this._lines=new ln(this,Pi)}_doMeasure(t,e,s,i,r){return Wr.create(s,i)}_doLayout(){const t=this.model,e=t.axis,s=this.width,i=this.height,r=t.getPoints(e._isHorz?s:i),n=this._lines,a=n.count-1;n.prepare(r.length,(t=>{t.setClass("rct-axis-grid-line")})),n.forEach(((t,n)=>{t.setBoolData("first",0===n),t.setBoolData("last",r[n]===(e._isHorz?s:i))})),e._isHorz?n.forEach(((e,n)=>{e.setVisible((r[n]>0||0!==n||t.startVisible)&&(r[n]<s||n!==a||t.endVisible))&&e.setVLineC(r[n],0,i)})):n.forEach(((e,n)=>{e.setVisible((r[n]<i||0!==n||t.startVisible)&&(r[n]>0||n!==a||t.endVisible))&&e.setHLineC(i-r[n],0,s)}))}}class Ia extends dt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new mt(t)),this._mask.setStyle("stroke","none"),this.add(this._upLine=new mt(t)),this._upLine.setStyle("fill","none"),this.add(this._downLine=new mt(t)),this._downLine.setStyle("fill","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 jr;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<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 $a extends dt{constructor(t){super(t,"rct-axis-guide"),this.add(this._label=new Zr(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t){this.model=t,this._label.text=t.label.text,this._label.setStyles(t.label.style)}}class Fa extends $a{constructor(t){super(t),this.insertFirst(this._line=new Pi(t,"rct-axis-guide-line"))}prepare(t){super.prepare(t),this._line.setStyles(t.style)}layout(t,e){const s=this.model,i=s.label,r=this._label;let n,a,h,o;if(this.vertical()){const r=s.axis.getPosition(t,s.value,!0);switch(this._line.setVLineC(r,0,e),i.align){case $.CENTER:n=r,h=Ur.MIDDLE;break;case $.RIGHT:n=r,h=Ur.START;break;default:n=r,h=Ur.END}switch(i.verticalAlign){case F.BOTTOM:a=e,o=Xr.BOTTOM;break;case F.MIDDLE:a=e/2,o=Xr.MIDDLE;break;default:a=0,o=Xr.TOP}}else{const l=e-s.axis.getPosition(e,s.value,!0);switch(this._line.setHLineC(l,0,t),i.align){case $.CENTER:n=t/2,h=Ur.MIDDLE;break;case $.RIGHT:n=t,h=Ur.END;break;default:n=0,h=Ur.START}switch(i.verticalAlign){case F.BOTTOM:a=l+1,o=Xr.TOP;break;case F.MIDDLE:a=l,o=Xr.MIDDLE;break;default:a=l-r.getBBounds().height,o=Xr.TOP}}r.anchor=h,r.layout=o,r.translate(n,a)}}class za extends $a{constructor(t){super(t),this.insertFirst(this._box=new Ae(t,"rct-axis-guide-range"))}prepare(t){super.prepare(t)}layout(t,e){const s=this.model,i=this._label;if(this.vertical()){const r=s.axis.getPosition(t,s.start,!0),n=s.axis.getPosition(t,s.end,!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a+=(n-r)/2,o=Ur.MIDDLE;break;case $.RIGHT:a=n,o=Ur.END;break;default:a=r,o=Ur.START}switch(s.label.verticalAlign){case F.BOTTOM:h=e,l=Xr.BOTTOM;break;case F.MIDDLE:h=e/2,l=Xr.MIDDLE;break;default:h=0,l=Xr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(r,0,n,e)}else{const r=e-this.model.axis.getPosition(e,Math.min(s.start,s.end),!0),n=e-this.model.axis.getPosition(e,Math.max(s.start,s.end),!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a=t/2,o=Ur.MIDDLE;break;case $.RIGHT:a=t,o=Ur.END;break;default:a=0,o=Ur.START}switch(s.label.verticalAlign){case F.BOTTOM:h=r,l=Xr.BOTTOM;break;case F.MIDDLE:h=n+(r-n)/2,l=Xr.MIDDLE;break;default:h=n,l=Xr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(0,n,t,r)}}}class Ha extends _t{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(let e=t.length-1;e>=0;e--){const e=t.pop();e.remove(),e instanceof za?this._rangePool.push(e):this._linePool.push(e)}R(0===t.length,"GuideContainer.prepare")}addAll(t,e){e.forEach((e=>{if(e instanceof re){let s=this._rangePool.pop()||new za(t);this.add(s),s.prepare(e),this._views.push(s)}else if(e instanceof ie){let s=this._linePool.pop()||new Fa(t);this.add(s),s.prepare(e),this._views.push(s)}}))}add(t){return this._views.push(t),super.add(t)}}class Ga extends mt{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 jr;if(this._bar){const o=n._isHorz?i:r;let l=-1;if(t?l=t.point.xValue:this._model.showAlways&&(l=n.reversed?n.categoryAt(a?i-e:s):n.categoryAt(a?e:r-s)),l>=0){const t=n.getPosition(o,l),e=n.getUnitLength(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 ja extends Na{constructor(t){super(t,"Reset Zoom","rc-reset-zoom"),this.visible=!1}}class Wa extends Jr{constructor(t,e,s=!1){super(t,Wa.BODY_CLASS),this._gridViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._focused=null,this._owner=e,this._side=s,this.add(this._hitTester=new ke(t)),this._hitTester.setStyle("fill","transparent"),this.add(this._background=new ke(t,"rct-body-background")),this.add(this._image=new cn(t,"rct-body-image")),this.add(this._gridContainer=new _t(t,"rct-grids")),this.add(this._guideContainer=new Ha(t,"rct-guides")),this.add(this._seriesContainer=new _t(t,"rct-series-container")),this.add(this._axisBreakContainer=new _t(t,"rct-axis-breaks")),this.add(this._labelContainer=new _t(t,"rct-label-container")),this.add(this._frontGuideContainer=new Ha(t,"rct-front-guides")),this.add(this._feedbackContainer=new _t(t,"rct-feedbacks")),this.add(this._zoomButton=new ja(t)),this._crosshairLines=new ln(this._feedbackContainer,Ga)}prepareSeries(t,e){this._animatable=ut._animatable&&e.animatable(),this.$_prepareSeries(t,e,e._getSeries().getVisibleSeries(this._side)),this.$_prepareGauges(t,e,e._getGauges().getVisibles(this._side))}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(Dn.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(Dn.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}return this._zoomRequested||this._crosshairLines.forEach((e=>{e.setVisible(r)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n.model,a):this.$_setFocused(null,null),r}$_setFocused(t,e){if(e!=this._focused)return this._focused&&this._focused.unsetData(Dn.DATA_FOUCS),this._focused=e,this._focused?(this._focused.setData(Dn.DATA_FOUCS),this._owner.showTooltip(t,e.point)):this._owner.hideTooltip(),!0}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===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;let o=a.getValueAt(h,n?h-i:t),l=a.getValueAt(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._zoomButton.setVisible(e.zoomButton.isVisible())&&this._zoomButton.layout(),Wr.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.setVisible(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{this._owner.clipSeries(s.getClipContainer(),0,0,t,e,s.invertable()),s.resize(t,e),s.layout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.translate(t-i._sect.pos,0):s.translate(i._sect.pos,0):r.reversed?s.translate(0,i._sect.pos):s.translate(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e)))}))}this.$_preppareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().translatep(s.getPosition(t,e))})),this._zoomButton.visible&&this._zoomButton.translate(t-this._zoomButton.getBBounds().width-10,10)}$_createGaugeView(t,e){return new(Da[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible()||(r.get(t).remove(),r.delete(t));[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if((e._isX||e.side==this._side)&&s&&e.grid.isVisible()&&!r.has(e)){const s=new Ba(t);r.set(e,s),i.add(s)}}))))}$_prepareSeries(t,e,s){const i=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=>{t.remove(),t._labelContainer.remove()})),n.length=0,s.forEach((e=>{const s=r.get(e)||Ra(t,e);s._setChartOptions(i,this._animatable),this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer),r.set(e,s),n.push(s),s.prepareSeries(t,e)}))}$_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((e=>{const s=n.get(e)||this.$_createGaugeView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareGauge(t,e)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof gs&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new Ia(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_preppareCrosshairs(t){const e=this._crosshairLines,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])}))}}Wa.BODY_CLASS="rct-body";class Ya extends dt{constructor(t){super(t,Ua.HANDLE_STYLE),this.add(this._back=new ke(t)),this.add(this._shape=new mt(t)),this._shape.setStyle("fill","white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*Math.min(t,e);const r=new jr;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=t,this._h=e,this._vertical=s}}}class Ua extends Jr{static isHandle(t){return t.parentElement.classList.contains(Ua.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Ua.MASK_STYLE)}constructor(t){super(t,Ua.CLASS_NAME),this.add(this._back=new ke(t,Ua.BACK_STYLE)),this.add(this._container=new _t(t,null)),this.add(this._mask=new ke(t,Ua.MASK_STYLE)),this.add(this._startHandle=new Ya(t)),this.add(this._endHandle=new Ya(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()}))}_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*i/e.axisLen():0,n=s?s.end*i/e.axisLen():i;this._mask.setBounds(t,0,n-t,r),this._startHandle.layout(r/3,r/3,!1),this._startHandle.translate(t,r/2),this._endHandle.layout(r/3,r/3,!1),this._endHandle.translate(n,r/2)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView&&(this._yAxisView.measure(this.doc,e._naviChart.yAxis,i,r,1),this._yAxisView.resize(i,r),this._yAxisView.layout())}$_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=Ra(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 on(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 on(t)),i._simpleMode=!0)}}Ua.CLASS_NAME="rct-navigator",Ua.BACK_STYLE="rct-navigator-back",Ua.MASK_STYLE="rct-navigator-mask",Ua.HANDLE_STYLE="rct-navigator-handle",Ua.HANDLE_BACK_STYLE="rct-navigator-handle-back";class Xa extends bt{constructor(t){super(),this.chart=t}}class qa extends Xa{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){return this._xStart=e-this._body.tx,this._yStart=s-this._body.ty,this._body.addFeedback(this._feedback=new ke(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){this._vertical?(e-=this._body.ty,this._body.setZoom(0,Math.min(this._yStart,e),this._body.width,Math.max(this._yStart,e))):(t-=this._body.tx,this._body.setZoom(Math.min(this._xStart,t),0,Math.max(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){return this._vertical?(r-=this._body.ty,this._feedback.setBounds(0,Math.min(this._yStart,r),this._body.width,Math.abs(this._yStart-r))):(i-=this._body.tx,this._feedback.setBounds(Math.min(this._xStart,i),0,Math.abs(this._xStart-i),this._body.height)),!0}}class Za extends Xa{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)),!0}}class Ka extends Xa{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:e-a.x,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(),h=n.model.axisLen();let o=n.svgToElement(i,r).x-this._startOff;return this._handleView._vertical?this._isStart:this._isStart?o>0&&a.zoom(o*h/n.width,NaN):o>0&&o<n.width&&a.zoom(NaN,o*h/n.width),!0}}class Qa extends Xa{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._zoomLen=n._zoom.length,!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axisLen(),h=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(h*a/n.height):this.$_moveZoom(h*a/n.width),!0}$_moveZoom(t){t=Math.max(0,Math.min(t,this._view.model._naviChart.xAxis.length()-this._zoomLen)),this._view.model.axis().zoom(t,t+this._zoomLen)}}class Ja{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&&(Math.abs(this._clickX-s)>3||Math.abs(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 Le){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 jn&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible;else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){}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.bodyView();return hn.isThumb(t)?new Za(this._chart,i.getScrollView(t)):r.model.canZoom()&&r.contains(t)?new qa(this._chart,r,i._inverted):Ua.isHandle(t)?new Ka(this._chart,i._navigatorView,t):Ua.isMask(t)&&this._chart.model.body.isZoomed()?new Qa(this._chart,i._navigatorView,t):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 th{static empty(){return new th}static create(t=0,e=0){return new th(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}get isEmpty(){return 0===this.x||0===this.y}clone(){return new th(this.x,this.y)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y}setEmpty(){return this.x=this.y=0,this}set(t,e){return this.x=t,this.y=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t}toString(){return"{x: "+this.x+", y: "+this.y+"}"}}class eh extends _t{constructor(t){super(t,eh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVisible(!1)}setHistory(t,e){if(this.setVisible(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Zr(t,"rct-history-item");e.anchor=Ur.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Zr(t);e.anchor=Ur.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].translateX(n),a<r-1&&(n+=e[a].width+i,s[a].translateX(n),n+=s[a].width+i)}}eh.TITLE_CLASS="rct-history";class sh extends Jr{constructor(t){super(t,"rct-legend-item"),this.add(this._label=new Zr(t,"rct-legend-item-label")),this._label.anchor=Ur.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){W.setData(this._label.dom,"hidden",e.source.visible?"":1),W.setData(this._marker.dom,"hidden",e.source.visible?"":1),this._label.text=e.text();const n=this._marker.getBBounds(),a=tt(this._label.getBBounds());return this._gap=c(e.legend.markerGap,0),Wr.create(n.width+this._gap+a.width,Math.max(n.height,a.height))}_doLayout(){const t=this._marker.getBBounds();this._marker.translate(0,(this.height-t.height)/2),this._label.translate(t.width+this._gap,(this.height-this._label.getBBounds().height)/2)}}class ih extends tn{constructor(t){super(t,ih.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new ln(this,sh)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===ve.VERTICAL;return this._ipr=c(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==ye.PLOT?c(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=this._sizes,i=t.itemsAlign,r=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,o=this._vertical,l=a.left+h.left,c=a.top+h.top;let u,d=l,_=c;this._itemViews.forEach((t=>{t._marker.setStyle("fill",t.model.source.legendColor()),t._marker.setStyle("stroke",t.model.source.legendColor()),t.resizeByMeasured().layout()})),e.forEach(((t,e)=>{o?(_=c,i!==Ve.CENTER&&i!==Ve.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,i===Ve.CENTER?_+=(this.height-u)/2:_+=this.height-u),t.forEach((t=>{t.translate(d,_),_+=t.height+n})),d+=s[e]+r):(d=l,i!==Ve.CENTER&&i!==Ve.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.left+a.right+h.left+h.right,i===Ve.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.translate(d,_),d+=t.width+n})),_+=s[e]+r)}))}$_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,u=this._rowViews=[],d=this._sizes=[];let _,g,p,m;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t)),e.measure(t,a[s],r,n,1)}));let w=0,b=0;if(s){for(;w<c;)m=h.get(w),b%i==0?(u.push(p=[m]),g=m.mh,b++,w++):(g+=o+m.mh,g<=n?(p.push(m),b++,w++):b=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{s+=t.mh,e=Math.max(e,t.mw)})),s+=o*(t.length-1),g=Math.max(g,s),_+=e,d.push(e)})),_+=l*(u.length-1)}else{for(;w<c;)m=h.get(w),b%i==0?(u.push(p=[m]),_=m.mw,b++,w++):(_+=o+m.mw,_<=r?(p.push(m),b++,w++):b=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=Math.max(s,t.mh)})),e+=o*(t.length-1),_=Math.max(_,e),g+=s,d.push(s)})),g+=l*(u.length-1)}return Wr.create(_,g)}}ih.LEGEND_CLASS="rct-legend";class rh extends en{constructor(t,e){super(t),this.isX=e,this.sections=[]}prepare(t,e,s){}_doMeasure(t,e,s,i,r){}_doLayout(t){}}class nh extends _t{constructor(t,e){super(t,nh.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}measure(t,e,s,i,r,n,a){this.$_init(t),this._model=e,this.$_prepareBodies(t,e),this.$_prepareAxes(t,s,!0),this.$_prepareAxes(t,i,!1)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this._debugger.text=t.colCount()+", "+t.rowCount(),this._debugger.translate(e/2,s/2)}$_init(t){this._back||(this.add(this._back=new ke(t)),this._back.setStyles({fill:"#f0f0f0",stroke:"lightgray",strokeDasharray:"3"}),this.add(this._bodyContainer=new _t(t,b)),this.add(this._axisContainer=new _t(t,b)),this.add(this._debugger=Zr.createCenter(t)))}$_prepareBodies(t,e){const s=e.paneCount(),i=this._bodies;for(;i.length<s;){const e=new Wa(t,this._owner);this._bodyContainer.add(e),i.push(e)}}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new rh(t,s);this._axisContainer.add(e),i.push(e)}}$_layoutBodies(){}$_layoutAxes(){}}nh.STYLE_NAME="rct-panes";class ah extends dt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Wn(t))}layout(){}}class hh extends dt{constructor(t,e){super(t,e),this.add(this._markContainer=new _t(t,"rct-polar-axis-markers")),this._markViews=new ln(this._markContainer,ah),this.add(this._gridContainer=new dt(t,"rct-polar-axis-grids")),this.add(this._labelContainer=new _t(t,"rct-polar-axis-labels")),this._labelViews=new ln(this._labelContainer,Zr,"rct-polar-axis-label")}prepare(t,e,s){this._model=e,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s)}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)}$_prepareLabels(t,e){if(this._labelContainer.setVisible(e.label.visible)){const t=e._ticks;this._labelViews.prepare(t.length,((e,s)=>{e.text=t[s].label}),(t=>{t.anchor=Ur.START}))}}}class oh extends hh{constructor(t){super(t,"rct-polar-xaxis"),this._gridLines=new ln(this._gridContainer,Pi,oh.GRID_CLASS),this.add(this._lineView=new Yn(t,oh.LINE_CLASS))}_doPrepare(t,e,s){this._gridContainer.setVisible(!1!==t.grid.visible)&&this._gridLines.prepare(e.length),(this._lineView.visible=t.line.visible)&&(s&&this._lineView instanceof ki?(this._lineView.remove(),this.add(this._lineView=new Yn(this.doc,oh.LINE_CLASS))):!s&&this._lineView instanceof Wn&&(this._lineView.remove(),this.add(this._lineView=new ki(this.doc,oh.LINE_CLASS))),this._lineView.setStyleOrClass(t.line.style))}_doLayout(t,e,s,i,r,n){const a=t.chart.startAngle();if(this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const h=r[n].pos*Math.PI*2,o=e+Math.cos(a+h)*i,l=s+Math.sin(a+h)*i;t.setLine(e,s,o,l)})),this._labelContainer.visible){const n=i+t.tick.length;this._labelViews.forEach(((t,i)=>{const h=r[i];t.anchor=Ur.MIDDLE,t.layout=Xr.MIDDLE,t.text=h.label;const o=t.getBBounds(),l=h.pos*Math.PI*2,c=e+Math.cos(a+l)*(n+o.width/2),u=s+Math.sin(a+l)*(n+o.height/2);t.translate(c,u)}))}if(this._lineView.visible)if(this._lineView instanceof Wn)this._lineView.setCircle(e,s,i);else{const t=[];r.forEach((r=>{const n=r.pos*Math.PI*2;t.push(e+Math.cos(a+n)*i,s+Math.sin(a+n)*i)})),this._lineView.setPoints(...t)}}}oh.LINE_CLASS="rct-polar-xaxis-line",oh.GRID_CLASS="rct-polar-xaxis-grid-line";class lh extends hh{constructor(t){super(t,"rct-polar-yaxis"),this._gridLines=new ln(this._gridContainer,Yn,"rct-polar-yaxis-grid-line"),this._gridLines.circular=!1,this.add(this._lineView=new Pi(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s){this._gridContainer.setVisible(!1!==t.grid.visible)&&(s!==this._gridContainer.circular&&(this._gridLines.destroy(),this._gridLines=new ln(this._gridContainer,s?Yn:ki,"rct-polar-yaxis-grid-line"),this._gridContainer.circular=s),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){this._gridContainer.visible&&this._gridLines.forEach(((i,a)=>{const h=r[a].pos;if(i instanceof Yn)i.setCircle(e,s,h);else if(i instanceof ki){const r=t.chart.startAngle(),a=[];n._ticks.forEach((t=>{const i=t.pos*Math.PI*2;a.push(e+Math.cos(r+i)*h,s+Math.sin(r+i)*h)})),i.setPoints(...a)}})),this._labelContainer.visible&&this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Ur.END,t.layout=Xr.MIDDLE,t.text=n.label,t.translate(e-4,s-n.pos)})),this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}class ch extends Wa{constructor(t,e){super(t,e,!1),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),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{t.resize(2*i,2*i),t.layout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)}))}$_prepareAxes(t,e,s,i){this._axisContainer||(this.add(this._axisContainer=new dt(t,"rct-polar-axes")),this._axisContainer.add(this._xAxisView=new oh(t))),this._xAxisView.prepare(t,e,i);const r=this._yAxisViews;for(;r.length<s.length;){const e=new lh(t);this._axisContainer.add(e),r.push(e)}for(;r.length>s.length;)r.pop().remove();r.forEach(((e,r)=>e.prepare(t,s[r],i)))}}class uh extends tn{constructor(t,e){super(t,e?uh.SUBTITLE_CLASS:uh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.add(this._textView=new Zr(t)),this._textView.anchor=Ur.START}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this.setBoolData("hassub",e.chart.subtitle.isVisible()),this._textView.text=this.model.text,tt(this._textView.getBBounds())}_doLayout(){this._textView.translate(this._margins.left+this._paddings.left,this._margins.top+this._paddings.top),this._textView.layoutText()}}uh.TITLE_CLASS="rct-title",uh.SUBTITLE_CLASS="rct-subtitle";class dh extends dt{constructor(t){super(t,"rct-tooltip"),this._textCallback=(t,e,s)=>this._model.getValue(this._series,t,e,s),this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new mt(t,"rct-tooltip-back")),this.add(this._textView=new Zr(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+ut.SHADOW_FILTER+")"),this._textView.anchor=Ur.START,this._richText=new Rt,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.tooltip,a=this._textView;this._series=t,this._richText.setFormat(n.text),this._richText.build(a,NaN,NaN,e,this._textCallback);const h=a.getBBounds(),o=Math.max(n.minWidth||0,h.width+16),l=Math.max(n.minHeight||0,h.height+12),c=new jr;c.rect(0,0,o,l),this._back.setPath(c.end(!0)),a.translate((o-h.width)/2,(l-h.height)/2);const u="visible"===this.getStyle("visibility")?300:0;n.series.chart.isInverted()?this.translateEx(s+n.offset,i-l/2,u,!1):this.translateEx(s-o/2,i-l-n.offset,u,!1),0===u&&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:Te.HIDE_DELAY))}$_hide(){!function(t,e,s,i,r,n){const a=null!=s?L(e,s):{},h=L(e,i),o=t.animate([a,h],{duration:r,fill:"none"});o&&n&&o.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}}class _h extends en{_doInitChildren(t){this.add(this.titleView=new uh(t,!1)),this.add(this.subtitleView=new uh(t,!0))}_doMeasure(t,e,s,i,r){const n=[e.title,e.subtitle];let a=s,h=0;return[this.titleView,this.subtitleView].forEach(((e,o)=>{if(e.visible=n[o].isVisible()){const l=e.measure(t,n[o],s,i,r);h+=l.height,i-=l.height,a=Math.max(l.width)}})),{width:a,height:h}}_doLayout(t){let e=0;[this.titleView,this.subtitleView].forEach((s=>{if(s.visible){const i=s.model,r=s.width>t.wPlot||i.alignBase===H.CHART?t.wChart:t.wPlot;let n=s.width>t.wPlot||i.alignBase===H.CHART?0:t.xPlot;switch(s.resizeByMeasured().layout(),i.align){case $.LEFT:break;case $.RIGHT:n+=r-s.width;break;default:n+=(r-s.width)/2}s.translate(n,e),e+=s.height}}))}}class gh extends en{_doInitChildren(t){this.add(this._legendView=new ih(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===ye.LEFT||h===ye.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 ye.LEFT:s-=e;break;case ye.RIGHT:s-=e,r+=e;break;case ye.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).translate(r,n),t.layout()}}class ph extends en{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i){const r=this.views;for(;r.length<e.length;){const e=new on(t);this.add(e),r.push(e)}for(;r.length>e.length;)r.pop().remove();if(r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,s,i)})),this.axes=e,this.setVisible(r.length>0)){const t=r[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap(),t.chart._splitted&&!this.isX?(this._splits=t.chart._splits,this.views2=r.filter((t=>t.model.side)),this.axes2=this.views2.map((t=>t.model)),0===this.views2.length?this.views2=b:(this.views=r.filter((t=>!t.model.side)),this.axes=this.views.map((t=>t.model)))):this._splits=[1,1]}else this.views2=b}checkHeights(t,e,s){if(this.views.length>0){let i=this.$_checkHeights(this.views,t,e,s*this._splits[0]);return this.views2&&(i=Math.max(i,this.$_checkHeights(this.views2,t,e,s*this._splits[1]))),i}return 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){if(this.views.length>0){let i=this.$_checkWidths(this.views,t,e*this._splits[0],s);return this.views2&&(i=Math.max(i,this.$_checkWidths(this.views2,t,e*this._splits[1],s))),i}return 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}_doMeasure(t,e,s,i,r){const n=e.isInverted();let a=0,h=0;return[this.views,this.views2].forEach(((e,o)=>{if(e){const l=1===o?this.axes2:this.axes,c=!this.isX&&n?s*this._splits[o]:s,u=this.isX?i:i*this._splits[o];let d=0,_=0;e.forEach(((e,s)=>{const i=e.measure(t,l[s],c,u,r);e.setAttr("xy",l[s]._isX?"x":"y"),d+=i.width,_+=i.height})),this.isHorz?_+=(e.length-1)*this._gap:d+=(e.length-1)*this._gap,a=Math.max(a,d),h=Math.max(h,_)}})),Wr.create(a,h)}_doLayout(t){let e=this.width,s=this.height,i=0,r=0;t=t||0,this.views2&&(this.isHorz?e=(e-t)/2:s=(s-t)/2),[this.views,this.views2].forEach((n=>{if(n){let a=0;n.forEach((t=>{this.isHorz?t.resize(e,t.mh):t.resize(t.mw,s),t.layout(),this.isHorz?(t.translate(i,this.dir===z.TOP?s-a-t.mh:a),a+=t.mh+this._gap):(t.translate(this.dir===z.RIGHT?a:e-a-t.mw,r),a+=t.mw+this._gap)})),this.isHorz?i+=e+t:r+=s+t}}))}}class mh extends Qr{}class wh extends Jr{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Zr(t)),this._textView.anchor=Ur.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.getBBounds()}}class bh extends _t{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._splitted=!1,this._axisSectionMap={},this.add(this._plotContainer=new _t(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Wa(t,this,!1));for(const e in z){const s=new ph(t,z[e]);this._plotContainer.add(s),this._axisSectionMap[z[e]]=s}this.add(this._paneContainer=new nh(t,this)),this.add(this._titleSectionView=new _h(t)),this.add(this._legendSectionView=new gh(t)),this.add(this._navigatorView=new Ua(t)),this.add(this._creditView=new wh(t)),this.add(this._historyView=new eh(t)),this.add(this._tooltipView=new dh(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}measure(t,e,s,i,r){if(e&&e.prepareRender(),this.$_checkEmpty(t,e,s,i))return;const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend,l=n.seriesNavigator;let c,u=s,d=i;if(this._inverted=n.isInverted(),this._splitted=n._splitted,n.split.visible?(this._plotContainer.setVisible(!1),this._paneContainer.setVisible(!0),this.$_preparePanes(t)):(this._plotContainer.setVisible(!0),this._paneContainer.setVisible(!1),this.$_prepareBody(t,a)),this._creditView.setVisible(h.visible)&&(c=this._creditView.measure(t,h,u,d,r),h.floating||(d-=c.height+h.offsetY)),c=this._titleSectionView.measure(t,n,u,d,r),d-=c.height,this._legendSectionView.setVisible(o.isVisible()))switch(c=this._legendSectionView.measure(t,n,u,d,r),o.getLocatiion()){case ye.TOP:case ye.BOTTOM:d-=c.height;break;case ye.RIGHT:case ye.LEFT:u-=c.width}this._navigatorView.setVisible(l.isVisible()),this._paneContainer.visible?this._paneContainer.measure(t,n.split,n.xPaneAxes,n.yPaneAxes,u,d,1):a?this.$_measurePolar(t,n,u,d,1):this.$_measurePlot(t,n,u,d,1),this._navigatorView.visible&&(n.seriesNavigator._vertical?d=this._bodyView.mh:u=this._bodyView.mw,this._navigatorView.measure(t,l,u,d,r))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;if(null===(t=this._emptyView)||void 0===t?void 0:t.visible)return void this._emptyView.resize(i,r);const n=this._model,a=n.isPolar(),h=n.legend,o=n.options.credits,l=this._creditView;let u=0,d=0,_=0,g=0;l.visible&&(l.resizeByMeasured(),o.floating||(o.verticalAlign===F.TOP?r-=u=l.height+o.offsetY:r-=d=l.height+o.offsetY));const p=this._titleSectionView;let m=0;const w=g+u;p.visible&&(p.resizeByMeasured(),r-=m=p.height),g=s-d;const b=this._navigatorView;let x=0;b.visible&&(b.model._vertical||(b.resize(b.mw,b.mh-b.model.gap-b.model.gapFar),r-=x=b.mh));const f=this._legendSectionView;let y,v,V=0,S=0;if(f.visible)switch(f.resizeByMeasured().layout(),V=f.height,S=f.width,h.getLocatiion()){case ye.TOP:y=m+u,r-=V;break;case ye.BOTTOM:r-=V,y=g-V,g-=V;break;case ye.RIGHT:i-=S,v=e-S;break;case ye.LEFT:i-=S,_+=S,v=0}b.visible&&(g-=x,b.layout().translateY(g+b.model.gap));let P=0,k=0,A=0,E=0;if(this._paneContainer.visible)this._paneContainer.resize(i,r).translate(_,w+m),this._paneContainer.layout(),A=r,E=i;else{const t=this._axisSectionMap,e=t[z.CENTER],s=t[z.MIDDLE];let h;a||(e&&e.visible&&(P=e.mw),s&&s.visible&&(k=s.mh),[z.LEFT,z.RIGHT].forEach((e=>{(h=t[e])&&h.visible&&(i-=h.mw)})),[z.TOP,z.BOTTOM].forEach((e=>{(h=t[e])&&h.visible&&(r-=h.mh)})),(h=t[z.LEFT])&&h.visible&&(h.resize(h.mw,r),h.layout(k),_+=h.mw),(h=t[z.RIGHT])&&h.visible&&(h.resize(h.mw,r),h.layout(k)),P>0&&(e.resize(h.mw,r),e.layout()),(h=t[z.BOTTOM])&&h.visible&&(h.resize(i,h.mh),h.layout(P),g-=h.mh),(h=t[z.TOP])&&h.visible&&(h.resize(i,h.mh),h.layout(P)),k>0&&(s.resize(i,h.mh),s.layout())),b.visible&&b.layout().translateX(_);const o=this._org=th.create(_,g);if(this._plotWidth=i,this._plotHeight=r,a||((h=t[z.LEFT])&&h.visible&&h.translate(o.x-h.mw,o.y-h.height),(h=t[z.RIGHT])&&h.visible&&h.translate(o.x+i,o.y-h.height),P>0&&e.translate(o.x+(i-P)/2,o.y-e.height),(h=t[z.BOTTOM])&&h.visible&&h.translate(o.x,o.y),(h=t[z.TOP])&&h.visible&&h.translate(o.x,o.y-r-h.height),k>0&&s.translate(o.x,o.y-(r-k)/2-k)),A=this._plotHeight-k,E=this._plotWidth-P,_=o.x,g=o.y-this._plotHeight,n._splitted){const t=this._splitBodyView;n.isInverted()?(this._currBody.resize(E/2,A),this._currBody.layout().translate(_,g),t.resize(E/2,A),t.layout().translate(_+E/2+P,g)):(this._currBody.resize(E,A/2),this._currBody.layout().translate(_,g+A/2+k),t.resize(E,A/2),t.layout().translate(_,g))}else this._currBody.resize(E,A),this._currBody.layout().translate(_,g)}if(l.visible){const t=o.offsetX||0,i=o.offsetY||0;let r,n;switch(l.layout(),o.verticalAlign){case F.TOP:break;case F.MIDDLE:n=(s-l.height)/2+i;break;default:n=s-d}switch(o.align){case $.LEFT:r=t;break;case $.CENTER:r=(e-l.width)/2+t;break;default:r=e-l.width-t}l.translate(r,n)}if(E+=P,p.visible&&p.layout({xPlot:_,wPlot:E,wChart:e}).translate(0,w),f.visible){if(h.location===ye.PLOT){let t=c(h.offsetX,0);switch(h.align){case $.RIGHT:_+=E-S-t;break;case $.CENTER:_+=(E-S)/2+t;break;default:_+=t}switch(t=c(h.offsetY,0),h.verticalAlign){case F.BOTTOM:g+=A-V-t;break;case F.MIDDLE:g+=(A-V)/2+t;break;default:g+=t}}else if(isNaN(y)){const t=c(h.offsetY,0);if(_=v,h.alignBase===H.CHART){switch(h.verticalAlign){case F.TOP:g=t;break;case F.BOTTOM:g=s-V-t;break;default:g=(s-V)/2+t}g+V>s&&(g=(s-V)/2)}else switch(h.verticalAlign){case F.TOP:g+=t;break;case F.BOTTOM:g=g+r-V-t;break;default:g=g+(r-V)/2+t}g+V>s&&(g=(s-V)/2),g<0&&(g=0)}else{const t=c(h.offsetX,0);if(g=y,h.alignBase===H.CHART)switch(h.align){case $.LEFT:_=t;break;case $.RIGHT:_=e-S-t;break;default:_=(e-S)/2+t}else switch(h.align){case $.LEFT:_+=t;break;case $.RIGHT:_=_+i-S-t;break;default:_+=(i-S)/2+t}_+S>e&&(_=(e-S)/2),_<0&&(_=0)}f.translate(_,g)}this._tooltipView.close(!0,!1)}showTooltip(t,e){const s=e.xPos+this._bodyView.tx,i=e.yPos+this._bodyView.ty;this._tooltipView.show(t,e,s,i,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}findSeriesView(t){return this._bodyView.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}clipSeries(t,e,s,i,r,n){t&&(this._model.inverted&&n?this._seriesClip.setBounds(0,-i,r,i):this._seriesClip.setBounds(0,0,i,r),t.setClip(this._seriesClip))}pointerMoved(t,e,s){const i=this._bodyView.controlToElement(t,e),r=this._bodyView.pointerMoved(i,s);for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?this._bodyView.width:this._bodyView.height,n=t.model._isHorz?i.x:i.y,a=r&&e.visible&&e.flag.visible&&!e.isBar()&&e.getFlag(s,n);a?t.showCrosshair(n,a):t.hideCrosshiar()}))}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._bodyView.getButton(t)}buttonClicked(t){this._bodyView.buttonClicked(t)}getScrollView(t){for(const e in z){const s=this._axisSectionMap[z[e]].getScrollView(t);if(s)return s}}_doAttached(t){this._seriesClip=this.control.clipBounds()}$_checkEmpty(t,e,s,i){if(!e||e.isEmpty())return this._emptyView||(this._emptyView=new mh(t)),this._emptyView.resize(s,i),!0;this._emptyView&&(this._emptyView.visible=!1)}$_preparePanes(t){}$_prepareBody(t,e){var s,i,r;e?(this._polarView||(this._polarView=new ch(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVisible(!1),null===(i=this._splitBodyView)||void 0===i||i.setVisible(!1),this._polarView.setVisible(!0)):(null===(r=this._polarView)||void 0===r||r.setVisible(!1),this._bodyView.setVisible(!0),this._currBody=this._bodyView,this._model._splitted&&(this._splitBodyView?this._splitBodyView.setVisible(!0):(this._splitBodyView=new Wa(t,this,!0),this._plotContainer.insertChild(this._splitBodyView,this._bodyView)),this._splitBodyView.prepareSeries(t,this._model))),this._currBody.prepareSeries(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e.needAxes(),n=this._axisSectionMap;for(const a in n){const h=n[a];r?h.prepare(t,e.getAxes(a),s,i):h.visible=!1}}$_measurePlot(t,e,s,i,r){var n;const a=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 h=e._splitted,o=s,l=i;let c=0,u=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=a[z.LEFT].checkWidths(t,s,i),s-=a[z.RIGHT].checkWidths(t,s,i),i-=a[z.BOTTOM].checkHeights(t,s,i),i-=a[z.TOP].checkHeights(t,s,i),this._inverted?s-=c=a[z.CENTER].checkWidths(t,s,i):i-=u=a[z.MIDDLE].checkHeights(t,s,i),s-=c,i-=u,e.layoutAxes(s,i,this._inverted,r);for(const n in a){const h=a[n];h.visible&&h.measure(t,e,s,i,r)}s=o,i=l,c=0,u=0;for(const t in a){const e=a[t];e.visible&&(t===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh),this._inverted?t===z.CENTER&&(s-=c=e.mw):t===z.MIDDLE&&(i-=u=e.mh))}e.layoutAxes(s,i,this._inverted,r);for(const n in a){const h=a[n];h.visible&&h.measure(t,e,s,i,r)}s=o,i=l,c=0,u=0;for(const t in a){const e=a[t];e.visible&&(t===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh),this._inverted?t===z.CENTER&&(s-=c=e.mw):t===z.MIDDLE&&(i-=u=e.mh))}e.calcAxesPoints(s,i,this._inverted),(null===(n=this._splitBodyView)||void 0===n?void 0:n.setVisible(h))?(e.isInverted(),this._bodyView.measure(t,e.body,s,i,r),this._splitBodyView.measure(t,e.body,s,i,r)):this._bodyView.measure(t,e.body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e.body.calcRadius(s,i);this.$_prepareAxes(t,e),e.layoutAxes(2*Math.PI,n,!1,r),this._polarView.measure(t,e.body,s,i,r)}}class xh extends ut{constructor(t,e){super(t,e),this.addElement(this._chartView=new bh(t)),this.setPointerHandler(new Ja(this))}onModelChanged(t,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.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.loaded=!e,this.clearAssetDefs(),this.model=new Hr(t)}refresh(t){t?this._render():this.invalidateLayout()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}useImage(t){}_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)),s.measure(this.doc(),e,t.width,t.height,1),s.resize(t.width,t.height),s.layout()}_doRenderBackground(t,e,s){this._model&&Object.assign(t.style,this._model.options.style)}}class fh{constructor(t){this._doInit(this.$_p=t)}_createObjects(...t){for(const e of t)this["_"+e]=new fh(this.$_p[e])}_doInit(t){}get(t){const e=this.$_p.getProp(t);if(e instanceof It){const e=this[t];return e instanceof fh?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 yh extends fh{_doInit(t){this._createObjects("title","line","grid","tick","label","crosshair")}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 vh extends yh{}class Vh extends yh{}class Sh extends Vh{}class Ph extends Vh{}class kh extends fh{_doInit(t){this._createObjects("pointLabel","trendline","tooltip")}get pointLabel(){return this._pointLabel}get trendLine(){return this._trendLine}get tooltip(){return this._tooltip}}class Ah extends fh{}class Eh extends kh{}class Lh extends Eh{}class Ch extends kh{}class Th extends kh{}class Mh extends kh{}class Nh extends kh{}class Oh extends kh{}class Dh extends kh{}class Rh extends kh{}class Bh extends kh{}class Ih extends kh{}class $h extends kh{}class Fh extends kh{}class zh extends kh{}class Hh extends kh{}class Gh extends kh{}class jh extends kh{}class Wh extends kh{}class Yh extends kh{}class Uh extends kh{}class Xh extends kh{}class qh extends kh{}class Zh extends fh{}class Kh extends Zh{}class Qh extends Kh{updateValue(t,e=!0){this.$_p.updateValue(t,e)}}class Jh extends fh{_doInit(t){this._createObjects("line","tick","tickLabel")}get line(){return this._line}get tick(){return this._tick}get tickLabel(){return this._tickLabel}}class to extends Qh{_doInit(t){this._createObjects("label")}get label(){return this._label}}class eo extends fh{_doInit(t){this._createObjects("rangeLabel","thickLabel")}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}}class so extends to{_doInit(t){this._createObjects("scale","rim","valueRim","marker","hand","pin"),this._band=new eo(t.band)}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get marker(){return this._marker}get hand(){return this._hand}get pin(){return this._pin}}class io extends Qh{_doInit(t){this._createObjects("label"),this._scale=new Jh(t.scale)}get label(){return this._label}get scale(){return this._scale}}class ro extends io{}class no extends io{}class ao extends Kh{}class ho extends Zh{}class oo extends fh{}class lo extends fh{}class co extends fh{}class uo extends fh{}const _o={category:vh,linear:Lh,time:Sh,log:Ph},go={area:Ch,arearange:Th,bar:Mh,barrange:Nh,bellcurve:Oh,boxplot:Dh,bubble:Rh,candlestick:Ih,dumbbell:$h,equalizer:Fh,errorbar:class extends kh{},funnel:zh,heatmap:Hh,histogram:jh,line:Lh,lollipop:Wh,ohlc:class extends kh{},pareto:Yh,pie:Uh,scatter:Bh,treemap:Gh,vector:Xh,waterfall:qh},po={circle:so,linear:ro,bullet:no,clock:ao};function mo(t,e){if(e){let s=t.get(e);return s||(e instanceof Ue?s=new(go[e._type()])(e):e instanceof Hs?s=new(po[e._type()])(e):e instanceof le?s=new(_o[e.type()])(e):e instanceof os?s=new oo(e):e instanceof ls?s=new lo(e):e instanceof Pe?s=new co(e):e instanceof be&&(s=new uo(e)),t.set(e,s)),s}}class wo{constructor(t){this._objects=new Map,this.$_p=t}load(t,e){this.$_p.load(t,e),this._objects.clear()}render(t=!1){this.$_p.refresh(t)}get xAxis(){return mo(this._objects,this.$_p.model.xAxis)}getXAxis(t){return mo(this._objects,this.$_p.model.getXAxis(t))}get yAxis(){return mo(this._objects,this.$_p.model.yAxis)}getYAxis(t){return mo(this._objects,this.$_p.model.getYAxis(t))}get series(){return mo(this._objects,this.$_p.model.firstSeries)}getSeries(t){return mo(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return mo(this._objects,this.$_p.model.firstGauge)}getGauge(t){return mo(this._objects,this.$_p.model.gaugeByName(t))}get title(){return mo(this._objects,this.$_p.model.title)}get subtitle(){return mo(this._objects,this.$_p.model.subtitle)}get legend(){return mo(this._objects,this.$_p.model.legend)}get body(){return mo(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)}}class bo{static getVersion(){return"0.9.14"}static setDebugging(t){dt.DEBUGGING=t}static setAnimatable(t){ut._animatable=t}static createChart(t,e,s){const i=new xh(t,e);return i.model=new Hr(s),new wo(i)}}const xo=bo.getVersion,fo=bo.setDebugging,yo=bo.setAnimatable,vo=bo.createChart;t.RcAreaRangeSeries=Th,t.RcAreaSeries=Ch,t.RcAreaSeriesGroup=class extends Ah{},t.RcBarRangeSeries=Nh,t.RcBarSeries=Mh,t.RcBarSeriesGroup=class extends Ah{},t.RcBellCurveSeries=Oh,t.RcBody=uo,t.RcBoxPlotSeries=Dh,t.RcBubbleSeries=Rh,t.RcBulletGauge=no,t.RcBulletGaugeGroup=class extends ho{},t.RcBumpSeriesGroup=class extends Ah{},t.RcCandlestickSeries=Ih,t.RcCategoryAxis=vh,t.RcChartAxis=yh,t.RcChartControl=wo,t.RcChartGauge=Kh,t.RcChartGaugeBase=Zh,t.RcChartObject=fh,t.RcChartSeries=kh,t.RcCircleGauge=so,t.RcCircleGaugeGroup=class extends ho{},t.RcCircularGauge=to,t.RcClockGauge=ao,t.RcContinuousAxis=Vh,t.RcDumbbellSeries=$h,t.RcEqualizerSeries=Fh,t.RcFunnelSeries=zh,t.RcGaugeGroup=ho,t.RcGaugeRangeBand=eo,t.RcGaugeScale=Jh,t.RcHeatmapSeries=Hh,t.RcHistogramSeries=jh,t.RcLegend=co,t.RcLineSeries=Lh,t.RcLineSeriesGroup=class extends Ah{},t.RcLinearAxis=class extends Vh{},t.RcLinearGauge=ro,t.RcLinearGaugeGroup=class extends ho{},t.RcLinerGaugeBase=io,t.RcLogAxis=Ph,t.RcLollipopSeries=Wh,t.RcParetoSeries=Yh,t.RcPieSeries=Uh,t.RcPieSeriesGroup=class extends Ah{},t.RcPointLabel=class extends yh{},t.RcScatterSeries=Bh,t.RcSeriesGroup=Ah,t.RcSubtitle=lo,t.RcTimeAxis=Sh,t.RcTitle=oo,t.RcTreemapSeries=Gh,t.RcValueGauge=Qh,t.RcVectorSeries=Xh,t.RcWaterfallSeries=qh,t.createChart=vo,t.getVersion=xo,t.setAnimatable=yo,t.setDebugging=fo}));
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";let e=0;class s{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(e++))}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 i extends s{wrapper(){return this._wrapper}wrapperOrThis(){return this._wrapper||this}createWrapper(t){const e=this._wrapper=new t;return e.$_c=this,e}setWrapper(t){return this._wrapper=t,t.$_c=this,t}isWrapper(t){return t===this._wrapper}}class r extends s{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 n="http://www.w3.org/2000/svg",a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},h=Array.isArray,o=function(t){return"string"==typeof t},l=function(t){return"number"==typeof t},c=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},u=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},d=function(t,e){return void 0!==t?t:e},_=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},g=(t,e)=>{const s=Object.assign({},t);for(const i in e){const r=e[i];a(r)&&a(t[i])?s[i]=g(t[i],r):s[i]=r}return s};class p{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}p._debugging=!1;const m={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let w=m.ko;const x=void 0,f="%".charCodeAt(0),b=2*Math.PI,y=-Math.PI/2,v=2*Math.PI/360,V=360/Math.PI/2,S=Math.ceil;function P(t){return parseFloat(t.toPrecision(12))}function k(t){return null==t?null:String(t)}function A(t){return t+"px"}function E(t){return null==t||Number.isNaN(t)||""===t}function C(t,e){const s={};return s[t]=e,s}function L(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)===f?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;I(w.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 T(t,e){return L(t,!0)||L(e,!1)}function M(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const N={fill:"fill",stroke:"stroke",strokeWidth:"stroke-width",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},O=function(t){const e=N[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return N[t]=e,e}return e};class D extends Error{}const R=function(t,e){if(!t)throw new D(e)};var B;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(B||(B={}));const I=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var $,F,z,H;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}($||($={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(F||(F={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(z||(z={})),function(t){t.CHART="chart",t.PLOT="plot"}(H||(H={}));const G=function(t,e,s){let i,r;return h(t)&&(i=[],t.forEach((t=>{if(a(t)&&o(t.color)){const n={fromValue:c(t.fromValue,r?r.toValue:e),toValue:c(t.toValue,s),color:t.color};n.fromValue<n.toValue&&(i.push(n),r=n)}})),i=i.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),i.forEach((t=>{t.fromValue=Math.max(t.fromValue,e),t.toValue=Math.min(t.toValue,s)}))),i};let j=651212;class W{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,a=s.pageYOffset||n.scrollTop||r.scrollTop,h=s.pageXOffset||n.scrollLeft||r.scrollLeft,o=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+h-l,u=i.top+a-o;return{x:Math.round(c),y:Math.round(u)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)W.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const a={},h={};return a[e]=s,h[e]=i,t.animate([a,h],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+j++}static stopAnimation(t){if(t)try{t.finish()}catch(t){p.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}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 Y=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});let X=!1,U=!1;"undefined"!=typeof window&&(X=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,U=!!window.chrome&&!X,Object.prototype.toString.call(HTMLElement).indexOf("Constructor")>0||!U&&!X&&navigator.userAgent.indexOf("Safari"),navigator.userAgent.toLocaleLowerCase().indexOf("samsungbrowser"),navigator.userAgent.toLocaleLowerCase().indexOf("miuibrowser"));const q=/"([^"]*(?="))"/,Z=/'([^']*(?='))'/,K='"'.charCodeAt(0),Q="'".charCodeAt(0);class J{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 stopEvent(t,e=!1){t.preventDefault?(t.preventDefault(),t.stopPropagation()):t.returnValue=!1,e&&t.stopImmediatePropagation()}static getErrorStack(t){const e=t.stack;return e?e.split("\n").map((t=>t+"<br/>")):""}static getBaseClassName(t){return Object.getPrototypeOf(t.constructor).name}static isObject(t){return t&&"object"==typeof t&&!h(t)}static assign(t,e){this.isObject(e)&&Object.assign(t,e)}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&&!h(t))return Object.assign({},t)}static checkArray(t){return h(t)?t:void 0}static makeArray(t,e=!1){return null!=t?h(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return h(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(h(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 h(t)?t:null!=t?[t]:null}static copyArray(t){return h(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 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()-Y}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=Math.max(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 cast(t,e){return t instanceof e?t:null}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 irandomExcept(t,e,s){if(0===t&&1===e&&isNaN(s))throw new Error("Invalid irandom2");for(;;){const i=this.irandom(e,s);if(i!==t)return i}}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(J.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 toEven(t){return 1&t?t+1:t}static hex(t,e=2,s="0"){e=Math.max(e||2,1);const i=t.toString(16);return s=s||"0",new Array(e-i.length+1).join(s)+i}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(Math.min(s,J.month_days[J.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 capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=h(t)?[]:{};for(let s of Object.keys(t))e[s]=J.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 hasSetter(t,e){for(;t;){const s=Reflect.getOwnPropertyDescriptor(t,e);if(s)return s.writable||!!s.set;t=Object.getPrototypeOf(t)}return!1}static dataUriToBinary(t){const e=";base64,",s=t.indexOf(e)+8,i=t.substring(s),r=window.atob(i),n=r.length,a=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t++)a[t]=r.charCodeAt(t);return a}static assignProps(t,e){let s=!1;if(e)for(let i in e)e[i]!==t[i]&&(t[i]=e[i],s=!0);return s}static assignStyleAndProps(t,e){let s=!1;if(e)for(let i in e)("style"===i||t.hasOwnProperty(i))&&(t[i]=e[i],s=!0);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 isUnique(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)if(t[s]===t[s-1])return!1;return!0}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),console.log(t,+new Date-s+"ms")}static clamp(t,e,s){return Math.max(e,Math.min(s,t))}static makeIntArray(t,e){const s=new Array(Math.max(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static setInterval(t,e){return setInterval(t,e)}static clearInterval(t){clearInterval(t)}static isStringArray(t){return h(t)&&t.every((t=>"string"==typeof t))}static isNumberArray(t){return h(t)&&t.every((t=>"number"==typeof t))}static makeLineSeparator(t){if(h(t)){if(t.length>0){let e=t[0];for(let s=1,i=t.length;s<i;s++)e+="|"+t[s];return new RegExp(e,"g")}}else if(t)return new RegExp(t,"g")}static stripQuotes(t){const e=t.charCodeAt(0);return e===K?t=t.replace(q,"$1"):e===Q&&(t=t.replace(Z,"$1")),t}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=Math.abs(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}}function tt(t){return{width:t.width,height:t.height}}J.week_days=["일","월","화","수","목","금","토"],J.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],J.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]],J.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();class et{static create(t,e,s,i){return J.isObject(t)?new et(t.x,t.y,t.width,t.height):E(e)?new et(t,t,t,t):E(s)?new et(t,e,t,e):new et(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return t=this,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height));var t}clone(){return new et(this.x,this.y,this.width,this.height)}getInner(){return new et(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}var st;et.Empty=new et,et.Temp=new et,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.RECTANGLE="rectangle",t.SQUARE="square",t.TRIANGLE="triangle",t.ITRIANGLE="itriangle",t.STAR="star"}(st||(st={}));const it=J.getEnumValues(st),rt=.001;class nt{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,"L",t+s,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static square(t,e,s,i){const r=Math.min(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"L",t+r,e,"L",t+r,e+r,"L",t,e+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=Math.cos(r),l=Math.sin(r),c=Math.cos(n-=rt),u=Math.sin(n),d=n-r-Math.PI<rt?0:1,_=a?1:0,g=[];return g.push("M",t+s*o,e+i*l,"A",s,i,0,d,_,t+s*c,e+i*u),h&&g.push("Z"),g}static sector(t,e,s,i,r,n,a,h){const o=2*Math.PI-Math.abs(a-n)<rt;let l=Math.abs(a-n)-Math.PI<rt?0:1;const c=h?1:0,u=Math.cos(n),d=Math.sin(n),_=Math.cos(a-=o?c?rt:-.001:0),g=Math.sin(a),p=s*r,m=i*r,w=[];return w.push("M",t+s*u,e+i*d,"A",s,i,0,l,c,t+s*_,e+i*g),o?w.push("M",t+p*_,e+m*g):w.push("L",t+p*_,e+m*g),isNaN(p)||w.push("A",p,m,0,l,1-c,t+p*u,e+m*d),w.push("Z"),w}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){const r=t+s/2,n=e+i/2,a=s/2,h=i/2,o=s/4,l=i/4,c=2*Math.PI/5,u=c/2,d=[];let _=-Math.PI/2;d.push("M",r+a*Math.cos(_),n+h*Math.sin(_));for(let t=0;t<5;t++)d.push("L",r+a*Math.cos(_),n+h*Math.sin(_)),d.push("L",r+o*Math.cos(_+u),n+l*Math.sin(_+u)),_+=c;return d.push("Z"),d}static setShape(t,e,s){let i;switch(e){case st.SQUARE:case st.RECTANGLE:case st.DIAMOND:case st.TRIANGLE:case st.ITRIANGLE:case st.STAR:i=nt[e](0,0,2*s,2*s);break;default:i=nt.circle(s,s,s)}t.setPath(i)}}var at;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(at||(at={}));const ht={name:"RealChart",version:"0.9.15",license:"enterprise",code:""};class ot{static decode(t){const e=ot.CHARS,s=ot.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}}ot.PAD="=",ot.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class lt{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=lt.xor,i=lt.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=lt.xor,i=lt.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=lt.kb,i=lt._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*lt.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=lt._decryptBlock;let i=lt._init(e),r=[],n=ot.decode(t),a=n.length>>3,h=0,o={left:null,right:null};for(let t=0;t<a;t++){o.left=n[h]*lt.POW24|n[h+1]*lt.POW16|n[h+2]*lt.POW8|n[h+3],o.right=n[h+4]*lt.POW24|n[h+5]*lt.POW16|n[h+6]*lt.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)}}lt.POW2=Math.pow(2,2),lt.POW3=Math.pow(2,3),lt.POW4=Math.pow(2,4),lt.POW8=Math.pow(2,8),lt.POW16=Math.pow(2,16),lt.POW24=Math.pow(2,24),lt.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 ct{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=lt.decrypt(t,"dkdl"+this._getLDKey(lt.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 i{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;try{if(e=realChartLic,!e)throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}catch(t){throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}const s=ct.decrypt(e);if("RealChart"!=s.name||"RealChart"!==ht.name)throw new Error("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/");try{const e=s.server.toLowerCase(),i=location.pathname.toLowerCase();if(ht.license!=at.Developer&&!ct.includedDomains(e,t.toLowerCase(),i))throw new Error;const r=s.lic.toLowerCase();if(!Object.values(at).includes(r))throw new Error;if(ht.code=s.code,ht.license=s.lic,r==at.Evaluation||r==at.Limited){const t=s.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("RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/")}}(),!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),W.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}setData(t,e,s){E(e)?(delete this._svg.dataset[t],s&&delete this._dom.dataset[t]):(this._svg.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){W.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs,s=e.children;for(let i=0;i<s.length;i++)s[i].hasAttribute(t)&&e.removeChild(s[i])}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)}removeElement(t){this._root.removeChild(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 pt(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)}clipPath(){const t=new wt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(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.getBBounds();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(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||I(w.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden",padding:"20px","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const a=this._svg=i.createElementNS(n,"svg");a.classList.add("rct-root"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const h=i.createElement("desc");h.textContent="Created by RealChart v0.9.15",a.appendChild(h);const o=this._defs=i.createElementNS(n,"defs");this._initDefs(i,o),a.appendChild(o),r.appendChild(a),this._root=new gt(this),a.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(n,"filter");const i=t.createElementNS(n,"feDropShadow");s.setAttribute("id",ut.SHADOW_FILTER),i.setAttribute("dx","1"),i.setAttribute("dy","1"),i.setAttribute("flood-olor","#000"),i.setAttribute("flood-opacity","0.75"),i.setAttribute("stdDeviation","1.5"),s.appendChild(i),e.appendChild(s)}_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{console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;Object.assign(this._htmlRoot.style,{left:A(e.left-t.left),top:A(e.top-t.top)}),this._doRender({x:0,y:0,width:s,height:i}),this._doRenderBackground(this._container.firstElementChild,s,i)}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s){}_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 s{constructor(t,e,s=x){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(n,s||"g"),(this._styleName=e||"")&&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._translateX}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._translateY}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.setVisible(t)}setVisible(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}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}appendElement(t,e){const s=t.createElementNS(n,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(n,e);return this._dom.insertBefore(i,s),i}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return E(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];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.translate(t,e),this.resize(s,i),this}setRect(t){return this.translate(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return et.create(this._translateX,this._translateY,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}getBBounds(){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}movep(t){return this.x=t.x,this.y=t.y,this}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}translate(t,e){return t===this._translateX&&e===this._translateY||(J.isValidNumber(t)&&(this._translateX=t),J.isValidNumber(e)&&(this._translateY=e),this._updateTransform()),this}translatep(t){return this.translate(t.x,t.y)}translateEx(t,e,s=0,i=!0){if(t=J.isNumber(t)?t:this._translateX,e=J.isNumber(e)?e:this._translateY,t!==this._translateX||e!==this._translateY){if(s>0){const r=this._dom.animate([{transform:`translate(${this._translateX}px,${this._translateY}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._translateX=t,this._translateY=e,this._updateTransform()}return this}translateX(t){return t!==this._translateX&&J.isValidNumber(t)&&(this._translateX=t,this._updateTransform()),this}translateY(t){return t!==this._translateY&&J.isValidNumber(t)&&(this._translateY=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&(this._width=t,s&&this.setAttrEx("width",t)),e!==this._height&&(this._height=e,s&&this.setAttrEx("height",e)),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(O(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(O(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(O(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){o(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this._dom.classList.add(t):a(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)}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setData(t,e){this.dom.dataset[t]=d(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.setVisible(!1)}))}else this.setVisible(!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)}_testing(){return dt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._translateX,s=this._translateY,i=[];(J.isValidNumber(e)||J.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),J.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+J.pick(this._originX,t.getAttribute("x"),0)+" "+J.pick(this._originY,t.getAttribute("y")||0)+")");const r=J.getNumber(this._scaleX,1),n=J.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}dt.TESTING=!1,dt.DEBUGGING=!1,dt.ASSET_KEY="_asset_",dt.TEMP_KEY="_temp_";class _t extends dt{constructor(t,e){super(t,e,"g")}}class gt extends dt{constructor(t){super(t.doc(),null),this._control=t}get control(){return this._control}}class pt extends dt{constructor(t,e,s,i,r,n=0,a=0){super(t,x,"clipPath");const h=this._id=J.uniqueKey()+"-";this.setAttr("id",h);const o=this._rect=new dt(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}get id(){return this._id}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),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 mt 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=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}renderShape(t,e,s,i){let r;switch(t){case"squre":case"diamond":case"triangle":case"itriangle":r=nt[t](e-i,s-i,2*i,2*i);break;default:r=nt.circle(e,s,i)}this.setPath(r)}}class wt extends dt{constructor(t){super(t,x,"clipPath");const e=this._id=J.uniqueKey()+"-";this.setAttr("id",e),this._path=new mt(t),this.add(this._path)}get id(){return this._id}setPath(t){this._path.setPath(t)}}class xt{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){}}class ft{constructor(t){this.source=t}}class bt extends ft{_setStops(t,e){const s=t.createElementNS(n,"stop"),i=t.createElementNS(n,"stop"),r=this.source.color,a=E(this.source.opacity)?1:this.source.opacity,o=h(r)?r[0]:r,l=h(r)&&r.length>1?r[1]:"white",c=h(a)?a[0]:a,u=h(a)&&a.length>1?a[1]:a;e.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",l),s.setAttribute("stop-opacity",c),i.setAttribute("offset","1"),i.setAttribute("stop-color",o),i.setAttribute("stop-opacity",u),e.appendChild(s),e.appendChild(i)}}class yt extends bt{getEelement(t,e){const s=t.createElementNS(n,"linearGradient");let{x1:i,x2:r,y1:a,y2:h}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),e.dir){case"up":a=1;break;case"right":r=1;break;case"left":i=1;break;default:h=1}return s.setAttribute("x1",i),s.setAttribute("y1",a),s.setAttribute("x2",r),s.setAttribute("y2",h),s}}yt.TYPE="lineargradient";class vt extends bt{getEelement(t,e){const s=t.createElementNS(n,"radialGradient");return E(e.cx)||s.setAttribute("cx",e.cx),E(e.cy)||s.setAttribute("cy",e.cy),E(e.rd)||s.setAttribute("rd",e.rd),this._setStops(t,s),s}}vt.TYPE="radialgradient";class Vt extends ft{getEelement(t,e){const s=t.createElementNS(n,"pattern"),i=t.createElementNS(n,"path");let r=!1;if(s.setAttribute("id",e.id),s.setAttribute("width",String(e.width||e.height||20)),s.setAttribute("height",String(e.height||e.width||20)),s.setAttribute("patternUnits","userSpaceOnUse"),+e.pattern>=0){const t=Vt.STOCK[+e.pattern%Vt.STOCK.length];i.setAttribute("d",t.path),t.style&&Object.assign(i.style,t.style),r=!t.fill}else o(e.pattern)&&i.setAttribute("d",e.pattern);return a(e.style)&&Object.assign(i.style,e.style),r&&(i.style.fill="none"),s.append(i),s}}Vt.TYPE="pattern",Vt.STOCK=[{path:"M20.03.03-.5 20.45"},{path:"m-.15 8.67 10.16 2.71 10.16-2.71",style:{strokeWidth:"1.24px"}},{path:"M0 20c1.67-1.67 3.49.15 5.15-1.51C6.82 16.82 5 15 6.66 13.34c1.67-1.67 3.49.15 5.15-1.51 1.67-1.67-.15-3.49 1.51-5.16 1.67-1.67 3.49.15 5.16-1.51 1.67-1.67-.15-3.49 1.51-5.16"},{path:"M 10 10 m 5 0 a 5 5 0 1 1 -10 0 a 5 5 0 1 1 10 0",fill:!0},{path:"M.61 7.19h4.95v4.95H.61z m12.38 9.669 3.5-3.5 3.5 3.5-3.5 3.5z",fill:!0},{path:"m18.3 5.18.02.02L10 10 1.68 5.2 10 .39l8.3 4.79M10 19.61 1.68 14.8V5.2 M1.68 5.2 10 10v9.61M10 19.15V10l8.32-4.8M18.32 5.2v9.6L10 19.61"},{path:"M19.64 9.99h-6.46M14.81 1.64l-3.23 5.6M5.17 1.65 8.4 7.26M.36 10.01h6.46M5.19 18.36l3.23-5.6M14.83 18.35l-3.23-5.61"},{path:"M20 5.04H0M0 14.96h20M14.96 20V0M5.04 0v20"},{path:"M.59 18.15 10 1.85l9.41 16.3H.59z"},{path:"m.005 8.165 1.83-3.17 3.17 1.83-1.83 3.17z m5.005 6.825 3.17-1.83 1.83 3.17-3.17 1.83z M.005 1.835l3.17-1.83 1.83 3.17-3.17 1.83z m5.005 3.175 1.83-3.17 3.17 1.83-1.83 3.17z m15.006 6.825 3.17-1.83 1.83 3.17-3.17 1.83z m10.005 8.165 1.83-3.17 3.17 1.83-1.83 3.17zM14.995 3.174l1.83-3.17 3.17 1.83-1.83 3.17z m9.995 1.835 3.17-1.83 1.83 3.17-3.17 1.83z M5 3.2v3.63M15 3.2v3.63M8.17 5h3.66"},{path:"M-.529 13.948 13.203.216l6.562 6.562L6.033 20.51zM9.625 16.928l6.562-6.562L29.92 24.098l-6.562 6.562z"},{path:"m7.98 6.42 7.85-13.59 7.84 13.59H7.98zM27.84 6.42 20 20 12.16 6.42h15.68z"}];class St{constructor(){this._items=[]}count(){return this._items.length}get(t){return this._items[t]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(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)}))}$_loadItem(t){if(a(t)&&t.type&&t.id){if(null!=t.pattern)return new Vt(t);if(t.type)switch(t.type.toLowerCase()){case yt.TYPE:return new yt(t);case vt.TYPE:return new vt(t);case Vt.TYPE:return new Vt(t)}}}}const Pt="0".charCodeAt(0),kt="#".charCodeAt(0),At=",".charCodeAt(0),Et="s".charCodeAt(0),Ct="a".charCodeAt(0);class Lt{static getFormatter(t){let e=Lt.Formatters[t];return e||(Lt.Formatters[t]=e=new Lt(t)),e}static get Default(){return Lt.getFormatter(Lt.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)===Pt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===kt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===Pt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===At){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Et){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===Ct){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}Lt.DEFAULT_FORMAT="",Lt.Formatters={};const Tt="$_TH";class Mt{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e){let i=this.text;for(let r=0;r<s.length;r+=3)i=i.replace(s[r],e(t,s[r+1],s[r+2]));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;){const s=t.indexOf("${",e);if(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(";");a>0?this._literals.push(r,n.substring(0,a),n.substring(a+1)):this._literals.push(r,n,""),e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Nt extends Mt{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 Ot={t:class extends Nt{get type(){return"t"}},b:class extends Nt{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends Nt{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class Dt{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 Mt).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 Ot){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 Ot[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}getText(t,e){let s="";for(let i of this._words)s+=i.getText(t,e);return s}}class Rt{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&(this._format=t,t&&this.$_parse(t))}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=c(this.lineHeight,1),h=this._lines,o=h.length,l=[];let u;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,u=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=Math.max(c,s[Tt]=a.height),u||(u=s)}l.push(u),s[Tt]=c*a}u=h[0][Tt];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(u-t.getAscent(u))+t.getAscent(h[e][Tt]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="&#8203;",u=h[e][Tt]}t.layoutText(h[0][Tt])}$_parse(t){const e=this._lines=[];if(t){const s=t.split(/<br.*?>|\r\n|\n/);for(let t of s)e.push((new Dt).parse(t))}}}let Bt=0;class It extends s{constructor(t,e=!0){super(),this.INVALID={},this.chart=t,this._visible=e,Bt++}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("."),i=e.length-1;let r=this;for(let t=0;t<i;t++)if(r=r[e[t]],!(r instanceof s))return this.INVALID;return{obj:r,prop:e[i]}}}getProp(t){if(o(t)){const e=this.$_parseProp(t);return e?e===this.INVALID?x:e.obj[e.prop]:this[t]}}setProp(t,e,i){if(o(t)){const r=this.$_parseProp(t);if(r)r.obj instanceof It?r.obj.setProp(r.prop,e,i):r.obj instanceof s&&e!==r.obj[r.prop]&&(r.obj[r.prop]=e,i&&this._changed());else if(t in this){const s=this[t];if(s instanceof It)return s.setProps(e,i);if(e!==s)return this[t]=e,i&&this._changed(),!0}}}setProps(t,e){let s=!1;if(a(t))for(const e in t)this.setProp(e,t[e],!1)&&(s=!0);else this._doLoadSimple(t)&&(s=!0);return s&&e&&this._changed(),s}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 e in t){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof It?this[e].load(s):h(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):a(s)?this[e]=Object.assign({},s):this[e]=s)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}_loadStroke(t){if(o(t))return this.visible=!0,this.style={stroke:t},!0}}var $t;!function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}($t||($t={}));class Ft extends It{constructor(){super(...arguments),this.effect=$t.NONE,this.autoContrast=!0}}class zt extends Ft{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?Lt.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&(this._text=t,t?(this._richTextImpl||(this._richTextImpl=new Rt),this._richTextImpl.setFormat(t)):this._richTextImpl=null),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r){this._richTextImpl.build(t,e,s,i,r)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(J.isValidNumber(t)){const i=this._numSymbols&&e&&J.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}}class Ht extends It{}const Gt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],jt=[".","/","-",":"],Wt="Z".charCodeAt(0),Yt="z".charCodeAt(0),Xt="A".charCodeAt(0),Ut="a".charCodeAt(0),qt="y".charCodeAt(0),Zt="M".charCodeAt(0),Kt="m".charCodeAt(0),Qt="W".charCodeAt(0),Jt="w".charCodeAt(0),te="d".charCodeAt(0),ee="H".charCodeAt(0),se="h".charCodeAt(0),ie="S".charCodeAt(0),re="s".charCodeAt(0),ne=function(t){return t<10?"0"+t:String(t)},ae=function(t){return t<10?"00"+t:t<100?"0":String(t)};class he{static getFormatter(t){let e=he.Formatters[t];return e||(he.Formatters[t]=e=new he(t)),e}static get Default(){return he.getFormatter(w.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||w.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 qt:i+=h>2?t.getFullYear():ne(t.getFullYear()%100);break;case Zt:i+=h>1?ne(t.getMonth()+1):t.getMonth()+1;break;case te:i+=h>1?ne(t.getDate()):t.getDate();break;case Qt:i+=h>1?ne(J.weekOfYear(t,e)):J.weekOfMonth(t,e,!0);break;case Jt:i+=h>1?J.long_week_days[t.getDay()]:J.week_days[t.getDay()];break;case ee:i+=h>1?ne(t.getHours()):t.getHours();break;case se:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?ne(e):e}else i+=h>1?ne(t.getHours()):t.getHours();break;case Kt:i+=h>1?ne(t.getMinutes()):t.getMinutes();break;case re:i+=h>1?ne(t.getSeconds()):t.getSeconds();break;case Ut:case Xt:t.getHours()<12?i+=w.am:i+=w.pm;break;case ie:let s=t.getMilliseconds();i+=3==h?ae(s):2==h?ne(s):s.toString().substr(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(jt.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),Gt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Xt&&e<=Wt||e>=Ut&&e<=Yt)&&I(w.invalidDateFormat,t)}e.push(n)}if(r<i&&J.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&J.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||w.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}var oe,le,ce,ue,de,_e;he.Formatters={},function(t){t.AUTO="auto",t.LINE="line"}(oe||(oe={}));class ge extends It{constructor(){super(...arguments),this.minWidth=50}}class pe extends It{constructor(t){super(t.chart),this.axis=t,this.type=oe.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.timeFormat="yyyy-MM-dd HH:mm",this.flag=new ge(t.chart),this.visible=!1}isBar(){return!this.axis.isContinuous()&&this.type===oe.AUTO}getFlag(t,e){const s=this.axis.getAxisValueAt(t,e);return s instanceof Date?he.getFormatter(this.timeFormat).toStr(new Date(s),0):Lt.getFormatter(this.numberFormat).toStr(s)}}class me extends It{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class we extends me{constructor(t){super(t,t._isX)}_doLoadSimple(t){return this._loadStroke(t)||super._doLoadSimple(t)}}!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(le||(le={}));class xe extends me{constructor(){super(...arguments),this.align=le.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&&!E(this.text)}getRotation(t){return t._isHorz?0:isNaN(this._rotation)?t.position===de.OPPOSITE?90:270:this._rotation}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}class fe extends me{constructor(t){super(t,null),this.startVisible=!1,this.endVisible=!t._isX}isVisible(){return null==this.visible?!this.axis._isX:this.visible}getPoints(t){const e=this.axis;return e.hasBreak()?e._ticks.filter((t=>!e.isBreak(t.value))).map((s=>e.getPosition(t,s.value,!1))):e._ticks.map((s=>e.getPosition(t,s.value,!1)))}}class be extends zt{constructor(t){super(t,!0),this.align=$.LEFT,this.verticalAlign=F.TOP}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}(ce||(ce={}));class ye extends me{constructor(t){super(t),this.front=!0,this.zindex=0,this.label=new be(t.chart)}}class ve extends ye{}class Ve extends ye{}class Se extends me{constructor(t){super(t,!1),this.length=7,this.margin=3,this.integral=!1,this.showFirst=!1,this.showLast=!1}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(ue||(ue={}));class Pe extends zt{constructor(t){super(t&&t.chart,!0),this.axis=t,this.step=0,this.startStep=0,this.rows=0,this.autoArrange=ue.ROTATE,this.wrap=!1,this.numberFormat=null}getRotation(){return this.rotation||0}}!function(t){t.AUTO="auto",t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base",t.BETWEEN="between"}(de||(de={}));class ke 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 Ae{constructor(t,e,s){this.axis=t,this.min=t.axisMin(),this.max=t.axisMax(),this.resize(e,s)}get length(){return this.end-this.start}resize(t,e){if(t=isNaN(t)?this.start:Math.max(this.min,Math.min(this.max,t)),e=isNaN(e)?this.end:Math.max(t,Math.min(this.max,e)),t!==this.start||e!==this.end)return this.start=t,this.end=e,!0}}class Ee extends It{constructor(t,e,s){super(t),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this.guides=[],this.crosshair=new pe(this),this.scrollBar=new ke(this),this.row=0,this.col=0,this.position=de.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this._isX=e,this.name=s,this.title=new xe(this),this.line=new we(this),this.tick=this._createTickModel(),this.label=this._createLabelModel(),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}getAxisValueAt(t,e){return this.getValueAt(t,e)}isBased(){return!1}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&this.position===de.BETWEEN&&this._isX,this._isOpposite=this.position===de.OPPOSITE,this._doPrepareRender();const t=this._series,e=this._values;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalcluateRange(e),this._isX&&t.length>0)if(this.chart.isSplitted()){const e=[t[0]._row];for(let s=1;s<t.length;s++)e.indexOf(t[s]._row)<0&&e.push(t[s]._row);e.forEach((e=>{let s=0,i=0;t.forEach((t=>{t._row==e&&t.clusterable()&&(s+=c(t.groupWidth,1))})),t.forEach((t=>{if(t._row==e&&t.clusterable()){const e=c(t.groupWidth,1)/s;t.setCluster(e,i),i+=e}}))}))}else{let e=0,s=0;t.forEach((t=>{t.clusterable()&&(e+=c(t.groupWidth,1))})),t.forEach((t=>{if(t.clusterable()){const i=c(t.groupWidth,1)/e;t.setCluster(i,s),s+=i}}))}}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t)}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPosition(t,e.value)))}getLabelLength(t,e){return this.getUnitLength(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())}zoom(t,e){if(t>e){const s=t;t=e,e=s}return this._zoom?this._zoom.resize(t,e)?(this._changed(),!0):void 0:(isNaN(t)&&(t=this._min),isNaN(e)&&(e=this._max),this._zoom=new Ae(this,t,e),this._changed(),!0)}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}_doLoadProp(t,e){if("guide"===t||"guides"===t)return this.guides.length=0,h(e)?this.$_loadGuides(e):a(e)&&this.$_loadGuides([e]),!0}_createGrid(){return new fe(this)}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;if("range"===s.type)i=new Ve(this);else i=new ve(this);i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalcluateRange(t){return{min:t.length>0?P(Math.min(...t)||0):NaN,max:t.length>0?P(Math.max(...t)||0):NaN}}}class Ce{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=this._items;h(t)?t.forEach(((t,i)=>s.push(this.$_loadAxis(e,t,i)))):a(t)&&s.push(this.$_loadAxis(e,t,0))}contains(t){return this._items.indexOf(t)>=0}get(t){return o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}$_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(this._getLength(e,t))))}_getLength(t,e){return e}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return l(s)&&s>=0&&s<e.length?i=e[s]:o(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&(i._connect(t),this.isX?t._col=c(t.col,i.col):t._row=c(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,s){var i;let r=t._getAxisType(e.type);if(!r){let n;if(h(e.categories))n="category";else if(this.isX){const i=t._getSeries().internalItems();if(i.length>0){n="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.xAxis===e.name){n=x;break}if(t.xAxis===s){n=x;break}if(E(t.xAxis)&&0===s){n=x;break}}}}else n=null===(i=t._getSeries().first)||void 0===i?void 0:i.defaultYAxisType();n&&(r=t._getAxisType(n))}r||(r=t._getAxisType("linear"));const n=new r(t,this.isX,e.name);return n.load(e),n._index=s,n._isPolar=t.isPolar(),n}}class Le{constructor(){this._axes=[]}isEmpty(){return this._axes.length<1}}class Te{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){this._matrix.forEach((e=>{e.forEach(((e,s)=>{e._axes.forEach((e=>{e.isBased()||e.buildTicks(t[e._runPos===de.OPPOSITE?s-1:s])}))}))})),this._matrix.forEach((e=>{e.forEach(((e,s)=>{e._axes.forEach((e=>{e.isBased()&&e.buildTicks(t[e._runPos===de.OPPOSITE?s-1:s])}))}))}))}calcPoints(t,e){this._matrix.forEach((s=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.calcPoints(t[s._runPos===de.OPPOSITE?i-1:i],e)}))}))}))}}class Me extends Te{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 Le)}t.forEach((t=>{let s=t._row;t.position===de.OPPOSITE?(s++,t._runPos=t.position):t._row<e-1&&t.position===de.BETWEEN?(s++,t._runPos=de.NORMAL):t._runPos=t.position,i[s][t._col]._axes.push(t)}))}}class Ne extends Te{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 Le)}t.forEach((t=>{let e=t._col;t.position===de.OPPOSITE?(e++,t._runPos=t.position):t._col<s-1&&t.position===de.BETWEEN?(e++,t._runPos=de.NORMAL):t._runPos=t.position,i[t._row][e]._axes.push(t)}))}}class Oe extends It{constructor(t){super(t),this.front=!1,this.align=$.LEFT,this.verticalAlign=F.TOP,this.offsetX=10,this.offsetY=10}getPostion(t,e,s,i){let r,n;switch(this.align){case $.CENTER:r=(t-s)/2+this.offsetX;break;case $.RIGHT:r=t-this.offsetX-s;break;default:r=this.offsetX}switch(this.verticalAlign){case F.MIDDLE:n=(e-i)/2-this.offsetY;break;case F.BOTTOM:n=e-this.offsetY-i;break;default:n=this.offsetY}return{x:r,y:n}}}class De{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 Oe)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],i=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t.name&&(i[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,s){const i=t._getAnnotationType(e.type||"text");if(!i)throw new Error("Invalid annotation type: "+e.type);const r=new i(t,e.name||`annotation ${s+1}`);return r.load(e),r.index=s,r}}class Re extends Oe{get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=L(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=L(this._height=t,!0))}getSize(t,e){return{width:M(this._widthDim,t),height:M(this._heightDim,e)}}}!function(t){t.NONE="none",t.X="x",t.Y="y",t.BOTH="both"}(_e||(_e={}));let Be=class extends It{constructor(t){super(t.chart,x),this.body=t}isVisible(){return!1!==this.visible&&this.body.isZoomed()&&this.body.canZoom()}};class Ie extends It{constructor(t){super(t.chart,!1),this.body=t,this.size=.5}}class $e extends It{constructor(t){super(t),this.split=new Ie(this),this.startAngle=0,this.circular=!0,this.image=new Ht(null),this.zoomType=_e.NONE,this.zoomButton=new Be(this),this._annotations=new De(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=L(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=L(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=L(t,!0))}canZoom(){return this.zoomType===_e.X||this.zoomType===_e.Y||this.zoomType===_e.BOTH}getSplits(){const t=Math.max(0,Math.min(1,c(this.split.size,.5)));return[1-t,t]}calcRadius(t,e){return M(this._radiusDim,Math.min(t,e))}setPolar(t,e){return this._cx=M(this._cxDim,t),this._cy=M(this._cyDim,e),this._rd=M(this._radiusDim,Math.min(t,e)),this}getStartAngle(){return y+v*this.startAngle}getPolar(t){return this.chart.isPolar()?{start:this.getStartAngle(),cx:this._cx,cy:this._cy,rd:this._rd}:x}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}_doLoadProp(t,e){if("annotations"===t||"annotation"===t)return h(e)?this.$_loadAnnotations(e):a(e)&&this.$_loadAnnotations([e]),!0}_doPrepareRender(t){this._annotations.prepareRender()}$_loadAnnotations(t){this._annotations.load(t)}}class Fe extends It{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class ze extends It{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}var He,Ge,je,We;ze.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.PLOT="plot",t.SUBPLOT="subplot"}(He||(He={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Ge||(Ge={})),function(t){t.START="start",t.CENTER="center",t.END="end"}(je||(je={}));class Ye extends Fe{constructor(t){super(t,void 0),this.location=He.BOTTOM,this.layout=Ge.AUTO,this.alignBase=H.PLOT,this.gap=6,this.itemGap=8,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=je.CENTER,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!==Ge.AUTO||this._location===He.PLOT)return this.layout;switch(this._location){case He.BOTTOM:case He.TOP:return Ge.HORIZONTAL;default:return Ge.VERTICAL}}getMaxWidth(t){return M(this._maxWidthDim,t,t)}getMaxHeight(t){return M(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=L(this.maxWidth,!0),this._maxHeightDim=L(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=J.checkEnumValue(He,this.location,He.BOTTOM),this._items=this.$_collectItems()}$_collectItems(){return this.chart._getLegendSources().map((t=>new ze(this,t)))}}class Xe extends dt{static create(t,e,s,i,r,n,a=0){return new Xe(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=x,s=x){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 Ue extends mt{constructor(t,e=x){super(t,e)}setBox(t,e,s,i){return this.setPath(nt.box(t,e,s,i)),this}}!function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(We||(We={}));let qe=0;class Ze{static swap(t){const e=[];for(let s=0;s<t.length;s++)e.push({xPos:t[s].yPos,yPos:t[s].xPos});return e}constructor(t){this.pid=qe++,this.visible=!0,this.getValueOf=(t,e)=>this[e]||this.source[e],this.source=t}get yAbs(){return Math.abs(this.yValue)}get xAbs(){return Math.abs(this.xValue)}ariaHint(){return this.x+", "+this.yValue}labelCount(){return 1}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 e=this.source;h(e)?this._readArray(t,e):a(e)?(this._readObject(t,e),(h(e.drillDown)||a(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e)}getLabel(t){return this.y}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}_assignTo(t){return Object.assign(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue})}_readArray(t,e){if(null==e)this.isNull=!0;else{const s=+t.colorField;isNaN(s)||(this.color=e[s]),e.length>1?(this.x=e[c(t.xField,0)],this.y=e[c(t.yField,1)]):this.y=e[c(t.yField,0)]}}_readObject(t,e){var s,i,r,n;null==e?this.isNull=!0:(this.x=(s=e[t.xField],i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=_(e[t.yField],e.y,e.value),this.color=d(e[t.colorField],e.color))}_readSingle(t){this.y=t}}class Ke{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]}contains(t){return this._points.indexOf(t)>=0}load(t){h(t)?this._points=this._owner.createPoints(t):this._points=[]}getProps(t){return this._points.map((e=>e.getProp(t)))}getValues(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;return s?this._points.slice(Math.floor(s.start),Math.ceil(s.end)+1):this._points}}class Qe extends It{constructor(t){super(t.chart),this.series=t,this.text="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.offset=8,this.hideDelay=Qe.HIDE_DELAY,this.minWidth=100,this.minHeight=40}getValue(t,e,s,i){const r=t.getPointTooltip(e,s);if(l(r)){const t=i||this.numberFormat;return t?Lt.getFormatter(t).toStr(r):r}return r}}var Je,ts,es,ss,is,rs,ns,as;Qe.HIDE_DELAY=700,function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}(Je||(Je={}));class hs extends Se{constructor(){super(...arguments),this.position=Je.POINT,this.step=1}getPosition(){return this.position===Je.POINT||this.position===Je.EDGE?this.position:this.axis._isX?Je.POINT:Je.EDGE}}class os extends Pe{getTick(t,e){return null!=e?this._getText(e,e,!1):""}}class ls extends fe{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 cs extends Ee{constructor(){super(...arguments),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1}getCategories(){return this._cats}getCategory(t){return this._cats[t]}categoryAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return e-2+(this._zoom?Math.floor(this._zoom.start):0);return-1}getWdith(t,e){return 0}categoryPad(){return this._catPad}type(){return"category"}isContinuous(){return!1}_createGrid(){return new ls(this)}_createTickModel(){return new hs(this)}_createLabelModel(){return new os(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=J.makeIntArray(0,this._categories.length)}_doPrepareRender(){this._cats=[],this._weights=[],this._minPad=u(this.minPadding,this.padding,0),this._maxPad=u(this.maxPadding,this.padding,0),this._catPad=c(this.categoryPadding,0)}_doBuildTicks(t,e,s){const i=this.label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[];for(t=this._min=Math.floor(t),e=this._max=Math.ceil(e);r.length<=e;)r.push(String(r.length)),n.push(1);r=this._cats=r.slice(t,e+1),n=n.slice(t,e+1);const o=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);if(o>0){const s=this._pts=[0];let l=this._minPad;for(let i=t;i<=e;i++)s.push(l/o),l+=n[i-t];s.push(l/o),s.push((l+this._maxPad)/o);for(let e=1;e<s.length-2;e+=a){const s=t+e-1;h.push({pos:NaN,value:s,label:i.getTick(e-1,r[e-1])})}}else this._pts=[];return 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)e>0&&(this._pts=s.map((e=>e/t*b)));else{let t;t=this.tick.getPosition()===Je.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPosition(t,e,s=!0){e-=this._min,s&&(e+=.5);const i=Math.floor(e),r=this._pts[i+1]+(this._pts[i+2]-this._pts[i+1])*(e-i);return this.reversed?t-r:r}getValueAt(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._min+t-1}getUnitLength(t,e){const s=Math.floor(e-this._min);return this._pts[s+2]-this._pts[s+1]}getValue(t){return l(t)?t:this._map[t]}$_collectCategories(t){const e=this.categories,s=this._categories=[];if(h(e)&&e.length>0)this._len=0,e.forEach((t=>{let e,i=null==t?1:c(t.weight,1);e=null==t?null:o(t)?t:t.name||t.label,this._len+=i,s.push({c:e,w:i})}));else if(h(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)s.find((t=>t.c===e))||s.push({c:e,w:1})}this._map={},s.forEach(((t,e)=>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"}(ts||(ts={}));class us extends zt{constructor(t){super(t,!1),this.position=ts.AUTO,this.offset=4,this.distance=25}getText(t){if(J.isValidNumber(t)){return this._getText(null,t,Math.abs(t)>1e3,!0)}return t}_doLoad(t){super._doLoad(t)}}!function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(es||(es={}));class ds extends s{constructor(){super(...arguments),this.interval=5,this.type="simple"}}class _s extends It{constructor(t){super(t.chart),this.series=t,this.type=es.LINEAR,this.lineType=We.DEFAULT,this.movingAverage=new ds,this.visible=!1}_doPrepareRender(t){(this["$_"+this.type]||this.$_linear).call(this,this.series._runPoints,this._points=[])}$_linear(t,e){const s=t.length;if(s>1){let i=0,r=0,n=0,a=0,h=0;t.forEach((t=>{i+=t.xValue,r+=t.yValue,n+=t.xValue*t.xValue,a+=t.yValue+t.yValue,h+=t.xValue*t.yValue}));const o=(s*h-i*r)/(s*n-i*i),l=(r-o*i)/s;e.push({x:t[0].xValue,y:o*t[0].xValue+l}),e.push({x:t[s-1].xValue,y:o*t[s-1].xValue+l})}}$_logarithmic(t,e){}$_polynomial(t,e){}$_power(t,e){}$_exponential(t,e){}$_movingAverage(t,e){const s=this.movingAverage,i=t.length,r=Math.max(1,Math.min(i,s.interval));let n=r-1;for(;n<=i;){n+=1;const s=t.slice(n-r,n).reduce(((t,e)=>t+e.yValue),0);n<=i&&e.push({x:t[n-1].xValue,y:s/r})}}}class gs extends It{static _loadSeries(t,e,s){return new(t._getSeriesType(e.type)||t._getSeriesType(s||t.type))(t,e.name).load(e)}constructor(t,e){super(t),this._row=0,this._col=0,this.index=-1,this._simpleMode=!1,this.zOrder=0,this.clipped=!1,this.visibleInLegend=!0,this.visibleInNavigator=!1,this.name=e,this.pointLabel=new us(t),this.trendline=new _s(this),this.tooltip=new Qe(this),this._points=new Ke(this),this._pointArgs=this._createPointArgs()}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}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,ze.MARKER_SIZE)),this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}ignoreAxisBase(t){return!1}canMixWith(t){return!0}getBaseValue(t){return NaN}canMinPadding(t){return!0}canMaxPadding(t){return!0}hasMarker(){return!1}setShape(t){}createPoints(t){return t.map(((t,e)=>{const s=this._createPoint(t);return s.index=e,s.parse(this),s.isNull||(s.isNull=null==t||null==s.y),s}))}getXStart(){let t=this._xAxisObj.getValue(this.xStart);const e=isNaN(t)?this._xAxisObj.getValue(this.chart.options.xStart):t;return this._xAxisObj._zoom?e+Math.floor(this._xAxisObj._zoom.start):e}getXStep(){return d(this.xStep,this.chart.options.xStep)}prepareRender(){this._calcedColor=void 0,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._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this._runRanges=G(this.ranges,this._xAxisObj.axisMin(),this._xAxisObj.axisMax()),super.prepareRender()}collectCategories(t){if(t instanceof cs){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getValues(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.getXStart()||0,i=this.getXStep()||1;o(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)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectVisibles(){const t=this._runPoints.filter((t=>t.visible)),e=t.length;if(e>0){let s=t[0].yValue,i=s;t[0].vindex=0;for(let r=1;r<e;r++){const e=t[r];e.vindex=r,e.yValue>i?i=e.yValue:e.yValue<s&&(s=e.yValue)}t.forEach(((t,e)=>{t.vindex=e,i=Math.max(t.yValue,i)})),this._pointArgs.yMin=this._minValue=s,this._pointArgs.yMax=this._maxValue=i}return t}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t)))}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){t.series=this.name||this.index,t.count=this._points.count}_getPointCallbackArgs(t,e){e.assignTo(t)}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointTooltip(t,e){switch(e){case"series":return this.displayName();case"name":return this._xAxisObj instanceof cs?this._xAxisObj.getCategory(t.index):t.x;case"x":return t.x||(this._xAxisObj instanceof cs?this._xAxisObj.getCategory(t.index):"");case"y":return t.y;case"xValue":return t.xValue;case"yValue":return t.yValue;default:return e}}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}_createPoint(t){return new Ze(t)}_createLegendMarker(t,e){return Xe.create(t,gs.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_getField(t){return t===this._xAxisObj?this.xField:this.yField}_colorByPoint(){return!1}_doLoad(t){super._doLoad(t);const e=this._loadData(t);h(e)&&e.length>0&&this._doLoadPoints(e)}_loadData(t){return t[this.dataProp||"data"]}_doLoadPoints(t){this._points.load(t)}loadPoints(t){this._points.load(t)}_doPrepareRender(){let t,e;!1===this.pointColors?t=this.color:h(this.pointColors)?e=this.pointColors:this._colorByPoint()?e=this.chart.colors:t=this.color,this._runPoints.forEach(((s,i)=>{!s.color&&e&&(s.color=t||e[i%e.length])})),this._preparePointArgs(this._pointArgs)}prepareAfter(){this.trendline.visible&&this.trendline.prepareRender()}}gs.LEGEND_MARKER="rct-legend-item-marker";class ps{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)}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 e=this.chart,s=this._items=[],i=this._series=[],r=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach(((t,e)=>{t.index=e,t instanceof Vs?i.push(...t.series):t instanceof gs&&i.push(t)})),this._widget=!0,i.forEach((t=>{!this._widget||t instanceof xs||(this._widget=!1),t.name&&(r[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}}))}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(it[e++%it.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 bs&&(t._single=1===s)})),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=h(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getSeriesType(e.type||t.type),!i)throw new Error("Invalid series type: "+e.type+", "+t.type);const r=new i(t,e.name||`Series ${s+1}`);return r.load(e),r.index=s,r}}!function(t){t.DEFAULT="default",t.VISIBLE="visible",t.HIDDEN="hidden"}(ss||(ss={}));class ms extends It{constructor(t){super(t.chart),this.series=t,this.radius=3}}class ws extends Ze{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return d(this.x,this.y)}}class xs extends gs{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:M(this._centerXDim,t),y:M(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===ts.AUTO?ts.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)}_doLoad(t){super._doLoad(t),this._centerXDim=L(_(this.centerX,this.center,xs.CENTER),!0),this._centerYDim=L(_(this.centerY,this.center,xs.CENTER),!0)}}xs.CENTER="50%";class fs extends xs{constructor(){super(...arguments),this.radius=fs.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return M(this._radiusDim,Math.min(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=L(d(this.radius,fs.DEF_RADIUS),!0)}}fs.DEF_RADIUS="40%";class bs extends gs{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===ts.AUTO?ts.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 ys extends bs{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=c(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}}class vs extends bs{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)}))}}!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(is||(is={}));class Vs extends It{constructor(){super(...arguments),this.layoutMax=100,this.index=-1,this._series=[],this._visibles=[],this.layout=is.DEFAULT,this.visibleInLegend=!0,this.zOrder=0}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}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case is.STACK:this.$_collectStack(t,e);break;case is.FILL:this.$_collectFill(t,e);break;case is.DEFAULT:case is.OVERLAP:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}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}ignoreAxisBase(t){for(const e of this._visibles)if(e.ignoreAxisBase(t))return!0}getLegendSources(t){!1!==this.visibleInLegend&&this._series.forEach((e=>e.getLegendSources(t)))}canMinPadding(t){return!0}canMaxPadding(t){return this.layout!==is.FILL}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(){this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.zOrder||0)-(+e.zOrder||0))),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,e){const s=this._seriesType();h(e)?e.forEach(((e,i)=>this.$_add(gs._loadSeries(t,e,s)))):a(e)&&this.$_add(gs._loadSeries(t,e,s))}$_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()){let s=0;for(const e of t)s+=e.yValue||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()){let r=0;for(const e of t)r+=Math.abs(e.yValue)||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 Ss extends Vs{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Ps extends Vs{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 ks extends gs{}!function(t){t.NORMAL="normal",t.MIXED="mixed",t.RANDOM="random"}(rs||(rs={}));class As extends It{constructor(t){super(null),this.assets=new St,t&&this.load(t)}activate(t){}deactivate(t){}_doLoadProp(t,e){if("assets"===t)return this.assets.load(e),!0}}class Es{constructor(){this._items=[]}load(t){if(this._items=[],h(t))t.forEach((t=>{let e=this.$_loadItem(t);e&&this._items.push(e)}));else if(a(t)){let e=this.$_loadItem(t);e&&this._items.push(e)}}$_loadItem(t){if(a(t)&&t.name)return new As(t)}}class Cs extends It{constructor(){super(...arguments),this.text="Title",this.alignBase=H.PLOT,this.align=$.CENTER}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(ns||(ns={}));class Ls extends Cs{constructor(){super(...arguments),this.position=ns.BOTTOM,this.verticalAlign=F.BOTTOM,this.text=""}}class Ts extends Se{constructor(){super(...arguments),this.stepPixels=72,this.baseRange=!1}buildSteps(t,e,s,i,r=!1){var n,a;let h;return this._step=NaN,h=r?this._getStepsByPixels(t,c(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?this.steps.slice(0):this._baseAxis instanceof Os?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i):this.stepInterval>0?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 Os&&(this._baseAxis=e,e.tick._baseAxis=null)}}_getStepsByCount(t,e,s,i){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),isNaN(e)&&this.integral;let r=(i-s)/(t-1);const n=Math.pow(10,Math.floor(Math.log10(r))),a=[];if(r=this._step=Math.ceil(r/n)*n,isNaN(e))s>Math.floor(s/n)*n?s=Math.floor(s/n)*n:s<Math.ceil(s/n)*n&&(s=Math.ceil(s/n)*n);else{for(R(s<e&&i>e,"base error"),t=Math.max(3,t);;){if(!(S((e-s)/r)+S((i-e)/r)+1>t))break;r+=n}s=e-S((e-s)/r)*r}a.push(s);for(let e=1;e<t;e++)a.push(P(a[e-1]+r));return a}_getStepsByInterval(t,e,s,i){const r=[];let n;if(isNaN(e))for(r.push(n=s);n<i;)r.push(n+=t);else{for(r.push(n=e);n>s;)r.unshift(n-=t);for(n=e;n<i;)r.push(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=Math.max(1,Math.floor(t/e))+1,o=n/(h-1);const l=Math.pow(10,Math.floor(Math.log10(o))),c=this._getStepMultiples(l);let u,d=0;if(o/=l,c)if(o>c[d]){for(;d<c.length-1;d++)if(o>c[d]&&o<c[d+1]){o=c[++d];break}}else o=c[d];if(o*=l,isNaN(s))i>Math.floor(i/o)*o?i=Math.floor(i/o)*o:i<Math.ceil(i/o)*o&&(i=Math.ceil(i/o)*o);else{for(R(i<=s&&r>=s,"base error"),h=Math.max(3,h);d<c.length;){if(!(S((s-i)/o)+S((r-s)/o)+1>h))break;o=d<c.length-1?c[d+1]*l:2*o,d++}i=s-S((s-i)/o)*o}for(this._step=o,a.push(P(u=i));u<r;)a.push(P(u+=o));return a}}class Ms extends Pe{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100)}}class Ns extends me{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16,this.gridVisible=!0}getSize(t){return M(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=c(this.space,0),this._sizeDim=L(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}(as||(as={}));class Os extends Ee{constructor(){super(...arguments),this.nullable=!0,this.padding=.05,this.startFit=as.DEFAULT,this.endFit=as.DEFAULT,this.breaks=[]}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===as.DEFAULT?this._isX?as.VALUE:as.TICK:this.startFit}getEndFit(){return this.endFit===as.DEFAULT?this._isX?as.VALUE:as.TICK:this.endFit}isContinuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createTickModel(){return new Ts(this)}_createLabelModel(){return new Ms(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._base=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 Os;let{min:n,max:a}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),h=this._base;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(isNaN(this.strictMin)&&this.getStartFit()!==as.VALUE){if(!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]}else for(;o.length>1&&n>o[0];)o.shift();if(isNaN(this.strictMax)&&this.getEndFit()!==as.VALUE){if(!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]}else for(;a<o[o.length-1]&&o.length>1;)o.pop();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}_getTickLabel(t,e){return this.label.getTick(t,e)||String(e)}_createTick(t,e,s){return{pos:NaN,value:s,label:this._getTickLabel(e,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}getPosition(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}}getValueAt(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}getUnitLength(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=!1,i=!1;this._series.forEach((r=>{const n=r.getBaseValue(this);isNaN(n)||(isNaN(this.minValue)&&n<=t?(t=n,s=!0):isNaN(this.maxValue)&&n>=e&&(e=n,i=!0)),s||r.canMinPadding(this)||(s=!0),i||r.canMaxPadding(this)||(i=!0)}));let r=0,n=0;isNaN(this.strictMin)?this.minValue<t?t=this.minValue:s||(r=u(this.minPadding,this.padding,0)):t=this.strictMin,isNaN(this.strictMax)?this.maxValue>e?e=this.maxValue:i||(n=u(this.maxPadding,this.padding,0)):e=this.strictMax;let a=Math.max(0,e-t);return t-=a*(this._minPad=r),e+=a*(this._maxPad=n),{min:t,max:e}}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&t.clusterable()&&e.push(...t.getVisiblePoints())}));const s=this._isX,i=e.map((t=>s?t.xValue:t.yValue)).sort();let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=Math.min(i[t]-i[t-1]);return t*=r/(this._max-this._min),this._unitLen=c(t,1)}$_loadBreak(t){if(a(t)&&"from"in t&&"to"in t)return new Ns(this).load(t)}$_loadBreaks(t){if(h(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(Object.assign(new Ns(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(Object.assign(new Ns(this),a))}}var s}}class Ds extends Os{type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return 1===i.length&&i[0]instanceof Vs&&i[0].layout===is.FILL&&(s.max=i[0].layoutMax),s}}class Rs extends Ts{_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}}const Bs=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Is=[[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]];class $s extends Ts{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}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Bs[e]&&t<Bs[e+1]/2)return this.scale=e,Is[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=Math.max(1,Math.floor(a/(l-1)));const u=this._getStepMultiples(c),d=Bs[this.scale];if(c/=d,u)if(c>u[0]){let t=0;for(;t<u.length-1;t++)if(c>u[t]&&c<u[t+1]){c=u[t+1];break}}else c=u[0];const _=h.date(i),g=h.date(r);let p,m=_;if(7===this.scale){const t=o.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=g)}else if(6===this.scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<o&&new Date(t,e+c)>o&&(m=new Date(o.getFullYear(),o.getMonth()));do{n.push(+m),e+=c,m=new Date(t,e)}while(m<=g)}else if(4===this.scale||5===this.scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this.scale?7:1;this._step=c=Math.ceil(c),m=new Date(t,e,s),m<o&&new Date(t,e,s+i*c)>o&&(m=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+m),s+=c*i,m=new Date(t,e,s)}while(m<=g)}else{switch(this._step=c,c*=d,this.scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}p=m.getTime();const t=o.getTime();p<t&&p+c>t&&(p=t);do{n.push(p),p+=c}while(p<=r)}return n}}const Fs=[{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 zs extends Pe{constructor(){super(...arguments),this.useBeginningFormat=!0,this.startOfWeek=0}_doLoad(t){super._doLoad(t);const e=o(this.timeFormat)?this.timeFormat:void 0,s=o(this.beginningFormat)?this.beginningFormat:void 0,i=this.timeFormats,r=this.useBeginningFormat;if(this._formats=Fs.map((t=>Object.assign(t))),h(i))for(let t=0;t<i.length;t++){const n=this._formats[t];if(e)n.format=e,n.beginningFormat=s||e;else{const e=i[t];o(e)?(n.format=e,r||(n.beginningFormat=e)):a(e)&&(o(e.format)&&(n.format=e.format),o(e.beginningFormat)?n.beginningFormat=e.beginningFormat:r||(n.beginningFormat=n.format))}}}getTick(t,e){const s=this.axis,i=this._formats,r=s.tick.scale,n=s.date(e);switch(r){case 7:return he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 6:return 0===t||0===n.getMonth()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 5:case 4:return 0===t||1===n.getDate()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 3:return 0===t||0===n.getHours()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 2:return 0===t||0===n.getMinutes()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 1:return 0===t||0===n.getSeconds()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek);case 0:return 0===t||0===n.getMilliseconds()?he.getFormatter(i[r].beginningFormat).toStr(n,this.startOfWeek):he.getFormatter(i[r].format).toStr(n,this.startOfWeek)}}}class Hs extends Os{constructor(t,e,s){super(t,e,s),this.timeOffset=0,this.baseValue=NaN}type(){return"time"}_createTickModel(){return new $s(this)}_createLabelModel(){return new zs(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*c(this.timeOffset,0)*60*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}getValue(t){return l(t)?t+this._offset:t instanceof Date?t.getTime():o(t)?new Date(t).getTime():void 0}incStep(t,e){if(!o(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"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)}getAxisValueAt(t,e){return new Date(this.getValueAt(t,e))}}class Gs extends Fe{constructor(t){super(t),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=L(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=L(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=L(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=L(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=L(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=L(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=L(this._size=t,!0))}getSize(t,e){return{width:M(this._widthDim||this._sizeDim,t,t),height:M(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return M(this._leftDim,t)}getRight(t){return M(this._rightDim,t)}getTop(t){return M(this._topDim,t)}getBottom(t){return M(this._bottomDim,t)}}class js extends Gs{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 Ws extends Gs{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,e){const s=this._gaugesType();h(e)?e.forEach(((e,i)=>this.$_add(js._loadGauge(t,e,s)))):a(e)&&this.$_add(js._loadGauge(t,e,s))}$_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 Ys{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 js)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],i=this._map={};h(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):a(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(i[t.name]=t),t instanceof Ws)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(i[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,s){let i=h(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i){const r=new i(t);return r.load(e),r.index=s,r}if(i=t._getGaugeType(e.type||t.gaugeType),!i)throw new Error("Invalid gauge type: "+e.type);const r=new i(t,e.name||`Gauge ${s+1}`);return r.load(e),r.index=s,r}}class Xs extends js{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 Us extends It{constructor(t){super(t.chart),this.scale=t,this.reversed=!1,this.length=7}}class qs extends It{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=Zs.DEFAULT,this.stepPixels=48,this.line=new It(t.chart,!0),this.tick=new Us(this),this.tickLabel=new It(t.chart)}get gap(){return this._gap}set gap(t){this._gap=c(t,0)}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=c(s,e);const{min:i,max:r}=this._adjustMinMax(Math.min(e,s),Math.max(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(Math.max(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=Math.min(t,e),this._max=Math.max(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=Math.min(...t)),isNaN(i)&&(i=Math.max(...t)),this._min=Math.min(s,i),this._max=Math.max(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(P(e));for(let e=1;e<t;e++)n.push(P(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(P(l=s));;){if(l+=a,l>=i){r.push(P(i));break}r.push(P(l))}return r}}var Zs,Ks,Qs,Js;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}(Zs||(Zs={}));class ti extends It{}class ei extends It{constructor(t,e=!1){super(t.chart,e),this.gauge=t,this.position=Zs.DEFAULT,this.gap=5,this.itemGap=0,this.rangeLabel=new ti(t.chart,!1),this.tickLabel=new It(t.chart,!0)}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickDim=L(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?M(this._thickDim,t,0):this.position===Zs.INSIDE?t:ei.DEF_THICKNESS}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=G(this._ranges,t.min,t.max)||[]}return this._runRanges}}ei.DEF_THICKNESS=7;class si extends zt{constructor(t){super(t,!0),this.animatable=!0}}class ii extends qs{}class ri extends si{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:M(this._offsetXDim,t,0),y:M(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=L(this.offsetX,!0),this._offsetYDim=L(this.offsetY,!0),this}}class ni{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ai.DEF_CENTER),this.setCenterY(ai.DEF_CENTER),this.setRadius(ai.DEF_RADIUS),this.setInnerRadius(ai.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=L(d(t,ai.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=L(d(t,ai.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=L(d(t,ai.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=L(d(t,ai.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=L(t,!0))}getCenter(t,e){return{x:M(this._centerXDim,t,t/2),y:M(this._centerYDim,e,e/2)}}getExtents(t){const e=M(this._radiusDim,t,t/2),s=Math.min(e,this._innerDim?M(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?M(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=c(t%360,0),i=Math.max(0,Math.min(360,c(e,360)));this._startRad=y+v*s,this._handRad=v*s,this._sweepRad=v*i}}class ai extends Xs{constructor(t){super(t),this.props=new ni,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new ri(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 ni)}_doPrepareRender(t){super._doPrepareRender(t);const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}ai.DEF_CENTER="50%",ai.DEF_RADIUS="40%",ai.DEF_INNER="80%";class hi extends Ws{constructor(){super(...arguments),this.props=new ni,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 oi extends It{constructor(t){super(t.chart,!0),this.gauge=t}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=G(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class li extends oi{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=L(this.segmentThickness,!0))}getSegmentThickness(t){return M(this._thickDim,t,t)}}class ci extends oi{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=L(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class ui extends It{constructor(t){super(t.chart,!1)}}class di extends It{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=L(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=L(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=L(t,!0))}getExtents(t){return{radius:M(this._radiusDim,t,0),length:M(this._lengthDim,t,0),offset:M(this._offsetDim,t,0)}}}class _i extends It{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=L(t,!0))}getRadius(t){return M(this._radiusDim,t,0)}}class gi extends qs{constructor(){super(...arguments),this.stepPixels=72}_getStepMultiples(t){return[1,2,2.5,5,10]}}class pi extends hi{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class mi extends It{constructor(t){super(t.chart),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=L(this.thickness,!0))}getThickness(t){return M(this._thickDim,t,t)}}class wi extends It{constructor(t,e,s){super(t.chart),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=L(t,!0))}getLength(t){return M(this._lengthDim,t,t)}}class xi extends wi{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class fi extends It{constructor(t,e){super(t.chart),this.length=e}}class bi extends It{constructor(t){super(t.chart),this.step=1,this.offset=1}}class yi extends It{constructor(t,e){super(t.chart),this.raidus=e}}class vi extends zt{constructor(t){super(t.chart,!0),this.position="top",this.text="RealChart Clock<br>ver1.0"}}class Vi extends Ze{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Si extends Ze{}class Pi extends ys{constructor(){super(...arguments),this.borderRaidus=0,this.colorByPoint=!1}_type(){return"bar"}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new Si(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class ki extends Ps{constructor(){super(...arguments),this.baseValue=0}_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof Pi}canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:c(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===is.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,is.STACK}}class Ai extends mt{constructor(t,e=x,s=x){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){J.isNumber(t)?this.setPath(nt.line(t,e,s,i)):t&&this.setPath(nt.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(nt.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(nt.line(t,e,t,s))}setHLine(t,e,s){this.setPath(nt.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(nt.line(e,t,s,t))}}class Ei extends mt{constructor(t,e){super(t,e),this.setStyle("fill","none")}setPoints(...t){this.setPath(nt.lines(...t))}resetStyles(t){const e=super.resetStyles(t);return this.setStyle("fill","none"),e}}class Ci extends dt{constructor(t,e){super(t,gs.LEGEND_MARKER),this._size=e,this.add(this._marker=new mt(t)),this.setShape(st.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){nt.setShape(this._marker,this._shape,t/2),this._marker.translate(this._markerOffset(t),0)}_markerOffset(t){return 0}}class Li extends Ci{constructor(t,e){super(t,e),this.insertFirst(this._line=new Ai(t))}_renderShape(t){var e;super._renderShape(t),null===(e=this._line)||void 0===e||e.setHLine(t/2,0,2*t)}_markerOffset(t){return t/2}}class Ti extends Ze{}class Mi extends ms{constructor(){super(...arguments),this.radius=4,this.firstVisible=ss.DEFAULT,this.lastVisible=ss.DEFAULT,this.minVisible=ss.DEFAULT,this.maxVisible=ss.DEFAULT}}class Ni extends gs{constructor(){super(...arguments),this.marker=new Mi(this),this.nullAsBase=!1}getShape(t){return t&&t.shape||this.marker.shape||this._shape}getRadius(t){return c(t.radius,this.marker.radius)}_createPoint(t){return new Ti(t)}hasMarker(){return!0}setShape(t){this._shape=t}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ks||(Ks={}));class Oi extends Ni{constructor(){super(...arguments),this.lineType=We.DEFAULT,this.stepDir=Ks.FORWARD,this.connectNullPoints=!1,this.baseValue=0}_type(){return"line"}getLineType(){return this.lineType}_createLegendMarker(t,e){return new Li(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.getShape(null),Math.min(ze.MARKER_SIZE,2*this.marker.radius)),e}}class Di extends Ti{}class Ri extends Oi{_type(){return"area"}_createPoint(t){return new Di(t)}_doPrepareRender(){super._doPrepareRender(),this._base=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t._isX?NaN:this._base}}class Bi extends Di{parse(t){super.parse(t),this.y=this.high=d(this.high,this.low),this.lowValue=parseFloat(this.low),this.highValue=this.yValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.highValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.high=e[c(t.highField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.high=d(e[t.lowField],e.high)}_readSingle(t){super._readSingle(t),this.low=this.y}}class Ii extends Vs{constructor(){super(...arguments),this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof Oi}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class $i extends Vs{constructor(){super(...arguments),this.baseValue=0}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof Ri}getBaseValue(t){return t===this._yAxisObj?c(this.baseValue,t.getBaseValue()):NaN}}class Fi extends Di{}class zi extends Ze{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return Object.assign(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})}_readArray(t,e){const s=e.length>5?1:0;this.min=e[c(t.minField,0+s)],this.low=e[c(t.lowField,1+s)],this.mid=e[c(t.midField,2+s)],this.high=e[c(t.highField,3+s)],this.y=e[c(t.yField,4+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.min=d(e[t.minField],e.min),this.low=d(e[t.lowField],e.low),this.mid=d(e[t.midField],e.mid),this.high=d(e[t.highField],e.high),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),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)||isNaN(this.highValue))}}class Hi extends Ze{getLabel(t){return this.z}parse(t){super.parse(t),this.zValue=parseFloat(this.z)}_assignTo(t){return Object.assign(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(null===e)this.isNull=!0;else{const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.z=e[c(t.zProp,1+s)],s>0&&(this.x=e[c(t.xField,0)])}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=d(e[t.zProp],e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}}!function(t){t.WIDTH="width",t.AREA="area"}(Qs||(Qs={}));class Gi extends Ze{parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high})}_readArray(t,e){const s=e.length>4?1:0;this.low=e[c(t.lowField,0+s)],this.open=e[c(t.openField,1+s)],this.close=e[c(t.closeField,2+s)],this.y=this.high=e[c(t.highField,3+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.row),this.open=d(e[t.openField],e.open),this.close=d(e[t.closeField],e.close),this.high=d(e[t.highField],e.high),isNaN(this.high)?isNaN(this.y)||(this.high=this.y):this.y=this.high}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.high=this.y}}class ji extends vs{_type(){return"candlestick"}canCategorized(){return!0}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;case"close":return t.close;case"closeValue":return t.closeValue;case"open":return t.open;case"openValue":return t.openValue;case"high":return t.high;case"highValue":return t.highValue;default:return super.getPointTooltip(t,e)}}_createPoint(t){return new Gi(t)}_getBottomValue(t){return t.lowValue}}class Wi extends ms{constructor(){super(...arguments),this.radius=4,this.shape=st.CIRCLE}}class Yi extends Ze{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.lowValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Xi extends Ze{}class Ui extends Ze{labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return Object.assign(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[c(t.lowField,0+s)],this.y=e[c(t.yField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=d(e[t.lowField],e.low),this.y=_(e[t.yField],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))}}class qi extends ws{}class Zi extends xs{constructor(t,e){super(t,e),this.width=Zi.DEF_WIDTH,this.height=Zi.DEF_HEIGHT,this.neckWidth=Zi.DEF_NECK_WIDTH,this.neckHeight=Zi.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:Math.max(.1*t,M(this._widthDim,t)),height:Math.max(.1*e,M(this._heightDim,e))}}getNeckSize(t,e){return{width:J.clamp(M(this._neckWidthDim,t),.1*t,t),height:J.clamp(M(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}getPointTooltip(t,e){return"height"===e?t.height:super.getPointTooltip(t,e)}_createPoint(t){return new qi(t)}load(t){return super.load(t),this._widthDim=T(this.width,Zi.DEF_WIDTH),this._heightDim=T(this.height,Zi.DEF_HEIGHT),this._neckWidthDim=T(this.neckWidth,Zi.DEF_NECK_WIDTH),this._neckHeightDim=T(this.neckHeight,Zi.DEF_NECK_HEIGHT),this}}Zi.DEF_WIDTH="85%",Zi.DEF_HEIGHT="90%",Zi.DEF_NECK_WIDTH="30%",Zi.DEF_NECK_HEIGHT="30%";class Ki extends Ze{parse(t){super.parse(t),this.heatValue=parseFloat(this.heat),this.isNull||(this.isNull=isNaN(this.heatValue))}_assignTo(t){return Object.assign(super._assignTo(t),{heat:this.heat,heatValue:this.heatValue})}_readArray(t,e){const s=e.length>2?1:0;this.y=e[c(t.yField,0+s)],this.heat=e[c(t.heatField,1+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.heat=d(e[t.heatField],e.color)}_readSingle(t){super._readSingle(t)}getLabel(t){return this.heat}}class Qi extends Ze{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return Object.assign(super._assignTo(t),{min:this.min,max:this.max})}}!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(Js||(Js={}));const Ji={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 tr extends ms{constructor(){super(...arguments),this.radius=4,this.shape=st.CIRCLE}}class er extends Ze{}class sr extends Gi{}class ir extends Ze{}class rr extends ws{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get endAngle(){return this.startAngle+this.angle}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return Object.assign(super._assignTo(t),{sliced:this.sliced})}}class nr extends zt{constructor(){super(null,!0)}}class ar extends fs{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new nr}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?M(this._sliceDim,t):0}_type(){return"pie"}_createPoint(t){return new rr(t)}_doLoad(t){super._doLoad(t),this._innerDim=L(this.innerRadius,!0),this._sliceDim=L(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=c(this.startAngle%360,0),e=Math.max(0,Math.min(360,c(this.totalAngle,360)));this._startRad=y+v*t,this._totalRad=v*e,this._groupPos=NaN}}class hr extends Vs{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return M(this._polarDim,Math.min(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 ar}_doLoad(t){super._doLoad(t),this._polarDim=L(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=L(this.innerSize,!0)}_doPrepareSeries(t){if(this.layout===is.STACK||this.layout===is.FILL){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+c(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=c(t.groupSize,1)/e}))}}}class or extends Ze{}class lr extends Ze{_assignTo(t){return Object.assign(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){super._readArray(t,e),this.id=k(e[parseInt(t.idField)]),this.group=k(e[parseInt(t.groupField)])}_readObject(t,e){super._readObject(t,e),this.id=k(e[t.idField]),this.group=k(e[t.groupField])}}class cr{constructor(t){this.point=t}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 ur,dr,_r,gr;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(ur||(ur={}));class pr extends Ze{_assignTo(t){return Object.assign(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[c(t.yField,0+s)],this.length=e[c(t.lengthField,1+s)],this.angle=e[c(t.angleField,2+s)],s>0&&(this.x=e[c(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.length=d(e[t.lengthField],e.length),this.angle=d(e[t.angleField],e.angle),this.y=_(e[t.yField],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"}(dr||(dr={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(_r||(_r={}));class mr extends Ze{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 wr extends si{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap="5%"}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=L(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=L(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=L(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=L(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=L(t,!0))}getWidth(t){return M(this._widthDim,t)}getHeight(t){return M(this._heightDim,t)}getMaxWidth(t){return M(this._maxWidthDim,t)}getMaxHeight(t){return M(this._maxHeightDim,t)}getGap(t){return M(this._gapDim,t,0)}}class xr extends Xs{constructor(t){super(t),this.reversed=!1,this.scale=new ii(this),this.label=new wr(this.chart)}isVertical(){return this.group?!this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}calcedMinMax(){return this.scale.range()}}!function(t){t.BAR="bar",t.needle="needle"}(gr||(gr={}));class fr extends It{constructor(t){super(t.chart,!0),this.gauge=t}}class br extends xr{constructor(t){super(t),this.marker=new fr(this),this.band=new ei(this)}_type(){return"linear"}}class yr extends It{constructor(){super(...arguments),this.opposite=!1,this.gap=10}}class vr extends Ws{constructor(t){super(t),this.vertical=!0,this.itemLabel=new yr(this.chart),this.scale=new ii(this),this.itemGap=10,this.label=new wr(t),this.label.gap=10}calcedMinMax(){return this.scale.range()}}class Vr extends vr{constructor(){super(...arguments),this.band=new ei(this,!1)}_type(){return"lineargroup"}_gaugesType(){return"linear"}}class Sr extends It{constructor(t){super(t.chart),this.gauge=t,this.vertical=!1}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=L(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=L(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=G(this._ranges,this.gauge.minValue,this.gauge.maxValue)),this._runRanges}}class Pr extends It{constructor(t){super(t.chart)}}class kr extends It{constructor(t){super(t.chart)}}class Ar extends vr{getRanges(t,e){return G(this.ranges,t,e)}_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}class Er extends It{}class Cr extends It{}const Lr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Tr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Mr={minPadding:0,maxPadding:0};class Nr extends It{constructor(t){super(t,!1),this._thickness=45,this._gap=8,this._gapFar=3,this._dataChanged=!0,this.liveScroll=!0,this.handle=new Er(t),this.mask=new Cr(t),this.borderLine=new It(t)}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 e=this.chart,s={};a(t.series)?s.series=Object.assign((Lr[t.series.type]||Lr.area)(),t.series):s.series=Lr.area(),a(t.xAxis)?s.xAxis=Object.assign((Tr[t.xAxis.type]||Tr.linear)(),t.xAxis,Mr):s.xAxis=Object.assign(Tr.linear(),Mr),a(t.yAxis)?s.yAxis=Object.assign((Tr[t.yAxis.type]||Tr.linear)(),t.yAxis,Mr):s.yAxis=Object.assign(Tr.linear(),Mr),this._naviChart=this.chart._createChart(s),(this._source=e._getSeries().getSeries(this.source)||e.firstSeries)&&this._naviChart.firstSeries.loadPoints(this._source.getPoints().getProxies())}_doPrepareRender(t){this._vertical=!1,this._naviChart.prepareRender()}}class Or extends It{constructor(t){super(t.chart),this.pane=t,this.align=$.CENTER}isVisible(){return this.visible&&!E(this.text)}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}}class Dr extends $e{constructor(t){super(t.chart),this.pane=t,this.radius=x,this.centerX=x,this.centerY=x,this.startAngle=x}}class Rr extends It{constructor(t,e,s){super(t),this.row=e,this.col=s,this.title=new Or(this),this.body=new Dr(this)}}class Br extends It{constructor(t){super(t,!1),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[]}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 h(t)&&t.length>0?(this.rows=Math.max(1,+t[0]),this.cols=Math.max(1,c(+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),a(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)}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)}$_parseSizes(t){let e;return e=h(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(o(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 e={};return t=h(t)?t:a(t)?[t]:null,h(t)&&t.forEach((t=>{const s=+t.row||0,i=+t.col||0;if(i>=0&&i<this._cols&&s>=0&&s<this._rows){const r=new Rr(this.chart,s,i);r.load(t),e[s+","+i]=r}})),e}$_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 Rr(t,e,r);s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}const Ir={bar:ki,line:Ii,area:$i,pie:hr,bargroup:ki,linegroup:Ii,areagroup:$i,piegroup:hr,bump:class extends Ss{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof Oi}_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].yValue=s[t].yGroup=t}return J.makeIntArray(0,t.length)}}},$r={area:Ri,arearange:class extends Ni{constructor(){super(...arguments),this.curved=!1}_type(){return"arearange"}_createPoint(t){return new Bi(t)}getLineType(){return this.curved?We.SPLINE:We.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}},bar:Pi,barrange:class extends vs{_type(){return"barrange"}pointLabelCount(){return 2}_createPoint(t){return new Vi(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends Ri{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!1}_type(){return"bellcurve"}getLineType(){return this.curved?We.SPLINE:We.DEFAULT}_createPoint(t){return new Fi(t)}_loadData(t){const e=super._loadData(t);if(h(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 vs{_type(){return"boxplot"}getPointTooltip(t,e){switch(e){case"min":return t.min;case"minValue":return t.minValue;case"low":return t.low;case"lowValue":return t.lowValue;case"mid":return t.mid;case"midValue":return t.midValue;case"high":return t.high;case"highValue":return t.highValue;default:return super.getPointTooltip(t,e)}}pointLabelCount(){return 2}_createPoint(t){return new zi(t)}_getBottomValue(t){return t.minValue}},bubble:class extends ks{constructor(){super(...arguments),this.sizeMode=Qs.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1}getPixelMinMax(t){return{min:M(this._minDim,t),max:M(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==Qs.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}ignoreAxisBase(t){return!0}getPointTooltip(t,e){switch(e){case"z":return t.z;case"zValue":return t.zValue;default:return super.getPointTooltip(t,e)}}_createPoint(t){return new Hi(t)}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=L(this.minSize,!0),this._maxDim=L(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=Math.min(this._zMin,t.zValue),this._zMax=Math.max(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}},candlestick:ji,dumbbell:class extends bs{constructor(){super(...arguments),this.marker=new Wi(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;default:return super.getPointTooltip(t,e)}}getLabelOff(t){return super.getLabelOff(t)+Math.max(0,this.marker.radius)}_createPoint(t){return new Yi(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 ys{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1,this.backSegments=!1}getSegmentSize(t){return M(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Xi(t)}_doLoad(t){super._doLoad(t),this._segmentDim=L(this.segmentSize,!1)}},errorbar:class extends vs{constructor(){super(...arguments),this.pointPadding=.3}_type(){return"errorbar"}getPointTooltip(t,e){switch(e){case"low":return t.low;case"lowValue":return t.lowValue;default:return super.getPointTooltip(t,e)}}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Ui(t)}_getBottomValue(t){return t.lowValue}},funnel:Zi,heatmap:class extends gs{getColor(t){}_type(){return"heatmap"}getPointTooltip(t,e){switch(e){case"heat":return t.heat;case"heatValue":return t.heatValue;default:return super.getPointTooltip(t,e)}}canMixWith(t){return!1}canCategorized(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new Ki(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.heatValue)||(this._heatMin=Math.min(this._heatMin,t.heatValue),this._heatMax=Math.max(this._heatMax,t.heatValue))}))}},histogram:class extends gs{constructor(){super(...arguments),this.binsNumber=Js.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=c(this.binWidth,0);if(e>0)return t/e;return c(this.binsNumber,0)<1?Ji[this.binsNumber||Js.SQURE_ROOT](t):void 0}_type(){return"histogram"}getPointTooltip(t,e){switch(e){case"min":return t.min;case"max":return t.max;default:return super.getPointTooltip(t,e)}}ignoreAxisBase(t){return t===this._xAxisObj}_createPoint(t){return new Qi(t)}_doLoadPoints(t){function e(t){let e;return e=h(t)?t[c(this.yField,0)]:a(t)?_(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=[];let i=[];for(let s=0;s<t.length;s++){const r=e(t[s]);isNaN(r)||i.push(r)}if(i.length>0){i=i.sort(((t,e)=>t-e)),this.minValue<i[0]&&i.unshift(this.minValue),this.maxValue>i[i.length-1]&&i.push(this.maxValue);const t=i.length,e=i[0],r=i[t-1],n=this.getBinCount(t),a=this._binInterval=(r-e)/n;let h=0,o=e,l=o+a;for(let e=0;e<n;e++){let c=0;if(e==n-1)c=t-h;else for(;h<t&&i[h]<l;)c++,h++;s.push({x:o,y:c,min:o,max:e===n-1?r:l}),o=l,l=o+a}}super._doLoadPoints(s)}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=c(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}},line:Oi,lollipop:class extends ys{constructor(){super(...arguments),this.marker=new tr(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return t+this.marker.radius}_createPoint(t){return new er(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 ji{_type(){return"ohlc"}_createPoint(t){return new sr(t)}},pareto:class extends Ni{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?We.SPLINE:We.DEFAULT}_createPoint(t){return new ir(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+c(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:ar,scatter:class extends ks{constructor(){super(...arguments),this.jitterX=0,this.jitterY=0,this.radius=5}_type(){return"scatter"}ignoreAxisBase(t){return!0}_createPoint(t){return new or(t)}_createLegendMarker(t,e){return new Ci(t,e)}legendMarker(t){const e=super.legendMarker(t);return e.setShape(this.shape,Math.min(ze.MARKER_SIZE,2*this.radius)),e}},treemap:class extends gs{constructor(){super(...arguments),this.idField="id",this.groupField="group",this.algorithm=ur.SQUARIFY,this.alternate=!0,this._map={}}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}))}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];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._leafs}_type(){return"treemap"}getPointTooltip(t,e){switch(e){case"id":return t.id;case"group":return t.group;default:return super.getPointTooltip(t,e)}}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new lr(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 cr(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 u=[];for(;t.length>0;){let d,_,g,p,m;if(d=t.shift(),c+=d.value,p=c*r/i,1===s?(_=p/a,g=a*d.value/c):(g=p/n,_=n*d.value/c),m=Math.max(_/g,g/_),t.length>0&&m>l)return t.unshift(d),c-=d.value,p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),1===s?(e.x+=_,e.width-=_):(e.y+=g,e.height-=g),i-c;if(0===t.length)return p=r*c/i,1===s?(g=a,_=p/g):(_=n,g=p/_),u.push(d),u.forEach((t=>{1===s?(t.setArea(h,o,_,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),0;l=m,u.push(d)}}$_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 gs{constructor(){super(...arguments),this.origin=dr.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=_r.CLOSE}_type(){return"vector"}getPointTooltip(t,e){switch(e){case"length":return t.length;case"lengthValue":return t.lengthValue;case"angle":return t.angle;case"angleValue":return t.angleValue;default:return super.getPointTooltip(t,e)}}ignoreAxisBase(t){return!0}_createPoint(t){return new pr(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)=>Math.max(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case dr.START:case dr.END:t._off=t._len/2;break;default:t._off=0}}))}}},waterfall:class extends vs{constructor(t,e){super(t,e)}_type(){return"waterfall"}getPointTooltip(t,e){switch(e){case"low":return t.low;case"save":return t.save;default:return super.getPointTooltip(t,e)}}canCategorized(){return!0}_createPoint(t){return new mr(t)}_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}}},Fr={category:cs,linear:Ds,time:Hs,date:Hs,log:class extends Os{type(){return"log"}_createTickModel(){return new Rs(this)}_doCalcluateRange(t){const e=super._doCalcluateRange(t);return e.min=Math.log10(e.min),e.max=Math.log10(e.max),e}_createTick(t,e,s){return super._createTick(t,e,Math.pow(10,s))}getPosition(t,e){return e=e>0?Math.log10(e):0,super.getPosition(t,e)}}},zr={circle:class extends ai{constructor(){super(...arguments),this.band=new ei(this),this.scale=new gi(this,!1),this.rim=new li(this),this.valueRim=new ci(this),this.marker=new ui(this),this.hand=new di(this),this.pin=new _i(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 Zs.INSIDE:e.band=r-(n-e.bandThick)/2;break;case Zs.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=Math.max(1,s.tick.length||0),e.scaleLabel=16,s.position){case Zs.OPPOSITE:e.scale=e.inner-s.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;break;case Zs.INSIDE:default:e.scale=r+s.gap}return e}},linear:br,bullet:class extends xr{constructor(t){super(t),this.band=new Sr(this),this.targetBar=new Pr(this),this.actualBar=new kr(this)}getRanges(t,e){return G(this.ranges,t,e)}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends js{constructor(t){super(t),this._active=!0,this.centerX=ai.DEF_CENTER,this.centerY=ai.DEF_CENTER,this.radius=ai.DEF_RADIUS,this.rim=new mi(this),this.hourHand=new wi(this,7,"60%"),this.minuteHand=new wi(this,5,"85%"),this.secondHand=new xi(this,2,"95%"),this.tick=new fi(this,10),this.minorTick=new fi(this,5),this.tickLabel=new bi(this),this.pin=new yi(this,5),this.label=new vi(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:o(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=Math.min(t,e);return{cx:M(this._centerXDim,t,t/2),cy:M(this._centerYDim,e,e/3),rd:M(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=L(d(this.centerX,ai.DEF_CENTER),!0),this._centerYDim=L(d(this.centerY,ai.DEF_CENTER),!0),this._radiusDim=L(d(this.radius,ai.DEF_RADIUS),!0)}}},Hr={circle:pi,linear:Vr,bullet:Ar,circlegroup:pi,lineargroup:Vr,bulletgroup:Ar},Gr={text:class extends Oe{constructor(){super(...arguments),this.text="Title"}isVisible(){return this.visible&&!E(this.text)}_type(){return"text"}_doLoadSimple(t){return o(t)?(this.text=t,!0):super._doLoadSimple(t)}},image:class extends Re{isVisible(){return this.visible&&!E(this.imageUrl)}_type(){return"image"}_doLoadSimple(t){return o(t)?(this.imageUrl=t,!0):super._doLoadSimple(t)}}};class jr extends It{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=$.RIGHT,this.verticalAlign=F.BOTTOM,this.offsetX=2,this.offsetY=1}}class Wr extends It{constructor(){super(...arguments),this.paletteMode=rs.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new jr(null)}}class Yr extends r{constructor(t){super(),this.type="bar",this.gaugeType="circle",this.polar=!1,this._assets=new St,this._themes=new Es,this._options=new Wr(this),this._title=new Cs(this),this._subtitle=new Ls(this),this._legend=new Ye(this),this._split=new Br(this),this._series=new ps(this),this._xAxes=new Ce(this,!0),this._yAxes=new Ce(this,!1),this._xPaneAxes=new Me(this),this._yPaneAxes=new Ne(this),this._gauges=new Ys(this),this._body=new $e(this),this._navigator=new Nr(this),t&&this.load(t)}_createChart(t){return new Yr(t)}startAngle(){return this.body.getStartAngle()}animatable(){return!1!==this._options.animatable}get assets(){return this._assets}get options(){return this._options}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 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}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}isGauge(){return this._gaugeOnly}isPolar(){return this._polar}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)}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){const e=this._xAxes.items,s=this._yAxes.items;let i;if(this.isInverted())switch(t){case z.LEFT:i=e.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.RIGHT:i=e.filter((t=>t._isOpposite));break;case z.BOTTOM:i=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.TOP:i=s.filter((t=>t._isOpposite));break;case z.CENTER:i=e.filter((t=>t._isBetween))}else switch(t){case z.LEFT:i=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.RIGHT:i=s.filter((t=>t._isOpposite));break;case z.BOTTOM:i=e.filter((t=>!t._isOpposite&&!t._isBetween));break;case z.TOP:i=e.filter((t=>t._isOpposite));break;case z.MIDDLE:i=e.filter((t=>t._isBetween))}return i||[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){const e=t.template;if(o(e)){let s=this._templates[e];if(s)return g(s,t)}else h(e)&&e.forEach((e=>{let s=this._templates[e];return s&&(s=g(s,t)),s}));return t}load(t){const e="load chart "+1e6*Math.random();console.time(e),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),this._themes.load(t.themes),this._options.load(t.options),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),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(t.xAxes||t.xAxis||{}),this._yAxes.load(t.yAxes||t.yAxis||{})),this._body.load(t.body||t.plot),this._navigator.load(t.seriesNavigator),console.log("chart-items:",Bt),console.timeEnd(e)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}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(),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._navigator.visible&&this._navigator.prepareRender()}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){this.$_calcAxesPoints(t,e,s,1)}$_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)}))}update(){}$_loadTemplates(t){if(a(t)){const e=this._templates={};for(const s in t){const i=t[s];a(i)&&(e[s]=Object.assign({},i))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&Ir[t.toLowerCase()]}_getSeriesType(t){return o(t)&&$r[t.toLowerCase()]}_getAxisType(t){return o(t)&&Fr[t.toLowerCase()]}_getGaugeType(t){return o(t)&&zr[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&Hr[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Gr[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t){this._fireEvent("onModelChanged",t)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}const Xr=function(t){return isNaN(t)?0:t};class Ur{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return t&&this._path.push("Z"),this._path.join(" ")}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return l(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return l(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return l(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),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 l(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(l(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Xr(t[e]),Xr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Xr(t[e].x),Xr(t[e].y));return this}polygon(...t){return l(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 qr{static empty(){return new qr}static create(t=0,e=0){return new qr(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 qr(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+"}"}}qr.EMPTY=new qr;class Zr{static isBright(t){return new Zr(t).isBright()}static getContrast(t,e,s){return new Zr(t).getContrast(e,s)}static interpolate(t,e,s){const i=(16711680&t)>>16,r=(65280&t)>>8,n=255&t;return(i+(((16711680&e)>>16)-i)*s<<16)+(r+(((65280&e)>>8)-r)*s<<8)+(n+((255&e)-n)*s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(J.startsWith(t,"rgb(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):J.startsWith(t,"rgba(")&&J.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):J.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 Zr(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 Kr,Qr,Jr;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Kr||(Kr={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Qr||(Qr={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Jr||(Jr={}));class tn extends dt{static createCenter(t){const e=new tn(t);return e._layout=Qr.MIDDLE,e}constructor(t,e=x){super(t,e,"text"),this._layout=Qr.TOP,this._overflow=Jr.WRAP,this._dirty=!0,this._text="",this.anchor=Kr.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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}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.getBBounds(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Qr.MIDDLE:i=Math.floor(s/2);break;case Qr.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=Math.max(0,t),(e=Math.min(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(Zr.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}getBBounds(){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}}class en{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new en(t,t,t,t):new en(t,t,e,e):new en(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 en(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=c(t.paddingLeft,0),this.right=c(t.paddingRight,0),this.top=c(t.paddingTop,0),this.bottom=c(t.paddingBottom,0),this}applyMargin(t){return this.left=c(t.marginLeft,0),this.right=c(t.marginRight,0),this.top=c(t.marginTop,0),this.bottom=c(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+"}"}}en.Empty=Object.freeze(new en),en.Temp=new en;class sn extends dt{constructor(t,e=x){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return sn.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}sn.IGNORE_ATTRS={width:"",height:""};class rn extends dt{constructor(t,e=x){super(t,e,"g"),dt.DEBUGGING&&(this.add(this._debugRect=new Xe(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),e!==this.model&&(this.model=e,this._doModelChanged());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 Xe(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 nn extends rn{constructor(t,e,s){super(t,e),this._margins=new en,this._paddings=new en,this.add(this._background=new Xe(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this.setStyleOrClass(e.style),e!==this.model&&(this.model=e,this._doModelChanged()),this._setBackgroundStyle(this._background);const n=this._doMeasure(t,e,s,i,r),a=getComputedStyle(this.dom),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;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 an extends sn{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 hn extends nn{constructor(t){super(t,hn.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new tn(t))}_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._textView.text=e.text;const n=tt(this._textView.getBBounds());if(!e.axis._isHorz&&0!==this._angle){const t=n.width;n.width=n.height,n.height=t}return n}_doLayout(t){this._textView.translateY(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}}hn.TITLE_CLASS="rct-axis-title";class on extends rn{constructor(t){super(t,dn.TICK_CLASS),this.add(this._lineView=new Ai(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLineC(0,0,this.height):this._lineView.setHLineC(0,0,this.width)}}class ln extends tn{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}get rotatedWidth(){const t=this.rotation*v,e=this.getBBounds();return Math.abs(Math.sin(t)*e.height)+Math.abs(Math.cos(t)*e.width)}get rotatedHeight(){const t=this.rotation*v,e=this.getBBounds();return Math.abs(Math.cos(t)*e.height)+Math.abs(Math.sin(t)*e.width)}}class cn extends dt{constructor(t){super(t,void 0),this.add(this._back=new mt(t,"rct-crosshair-flag")),this.add(this._text=new tn(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){this._text.text=e;const s=this._text.getBBounds(),i=new Ur,r=Math.max(t.flag.minWidth||0,s.width+8);i.rect(0,0,r,s.height+4),this._back.setPath(i.end()),this._text.translate(r/2,2)}}}class un extends rn{static isThumb(t){return t.classList.contains(un.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._max=0,this._page=0,this._pos=0,this.add(this._trackView=new Xe(t,un.TRACK_CLASS)),this.add(this._thumbView=new Xe(t,un.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._max=Math.max(0,e),this._page=Math.min(s,e),this._pos=Math.min(e-s,Math.max(0,t.start))}else this._max=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=Math.max(0,Math.min(t,s)))*(e.max-e.min-(e.end-e.start))/s}_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=this._szThumb=c(e.minThumbSize,32),i=this._max,r=this._page,n=this._pos,a=0===this._max;let h=this.width,o=this.height;if(this._vertical){h-=e.gap+e.gapFar,this._trackView.setBounds(e.gap,0,h,o),o-=s;const t=(a||r===i?o:o*r/i)+s;this._reversed,this._thumbView.setBounds(e.gap+1,a?0:this.height-o*n/i-t,h-2,t)}else{o-=e.gap+e.gapFar,this._trackView.setBounds(0,e.gap,h,o),h-=s;const t=(a||r===i?h:h*r/i)+s;this._reversed,this._thumbView.setBounds(a?0:h*n/i,e.gap+1,t,o-2)}}}un.TRACK_CLASS="rct-axis-scrollbar-track",un.THUMB_CLASS="rct-axis-scrollbar-thumb";class dn extends rn{constructor(t){super(t,dn.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._labelViews=[],this.add(this._lineView=new Ai(t,dn.LINE_CLASS)),this.add(this._titleView=new hn(t)),this.add(this._markContainer=new dt(t,"rct-axis-ticks")),this.add(this._labelContainer=new dt(t,"rct-axis-labels"))}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new un(t)),this._scrollView.setVisible(!0),this._scrollView.measure(t,e,i,r,1)[s]):(this._scrollView&&this._scrollView.setVisible(!1),0)}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(t,i)&&(r+=this.$_measureLabelsHorz(i,this._labelViews,e)),this._titleView.setVisible(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(t,i)&&(r+=this.$_measureLabelsVert(i,this._labelViews,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){let i=this.model.guides.filter((t=>!t.front));e.addAll(t,i),i=this.model.guides.filter((t=>t.front)),s.addAll(t,i)}showCrosshair(t,e){let s=this._crosshairView;s||this.add(this._crosshairView=s=new cn(this.doc)),s.setVisible(!0),s.setText(this.model.crosshair,e);const i=s.getBBounds();this.model._isHorz?s.translate(t-i.width/2,this.model.tick.length):s.translate(this.width-this.model.tick.length-i.width,t-i.height/2)}hideCrosshiar(){this._crosshairView&&this._crosshairView.visible&&this._crosshairView.setVisible(!1)}scroll(t){}_doMeasure(t,e,s,i,r){var n;const a=e._isHorz,h=e._isBetween,o=this._titleView,l=this._labelViews;let c=0;return(this._lineView.visible=e.line.visible)?(this._lineView.setStyleOrClass(e.line.style),h&&(this._lineView2?this._lineView2.setVisible(!0):this.insertChild(this._lineView2=new Ai(t,dn.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(e.line.style))):this._lineView2&&this._lineView2.setVisible(!1),this._markLen=e.tick.length||0,this._markLen>0&&(c+=e.tick.margin||0),c+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),h&&(c*=2),this.$_prepareLabels(t,e)?c+=this._labelSize=a?this.$_measureLabelsHorz(e,l,s):this.$_measureLabelsVert(e,l,i):this._labelSize=0,this._simpleMode?o.setVisible(!1):(o.visible&&(c+=a?o.mh:o.mw,c+=+e.title.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(c+=a?this._scrollView.mh:this._scrollView.mw)),qr.create(a?s:c,a?c: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().translate(n[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().translate(s?0:o-h,l-n[e])})));const c=h+(t.tick.margin||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;let n=0,a=0;if(i.visible){const r=this._labelSize,h=+t.title.offset||0,u=+t.title.gap||0;if(i.resizeByMeasured().layout(e),e){if(a+=s?0:c+r+u,t.reversed)switch(t.title.align){case le.START:n=o-i.width/2-h;break;case le.END:n=i.width/2+h;break;case le.MIDDLE:default:n=o/2-h}else switch(t.title.align){case le.START:n=i.width/2+h;break;case le.END:n=o-i.width/2-h;break;case le.MIDDLE:default:n=o/2+h}i.translate(n,a),a+=i.height}else{const e=0===i._angle?i.width:i.height;if(n=s?c+r+u+e/2:o-c-r-u-e/2,t.reversed)if(0===i._angle)switch(t.title.align){case le.START:a=0+h;break;case le.END:a=l-i.height-h;break;case le.MIDDLE:default:a=(l-i.height)/2+h}else switch(t.title.align){case le.START:a=i.width/2-i.height/2+h;break;case le.END:a=l-i.width/2-i.height/2-h;break;case le.MIDDLE:default:a=(l-i.height)/2+h}else if(0===i._angle)switch(t.title.align){case le.START:a=l-i.height-h;break;case le.END:a=0+h;break;case le.MIDDLE:default:a=(l-i.height)/2-h}else switch(t.title.align){case le.START:a=l-i.width/2-i.height/2-h;break;case le.END:a=i.width/2-i.height/2+h;break;case le.MIDDLE:default:a=(l-i.height)/2-h}i.translate(n,a)}}(null==r?void 0:r.visible)&&(e?(r.translate(0,a).resize(this.width,r.mh),r.setScroll(t._zoom,t.reversed)):(r.translate(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 on(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}$_prepareLabels(t,e){const s=this._labelContainer;if(s.visible=e.label.visible){const i=e._ticks,r=i.length,n=this._labelViews;for(;n.length<r;){const e=new ln(t,"rct-axis-label");e.anchor=Kr.START,s.add(e),n.push(e)}for(;n.length>r;)n.pop().remove();return n.forEach(((t,e)=>{t.setVisible(!0),t.value=i[e].value,t.text=i[e].label})),n.length}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz(t,e,s,i,r,n){const a=e.length,h=Math.max(1,i)*Math.max(1,r),o=n||0,l=Math.abs(o)*Math.PI/180;let c=!1;e.forEach((t=>t.rotation=o));for(let i=0;i<a-1;i+=h){let r=0;for(let n=i;n<i+h&&n<a-1;n++)r+=t.getLabelLength(s,e[i].value);if(0===o&&e[i].getBBounds().width>=r){c=!0;break}if(0!==o&&(e[i].getBBounds().width+e[i].getBBounds().height)*Math.cos(l)>=r){c=!0;break}}return c}$_applyStep(t,e,s){const i=t.label,r=Math.max(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.setVisible(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s){const i=t.label;let r,n=+i.step>>0,a=+i.rows>>0,h=+i.rotation%360,o=this.$_checkOverlappedHorz(t,e,s,n,a,h);if(e.forEach((t=>t.row=0)),this._labelRowPts=[0],o){switch(n=a=h=0,i.autoArrange){case ue.ROTATE:h=-45;break;case ue.ROWS:a=this.$_getRows(e);break;case ue.STEP:n=this.$_getStep(e)}if(n>1){const i=e.slice(0);for(;i.length>1&&(e=this.$_applyStep(t,i,n),this.$_checkOverlappedHorz(t,i,s,n,1,0));)n++}else if(a>1){for(;e.length>a&&(e.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz(t,e,s,1,a,0));)a++;this._labelRowPts=[]}else h=-45,e.forEach(((t,e)=>{t.rotation=h,t.index=e})),this.$_checkOverlappedHorz(t,e,s,n,a,h)&&(n=Math.max(2,n++),e=this.$_applyStep(t,e,n),this.$_checkOverlappedHorz(t,e,s,n,a,0)&&e.forEach(((t,e)=>{t.rotation=h})))}else e=this.$_applyStep(t,e,n||1);if(a>1){const t=!isNaN(h)&&0!=h,s=this._labelRowPts;a>1&&e.forEach(((t,e)=>t.row=e%a));for(let t=0;t<a;t++)s.push(0);e.forEach((e=>{s[e.row]=Math.max(s[e.row],t?e.rotatedHeight:e.getBBounds().height)})),s.unshift(0);for(let t=2;t<s.length;t++)s[t]+=s[t-1];return s[s.length-1]}if(isNaN(h)||0==h){r=e[0].getBBounds().height;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].getBBounds().height)}else{r=e[0].rotatedHeight;for(let t=1;t<e.length;t++)r=Math.max(r,e[t].rotatedHeight)}return r}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=Math.max(1,i);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].getBBounds().height>=a)return!0}}$_measureLabelsVert(t,e,s){const i=t.label;let r=Math.max(1,+i.step>>0);if(this.$_checkOverlappedVert(t,e,s,r)){const i=e.slice(0);for(;i.length>1&&r<i.length/2&&(e=this.$_applyStep(t,i,++r),this.$_checkOverlappedHorz(t,i,s,r,1,0)););}else e=this.$_applyStep(t,e,r);let n=e[0].getBBounds().width;for(let t=1;t<e.length;t++)n=Math.max(n,e[t].getBBounds().width);return n}$_layoutLabelsHorz(t,e,s,i,r,n,a){const h=this._labelRowPts;t.forEach((t=>{if(t.visible){const s=t.rotation,r=s*v,o=t.getBBounds(),l=Math.floor(t.getAscent(o.height));let c=e[t.index].pos,u=i?n-a-o.height-h[t.row]:a+h[t.row];s<-15&&s>=-90?(t.anchor=Kr.END,c+=-Math.sin(r)*l/2-1,u+=Math.cos(r)*l-l):s>15&&s<=90?(t.anchor=Kr.START,c-=Math.sin(r)*l/2-1,u+=Math.cos(r)*l-l):t.anchor=Kr.MIDDLE,t.translate(c,u)}}))}$_layoutLabelsVert(t,e,s,i,r,n,a){const h=i?a:r-a;t.forEach(((t,a)=>{if(t.visible){const o=t.getBBounds(),l=i?h:s?(r-o.width)/2:h-o.width;t.anchor=Kr.START,t.translate(l,n-e[a].pos-o.height/2)}}))}}dn.AXIS_CLASS="rct-axis",dn.LINE_CLASS="rct-axis-line",dn.TICK_CLASS="rct-axis-tick";class _n extends s{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()}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}reprepare(t,e,s,i,r,n){const a=this._owner.doc,h=this._pool,o=this._views,l=[];for(let t=this._removes.length-1;t>=0;t--)if(!this._removes[t].parent){const e=this._removes.splice(t,1)[0];h.push(e)}for(let i=0,n=e.length;i<n;i++){const h=e[i];let c=-1;if(t)for(let e=0,i=o.length;e<i;e++){const i=o[e][t];if(s&&i===h[s]||!s&&i===h){l.push(o[e]),c=e;break}}if(c>=0){const t=o.splice(c,1)[0];t.parent||this._owner.add(t)}else{const t=this.$_create(a,i,n);l.push(t),null==r||r(t,i,n)}}for(let t=0,e=o.length;t<e;t++){const s=o[t];s.removing||(this.removeDelay>0?this._removes.push(s.removeLater(this.removeDelay)):h.push(s.remove()),null==i||i(s,t,e))}return this._views=l,n&&this.forEach(n),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)}}class gn extends dt{constructor(t,e){super(t,e,"image"),this._dirty=!0,this.setAttr("preserveAspectRatio","none")}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.setAttr("href",t),this.resize(e,s),!0)}getBBounds(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}const pn=Math.pow,mn=Math.sqrt,wn=Math.sin,xn=Math.cos,fn=Math.PI,bn=1.70158,yn=1.525*bn,vn=bn+1,Vn=2*fn/3,Sn=2*fn/4.5,Pn=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},kn={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-pn(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-pn(1-t,3),outCubic2:t=>1-pn(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-pn(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-pn(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-pn(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-pn(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-pn(-2*t+2,5)/2,inSine:t=>1-xn(t*fn/2),outSine:t=>wn(t*fn/2),inOutSine:t=>-(xn(fn*t)-1)/2,inExpo:t=>0===t?0:pn(2,10*t-10),outExpo:t=>1===t?1:1-pn(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?pn(2,20*t-10)/2:(2-pn(2,-20*t+10))/2,inCirc:t=>1-mn(1-pn(t,2)),outCirc:t=>mn(1-pn(t-1,2)),inOutCirc:t=>t<.5?(1-mn(1-pn(2*t,2)))/2:(mn(1-pn(-2*t+2,2))+1)/2,inBack:t=>vn*t*t*t-bn*t*t,outBack:t=>1+vn*pn(t-1,3)+bn*pn(t-1,2),inOutBack:t=>t<.5?pn(2*t,2)*(7.189819*t-yn)/2:(pn(2*t-2,2)*((yn+1)*(2*t-2)+yn)+2)/2,inElastic:t=>0===t?0:1===t?1:-pn(2,10*t-10)*wn((10*t-10.75)*Vn),outElastic:t=>0===t?0:1===t?1:pn(2,-10*t)*wn((10*t-.75)*Vn)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-pn(2,20*t-10)*wn((20*t-11.125)*Sn)/2:pn(2,-20*t+10)*wn((20*t-11.125)*Sn)/2+1,inBounce:t=>1-Pn(1-t),outBounce:Pn,inOutBounce:t=>t<.5?(1-Pn(1-2*t))/2:(1+Pn(2*t-1))/2};class An{constructor(){this.delay=0,this.duration=An.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=Math.min(1,Math.max(0,P(t/this.duration)));this._easing&&(e=this._easing(e));try{!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=c(t,An.DURATION),this.delay=e||0,this._easing=kn[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(){}}An.DURATION=700,An.SHORT_DURATION=300;class En extends sn{constructor(t,e=x){super(t),this.add(this._text=new tn(t,e)),this._text.anchor=Kr.START}get text(){return this._text.text}get anchor(){return this._text.anchor}set anchor(t){this._text.anchor=t}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setSvg(t){return this._text.svg=t,this}setModel(t,e,s){var i,r,n,a;const h=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),h===$t.BACKGROUND?(null===(i=this._outline)||void 0===i||i.remove(),this._back||(this._back=new Xe(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):h===$t.OUTLINE?(null===(r=this._back)||void 0===r||r.remove(),this._outline||(this._outline=new tn(t),this._outline.anchor=Kr.START),this.insertFirst(this._outline),this._outline.setStyleOrClass(e.style)):(null===(n=this._back)||void 0===n||n.remove(),null===(a=this._outline)||void 0===a||a.remove()),this._text.setBoolData("outlined",!!this._outline),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=Zr.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:"2px"})}return this}layout(){if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom),e=this._text.getBBounds(),s=parseFloat(t.paddingLeft)||0,i=parseFloat(t.paddingTop)||0;this._back.setBounds(-s,-i,e.width+s+(parseFloat(t.paddingRight)||0),e.height+i+(parseFloat(t.paddingBottom)||0),3)}return this}}class Cn{static slide(t,e){new Tn(t,e)}static fadeIn(t){new Ln(t,{prop:"opacity",start:"0",end:"1"})}static grow(t,e){new Nn(t,e)}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Ln extends Cn{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:An.DURATION,fill:"none"})}}class Tn extends Cn{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:An.DURATION,fill:"none"}}$_clipRect(t){return t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height).setTemporary()}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:A(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:A(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class Mn extends An{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_doStop(){this._series=null}}class Nn extends Mn{_doUpdate(t){return!!this._series.parent&&(this._series.setViewRate(t),!0)}_doStop(){this._series.parent&&this._series.setViewRate(NaN),super._doStop()}}class On extends En{constructor(t){super(t,"rct-point-label")}}class Dn extends _t{constructor(t){super(t,"rct-point-labels"),this._labels=[new _n(this,On),new _n(this,On)],this._maps=[],this.setStyle("pointerEvents","none")}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r){const n=r.text,a=r.style;e.point=i,e.setModel(t,r,null),n?(r.buildSvg(e._text,NaN,NaN,r,i.getValueOf),e.setStyles(a),e._outline&&r.buildSvg(e._outline,NaN,NaN,r,i.getValueOf)):e.setText(r.getText(i.getLabel(s))).setStyles(a)}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){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(((s,r)=>{for(let a=0;a<s.labelCount();a++){const o=n[a].get(r);o.setVisible(e.isPointVisible(s))&&(this.prepareLabel(t,o,a,s,i),h[a][s.pid]=o)}})),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 Rn extends sn{constructor(t){super(t),this.add(this._line=new mt(t))}setLine(t){this._line.setPath(t)}}class Bn extends sn{constructor(t){super(t,"rct-point-label-lines"),this._lines=new _n(this,Rn)}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 In extends _t{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 $n extends rn{constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._inverted=!1,this._animatable=!0,this._viewRate=NaN,this._animations=[],this.add(this._pointContainer=new In(t,"rct-series-points")),this._labelContainer=new Dn(t)}invertable(){return!0}getClipContainer(){return this._pointContainer}setViewRate(t){isNaN(t)&&isNaN(this._viewRate)||t===this._viewRate||(this._viewRate=t,isNaN(t)?this.control.invalidateLayout():this._doViewRateChanged(t))}setPosRate(t){}isPointVisible(t){return t.visible&&!t.isNull}_doViewRateChanged(t){}_setChartOptions(t,e){this._inverted=t,this._animatable=e}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.visible&&this._labelContainer.setVisible(!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)}findPointView(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){}_getColor(){return this.model._calcedColor}prepareSeries(t,e){this.setData("index",e.index%12),this.setBoolData("pointcolors",e._colorByPoint()),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&(this.internalSetStyle("fill",e.color),this.internalSetStyle("stroke",e.color)),e._calcedColor=getComputedStyle(this.dom).fill,this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return this.setClip(void 0),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new mt(t,"rct-series-trendline")),this._trendLineView.setVisible(!0)):this._trendLineView&&this._trendLineView.setVisible(!1),qr.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(),this._afterRender(),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded)}_collectVisPoints(t){return t.collectVisibles()}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointStyle(t,e,s,i){t.setAttr("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&(t.internalSetStyle("fill",s.color),t.internalSetStyle("stroke",s.color));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVisible(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible&&this._labelContainer}_getViewRate(){return c(this._viewRate,1)}_animating(){return!isNaN(this._viewRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_afterRender(){}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(){const t=this.model,e=t._xAxisObj,s=t._yAxisObj,i=t.trendline._points.map((t=>({x:e.getPosition(e._vlen,t.x),y:s._vlen-s.getPosition(s._vlen,t.y)}))),r=new Ur;r.move(i[0].x,i[0].y),r.lines(...i),this._trendLineView.setPath(r.end(!1))}_layoutLabel(t){let{inverted:e,x:s,y:i,hPoint:r,labelView:n,labelOff:a}=t;const h=t.reversed?r<=0:r<0,o=n.getBBounds();let l=!0;switch(e?i-=o.height/2:s-=o.width/2,t.labelPos){case ts.INSIDE:e?s-=r/2+a:i+=(r-o.height)/2+a;break;case ts.HEAD:e?h?s+=o.width-a:s-=o.width+a:h?i-=o.height+a:i+=a;break;case ts.FOOT:e?s-=h?r+o.width+a:r-a:i+=h?r+a:r-o.height-a;break;case ts.OUTSIDE:default:e?h?s-=o.width+a:s+=a:h?i+=a:i-=o.height+a,l=!1}n.setContrast(l&&t.pointView.dom),n.layout().translate(s,i)}}$n.POINT_CLASS="rct-point",$n.DATA_FOUCS="focus",$n.LEGEND_MARKER="rct-legend-item-marker";class Fn extends mt{constructor(t){super(t,$n.POINT_CLASS),this.labelViews=[]}}let zn=class extends Fn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Hn extends $n{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&&Cn.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}}class Gn extends Hn{_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof cs?2*h.categoryPad():0,u=i?t:e,d=i?e:t,_=i?0:e,g=o.axisMin(),p=o.getPosition(u,g),m=s.getBaseValue(o),w=c(o.getPosition(u,Math.max(g,m)),p),x=!isNaN(m),f=a&&Object.assign(this._labelInfo,{inverted:i,reversed:o.reversed,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const c=h.getUnitLength(d,n.xValue)*(1-l),g=s.getPointWidth(c),p=(o.getPosition(u,n.yValue)-w)*r;let m,b;m=h.getPosition(d,n.xValue)-c/2,b=_,n.xPos=m+=s.getPointPos(c)+g/2,n.yPos=b-=o.getPosition(u,n.yGroup*r),this._layoutPointView(t,e,m,b+p,g,p),f&&(f.labelView=a.get(n,0))&&(i&&(b=d-h.getPosition(d,n.xValue)+c/2,m=_,n.yPos=b-=s.getPointPos(c)+g/2,n.xPos=m+=x?o.getPosition(u,n.yGroup)*r:o.getPosition(u,n.yGroup*r)),f.pointView=t,f.x=m,f.y=b,f.wPoint=g,f.hPoint=p,this._layoutLabel(f))}}))}}class jn extends Hn{_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=h instanceof cs?2*h.categoryPad():0,c=i?t:e,u=i?e:t,d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull)){const g=h.getUnitLength(u,n.xValue)*(1-l),p=s.getPointWidth(g),m=(o.getPosition(c,n.yValue)-o.getPosition(c,this._getLowValue(n)))*r;let w=h.getPosition(u,n.xValue)-g/2,x=d;n.xPos=w+=s.getPointPos(g)+p/2,n.yPos=x-=o.getPosition(c,n.yGroup)*r,this._layoutPointView(t,e,w,x,p,m),a&&(i&&(x=u-h.getPosition(u,n.xValue)+g/2,w=d,n.yPos=x-=s.getPointPos(g)+p/2,n.xPos=w+=o.getPosition(c,n.yGroup)*r),_.pointView=t,_.hPoint=m,_.x=w,_.y=x,(_.labelView=a.get(n,0))&&(_.hPoint=m,this._layoutLabel(_)),(_.labelView=a.get(n,1))&&(i?_.x-=m:_.y+=m,_.hPoint=-m,this._layoutLabel(_)))}}))}}class Wn extends mt{constructor(t){super(t,$n.POINT_CLASS)}}class Yn extends $n{constructor(t,e){super(t,e),this._markers=new _n(this._pointContainer,Wn)}_getPointPool(){return this._markers}invertable(){return!1}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBounds();e===ts.AUTO&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVisible(null!=e)&&(e===ts.INSIDE?t.translate(r-a.width/2,n-a.height/2):e&&t.translate(r-a.width/2,n-i-a.height-s))}}class Xn extends An{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.control.invalidateLayout(),this.series=null)}}class Un extends $n{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 Xn(this),this._zombieAni.start())}_createPointLegendMarker(t,e,s){return Xe.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,ze.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class qn extends dt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Zn extends qn{constructor(t,e){super(t,e),this.setStyle("fill","none")}resetStyles(t){const e=super.resetStyles(t);return this.setStyle("fill","none"),e}}class Kn extends mt{setArc(t,e,s,i,r,n){this.setPath(nt.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Qn extends mt{static create(t,e,s,i,r,n,a,h,o=!0){return new Qn(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 Qn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=x,s=x){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 nt.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 nt.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 Jn extends rn{constructor(t,e){super(t,e),this._inverted=!1,this._animatable=!0,this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Xe(t,Jn.PANE_CLASS)),this.add(this._contentContainer=new _t(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Jn.GAUGE_CLASS}_setChartOptions(t,e){this._inverted=t,this._animatable=e}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){super._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=Object.assign(W.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.translate(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof aa)return t;t=t.parent}}}Jn.GAUGE_CLASS="rct-gauge",Jn.PANE_CLASS="rct-gauge-pane";class ta extends An{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 ea extends Jn{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Lt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_getValue(t){return Math.max(t.minValue,Math.min(t.maxValue,c(this._runValue,t.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new ta(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class sa extends rn{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new _t(t,"rct-gauge-scale-ticks")),this._ticks=new _n(this._tickContainer,Ai),this.add(this._labelContainer=new _t(t,"rct-gauge-scale-tick-labels")),this._labels=new _n(this._labelContainer,tn)}}class ia extends sa{_createLine(t,e){return new Ai(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e._steps,o=h.length;let l=a?e.gap:s,c=a?i:e.gap;if(this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(o)),a?l+=e.tick.length:c+=e.tick.length,this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(o),o>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?s:o-1-s]),t=Math.max(e.getBBounds().width)})),l+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.text=String(h[n?o-1-s:s]),t=Math.max(e.getBBounds().height)})),c+=t}return{width:l,height:c}}_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===Zs.OPPOSITE,h=a?-r.length:r.length;let o,l=a?s-t.gap:t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLineC(l,0,e)),this._tickContainer.setVisible(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.getBBounds();o=t.getRate(n[r])*e,i.setVisible(o-a.width/2>s)&&(i.translate(o,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===Zs.OPPOSITE,h=a?r.length:-r.length;let o,l=a?t.gap:e-t.gap;if(i.setVisible(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLineC(l,0,s)),this._tickContainer.setVisible(r.visible)&&this._ticks.forEach(((e,i)=>{o=t.getRate(n[i])*s,e.setHLine(o,l,l+h)})),this._labelContainer.visible){const i=a?Kr.START:Kr.END;l=a?l+h:e-t.gap+h,this._labels.forEach(((e,r)=>{o=t.getRate(n[r])*s,e.anchor=i,e.layout=r<n.length-1?Qr.MIDDLE:Qr.BOTTOM,e.translate(l,o)}))}}}class ra extends ea{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,e,s,t,this.valueOf),tt(r.getBBounds())}_renderGauge(t,e){const s=this.model,i=c(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=c(this._runValue,t.value),n=Object.assign({},this._rBand);if(this._renderScale(n),n.height>0&&(this.background().setRect(n),this._renderBand(t,n,r),this._rLabel.height=n.height,this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===Zs.OPPOSITE)){const t=i.getBBounds();i.ty+t.height>this.height&&i.translateY(Math.max(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=et.create(0,0,n,a);if(this._vertical=!t.group&&d(r,a>n),e.visible){const r=e._runPos=d(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 u=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const g=o?n:e.getMaxWidth(n),p=o?e.getMaxHeight(a):a,m=this._rLabel=et.create(0,0,n,a);e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,c(u,g),c(_,p),t,this.valueOf);const w=s.getBBounds();switch(o?(m.height=c(_,w.height),h.height=Math.max(0,h.height-(m.height+l))):(m.width=c(u,w.width),this._wLabel=t.group?t.group._labelWidth:m.width,h.width=Math.max(0,h.width-(this._wLabel+l))),r){case"top":h.y=m.height+l;break;case"bottom":m.y=h.height+l;break;case"right":m.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.getBBounds();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=Kr.START,n+=Math.max(0,(t.height-i.height)/2);break;default:s.anchor=Kr.END,r+=this._wLabel,n+=Math.max(0,(t.height-i.height)/2)}s.translate(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.setVisible(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,h=t.y,t.width=Math.max(0,t.width-e.width),i.position===Zs.OPPOSITE?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=Math.max(0,t.height-e.height),i.position===Zs.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().translate(a,h)}}}class na extends ea{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return l(i)?Lt.getFormatter(s||t.label.numberFormat).toStr(i):i}}}class aa extends Jn{_defaultCalss(){return aa.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new _t(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_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))}))}}aa.GAUGE_GROUP_CLASS="rct-gauge-group";class ha extends sa{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new Kn(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.sweepAngle?1:0);return this._line.setVisible(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVisible(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVisible(e.tickLabel.visible)&&(this._labelContainer.internalSetStyleOrClass(e.tickLabel.style),this._labels.prepare(n,(t=>{t.layout=Qr.MIDDLE}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=e.position===Zs.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,c=n._sweepRad,u=n._startRad,d=i.maxValue-i.minValue;let _,g,p,m;if(this._line.visible&&this._line.setArc(a,h,o,u,c,!0),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*c+u;_=a+Math.cos(n)*o,g=h+Math.sin(n)*o,p=a+Math.cos(n)*l,m=h+Math.sin(n)*l,t.setLine(_,g,p,m)})),this._labelContainer.visible){this._labels.get(0).text=String(i.maxValue);const t=l+.5*this._labels.get(0).getBBounds().height*r;this._labels.forEach(((r,n,o)=>{const l=e.getRate(s[n])*c+u;p=a+Math.cos(l)*t,m=h+Math.sin(l)*t,r.text=String(P(i.minValue+e.getRate(s[n])*d)),r.translate(p,m)}))}}}let oa=class extends rn{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new _n(this,Qn),this.add(this._labelContainer=new _t(t,"rct-circle-gauge-band-tick-labels")),this._labels=new _n(this._labelContainer,tn)}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,u=r._sweepRad;s.maxValue,s.minValue;let d=r._startRad;this._sectorViews.prepare(c.length).forEach(((t,e)=>{const s=i.getRate(c[e].toValue-c[e].fromValue)*u;t.setSector({cx:n,cy:a,rx:h,ry:h,innerRadius:l,start:d,angle:s,clockwise:o}),t.setStyle("fill",c[e].color),d+=s}))}};class la extends mt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Ur).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class ca extends mt{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 Ur;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 ua extends na{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new Qn(t,"rct-circle-gauge-back")),e.add(this._valueView=new Qn(t,"rct-circle-gauge-value")),e.add(this._innerView=new Qn(t,"rct-circle-gauge-inner")),e.add(this._textView=new tn(t,"rct-circle-gauge-label")),e.add(this._handContainer=new _t(t,void 0)),e.add(this._scaleView=new ha(t)),e.add(this._bandView=new oa(t))}_prepareGauge(t,e){this._rimView.setVisible(e.rim.visible),this._scaleView.setVisible(e.scale.visible),this._bandView.setVisible(e.band.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new ca(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 la(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(Math.min(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(c(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);this._valueView.setStyleOrClass(e.style),o&&this._valueView.setStyle(e.stroked?"stroke":"fill",o.color),t.valueRim.stroked&&(this._valueView.setStyle("fill","none"),this._valueView.setStyle("strokeWidth",A(h))),this._valueView.setBoolData("stroked",e.stroked),this._valueView.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)*V;this._handView.render(t.hand,a.radius).translatep(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,NaN,NaN,t,this.valueOf),o.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,o,a);else{const e=o.getBBounds(),s=t.label.getOffset(this.width,this.height);o.translate(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.setVisible(t.rim.visible)&&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.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(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).translate(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBounds(),r=this._rimView.getBBounds(),n=+t.group.labelGap||0;e.anchor=Kr.END,e.translate(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class da extends An{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class _a extends mt{constructor(t){super(t,$n.POINT_CLASS)}}class ga extends dt{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.dom.style.transform=`translate(${e}px, ${e}px) rotate(-90deg) scale(1, -1)`:this.dom.style.transform=""),this.inverted}}class pa extends $n{constructor(t,e){super(t,e),this._needBelow=!1,this.insertFirst(this._lineContainer=new ga(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new mt(t,"rct-line-series-line")),this._markers=new _n(this._pointContainer,_a)}getClipContainer(){return null}_getPointPool(){return this._markers}_prepareSeries(t,e){e instanceof Oi&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.model,this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this._layoutLines(this._visPoints)}_runShowEffect(t){this._polar?t&&Cn.grow(this):t&&Cn.slide(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(this._visPoints.slice())}_markersPerPoint(){return 1}_prepareBelow(t){const e=this.control;let s=this._lowLine;if(this._needBelow=t.belowStyle&&t._minValue<t.baseValue,this._needBelow)return s||(this._lineContainer.insertChild(s=this._lowLine=new mt(this.doc),this._line),this._upperClip=e.clipBounds(),this._lowerClip=e.clipBounds()),this._line.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.setClip(),this._line.setClip()}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,e-s,e,t):n.setBounds(0,e-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,e-t,e,t-s):n.setBounds(0,e-s,e,t):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof Oi&&this._needBelow,i=s?t.baseValue:NaN,r=t.marker,n=[r.style,null];if(this._pointContainer.visible=r.visible&&!t._simpleMode){const r=this._markersPerPoint(),a=e.length;this._markers.prepare(a*r,((r,h)=>{const o=e[h%a];o.isNull||(r.point=o,n[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(r,t,o,n))}))}else this._markers.prepare(0)}_layoutMarker(t,e,s){const i=this.model,r=t.point,n=t._radius=i.getRadius(r);nt.setShape(t,i.getShape(r),n),t.translate(e-=n,s-=n)}_layoutMarkers(t,e,s){const i=this.model,r=this._inverted,n=this._polar=i.chart.body.getPolar(i),a=this._getViewRate(),h=i.marker.visible,o=i.pointLabel.offset,l=this._labelViews(),c=i._xAxisObj,u=i._yAxisObj,d=r?e:s,_=n?n.rd*b:r?s:e,g=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];let i,p;if(n){const t=n.start+c.getPosition(_,s.xValue),e=u.getPosition(n.rd,s.yGroup)*a;i=s.xPos=n.cx+e*Math.cos(t),p=s.yPos=n.cy+e*Math.sin(t)}else i=s.xPos=c.getPosition(_,s.xValue),p=s.yPos=g-u.getPosition(d,s.yGroup),r&&(i=u.getPosition(d,s.yGroup),p=g-c.getPosition(_,s.xValue));const m=this._markers.get(e),w=l&&l.get(s,0);if(m&&m.setVisible(!s.isNull)){if(this._layoutMarker(m,i,p),w){const t=w.getBBounds();w.visible=!0,w.setContrast(null),w.translate(i-t.width/2,p-t.height-o-(h?m._radius:0))}}else w&&(w.visible=!1)}}_layoutLines(t){const e=this.model,s=e instanceof Oi&&this._needBelow,i=new Ur;let r,n=0;for(;n<t.length;){const e=t[n++];if(!e.isNull){i.move(e.xPos,e.yPos);break}}if(this._linePts=t,n<t.length-1&&(this._buildLines(t,n,i),this._line.setPath(r=i.end(this._polar)),this._line.clearStyleAndClass(),this._line.setStyle("stroke",e.color),this._line.addStyleOrClass(e.style),W.setImportantStyle(this._line.dom.style,"fill","none"),s)){const t=e._yAxisObj,s=e.baseValue;this._inverted?this.$_resetClips(this.width,this.height,t.getPosition(this.width,s),!0):this.$_resetClips(this.width,this.height,this.height-t.getPosition(this.height,s),!1),this._lowLine.setPath(r),this._lowLine.clearStyleAndClass(),this._lowLine.setStyle("stroke",e.color),this._lowLine.addStyleOrClass(e.style),this._lowLine.addStyleOrClass(e.belowStyle),W.setImportantStyle(this._lowLine.dom.style,"fill","none")}}_buildLines(t,e,s){const i=this.model,r=i.getLineType();r===We.SPLINE?this._drawCurve(t,e-1,s):i instanceof Oi&&r===We.STEP?this._drawStep(t,e,s,i.stepDir):this._drawLine(t,e,s)}_drawLine(t,e,s){const i=t.length;let r=e;for(;r<i;)if(t[r].isNull){do{r++}while(r<i&&t[r].isNull);r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else s.line(t[r].xPos,t[r].yPos),r++}_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.$_drawCurve(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].xPos,t[r].yPos),r++)}else r++;r-1>n&&this.$_drawCurve(t,n,r-1,s)}}$_drawCurve(t,e,s,i){let r=e;if(1===Math.abs(s-e))return void i.line(t[r+1].xPos,t[r+1].yPos);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].xPos-t[r].xPos,y:t[r+1].yPos-t[r].yPos},c={x:0,y:0},u={x:0,y:0},d={x:0,y:0};let _={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].xPos-t[r].xPos,m=t[r].xPos,w=t[r].yPos;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].xPos-t[r].xPos,l.y=t[r+1].yPos-t[r].yPos,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(_.x=o.x-l.x,_.y=o.y-l.y):(_.x=l.x-o.x,_.y=l.y-o.y);const s=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=s,_.y/=s,o.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*p*n,a.y=-_.y*p*n,r===e+1?i.quad(t[r].xPos+a.x,t[r].yPos+a.y,t[r].xPos,t[r].yPos):(c.x=m+h.x,c.y=w+h.y,u.x=t[r].xPos+a.x,u.y=t[r].yPos+a.y,d.x=(c.x+u.x)/2,d.y=(c.y+u.y)/2,i.quad(c.x,c.y,d.x,d.y),i.quad(u.x,u.y,t[r].xPos,t[r].yPos)),p=t[r+1].xPos-t[r].xPos,h.x=_.x*p*n,h.y=_.y*p*n,m=t[r].xPos,w=t[r].yPos}i.quad(m+h.x,w+h.y,t[r].xPos,t[r].yPos)}_drawStep(t,e,s,i){const r=t.length;let n=e;for(;n<r;)if(t[n].isNull){do{n++}while(n<r&&t[n].isNull);n<r&&(s.move(t[n].xPos,t[n].yPos),n++)}else i===Ks.BACKWARD?(s.line(t[n-1].xPos,t[n].yPos),s.line(t[n].xPos,t[n].yPos)):(s.line(t[n].xPos,t[n-1].yPos),s.line(t[n].xPos,t[n].yPos)),n++}}class ma extends pa{constructor(t){super(t,ma.CLASS)}}ma.CLASS="rct-line-series";class wa extends pa{constructor(t,e){super(t,e||"rct-area-series"),this._lineContainer.insertFirst(this._area=new mt(t,"rct-area-series-area"))}_layoutLines(t){super._layoutLines(t),this._polar?this._layoutPolar(this._area,t):this._layoutArea(this._area,t)}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._lineContainer.insertChild(e=this._lowArea=new mt(this.doc,"rct-area-series-area"),this._area),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model._yAxisObj,r=s;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.yLow=r-i.getPosition(s,n.yGroup-n.yValue)}}_layoutArea(t,e){const s=this.model,i=this._needBelow?this._lowArea:void 0,r=s.group,n=s.chart.isInverted(),a=s._yAxisObj,h=n?this.width:this.height,o=a.axisMin(),l=s.getBaseValue(a),u=this.height-a.getPosition(h,c(Math.max(o,l),o)),d=new Ur;let _,g=0;for(;g<e.length&&e[g].isNull;)g++;if(!r||r.layout!==is.STACK&&r.layout!==is.FILL){d.move(e[g].xPos,u),d.line(e[g].xPos,e[g].yPos),this._buildLines(e,g+1,d);const t=d._path;for(g=6;g<t.length;)"M"===t[g]?(t.splice(g,0,"L",t[g-2],u),g+=3,t.splice(g,0,"M",t[g+1],u),t[g+3]="L",g+=6):"Q"===t[g]?g+=4:g+=3;d.line(t[t.length-2],u)}else{const t=g;for(d.move(e[g].xPos,e[g].yLow),d.line(e[g].xPos,e[g].yPos),g++;g<e.length;)d.line(e[g].xPos,e[g].yPos),g++;for(g=e.length-1,d.line(e[g].xPos,e[g].yLow);g>=t;)d.line(e[g].xPos,e[g].yLow),g--}t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.setPath(_=d.end()),t.internalClearStyleAndClass(),s.color&&t.setStyle("fill",s.color),s.style&&t.internalSetStyleOrClass(s.style),i&&(i.setBoolData("simple",this._simpleMode),i.setPath(_),i.internalClearStyleAndClass(),s.color&&i.setStyle("fill",s.color),s.belowStyle&&i.internalSetStyleOrClass(s.belowStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof Ds?s.getBaseValue(r):NaN,a=this.height;r.getPosition(a,J.isNotEmpty(n)?n:r.axisMax());const h=new Ur;if(!i||i.layout!==is.STACK&&i.layout!==is.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.setStyle("fill",s.color),t.addStyleOrClass(s.style)}}class xa extends Qn{constructor(t){super(t,$n.POINT_CLASS)}}class fa extends sn{constructor(t){super(t,$n.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.setStyle("fill",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 Ai(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Ai(t,"rct-boxplot-point-stem")),this.add(this._box=new Xe(t,"rct-boxplot-point-box")),this.add(this._mid=new Ai(t,"rct-boxplot-point-mid")),this.add(this._min=new Ai(t,"rct-boxplot-point-min")),this.add(this._max=new Ai(t,"rct-boxplot-point-max"))}}let ba=class extends sn{constructor(t){super(t,$n.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue;const r=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i,a=Math.min(n,r),h=Math.max(1,Math.abs(r-n)),o=t.close<t.open;this._body.setStyle("fill",o?"":t.color),this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this._body.setClass(o?"rct-candlestick-point-fall":"")}_doInitChildren(t){this.add(this._wickUpper=new Ai(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Ai(t,"rct-candlestick-point-wick")),this.add(this._body=new Xe(t))}};class ya extends sn{constructor(t){super(t,$n.POINT_CLASS),this.add(this._line=new Ai(t)),this.add(this._hmarker=new mt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new mt(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setStyle("fill",t.color),this._lmarker.setStyle("fill",t.color)),this._line.setVLineC(i,0,s),this._hmarker.renderShape(t.shape,i,0,t.radius),this._lmarker.renderShape(t.shape,i,s,t.radius)}}let va=class extends sn{constructor(t){super(t,$n.POINT_CLASS),this._backs=new _n(this,mt),this._segments=new _n(this,mt),this._decimal=0}prepareSegments(t,e,s,i,r){this._decimal=i,this._backs.prepare(t?e:0).forEach(((t,e)=>{t.setClass(r)})),this._segments.prepare(Math.round(s)).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._backs.forEach(((e,r)=>{e.setPath(nt.rectangle(0,s-t[2*r],i,n(-1,t[2*r]-t[2*r+1])))})),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(nt.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(nt.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}};let Va=class extends sn{constructor(t){super(t,$n.POINT_CLASS),this.add(this._stem=new Ai(t)),this.add(this._whiskerUp=new Ai(t)),this.add(this._whiskerDown=new Ai(t))}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)}};class Sa extends mt{constructor(t){super(t,$n.POINT_CLASS)}}class Pa extends Xe{constructor(t){super(t,$n.POINT_CLASS)}}let ka=class extends Fn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};let Aa=class extends sn{constructor(t){super(t,$n.POINT_CLASS),this.add(this._line=new Ai(t)),this.add(this._marker=new mt(t,"rct-lollipop-point-marker"))}layout(){this._line.setVLineC(0,0,this.height),this._marker.renderShape(this.point.shape,0,0,this.point.radius)}};class Ea extends sn{constructor(t){super(t,$n.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.highValue-t.lowValue,r=-e/2;const n=0+s-s*(Math.min(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(Math.max(t.openValue,t.closeValue)-t.lowValue)/i;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,this.width),this._bar.setVLine(0,0,0+s),this._bar.setClass(t.close<t.open?"rct-ohlc-point-bar-fall":"rct-ohlc-point-bar")}_doInitChildren(t){this.add(this._tickOpen=new Ai(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Ai(t,"rct-ohlc-point-tick")),this.add(this._bar=new Ai(t)),this.add(this._back=new Xe(t,"rct-ohlc-point-back")),W.setImportantStyle(this._back.dom.style,"fill","transparent")}}class Ca extends Qn{constructor(t){super(t,$n.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class La extends mt{constructor(t){super(t,$n.POINT_CLASS)}get point(){return this.node.point}render(){this.setPath(nt.rect(this.node))}}class Ta extends mt{constructor(t){super(t,$n.POINT_CLASS)}layout(t,e,s){const i=this.point._len,r=this.point._off,n=.5;let a;switch(t){case _r.NONE:a=[0,-.5*i,0,n*i];break;case _r.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 Ma extends Fn{layout(t,e){this.setPath(nt.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}}class Na extends rn{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._barViews=new _n(this,Xe),this.add(this._labelContainer=new _t(t,"rct-linear-gauge-band-tick-labels")),this._labels=new _n(this._labelContainer,tn)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof br?n.isVertical():!n.vertical,h=e.position,o=this._thick=e.getThickness(a?s:i)+(h===Zs.INSIDE?0:this._gap=c(e.gap,0));let l=a?o:s,u=a?i:o;const d=this._ranges=e.ranges;if(this._labelContainer.setVisible(e.tickLabel.visible&&d.length>0)){const t=[d[0].fromValue].concat(d.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(d.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().width)})),l+=e}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=Math.max(s.getBBounds().height)})),u+=e}}return{width:l,height:u}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVisible(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&e.position!==Zs.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===Zs.OPPOSITE,r=this.width,n=this.height,a=t?n:r,h=this._thick;let o=0;return this._barViews.prepare(s.length).forEach(((r,l)=>{const c=s[l],u=a*(c.toValue-c.fromValue)/e;if(t)r.setBounds(0,n-o-u,h,u);else{const t=i?n-h:0;r.setBounds(o,t,u,this._thick)}r.setStyle("fill",c.color),o+=u})),!0}}$_layoutLabels(t,e,s){const i=this._vertical,r=this.model.position===Zs.OPPOSITE,n=this.width,a=this.height,h=i?a:n,o=r?0:this._thick;let l=this._labels.get(0);i?l.translate(o,0):l.translate(0,o);for(let t=1;t<=s.length;t++){const r=h*s[t-1].toValue/e,n=this._labels.get(t);i?n.translate(o,r):n.translate(r,o)}}}class Oa extends ra{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new Xe(t,"rct-linear-gauge-background")),e.add(this._bandView=new Na(t)),e.add(this._scaleView=new ia(t)),e.add(this._valueView=new Xe(t,"rct-linear-gauge-value")),e.add(this._labelView=new tn(t))}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.setVisible(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===Zs.INSIDE?s.translate(t.x,t.y):e.position===Zs.OPPOSITE?(s.translate(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.translate(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===Zs.INSIDE?s.translate(t.x,t.y):e.position===Zs.OPPOSITE?(s.translate(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.translate(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=t.reversed,r=t.group?t.group.scale:t.scale;if(this._valueView.setVisible(!r.isEmpty()&&!isNaN(t.value)))if(this._vertical){const t=e.height*r.getRate(s),n=i?e.y:e.y+e.height-t;this._valueView.setBounds(e.x,n,e.width,t)}else{const t=e.width*r.getRate(s),n=i?e.x+e.width-t:e.x;this._valueView.setBounds(n,e.y,t,e.height)}}}class Da extends aa{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new ia(t)),e.insertFirst(this._textView=new tn(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVisible(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVisible(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=et.create(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,NaN,NaN,r,null);const t=this._textView.getBBounds().height+r.label.getGap(i);a.y+=t,a.height-=t,n.translate(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=Math.max(r._labelWidth,n.width),r._labelHeight=Math.max(r._labelHeight,n.height)}));const h=(o=a)&&Object.assign({},o);var o;const l=r.itemLabel.gap;r.vertical?(h.width-=r._labelWidth+l,r.itemLabel.opposite||(h.x+=r._labelWidth+l)):(h.height-=r._labelHeight+l,r.itemLabel.opposite||(h.x+=r._labelHeight+l)),this._renderScale(r,a,h),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.width:e.height,a=[];let h,o;if(this._gaugeViews.forEach(((e,s)=>{a.push(c(e._runValue,t.get(s).value))})),r.buildGroupSteps(n,a),i.setVisible(r.visible)){if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1);s.height-=t.height,e.height-=t.height,h=s.x,r.position===Zs.OPPOSITE?(o=s.y,s.y+=t.height,e.y+=t.height):o=s.y+s.height}i.resizeByMeasured().layout().translate(h,o)}}$_layoutHorz(t,e,s,i){i.height,i.width,s.count,i.y}$_layoutVert(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.translate(a,h),h+=n+e.itemGap}))}}class Ra extends ra{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new Xe(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new _t(t,void 0)),this._barViews=new _n(this._barContainer,Xe),e.add(this._valueView=new Xe(t,"rct-bullet-gauge-value")),e.add(this._targetView=new Xe(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new ia(t)),e.add(this._labelView=new tn(t))}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;if(this._barContainer.setVisible(!a.isEmpty())){const s=t.getRanges(a._min,a._max)||(null==i?void 0:i.getRanges(a._min,a._max));if(s)if(this._barContainer.setRect(e),this._barViews.prepare(s.length),n){let t=r?0:e.height;this._barViews.forEach(((i,n)=>{const h=s[n],o=e.height*a.getRate(h.toValue);i.setBounds(0,r?t:t-o,e.width,o),i.setStyle("fill",h.color)}))}else{let t=r?e.width:0;this._barViews.forEach(((i,n)=>{const h=s[n],o=e.width*a.getRate(h.toValue);i.setBounds(r?t-o:t,0,o,e.height),i.setStyle("fill",h.color)}))}}if(this._valueView.setVisible(!a.isEmpty()&&!isNaN(s)))if(n){const t=e.height*a.getRate(s),i=r?e.y:e.y+e.height-t;this._valueView.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;this._valueView.setBounds(i,e.y+e.height/3,t,e.height/3)}if(this._targetView.setVisible(!a.isEmpty()&&!isNaN(t.targetValue)))if(n&&e.width>10){let s=e.height*a.getRate(t.targetValue);s=r?e.y+s:e.y+e.height-s,this._targetView.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,this._targetView.setBounds(s-1,e.y+5,3,e.height-10)}}}class Ba extends dt{constructor(t,e,s){super(t,Ba.STYLE),this.add(this._back=new Xe(t,Ba.BACK_STYLE)),this.add(this._textView=new tn(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 en).applyPadding(e),i=this._textView.getBBounds();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.translate(i.width/2+s.left,s.top)}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Ba.STYLE="rct-button",Ba.BACK_STYLE="rct-button-background";class Ia extends nn{constructor(t,e){super(t,Ia.CLASS_NAME+" "+e,x)}_doLayout(t){const e=this.model.rotation;isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Ia.CLASS_NAME="rct-annotation";class $a extends Ia{constructor(t){super(t,$a.CLASS_NAME),this.add(this._textView=new tn(t)),this._textView.anchor=Kr.START}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._textView.text=this.model.text,tt(this._textView.getBBounds())}_doLayout(t){this._textView.getBBounds(),this._textView.translate(this._paddings.left,this._paddings.top),this._textView.layoutText(),super._doLayout(t)}}$a.CLASS_NAME="rct-text-annotation";class Fa extends Ia{constructor(t){super(t,Fa.CLASS_NAME),this.add(this._imageView=new gn(t))}_setBackgroundStyle(t){t.setStyle("fill","none")}_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),tt(this._imageView.getBBounds())}_doLayout(t){this._imageView.translate(this._paddings.left,this._paddings.top),super._doLayout(t)}}Fa.CLASS_NAME="rct-image-annotation";const za={area:wa,arearange:class extends pa{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ga(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new mt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new mt(t,"rct-areanrange-series-line")),W.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=this._inverted,n=i._yAxisObj,a=r?e:s,h=s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=h-n.getPosition(a,s.lowValue)}if(i.marker.visible){const e=this._markers;for(let s=0,i=t.length;s<i;s++){const h=t[s],o=e.get(s+i);let l,c;h.isNull?o.visible=!1:(o.visible=!0,r?(l=n.getPosition(a,h.lowValue),c=e.get(s).ty):(l=h.xPos,c=h.yLow),this._layoutMarker(o,l,c))}}}_layoutLines(t){super._layoutLines(t);const e=t.map((t=>({xPos:t.xPos,yPos:t.yLow,isNull:t.isNull}))).slice().reverse(),s=new Ur;let i=0;for(;i<e.length&&e[i].isNull;)i++;s.move(e[i].xPos,e[i].yPos),this._buildLines(e,i+1,s),this._lowerLine.setPath(s.end(!1)),this._lowerLine.setStyle("stroke",this.model.color),this.$_layoutArea(this._area,this._linePts,e)}$_layoutArea(t,e,s){const i=new Ur;let r=0;for(;r<e.length&&e[r].isNull;)r++;const n=e.length;let a,h,o,l=r++;for(;r<n;)if(e[r].isNull){for(a=r,a>l&&(h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i));r<n&&e[r].isNull;)r++;l=r}else r++;r>l&&(a=r,h=e.slice(l,a),o=s.slice(n-a,n-l),i.move(h[0].xPos,h[0].yPos),this._buildLines(h,1,i),i.line(o[0].xPos,o[0].yPos),this._buildLines(o,1,i)),t.setPath(i.end())}},bar:class extends Gn{constructor(t){super(t,"rct-bar-series"),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,i){super._setPointStyle(t,e,s,i),s.yValue<e.baseValue&&e.belowStyle&&t.addStyleOrClass(e.belowStyle)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}$_parepareBars(t,e,s){this._bars||(this._bars=new _n(this._pointContainer,zn)),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 _n(this._pointContainer,xa)),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._getViewRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,a=t._yAxisObj,h=r.getPolar(t),o=i&&Object.assign(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.offset)});this._sectors.forEach(((s,r)=>{const l=s.point,c=a.getPosition(h.rd,l.yGroup)*e,u=n.getUnitLength(2*Math.PI,l.xValue),d=t.getPointWidth(u),_=h.start+n.getPosition(b*h.rd,l.xValue);if(s.setSector({cx:h.cx,cy:h.cy,rx:c,ry:c,start:_-d/2,angle:d,clockwise:!0}),i&&(o.labelView=i.get(l,0))){const t=s.start+s.angle,e=s.cx+s.rx/2*Math.cos(t),i=s.cy+s.ry/2*Math.sin(t),r=o.labelView.getBBounds();o.labelView._text.anchor=Kr.MIDDLE,o.labelView.translate(e-r.width/2,i-r.height/2)}}))}},barrange:class extends jn{constructor(t){super(t,"rct-barrange-series"),this._bars=new _n(this._pointContainer,zn)}_getPointPool(){return this._bars}_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)}},bellcurve:class extends wa{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends jn{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new _n(this._pointContainer,fa)}_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 Yn{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&&Cn.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?ts.OUTSIDE:ts.INSIDE}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=this._getViewRate(),n=s.pointLabel,a=n.position,h=n.offset,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,u=i?t:e,d=i?e:t,_=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:g,max:p}=s.getPixelMinMax(_),m=e;let w;this._markers.forEach(((t,e)=>{const n=t.point;if(t.setVisible(!n.isNull&&!isNaN(n.zValue))){const e=(n.radius=s.getRadius(n.zValue,g,p))*r;let _,x,f;x=n.xPos=l.getPosition(d,n.xValue),f=n.yPos=m-c.getPosition(u,n.yValue),i&&(x=c.getPosition(u,n.yGroup),f=m-l.getPosition(d,n.xValue)),_=nt.circle(0,0,e),t.setPath(_),t.translate(x,f),o&&(w=o.get(n,0))&&(w.setContrast(t.dom),w.layout(),this._layoutLabelView(w,a,h,e,x,f))}}))}},candlestick:class extends jn{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new _n(this._pointContainer,ba)}_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)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},dumbbell:class extends jn{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new _n(this._pointContainer,ya)}_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 Gn{constructor(t){super(t,"rct-equalizer-series"),this._bars=new _n(this._pointContainer,va)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=(this._inverted?t:e)*this._getViewRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){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.backSegments,i=t._yAxisObj.axisMax(),r=t.segmented,n=t.segmentGap||0,a=this._pts=[];let h,o,l=0;for(o=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),h=(e-n*(o-1))/o;a.length<2*o;)a.push(l,l+h),l+=h+n;a[a.length-1]=e;const c=a.length/2;this._bars.forEach((n=>{const o=n.point;if(n.setVisible(!o.isNull)){const l=o.yValue/i;let u=-1,d=0;for(let t=0;t<c-1;t++)if(l>=a[2*t]/e&&l<a[2*(t+1)]/e){u=t+1,d=!r&&l<a[2*t+1]/e?l*e-a[2*t]:h;break}u<0&&(u=c,d=h),n.prepareSegments(s,c,u,d,t.backStyle)}}))}},errorbar:class extends jn{constructor(t){super(t,"rct-errorbar-series"),this._bars=new _n(this._pointContainer,Va)}_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 Un{constructor(t){super(t,"rct-funnel-series"),this._segments=new _n(this._pointContainer,Sa),this.add(this._lineContainer=new Bn(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&&Cn.slide(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVisible(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=P(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=P(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+(b-p)*(w-t)/(w-y):p+(b-p)*(t-m)/(y-m)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===ts.INSIDE,a=i.pointLabel,h=a.offset,o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,u=i.getSize(t,e),d=i.getNeckSize(u.width,u.height),_=new Ur,g=i.getCenter(t,e),p=g.x-u.width/2,m=g.y-u.height/2,w=m+u.height,x=p+u.width/2,f=u.height-d.height,b=p+(u.width-d.width)/2,y=c?w-f:m+f;let v;this._lineContainer.setVisible(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVisible(!i.isNull)){const a=i.yPos*u.height,g=(i.yPos+i.height)*u.height,p=c?w-a:m+a,V=c?w-g:m+g;let S,P,k,A;if(a>=f?(S=b,P=S+d.width,_.move(S,p).lines(P,p,P,V,S,V),t.ny=t.nx1=NaN):g<f?(S=s(p),P=S+2*(x-S),k=s(V),A=k+2*(x-k),_.move(S,p).lines(P,p,A,V,k,V),t.ny=NaN,t.nx1=k-S,t.nx2=A-S):(S=s(p),P=S+2*(x-S),k=b,A=k+d.width,_.move(S,p).lines(P,p,A,y,A,V,k,V,k,y),t.ny=y-p,t.nx1=k-S,t.nx2=A-S),t.setPath(_.close(!0)),i.xPos=x,i.yPos=p+(V-p)/2,r&&(v=r.get(i,0))){const e=l.get(i);if(e.setVisible(!n)){const s=t.getBBounds();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):Math.abs(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/Math.abs(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.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBounds();n+=e.width/2,s.setLine((new Ur).move(0,0).line(r,0).end()),s.translate(n,a),n+=r+i,t.translate(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBounds();t.translate(e-i.width/2,s-i.height/2)}},heatmap:class extends $n{constructor(t){super(t,"rct-heatmap-series"),this._cells=new _n(this._pointContainer,Pa)}_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&&Cn.slide(this)}$_parepareCells(t,e){this._cells.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutCells(t,e){const s=this.model,i=s.chart.isInverted();s.pointLabel.offset;const r=this._labelViews(),n=s._xAxisObj,a=s._yAxisObj,h=i?t:e,o=i?e:t,l=new Zr(this._getColor());this._cells.forEach((t=>{const c=t.point;if(t.setVisible(!c.isNull)){const u=n.getUnitLength(o,c.xValue),d=u,_=a.getUnitLength(h,c.yValue),g=_,p=i?0:e;let m,w,x;if(m=(c.xPos=n.getPosition(o,c.xValue))-u/2,w=(c.yPos=p-a.getPosition(h,c.yValue))-_/2,t.setBounds(m,w,d,g),t.setStyle("fill",l.brighten(1-c.heatValue/s._heatMax).toString()),r&&(x=r.get(c,0))){const t=x.getBBounds();i?(w=o-n.getPosition(o,c.xValue),m=p,w-=t.height/2,m+=a.getPosition(h,c.yValue)-t.width/2):(m+=(d-t.width)/2,w+=(g-t.height)/2),x.translate(m,w)}}}))}},histogram:class extends Hn{constructor(t){super(t,"rct-histogram-series"),this._bars=new _n(this._pointContainer,ka)}_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._getViewRate(),n=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,o=s._yAxisObj,l=i?t:e,c=i?e:t,u=o.getPosition(l,s.getBaseValue(o)),d=i?0:e,_=a&&Object.assign(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.offset)});this._getPointPool().forEach(((t,e)=>{const s=t.point,n=h.getPosition(c,s.min),g=h.getPosition(c,s.max),p=o.getPosition(l,s.yValue),m=g-n+(g>n?-1:1),w=p-u;let x=n+(g-n)/2,f=d;s.xPos=x,s.yPos=f-=p,this._layoutPointView(t,e,x,f+w,m,w*r),_&&(_.labelView=a.get(s,0))&&(i&&(f=c-x,x=d,s.yPos=f,s.xPos=x+=o.getPosition(l,s.yGroup)),_.pointView=t,_.x=x,_.y=f,_.wPoint=m,_.hPoint=w,this._layoutLabel(_))}))}$_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._getViewRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPosition(t,o.min),c=s.getPosition(t,o.max),u=l+(c-l)/2,d=i.getPosition(e,a.point.yValue)*n,_=Math.max(1,c-l-1);o.xPos=u,o.yPos=r-d,a.wPoint=_,a.hPoint=d,a.layout(u,r)}))}},line:ma,lollipop:class extends Gn{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){this._bars||(this._bars=new _n(this._pointContainer,Aa)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}},ohlc:class extends jn{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new _n(this._pointContainer,Ea)}_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()}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutSticks(t,e){const s=this.model;this._inverted;const i=this._getViewRate(),r=s.pointLabel.offset,n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=this.height;this._sticks.forEach(((l,c)=>{const u=l.point;if(l.setVisible(!u.isNull)){const c=a.getUnitLength(t,u.xValue),d=s.getPointWidth(c),_=(u.xPos=a.getPosition(t,u.xValue))-d/2,g=u.yPos=o-h.getPosition(e,u.yValue)*i,p=d,m=Math.abs(o-h.getPosition(e,u.lowValue)-g)*i;let w;if(l.setBounds(_,g,p,m),l.layout(),n&&(w=n.get(u,0))){const t=w.getBBounds();w.translate(_+(p-t.width)/2,g-t.height-r)}}}))}},pareto:class extends pa{constructor(t){super(t,"rct-pareto-series")}},pie:class extends Un{constructor(t){super(t,"rct-pie-series"),this._sectors=new _n(this._pointContainer,Ca,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new qn(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new En(t,"rct-pie-series-inner")),this._textView.anchor=Kr.MIDDLE,this.add(this._lineContainer=new Bn(t))}_getPointPool(){return this._sectors}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVisible(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null),e.innerText.buildSvg(this._textView._text,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&&Cn.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.translate(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof Ca){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.control.invalidateLayout()}}_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._getViewRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=P(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._getViewRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,l=this._rd,c=this._rdInner,u=i.pointLabel,d=this._labelViews(),_=i.getLabelPosition()===ts.INSIDE,g=u.offset,p=u.distance||0,m=this._lineContainer,w=this._slicedOff=i.getSliceOffset(l)*n;let x;if(this._textView.visible){const t=this._textView.getBBounds();this._textView.translate(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.setVisible(!1),d&&(x=d.get(a,0))&&x.setVisible(!1),null===(s=m.get(a))||void 0===s||s.setVisible(!1);else{const s=a.startAngle;let u=0,f=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;u+=Math.cos(t)*w,f+=Math.sin(t)*w}t.translate(u,f).setVisible(!0);const b=a.startAngle+a.angle/2;if(a.xPos=h+Math.cos(b)*(w+.7*l),a.yPos=o+Math.sin(b)*(w+.7*l),t.setPieSector(d,null,{cx:h,cy:o,rx:l,ry:l,innerRadius:c,start:s,angle:Math.abs(a.angle),clockwise:i.clockwise}),d&&(x=d.get(a,0))){const e=m.get(a);e.setVisible(!_)?this.$_layoutLabel(a,x,e,g,p,a.sliced?w:0,r):(e.visible=!1,this.$_layoutLabelInner(a,x,g,0,a.sliced?w:0)),x.setContrast(_&&t.dom).setVisible(!0)}else null===(e=m.get(a))||void 0===e||e.setVisible(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBounds(),o=t.startAngle+t.angle/2;let l=this._cx,c=this._cy,u=this._rd+.8*r,d=Math.cos(o)*n,_=Math.sin(o)*n,g=l+Math.cos(o)*this._rd,p=c+Math.sin(o)*this._rd,m=l+Math.cos(o)*u,w=c+Math.sin(o)*u;const x=m<l;let f;f=x?m-.2*r:m+.2*r,s&&s.setVisible(u>0)&&(s.setLine((new Ur).move(0,0).quad(m-g,w-p,f-g,w-p).end()),s.move(g,p),!e.isDomAnimating()&&s.translate(g+d,p+_)),x?(f-=h.width+i,w-=h.height/2):(f+=i,w-=h.height/2),e.move(f,w),!e.isDomAnimating()&&e.layout().translate(f+d,w+_)}$_layoutLabelInner(t,e,s,i,r){const n=e.getBBounds(),a=this._rdInner*this._rd,h=a>0?a+(this._rd-a)/2:.7*this._rd,o=t.startAngle+t.angle/2;let l=this._cx+Math.cos(o)*h,c=this._cy+Math.sin(o)*h;e.move(l-n.width/2,c-n.height/2),l=this._cx+Math.cos(o)*(r+h),c=this._cy+Math.sin(o)*(r+h),e.layout().translate(l-n.width/2,c-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,h=this._labelViews(),o=i.pointLabel,l=this._lineContainer,c=i.getLabelPosition()===ts.INSIDE;(n.sliced=e)?t.translateEx(Math.cos(a)*this._slicedOff,Math.sin(a)*this._slicedOff,r):t.translateEx(0,0,r);const u=h.get(n,0);if(u){const t=!c&&l.get(n);if(s&&(c?this.$_layoutLabelInner(n,u,o.offset,o.distance,this._slicedOff):this.$_layoutLabel(n,u,t,o.offset,o.distance,this._slicedOff,i.clockwise)),e){let e=u.tx,s=u.ty;u.translate(u.x,u.y),u.translateEx(e,s,r),t&&(e=t.tx,s=t.ty,t.translate(t.x,t.y),t.translateEx(e,s,r))}else u.translate(u.tx,u.ty),u.translateEx(u.x,u.y,r),t&&(t.translate(t.tx,t.ty),t.translateEx(t.x,t.y,r))}}},scatter:class extends Yn{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?Cn.grow(this):Cn.slide(this))}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setStyle("fill",s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return ts.OUTSIDE}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=this._polar=s.chart.body.getPolar(s),n=r?this._getViewRate():1,a=s.jitterX,h=s.jitterY,o=s.pointLabel,l=o.position,c=o.offset,u=this._labelViews(),d=s._xAxisObj,_=s._yAxisObj,g=i?t:e,p=i?e:t,m=e;let w;this._markers.forEach(((t,e)=>{const o=t.point;if(t.setVisible(!o.isNull)){const e=s.shape,x=s.radius*n,f=J.jitter(o.xValue,a),y=J.jitter(o.yGroup,h);let v,V,S;if(r){const t=r.start+d.getPosition(b,f),e=_.getPosition(r.rd,y)*n;V=o.xPos=r.cx+e*Math.cos(t),S=o.yPos=r.cy+e*Math.sin(t)}else V=o.xPos=d.getPosition(p,f),S=o.yPos=m-_.getPosition(g,y),i&&(V=_.getPosition(g,y),S=m-d.getPosition(p,f));switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":v=nt[e](0-x,0-x,2*x,2*x);break;default:v=nt.circle(0,0,x)}t.setPath(v),t.translate(V,S),u&&(w=u.get(o,0))&&this._layoutLabelView(w,l,c,x,V,S)}}))}},treemap:class extends $n{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new _n(this._pointContainer,La)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){const s=this.model;s.pointLabel;const i=this._labelViews(),r=s.buildMap(t,e),n=new Zr(s._calcedColor);let a;i.prepare(this.doc,this),this._nodeViews.prepare(r.length,((t,e,s)=>{const h=r[e],o=h.parent;let l=n;if(o&&(!o._color&&o.point.color?l=o._color=new Zr(o.point.color):o._color&&(l=o._color)),t.node=h,t.setStyle("fill",l.brighten(h.index/s).toString()),t.render(),h.point.xPos=h.x+h.width/2,h.point.yPos=h.y+h.height/2,i&&(a=i.get(h.point,0))){const t=a.getBBounds();a.setVisible(h.width>=t.height&&h.height>=t.height)&&a.translate(h.x+h.width/2-t.width/2,h.y+h.height/2-t.height/2)}}))}_runShowEffect(t){t&&new Tn(this)}},vector:class extends $n{constructor(t){super(t,"rct-vector-series"),this._arrows=new _n(this._pointContainer,Ta)}_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;this._arrows.forEach((t=>{const e=t.point;if(t.setVisible(!e.isNull)){const s=e.xPos=n.getPosition(this.width,e.xValue),h=e.yPos=this.height-a.getPosition(this.height,e.yValue);t.translate(s,h),t.layout(r,e.angleValue+i,!1)}}))}_runShowEffect(t){t&&Cn.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 jn{constructor(t){super(t,"rct-waterfall-series"),this._bars=new _n(this._pointContainer,Ma),this.add(this._lineContainer=new _t(t,"rct-waterfall-series-lines")),this._lines=new _n(this._lineContainer,Ai)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_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),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}))}}},Ha={circle:ua,linear:Oa,bullet:Ra,clock:class extends Jn{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new qn(t,"rct-clock-gauge-face")),e.add(this._rimView=new Qn(t,"rct-clock-gauge-rim")),e.add(this._labelView=new tn(t,"rct-clock-gauge-label")),this._labelView.layout=Qr.MIDDLE,e.add(this._tickContainer=new _t(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new _t(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new mt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new mt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new mt(t,"rct-clock-gauge-second")),e.add(this._pinView=new qn(t,"rct-clock-gauge-pin")),this._tickViews=new _n(this._tickContainer,Ai,"rct-clock-gauge-tick"),this._minorTickViews=new _n(this._tickContainer,Ai,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new _n(this._tickLabelContainer,tn,"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/Math.max(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Qr.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),Math.abs(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=y,c=b/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,l=y,c=b/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=c,t++),e.setLine(i+Math.cos(l)*h,r+Math.sin(l)*h,i+Math.cos(l)*o,r+Math.sin(l)*o),l+=c,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=b/12*t;l=y,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBounds().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.translate(i+Math.cos(l)*o,r+Math.sin(l)*o),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVisible(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,NaN,NaN,null,null),"bottom"===t.label.position?s.translate(i,r+o/2):s.translate(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 Ur;let c,u,d,_;c=t.hourHand,u=this._hourView,u.setVisible(c.visible)&&(_=b*(i/12+r/60/12+n/60/60/12),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V)),c=t.minuteHand,u=this._minuteView,u.setVisible(c.visible)&&(_=b*(r/60+n/60/60),d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V)),c=t.secondHand,u=this._secondView,u.setVisible(c.visible)&&(_=this._secRate<1?b*(this._aniSec+this._secRate)/60:b*n/60,d=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-d,c.thickness,d),u.internalSetStyleOrClass(c.style),u.setPath(l.close(!0)).translate(a,h).rotate(_*V),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new da(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends aa{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new _n(t,ua)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(Math.min(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.translate(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends Da{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new Na(t),this._scaleView)}_createPool(t){return new _n(t,Oa)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVisible(r.visible)){const h=+r.gap||0;if(t.vertical){const t=i.measure(this.doc,r,s.width,s.height,1).height+h;s.height-=t,e.height-=t,n=s.x,r.position===Zs.OPPOSITE?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+h}i.resizeByMeasured().layout().translate(n,a)}}},bulletgroup:class extends Da{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new _n(t,Ra)}}},Ga={text:$a,image:Fa};function ja(t,e){return new(za[e._type()])(t)}class Wa extends rn{constructor(t){super(t,"rct-axis-grid"),this._lines=new _n(this,Ai)}_doMeasure(t,e,s,i,r){return qr.create(s,i)}_doLayout(){const t=this.model,e=t.axis,s=this.width,i=this.height,r=t.getPoints(e._isHorz?s:i),n=this._lines,a=n.count-1;n.prepare(r.length,(t=>{t.setClass("rct-axis-grid-line")})),n.forEach(((t,n)=>{t.setBoolData("first",0===n),t.setBoolData("last",r[n]===(e._isHorz?s:i))})),e._isHorz?n.forEach(((e,n)=>{e.setVisible((r[n]>0||0!==n||t.startVisible)&&(r[n]<s||n!==a||t.endVisible))&&e.setVLineC(r[n],0,i)})):n.forEach(((e,n)=>{e.setVisible((r[n]<i||0!==n||t.startVisible)&&(r[n]>0||n!==a||t.endVisible))&&e.setHLineC(i-r[n],0,s)}))}}class Ya extends dt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new mt(t)),this._mask.setStyle("stroke","none"),this.add(this._upLine=new mt(t)),this._upLine.setStyle("fill","none"),this.add(this._downLine=new mt(t)),this._downLine.setStyle("fill","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 Ur;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<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 Xa extends dt{constructor(t){super(t,"rct-axis-guide"),this.add(this._label=new tn(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t){this.model=t,this._label.text=t.label.text,this._label.setStyles(t.label.style)}}class Ua extends Xa{constructor(t){super(t),this.insertFirst(this._line=new Ai(t,"rct-axis-guide-line"))}prepare(t){super.prepare(t),this._line.setStyles(t.style)}layout(t,e){const s=this.model,i=s.label,r=this._label;let n,a,h,o;if(this.vertical()){const r=s.axis.getPosition(t,s.value,!0);switch(this._line.setVLineC(r,0,e),i.align){case $.CENTER:n=r,h=Kr.MIDDLE;break;case $.RIGHT:n=r,h=Kr.START;break;default:n=r,h=Kr.END}switch(i.verticalAlign){case F.BOTTOM:a=e,o=Qr.BOTTOM;break;case F.MIDDLE:a=e/2,o=Qr.MIDDLE;break;default:a=0,o=Qr.TOP}}else{const l=e-s.axis.getPosition(e,s.value,!0);switch(this._line.setHLineC(l,0,t),i.align){case $.CENTER:n=t/2,h=Kr.MIDDLE;break;case $.RIGHT:n=t,h=Kr.END;break;default:n=0,h=Kr.START}switch(i.verticalAlign){case F.BOTTOM:a=l+1,o=Qr.TOP;break;case F.MIDDLE:a=l,o=Qr.MIDDLE;break;default:a=l-r.getBBounds().height,o=Qr.TOP}}r.anchor=h,r.layout=o,r.translate(n,a)}}class qa extends Xa{constructor(t){super(t),this.insertFirst(this._box=new Ue(t,"rct-axis-guide-range"))}prepare(t){super.prepare(t)}layout(t,e){const s=this.model,i=this._label;if(this.vertical()){const r=s.axis.getPosition(t,s.start,!0),n=s.axis.getPosition(t,s.end,!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a+=(n-r)/2,o=Kr.MIDDLE;break;case $.RIGHT:a=n,o=Kr.END;break;default:a=r,o=Kr.START}switch(s.label.verticalAlign){case F.BOTTOM:h=e,l=Qr.BOTTOM;break;case F.MIDDLE:h=e/2,l=Qr.MIDDLE;break;default:h=0,l=Qr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(r,0,n,e)}else{const r=e-this.model.axis.getPosition(e,Math.min(s.start,s.end),!0),n=e-this.model.axis.getPosition(e,Math.max(s.start,s.end),!0);let a,h,o,l;switch(s.label.align){case $.CENTER:a=t/2,o=Kr.MIDDLE;break;case $.RIGHT:a=t,o=Kr.END;break;default:a=0,o=Kr.START}switch(s.label.verticalAlign){case F.BOTTOM:h=r,l=Qr.BOTTOM;break;case F.MIDDLE:h=n+(r-n)/2,l=Qr.MIDDLE;break;default:h=n,l=Qr.TOP}i.anchor=o,i.layout=l,i.translate(a,h),this._box.setBox(0,n,t,r)}}}class Za extends _t{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(let e=t.length-1;e>=0;e--){const e=t.pop();e.remove(),e instanceof qa?this._rangePool.push(e):this._linePool.push(e)}R(0===t.length,"GuideContainer.prepare")}addAll(t,e){e.forEach((e=>{if(e instanceof Ve){let s=this._rangePool.pop()||new qa(t);this.add(s),s.prepare(e),this._views.push(s)}else if(e instanceof ve){let s=this._linePool.pop()||new Ua(t);this.add(s),s.prepare(e)}}))}add(t){return this._views.push(t),super.add(t)}}class Ka extends mt{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 Ur;if(this._bar){const o=n._isHorz?i:r;let l=-1;if(t?l=t.point.xValue:this._model.showAlways&&n instanceof cs&&(l=n.reversed?n.categoryAt(a?i-e:s):n.categoryAt(a?e:r-s)),l>=0){const t=n.getPosition(o,l),e=n.getUnitLength(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 Qa extends Ba{constructor(t){super(t,"Reset Zoom","rc-reset-zoom"),this.visible=!1}}class Ja extends rn{constructor(t,e){super(t,Ja.BODY_CLASS),this._gridViews=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 Xe(t)),this._hitTester.setStyle("fill","transparent"),this.add(this._background=new Xe(t,"rct-body-background")),this.add(this._image=new gn(t,"rct-body-image")),this.add(this._gridContainer=new _t(t,"rct-grids")),this.add(this._guideContainer=new Za(t,"rct-guides")),this.add(this._annotationContainer=new _t(t,"rct-annotations")),this.add(this._seriesContainer=new _t(t,"rct-series-container")),this.add(this._axisBreakContainer=new _t(t,"rct-axis-breaks")),this.add(this._labelContainer=new _t(t,"rct-label-container")),this.add(this._frontGuideContainer=new Za(t,"rct-front-guides")),this.add(this._frontAnnotationContainer=new _t(t,"rct-front-annotations")),this.add(this._feedbackContainer=new _t(t,"rct-feedbacks")),this.add(this._zoomButton=new Qa(t)),this._crosshairLines=new _n(this._feedbackContainer,Ka)}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,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($n.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains($n.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}return this._zoomRequested||this._crosshairLines.forEach((e=>{e.setVisible(r)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n.model,a):this.$_setFocused(null,null),r}$_setFocused(t,e){if(e!=this._focused)return this._focused&&this._focused.unsetData($n.DATA_FOUCS),this._focused=e,this._focused?(this._focused.setData($n.DATA_FOUCS),this._owner.showTooltip(t,e.point)):this._owner.hideTooltip(),!0}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===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;let o=a.getValueAt(h,n?h-i:t),l=a.getValueAt(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.setVisible(e.zoomButton.isVisible())&&this._zoomButton.layout(),qr.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.setVisible(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{this._owner.clipSeries(s.getClipContainer(),0,0,t,e,s.invertable()),s.resize(t,e),s.layout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.translate(t-i._sect.pos,0):s.translate(i._sect.pos,0):r.reversed?s.translate(0,i._sect.pos):s.translate(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e)))}))}this.$_preppareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().translatep(s.getPosition(t,e))})),this._annotationViews.forEach((s=>{s.resizeByMeasured(),s.layout().translatep(s.model.getPostion(t,e,s.width,s.height))})),this._zoomButton.visible&&this._zoomButton.translate(t-this._zoomButton.getBBounds().width-10,10)}$_createGaugeView(t,e){return new(Ha[e._type()])(t)}$_createAnnotationView(t,e){return new(Ga[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible()||(r.get(t).remove(),r.delete(t));[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if(s&&e.grid.isVisible()&&!r.has(e)){const s=new Wa(t);r.set(e,s),i.add(s)}}))))}_prepareSeries(t,e,s){const i=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=>{t.remove(),t._labelContainer.remove()})),n.length=0,s.forEach((e=>{const s=r.get(e)||ja(t,e);s._setChartOptions(i,this._animatable),this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer),r.set(e,s),n.push(s),s.prepareSeries(t,e)}))}_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((e=>{const s=n.get(e)||this.$_createGaugeView(t,e);s._setChartOptions(r,this._animatable),i.add(s),n.set(e,s),a.push(s),s.prepareGauge(t,e)}))}$_prepareAnnotations(t,e,s){const i=this._annotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())s.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=s).forEach((e=>{const s=r.get(e)||this.$_createAnnotationView(t,e);i.add(s),r.set(e,s),n.push(s)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof Ds&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new Ya(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_preppareCrosshairs(t){const e=this._crosshairLines,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])}))}}Ja.BODY_CLASS="rct-body";class th extends dt{constructor(t){super(t,eh.HANDLE_STYLE),this.add(this._back=new Xe(t)),this.add(this._shape=new mt(t)),this._shape.setStyle("fill","white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*Math.min(t,e);const r=new Ur;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=t,this._h=e,this._vertical=s}}}class eh extends rn{static isHandle(t){return t.parentElement.classList.contains(eh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(eh.MASK_STYLE)}constructor(t){super(t,eh.CLASS_NAME),this.add(this._back=new Xe(t,eh.BACK_STYLE)),this.add(this._container=new _t(t,null)),this.add(this._mask=new Xe(t,eh.MASK_STYLE)),this.add(this._startHandle=new th(t)),this.add(this._endHandle=new th(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()}))}_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*i/e.axisLen():0,n=s?s.end*i/e.axisLen():i;this._mask.setBounds(t,0,n-t,r),this._startHandle.layout(r/3,r/3,!1),this._startHandle.translate(t,r/2),this._endHandle.layout(r/3,r/3,!1),this._endHandle.translate(n,r/2)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView&&(this._yAxisView.measure(this.doc,e._naviChart.yAxis,i,r,1),this._yAxisView.resize(i,r),this._yAxisView.layout())}$_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=ja(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 dn(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 dn(t)),i._simpleMode=!0)}}eh.CLASS_NAME="rct-navigator",eh.BACK_STYLE="rct-navigator-back",eh.MASK_STYLE="rct-navigator-mask",eh.HANDLE_STYLE="rct-navigator-handle",eh.HANDLE_BACK_STYLE="rct-navigator-handle-back";class sh extends xt{constructor(t){super(),this.chart=t}}class ih extends sh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){return this._xStart=e-this._body.tx,this._yStart=s-this._body.ty,this._body.addFeedback(this._feedback=new Xe(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){this._vertical?(e-=this._body.ty,this._body.setZoom(0,Math.min(this._yStart,e),this._body.width,Math.max(this._yStart,e))):(t-=this._body.tx,this._body.setZoom(Math.min(this._xStart,t),0,Math.max(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){return this._vertical?(r-=this._body.ty,this._feedback.setBounds(0,Math.min(this._yStart,r),this._body.width,Math.abs(this._yStart-r))):(i-=this._body.tx,this._feedback.setBounds(Math.min(this._xStart,i),0,Math.abs(this._xStart-i),this._body.height)),!0}}class rh extends sh{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)),!0}}class nh extends sh{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:e-a.x,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(),h=n.model.axisLen();let o=n.svgToElement(i,r).x-this._startOff;return this._handleView._vertical?this._isStart:this._isStart?o>0&&a.zoom(o*h/n.width,NaN):o>0&&o<n.width&&a.zoom(NaN,o*h/n.width),!0}}class ah extends sh{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._zoomLen=n._zoom.length,!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axisLen(),h=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(h*a/n.height):this.$_moveZoom(h*a/n.width),!0}$_moveZoom(t){t=Math.max(0,Math.min(t,this._view.model._naviChart.xAxis.length()-this._zoomLen)),this._view.model.axis().zoom(t,t+this._zoomLen)}}class hh{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&&(Math.abs(this._clickX-s)>3||Math.abs(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 Ze){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 Un&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible;else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){}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.bodyView();return un.isThumb(t)?new rh(this._chart,i.getScrollView(t)):r.model.canZoom()&&r.contains(t)?new ih(this._chart,r,i._inverted):eh.isHandle(t)?new nh(this._chart,i._navigatorView,t):eh.isMask(t)&&this._chart.model.body.isZoomed()?new ah(this._chart,i._navigatorView,t):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 oh{static empty(){return new oh}static create(t=0,e=0){return new oh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}get isEmpty(){return 0===this.x||0===this.y}clone(){return new oh(this.x,this.y)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y}setEmpty(){return this.x=this.y=0,this}set(t,e){return this.x=t,this.y=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t}toString(){return"{x: "+this.x+", y: "+this.y+"}"}}class lh extends _t{constructor(t){super(t,lh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVisible(!1)}setHistory(t,e){if(this.setVisible(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new tn(t,"rct-history-item");e.anchor=Kr.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new tn(t);e.anchor=Kr.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].translateX(n),a<r-1&&(n+=e[a].width+i,s[a].translateX(n),n+=s[a].width+i)}}lh.TITLE_CLASS="rct-history";class ch extends rn{constructor(t){super(t,"rct-legend-item"),this.add(this._label=new tn(t,"rct-legend-item-label")),this._label.anchor=Kr.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){W.setData(this._label.dom,"hidden",e.source.visible?"":1),W.setData(this._marker.dom,"hidden",e.source.visible?"":1),this._label.text=e.text();const n=this._marker.getBBounds(),a=tt(this._label.getBBounds());return this._gap=c(e.legend.markerGap,0),qr.create(n.width+this._gap+a.width,Math.max(n.height,a.height))}_doLayout(){const t=this._marker.getBBounds();this._marker.translate(0,(this.height-t.height)/2),this._label.translate(t.width+this._gap,(this.height-this._label.getBBounds().height)/2)}}class uh extends nn{constructor(t){super(t,uh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new _n(this,ch)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===Ge.VERTICAL;return this._ipr=c(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==He.PLOT?c(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=this._sizes,i=t.itemsAlign,r=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,o=this._vertical,l=a.left+h.left,c=a.top+h.top;let u,d=l,_=c;this._itemViews.forEach((t=>{t._marker.setStyle("fill",t.model.source.legendColor()),t._marker.setStyle("stroke",t.model.source.legendColor()),t.resizeByMeasured().layout()})),e.forEach(((t,e)=>{o?(_=c,i!==je.CENTER&&i!==je.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,i===je.CENTER?_+=(this.height-u)/2:_+=this.height-u),t.forEach((t=>{t.translate(d,_),_+=t.height+n})),d+=s[e]+r):(d=l,i!==je.CENTER&&i!==je.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.left+a.right+h.left+h.right,i===je.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.translate(d,_),d+=t.width+n})),_+=s[e]+r)}))}$_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,u=this._rowViews=[],d=this._sizes=[];let _,g,p,m;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t)),e.measure(t,a[s],r,n,1)}));let w=0,x=0;if(s){for(;w<c;)m=h.get(w),x%i==0?(u.push(p=[m]),g=m.mh,x++,w++):(g+=o+m.mh,g<=n?(p.push(m),x++,w++):x=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{s+=t.mh,e=Math.max(e,t.mw)})),s+=o*(t.length-1),g=Math.max(g,s),_+=e,d.push(e)})),_+=l*(u.length-1)}else{for(;w<c;)m=h.get(w),x%i==0?(u.push(p=[m]),_=m.mw,x++,w++):(_+=o+m.mw,_<=r?(p.push(m),x++,w++):x=0);_=g=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=Math.max(s,t.mh)})),e+=o*(t.length-1),_=Math.max(_,e),g+=s,d.push(s)})),g+=l*(u.length-1)}return qr.create(_,g)}}uh.LEGEND_CLASS="rct-legend";let dh=class extends an{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 dn(t);this.add(e),n.push(e)}for(;n.length>a.length;)n.pop().remove();if(n.forEach(((e,s)=>{const r=a[s]._runPos;if(e.model=a[s],r===de.BETWEEN){let s=this.isX?this.row:this.row-1,r=this.isX?this.col-1:this.col;e.prepareGuides(t,i[s][r]._guideContainer,i[s][r]._frontGuideContainer),s=this.row,r=this.col,e.prepareGuides(t,i[s][r]._guideContainer,i[s][r]._frontGuideContainer)}else{const s=r===de.OPPOSITE?this.row-1:this.row,n=r===de.OPPOSITE?this.col-1:this.col;e.prepareGuides(t,i[s][n]._guideContainer,i[s][n]._frontGuideContainer)}})),this.axes=a,this.setVisible(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.layout()}))}};class _h extends an{constructor(t,e){super(t),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 dh(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=Math.max(a,n.measure(t,e,s,i,r).height)})):this.sections.forEach((a=>{n=Math.max(n,a.measure(t,e,s,i,r).width)})),{width:n,height:a}}_doLayout(t){this._isHorz?this.sections.forEach(((e,s)=>{this.height>0&&(e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height).translate(t[2*s+1]-t[1],0),e.layout())})):this.sections.forEach(((e,s)=>{this.width>0&&(e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]).translate(0,this.height-(t[2*(s+1)]-t[1])),e.layout())}))}}class gh extends Ja{constructor(){super(...arguments),this.row=0,this.col=0}prepareSeries(t,e){const s=this.row,i=this.col,r=e._getSeries().getPaneSeries(s,i),n=e._getGauges().getPaneVisibles(s,i);this._animatable=ut._animatable&&e.animatable(),this._prepareSeries(t,e,r),this._prepareGauges(t,e,n)}}class ph extends _t{constructor(t,e){super(t,ph.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}measure(t,e,s,i,r,n,a){const h=e.chart,o=this._inverted=e.chart.isInverted(),l=r,c=n;this.$_init(t),this._model=e,this.$_prepareBodies(t,e),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 u=e.getXLens(o?n:r),d=e.getYLens(o?r:n);e.calcAxesPoints(u,d)}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)}$_init(t){this._back||(this.add(this._back=new Xe(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new _t(t,x)),this.add(this._axisContainer=new _t(t,x)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount(),r=this._bodies,n=this._bodyMap=[];for(;r.length<i;){const e=new gh(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.prepareSeries(t,s),e.prepareGuideContainers()}))}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new _h(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).translate(r[2*s],i-n[n.length-2]),t.layout(n)}))}else{const t=r[1],e=r[2]-t;a.forEach(((t,s)=>{t.resize(e,t.mh).translate(r[2*s+1],i-n[2*s+1]),t.layout(r)}))}else if(e){const t=n[1];s=n[n.length-2]-t,a.forEach(((e,a)=>{e.resize(s,e.mh).translate(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).translate(n[2*a],i-t),s.layout(r)}))}}$_layoutBodies(t,e,s){const i=t.chart.body,r=t.rowCount(),n=t.colCount(),a=this._rowPoints,h=this._colPoints,o=this._bodies;if(this._inverted)for(let t=0;t<r;t++){const e=a[2*(t+1)-1],s=a[2*(t+1)];for(let r=0;r<n;r++){const a=o[t*n+r],l=h[2*r+1],c=h[2*(r+1)];a.measure(this.doc,i,s-e,c-l,1),a.resize(s-e,c-l).translate(e,this.height-c),a.layout()}}else for(let t=0;t<r;t++){const e=a[2*(t+1)-1],r=a[2*(t+1)];for(let a=0;a<n;a++){const l=o[t*n+a],c=h[2*(a+1)-1],u=h[2*(a+1)];l.measure(this.doc,i,u-c,r-e,1),l.resize(u-c,r-e).translate(c,s-r),l.layout()}}}}ph.STYLE_NAME="rct-panes";class mh extends dt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new qn(t))}layout(){}}class wh extends dt{constructor(t,e){super(t,e),this.add(this._markContainer=new _t(t,"rct-polar-axis-markers")),this._markViews=new _n(this._markContainer,mh),this.add(this._gridContainer=new dt(t,"rct-polar-axis-grids")),this.add(this._labelContainer=new _t(t,"rct-polar-axis-labels")),this._labelViews=new _n(this._labelContainer,tn,"rct-polar-axis-label")}prepare(t,e,s){this._model=e,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s)}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)}$_prepareLabels(t,e){if(this._labelContainer.setVisible(e.label.visible)){const t=e._ticks;this._labelViews.prepare(t.length,((e,s)=>{e.text=t[s].label}),(t=>{t.anchor=Kr.START}))}}}class xh extends wh{constructor(t,e){super(t,"rct-polar-xaxis"),this._gridLines=new _n(this._gridContainer,Ai,xh.GRID_CLASS),e.add(this._lineView=new Zn(t,xh.LINE_CLASS))}_doPrepare(t,e,s){this._gridContainer.setVisible(!1!==t.grid.visible)&&this._gridLines.prepare(e.length),(this._lineView.visible=t.line.visible)&&(s&&this._lineView instanceof Ei?(this._lineView.remove(),this.add(this._lineView=new Zn(this.doc,xh.LINE_CLASS))):!s&&this._lineView instanceof qn&&(this._lineView.remove(),this.add(this._lineView=new Ei(this.doc,xh.LINE_CLASS))),this._lineView.setStyleOrClass(t.line.style))}_doLayout(t,e,s,i,r,n){const a=t.chart.startAngle();if(r.forEach((t=>t.pos=t.pos/i)),this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const h=r[n].pos,o=e+Math.cos(a+h)*i,l=s+Math.sin(a+h)*i;t.setLine(e,s,o,l)})),this._labelContainer.visible){const n=i+t.tick.length;this._labelViews.forEach(((t,i)=>{const h=r[i];t.anchor=Kr.MIDDLE,t.layout=Qr.MIDDLE,t.text=h.label;const o=t.getBBounds(),l=h.pos,c=e+Math.cos(a+l)*(n+o.width/2),u=s+Math.sin(a+l)*(n+o.height/2);t.translate(c,u)}))}if(this._lineView.visible)if(this._lineView instanceof qn)this._lineView.setCircle(e,s,i);else{const t=[];r.forEach((r=>{const n=r.pos;t.push(e+Math.cos(a+n)*i,s+Math.sin(a+n)*i)})),this._lineView.setPoints(...t)}}}xh.LINE_CLASS="rct-polar-xaxis-line",xh.GRID_CLASS="rct-polar-xaxis-grid-line";class fh extends wh{constructor(t,e){super(t,"rct-polar-yaxis"),this._gridLines=new _n(this._gridContainer,Zn,"rct-polar-yaxis-grid-line"),this._gridLines.circular=!1,e.add(this._lineView=new Ai(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s){this._gridContainer.setVisible(!1!==t.grid.visible)&&(s!==this._gridContainer.circular&&(this._gridLines.destroy(),this._gridLines=new _n(this._gridContainer,s?Zn:Ei,"rct-polar-yaxis-grid-line"),this._gridContainer.circular=s),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){this._gridContainer.visible&&this._gridLines.forEach(((i,a)=>{const h=r[a].pos;if(i instanceof Zn)i.setCircle(e,s,h);else if(i instanceof Ei){const r=t.chart.startAngle(),a=[];n._ticks.forEach((t=>{const i=t.pos*Math.PI*2;a.push(e+Math.cos(r+i)*h,s+Math.sin(r+i)*h)})),i.setPoints(...a)}})),this._labelContainer.visible&&this._labelViews.forEach(((t,i)=>{const n=r[i];t.anchor=Kr.END,t.layout=Qr.MIDDLE,t.text=n.label,t.translate(e-4,s-n.pos)})),this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}class bh extends Ja{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),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{t.resize(2*i,2*i),t.layout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)}))}$_prepareAxes(t,e,s,i){this._axisContainer||(this.insertFirst(this._lineContainer=new _t(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new _t(t,"rct-polar-axes")),this._axisContainer.add(this._xAxisView=new xh(t,this._lineContainer))),this._xAxisView.prepare(t,e,i);const r=this._yAxisViews;for(;r.length<s.length;){const e=new fh(t,this._lineContainer);this._axisContainer.add(e),r.push(e)}for(;r.length>s.length;)r.pop().remove();r.forEach(((e,r)=>e.prepare(t,s[r],i)))}}class yh extends nn{constructor(t,e){super(t,e?yh.SUBTITLE_CLASS:yh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.add(this._textView=new tn(t)),this._textView.anchor=Kr.START}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this.setBoolData("hassub",e.chart.subtitle.isVisible()),this._textView.text=this.model.text,tt(this._textView.getBBounds())}_doLayout(){this._textView.translate(this._margins.left+this._paddings.left,this._margins.top+this._paddings.top),this._textView.layoutText()}}yh.TITLE_CLASS="rct-title",yh.SUBTITLE_CLASS="rct-subtitle";class vh extends dt{constructor(t){super(t,"rct-tooltip"),this._textCallback=(t,e,s)=>this._model.getValue(this._series,t,e,s),this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new mt(t,"rct-tooltip-back")),this.add(this._textView=new tn(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+ut.SHADOW_FILTER+")"),this._textView.anchor=Kr.START,this._richText=new Rt,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.tooltip,a=this._textView;this._series=t,this._richText.setFormat(n.text),this._richText.build(a,NaN,NaN,e,this._textCallback);const h=a.getBBounds(),o=Math.max(n.minWidth||0,h.width+16),l=Math.max(n.minHeight||0,h.height+12),c=new Ur;c.rect(0,0,o,l),this._back.setPath(c.end(!0)),a.translate((o-h.width)/2,(l-h.height)/2);const u="visible"===this.getStyle("visibility")?300:0;n.series.chart.isInverted()?this.translateEx(s+n.offset,i-l/2,u,!1):this.translateEx(s-o/2,i-l-n.offset,u,!1),0===u&&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:Qe.HIDE_DELAY))}$_hide(){!function(t,e,s,i,r,n){const a=null!=s?C(e,s):{},h=C(e,i),o=t.animate([a,h],{duration:r,fill:"none"});o&&n&&o.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}}class Vh extends an{_doInitChildren(t){this.add(this.titleView=new yh(t,!1)),this.add(this.subtitleView=new yh(t,!0))}_doMeasure(t,e,s,i,r){const n=[e.title,e.subtitle];let a=s,h=0;return[this.titleView,this.subtitleView].forEach(((e,o)=>{if(e.visible=n[o].isVisible()){const l=e.measure(t,n[o],s,i,r);h+=l.height,i-=l.height,a=Math.max(l.width)}})),{width:a,height:h}}_doLayout(t){let e=0;[this.titleView,this.subtitleView].forEach((s=>{if(s.visible){const i=s.model,r=s.width>t.wPlot||i.alignBase===H.CHART?t.wChart:t.wPlot;let n=s.width>t.wPlot||i.alignBase===H.CHART?0:t.xPlot;switch(s.resizeByMeasured().layout(),i.align){case $.LEFT:break;case $.RIGHT:n+=r-s.width;break;default:n+=(r-s.width)/2}s.translate(n,e),e+=s.height}}))}}class Sh extends an{_doInitChildren(t){this.add(this._legendView=new uh(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===He.LEFT||h===He.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 He.LEFT:s-=e;break;case He.RIGHT:s-=e,r+=e;break;case He.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).translate(r,n),t.layout()}}class Ph extends an{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i){const r=this.views;for(;r.length<e.length;){const e=new dn(t);this.add(e),r.push(e)}for(;r.length>e.length;)r.pop().remove();if(r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,s,i)})),this.axes=e,this.setVisible(r.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}_doMeasure(t,e,s,i,r){this._inverted;let n=0,a=0;return[this.views].forEach((e=>{if(e){const h=this.axes,o=(this.isX,s),l=(this.isX,i);let c=0,u=0;e.forEach(((e,s)=>{const i=e.measure(t,h[s],o,l,r);e.setAttr("xy",h[s]._isX?"x":"y"),c+=i.width,u+=i.height})),this.isHorz?u+=(e.length-1)*this._gap:c+=(e.length-1)*this._gap,n=Math.max(n,c),a=Math.max(a,u)}})),qr.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=>{this.isHorz?t.resize(e,t.mh):t.resize(t.mw,s),t.layout(),this.isHorz?(t.translate(i,this.dir===z.TOP?s-a-t.mh:a),a+=t.mh+this._gap):(t.translate(this.dir===z.RIGHT?a:e-a-t.mw,r),a+=t.mw+this._gap)})),this.isHorz?i+=e+t:r+=s+t}}))}}class kh extends sn{}class Ah extends rn{constructor(t){super(t,"rct-credits"),this.add(this._textView=new tn(t)),this._textView.anchor=Kr.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.getBBounds()}}class Eh extends _t{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this.add(this._plotContainer=new _t(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Ja(t,this));for(const e in z){const s=new Ph(t,z[e]);this._plotContainer.add(s),this._axisSectionMap[z[e]]=s}this.add(this._paneContainer=new ph(t,this)),this.add(this._titleSectionView=new Vh(t)),this.add(this._legendSectionView=new Sh(t)),this.add(this._navigatorView=new eh(t)),this.add(this._creditView=new Ah(t)),this.add(this._historyView=new lh(t)),this.add(this._tooltipView=new vh(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}measure(t,e,s,i,r){if(e&&e.prepareRender(),this.$_checkEmpty(t,e,s,i))return;const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend,l=n.seriesNavigator;let c,u=s,d=i;if(this._inverted=n.isInverted(),n.isSplitted()?(this._plotContainer.setVisible(!1),this._paneContainer.setVisible(!0),this.$_preparePanes(t)):(this._plotContainer.setVisible(!0),this._paneContainer.setVisible(!1),this.$_prepareBody(t,a)),this._creditView.setVisible(h.visible)&&(c=this._creditView.measure(t,h,u,d,r),h.floating||(d-=c.height+h.offsetY)),c=this._titleSectionView.measure(t,n,u,d,r),d-=c.height,this._legendSectionView.setVisible(o.isVisible()))switch(c=this._legendSectionView.measure(t,n,u,d,r),o.getLocatiion()){case He.TOP:case He.BOTTOM:d-=c.height;break;case He.RIGHT:case He.LEFT:u-=c.width}this._navigatorView.setVisible(l.isVisible()),this._paneContainer.visible?this._paneContainer.measure(t,n.split,n.xPaneAxes,n.yPaneAxes,u,d,1):a?this.$_measurePolar(t,n,u,d,1):this.$_measurePlot(t,n,u,d,1),this._navigatorView.visible&&(n.seriesNavigator._vertical?d=this._bodyView.mh:u=this._bodyView.mw,this._navigatorView.measure(t,l,u,d,r))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;if(null===(t=this._emptyView)||void 0===t?void 0:t.visible)return void this._emptyView.resize(i,r);const n=this._model,a=n.isPolar(),h=n.legend,o=n.options.credits,l=this._creditView;let u=0,d=0,_=0,g=0;l.visible&&(l.resizeByMeasured(),o.floating||(o.verticalAlign===F.TOP?r-=u=l.height+o.offsetY:r-=d=l.height+o.offsetY));const p=this._titleSectionView;let m=0;const w=g+u;p.visible&&(p.resizeByMeasured(),r-=m=p.height),g=s-d;const x=this._navigatorView;let f=0;x.visible&&(x.model._vertical||(x.resize(x.mw,x.mh-x.model.gap-x.model.gapFar),r-=f=x.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,h.getLocatiion()){case He.TOP:y=m+u,r-=V;break;case He.BOTTOM:r-=V,y=g-V,g-=V;break;case He.RIGHT:i-=S,v=e-S;break;case He.LEFT:i-=S,_+=S,v=0}x.visible&&(g-=f,x.layout().translateY(g+x.model.gap));let P=0,k=0,A=0,E=0;if(this._paneContainer.visible)this._paneContainer.resize(i,r).translate(_,w+m),this._paneContainer.layout(),A=r,E=i;else{const t=this._axisSectionMap,e=t[z.CENTER],s=t[z.MIDDLE];let n;a||(e&&e.visible&&(P=e.mw),s&&s.visible&&(k=s.mh),[z.LEFT,z.RIGHT].forEach((e=>{(n=t[e])&&n.visible&&(i-=n.mw)})),[z.TOP,z.BOTTOM].forEach((e=>{(n=t[e])&&n.visible&&(r-=n.mh)})),(n=t[z.LEFT])&&n.visible&&(n.resize(n.mw,r),n.layout(k),_+=n.mw),(n=t[z.RIGHT])&&n.visible&&(n.resize(n.mw,r),n.layout(k)),P>0&&(e.resize(n.mw,r),e.layout()),(n=t[z.BOTTOM])&&n.visible&&(n.resize(i,n.mh),n.layout(P),g-=n.mh),(n=t[z.TOP])&&n.visible&&(n.resize(i,n.mh),n.layout(P)),k>0&&(s.resize(i,n.mh),s.layout())),x.visible&&x.layout().translateX(_);const h=this._org=oh.create(_,g);this._plotWidth=i,this._plotHeight=r,a||((n=t[z.LEFT])&&n.visible&&n.translate(h.x-n.mw,h.y-n.height),(n=t[z.RIGHT])&&n.visible&&n.translate(h.x+i,h.y-n.height),P>0&&e.translate(h.x+(i-P)/2,h.y-e.height),(n=t[z.BOTTOM])&&n.visible&&n.translate(h.x,h.y),(n=t[z.TOP])&&n.visible&&n.translate(h.x,h.y-r-n.height),k>0&&s.translate(h.x,h.y-(r-k)/2-k)),A=this._plotHeight-k,E=this._plotWidth-P,_=h.x,g=h.y-this._plotHeight,this._currBody.resize(E,A),this._currBody.layout().translate(_,g)}if(l.visible){const t=o.offsetX||0,i=o.offsetY||0;let r,n;switch(l.layout(),o.verticalAlign){case F.TOP:break;case F.MIDDLE:n=(s-l.height)/2+i;break;default:n=s-d}switch(o.align){case $.LEFT:r=t;break;case $.CENTER:r=(e-l.width)/2+t;break;default:r=e-l.width-t}l.translate(r,n)}if(E+=P,p.visible&&p.layout({xPlot:_,wPlot:E,wChart:e}).translate(0,w),b.visible){if(h.location===He.PLOT){let t=c(h.offsetX,0);switch(h.align){case $.RIGHT:_+=E-S-t;break;case $.CENTER:_+=(E-S)/2+t;break;default:_+=t}switch(t=c(h.offsetY,0),h.verticalAlign){case F.BOTTOM:g+=A-V-t;break;case F.MIDDLE:g+=(A-V)/2+t;break;default:g+=t}}else if(isNaN(y)){const t=c(h.offsetY,0);if(_=v,h.alignBase===H.CHART){switch(h.verticalAlign){case F.TOP:g=t;break;case F.BOTTOM:g=s-V-t;break;default:g=(s-V)/2+t}g+V>s&&(g=(s-V)/2)}else switch(h.verticalAlign){case F.TOP:g+=t;break;case F.BOTTOM:g=g+r-V-t;break;default:g=g+(r-V)/2+t}g+V>s&&(g=(s-V)/2),g<0&&(g=0)}else{const t=c(h.offsetX,0);if(g=y,h.alignBase===H.CHART)switch(h.align){case $.LEFT:_=t;break;case $.RIGHT:_=e-S-t;break;default:_=(e-S)/2+t}else switch(h.align){case $.LEFT:_+=t;break;case $.RIGHT:_=_+i-S-t;break;default:_+=(i-S)/2+t}_+S>e&&(_=(e-S)/2),_<0&&(_=0)}b.translate(_,g)}this._tooltipView.close(!0,!1)}showTooltip(t,e){const s=e.xPos+this._bodyView.tx,i=e.yPos+this._bodyView.ty;this._tooltipView.show(t,e,s,i,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}findSeriesView(t){return this._bodyView.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}clipSeries(t,e,s,i,r,n){t&&(this._model.inverted&&n?this._seriesClip.setBounds(0,-i,r,i):this._seriesClip.setBounds(0,0,i,r),t.setClip(this._seriesClip))}pointerMoved(t,e,s){const i=this._bodyView.controlToElement(t,e),r=this._bodyView.pointerMoved(i,s);for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?this._bodyView.width:this._bodyView.height,n=t.model._isHorz?i.x:i.y,a=r&&e.visible&&e.flag.visible&&!e.isBar()&&e.getFlag(s,n);a?t.showCrosshair(n,a):t.hideCrosshiar()}))}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._bodyView.getButton(t)}buttonClicked(t){this._bodyView.buttonClicked(t)}getScrollView(t){for(const e in z){const s=this._axisSectionMap[z[e]].getScrollView(t);if(s)return s}}_doAttached(t){this._seriesClip=this.control.clipBounds()}$_checkEmpty(t,e,s,i){if(!e||e.isEmpty())return this._emptyView||(this._emptyView=new kh(t)),this._emptyView.resize(s,i),!0;this._emptyView&&(this._emptyView.visible=!1)}$_preparePanes(t){}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new bh(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVisible(!1),this._polarView.setVisible(!0)):(null===(i=this._polarView)||void 0===i||i.setVisible(!1),this._bodyView.setVisible(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e.needAxes(),n=this._axisSectionMap;for(const a in n){const h=n[a];r?h.prepare(t,e.getAxes(a),s,i):h.visible=!1}}$_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[z.LEFT].checkWidths(t,s,i),s-=n[z.RIGHT].checkWidths(t,s,i),i-=n[z.BOTTOM].checkHeights(t,s,i),i-=n[z.TOP].checkHeights(t,s,i),this._inverted?s-=o=n[z.CENTER].checkWidths(t,s,i):i-=l=n[z.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===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh),this._inverted?t===z.CENTER&&(s-=o=e.mw):t===z.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)}s=a,i=h,o=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===z.LEFT||t===z.RIGHT?s-=e.mw:t!==z.BOTTOM&&t!==z.TOP||(i-=e.mh),this._inverted?t===z.CENTER&&(s-=o=e.mw):t===z.MIDDLE&&(i-=l=e.mh))}e.calcAxesPoints(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.$_prepareAxes(t,e),e.layoutAxes(a,h,!1,r),e.calcAxesPoints(a,h,!1),this._polarView.measure(t,e.body,s,i,r)}}class Ch extends ut{constructor(t,e){super(t,e),this.addElement(this._chartView=new Eh(t)),this.setPointerHandler(new hh(this))}onModelChanged(t,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.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.loaded=!e,this.clearAssetDefs(),this.model=new Yr(t)}refresh(t){t?this._render():this.invalidateLayout()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}useImage(t){}_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)),s.measure(this.doc(),e,t.width,t.height,1),s.resize(t.width,t.height),s.layout()}_doRenderBackground(t,e,s){this._model&&Object.assign(t.style,this._model.options.style)}}class Lh{constructor(t){this._doInit(this.$_p=t)}_createObjects(...t){for(const e of t)this["_"+e]=new Lh(this.$_p[e])}_doInit(t){}get(t){const e=this.$_p.getProp(t);if(e instanceof It){const e=this[t];return e instanceof Lh?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 Th extends Lh{_doInit(t){this._createObjects("title","line","grid","tick","label","crosshair")}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 Mh extends Th{}class Nh extends Th{}class Oh extends Nh{}class Dh extends Nh{}class Rh extends Lh{_doInit(t){this._createObjects("pointLabel","trendline","tooltip")}get pointLabel(){return this._pointLabel}get trendLine(){return this._trendLine}get tooltip(){return this._tooltip}}class Bh extends Lh{}class Ih extends Rh{}class $h extends Ih{}class Fh extends Rh{}class zh extends Rh{}class Hh extends Rh{}class Gh extends Rh{}class jh extends Rh{}class Wh extends Rh{}class Yh extends Rh{}class Xh extends Rh{}class Uh extends Rh{}class qh extends Rh{}class Zh extends Rh{}class Kh extends Rh{}class Qh extends Rh{}class Jh extends Rh{}class to extends Rh{}class eo extends Rh{}class so extends Rh{}class io extends Rh{}class ro extends Rh{}class no extends Rh{}class ao extends Lh{}class ho extends ao{}class oo extends ho{updateValue(t,e=!0){this.$_p.updateValue(t,e)}}class lo extends Lh{_doInit(t){this._createObjects("line","tick","tickLabel")}get line(){return this._line}get tick(){return this._tick}get tickLabel(){return this._tickLabel}}class co extends oo{_doInit(t){this._createObjects("label")}get label(){return this._label}}class uo extends Lh{_doInit(t){this._createObjects("rangeLabel","thickLabel")}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}}class _o extends co{_doInit(t){this._createObjects("scale","rim","valueRim","marker","hand","pin"),this._band=new uo(t.band)}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get marker(){return this._marker}get hand(){return this._hand}get pin(){return this._pin}}class go extends oo{_doInit(t){this._createObjects("label"),this._scale=new lo(t.scale)}get label(){return this._label}get scale(){return this._scale}}class po extends go{}class mo extends go{}class wo extends ho{}class xo extends ao{}class fo extends Lh{}class bo extends Lh{}class yo extends Lh{}class vo extends Lh{}const Vo={category:Mh,linear:$h,time:Oh,log:Dh},So={area:Fh,arearange:zh,bar:Hh,barrange:Gh,bellcurve:jh,boxplot:Wh,bubble:Yh,candlestick:Uh,dumbbell:qh,equalizer:Zh,errorbar:class extends Rh{},funnel:Kh,heatmap:Qh,histogram:to,line:$h,lollipop:eo,ohlc:class extends Rh{},pareto:so,pie:io,scatter:Xh,treemap:Jh,vector:ro,waterfall:no},Po={circle:_o,linear:po,bullet:mo,clock:wo};function ko(t,e){if(e){let s=t.get(e);return s||(e instanceof gs?s=new(So[e._type()])(e):e instanceof js?s=new(Po[e._type()])(e):e instanceof Ee?s=new(Vo[e.type()])(e):e instanceof Cs?s=new fo(e):e instanceof Ls?s=new bo(e):e instanceof Ye?s=new yo(e):e instanceof $e&&(s=new vo(e)),t.set(e,s)),s}}class Ao{constructor(t){this._objects=new Map,this.$_p=t}load(t,e){this.$_p.load(t,e),this._objects.clear()}render(t=!1){this.$_p.refresh(t)}get xAxis(){return ko(this._objects,this.$_p.model.xAxis)}getXAxis(t){return ko(this._objects,this.$_p.model.getXAxis(t))}get yAxis(){return ko(this._objects,this.$_p.model.yAxis)}getYAxis(t){return ko(this._objects,this.$_p.model.getYAxis(t))}get series(){return ko(this._objects,this.$_p.model.firstSeries)}getSeries(t){return ko(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return ko(this._objects,this.$_p.model.firstGauge)}getGauge(t){return ko(this._objects,this.$_p.model.gaugeByName(t))}get title(){return ko(this._objects,this.$_p.model.title)}get subtitle(){return ko(this._objects,this.$_p.model.subtitle)}get legend(){return ko(this._objects,this.$_p.model.legend)}get body(){return ko(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)}}class Eo{static getVersion(){return"0.9.15"}static setDebugging(t){dt.DEBUGGING=t}static setAnimatable(t){ut._animatable=t}static createChart(t,e,s){const i=new Ch(t,e);return i.model=new Yr(s),new Ao(i)}}const Co=Eo.getVersion,Lo=Eo.setDebugging,To=Eo.setAnimatable,Mo=Eo.createChart;t.RcAreaRangeSeries=zh,t.RcAreaSeries=Fh,t.RcAreaSeriesGroup=class extends Bh{},t.RcBarRangeSeries=Gh,t.RcBarSeries=Hh,t.RcBarSeriesGroup=class extends Bh{},t.RcBellCurveSeries=jh,t.RcBody=vo,t.RcBoxPlotSeries=Wh,t.RcBubbleSeries=Yh,t.RcBulletGauge=mo,t.RcBulletGaugeGroup=class extends xo{},t.RcBumpSeriesGroup=class extends Bh{},t.RcCandlestickSeries=Uh,t.RcCategoryAxis=Mh,t.RcChartAxis=Th,t.RcChartControl=Ao,t.RcChartGauge=ho,t.RcChartGaugeBase=ao,t.RcChartObject=Lh,t.RcChartSeries=Rh,t.RcCircleGauge=_o,t.RcCircleGaugeGroup=class extends xo{},t.RcCircularGauge=co,t.RcClockGauge=wo,t.RcContinuousAxis=Nh,t.RcDumbbellSeries=qh,t.RcEqualizerSeries=Zh,t.RcFunnelSeries=Kh,t.RcGaugeGroup=xo,t.RcGaugeRangeBand=uo,t.RcGaugeScale=lo,t.RcHeatmapSeries=Qh,t.RcHistogramSeries=to,t.RcLegend=yo,t.RcLineSeries=$h,t.RcLineSeriesGroup=class extends Bh{},t.RcLinearAxis=class extends Nh{},t.RcLinearGauge=po,t.RcLinearGaugeGroup=class extends xo{},t.RcLinerGaugeBase=go,t.RcLogAxis=Dh,t.RcLollipopSeries=eo,t.RcParetoSeries=so,t.RcPieSeries=io,t.RcPieSeriesGroup=class extends Bh{},t.RcPointLabel=class extends Th{},t.RcScatterSeries=Xh,t.RcSeriesGroup=Bh,t.RcSubtitle=bo,t.RcTimeAxis=Oh,t.RcTitle=fo,t.RcTreemapSeries=Jh,t.RcValueGauge=oo,t.RcVectorSeries=ro,t.RcWaterfallSeries=no,t.createChart=Mo,t.getVersion=Co,t.setAnimatable=To,t.setDebugging=Lo}));