realchart 1.4.20 → 1.4.21
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/gauge.js +1 -1
- package/gauge.mjs +1 -1
- package/heatmap.js +1 -1
- package/heatmap.mjs +1 -1
- package/ie/gauge.ie.js +1 -1
- package/ie/heatmap.ie.js +1 -1
- package/ie/index.ie.js +2 -2
- package/ie/pictogram.ie.js +1 -1
- package/ie/split.ie.js +1 -1
- package/ie/treemap.ie.js +1 -1
- package/ie/vector.ie.js +1 -1
- package/ie/wordcloud.ie.js +1 -1
- package/index.d.ts +9 -66
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/pictogram.js +1 -1
- package/pictogram.mjs +1 -1
- package/split.js +1 -1
- package/split.mjs +1 -1
- package/treemap.js +1 -1
- package/treemap.mjs +1 -1
- package/vector.js +1 -1
- package/vector.mjs +1 -1
- package/wordcloud.js +1 -1
- package/wordcloud.mjs +1 -1
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.4.
|
|
3
|
+
* RealChart v1.4.21
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"string"==typeof t&&t.length>0},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=function(t){return null==t||isNaN(t)},_=Object.assign,c=Math.floor,d=Math.ceil,u=Math.cos,p=Math.sin,g=Math.log10,f=Math.min,m=Math.max,y=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},w=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},S=t=>t&&_({},t),V=(t,e,s)=>t+(e-t)*s,P=function(t){return"function"==typeof t?t:null},A={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let k="ko",C=A[k]||A[k="ko"];const L=(t,e)=>{t&&s(e)&&(C=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},N=void 0,M=Math.PI,E=2*M,T=-M/2,B=2*M/360,O=360/M/2,R="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function $(t){return Math.floor(1e6*t)/1e6}function F(t){return null==t?null:String(t)}function I(t){return t+"px"}function z(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function H(t){return null==t||Number.isNaN(t)||""===t}function G(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function X(t,e){const s={};return s[t]=e,s}function Y(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)===R?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;tt(C.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 W(t,e){return Y(t,!0)||Y(e,!1)}function U(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z="fill",q="stroke",K={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},Q=function(t){const e=K[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return K[t]=e,e}return e};class J extends Error{}const tt=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},et=function(t,e,r,o=!0,a=!0,h=!1,l){let c,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:x(t.fromValue,d?d.toValue:e),toValue:x(t.toValue,r),color:t.color,style:t.style?_({},t.style):N};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),a&&c.forEach((t=>{t.fromValue=m(t.fromValue,e),t.toValue=f(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),r>o[o.length-1]&&o.push(r);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:s[f(t,s.length-1)],style:n?n[f(t,n.length-1)]:N})}else{let i=x(t.fromValue,e);const o=x(t.toValue,r),a=(o-i)/s.length;let h=0;for(;i<o;)c.push({fromValue:i,toValue:i+=a,color:s[f(h,s.length-1)],style:n?n[f(h,n.length-1)]:N}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:l}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:l})}return c},st="shuffle",it="random",rt="vertical-lr",nt="vertical-rl",ot=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const at="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class ht{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}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 dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&ht.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,ht.month_days[ht.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return _({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(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(i(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 i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(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 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()-ot}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=m(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=m(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 toStr(t){return Number.isNaN(t)||null==t?"":String(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 parseTuples(t){if(i(t)){const e=[];let s=-1/0;return t.forEach(((r,n)=>{i(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>s&&(e.push([+r[0],+r[1]]),s=r[0]):isNaN(r)||n!==t.length-1||e.push([1/0,+r])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+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 setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=this.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),ht.log(t,+new Date-s+"ms")}static clamp(t,e,s){return m(e,f(s,t))}static makeIntArray(t,e){const s=new Array(m(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isAnimation(t){return"[object Animation]"===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=y(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}static diffAngle(t,e){const s=y(t-e);return f(s,E-s)}}ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],ht.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let lt=0;class _t{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(lt++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}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 ct extends _t{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 dt=function(t){return t&&"object"==typeof t};class ut extends ct{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else dt(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&tt(C.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class pt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ut({},s):dt(s)&&i(s.values)&&(r=new ut(s.options,s.values)),this._map[e]=r}}}const gt="0".charCodeAt(0),ft="#".charCodeAt(0),mt=",".charCodeAt(0),yt="s".charCodeAt(0),xt="a".charCodeAt(0);class bt{static getFormatter(t){let e=bt.Formatters[t];return e||(bt.Formatters[t]=e=new bt(t)),e}static get Default(){return bt.getFormatter(bt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_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)===gt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ft;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===gt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===mt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===yt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===xt){s.signDisplay="never";break}}return s.minimumIntegerDigits=m(1,s.minimumIntegerDigits),s}}}bt.DEFAULT_FORMAT="",bt.Formatters={};const wt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],vt=[".","/","-",":"],St="Z".charCodeAt(0),Vt="z".charCodeAt(0),Pt="A".charCodeAt(0),At="a".charCodeAt(0),kt="y".charCodeAt(0),Ct="M".charCodeAt(0),Lt="m".charCodeAt(0),Nt="W".charCodeAt(0),Mt="w".charCodeAt(0),Et="d".charCodeAt(0),Tt="H".charCodeAt(0),Bt="h".charCodeAt(0),Ot="S".charCodeAt(0),Rt="s".charCodeAt(0);class Dt{static getFormatter(t){let e=Dt.Formatters[t];return e||(Dt.Formatters[t]=e=new Dt(t)),e}static get Default(){return Dt.getFormatter(C.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||C.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 o=s[r],a=o.length;switch(o.charCodeAt(0)){case kt:i+=a>2?t.getFullYear():G(t.getFullYear()%100);break;case Ct:i+=a>1?G(t.getMonth()+1):t.getMonth()+1;break;case Et:i+=a>1?G(t.getDate()):t.getDate();break;case Nt:i+=a>1?G(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case Mt:i+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case Tt:i+=a>1?G(t.getHours()):t.getHours();break;case Bt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?G(e):e}else i+=a>1?G(t.getHours()):t.getHours();break;case Lt:i+=a>1?G(t.getMinutes()):t.getMinutes();break;case Rt:i+=a>1?G(t.getSeconds()):t.getSeconds();break;case At:case Pt:t.getHours()<12?i+=C.am:i+=C.pm;break;case Ot:let s=t.getMilliseconds();i+=3==a?j(s):2==a?G(s):s.toString().substring(0,a);break;default:i+=o}}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(vt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),wt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Pt&&e<=St||e>=At&&e<=Vt)&&tt(C.invalidDateFormat,t)}e.push(n)}if(r<i&&ht.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ht.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||C.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Dt.Formatters={};class $t{static isBright(t){return new $t(t).isBright()}static getContrast(t,e,s){return new $t(t).getContrast(e,s)}static interpolate(t,e,s){const i=new $t(t),r=new $t(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return at?new $t(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):ht.startsWith(t,"rgba(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):ht.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new $t(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}}$t.BLACK="#000",$t.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class Ft{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:Ft.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(e,s){const i=e.createElementNS(t,"clipPath");return i.id=s,i.append(e.createElementNS(t,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(e){return Ft.isElement(e)&&e.namespaceURI===t}static isSVGClipPathElement(t){return Ft.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var It;Ft.instanceOf=function(t,e){return Ft.isElement(t)&&t.tagName===e.toUpperCase()},Ft.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(It||(It={}));const zt={name:"RealChart",version:"1.4.20",license:"enterprise",code:null};class Ht{static decode(t){const e=Ht.CHARS,s=Ht.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}}Ht.PAD="=",Ht.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Gt{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 o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=Gt.xor,i=Gt.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=Gt.xor,i=Gt.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=Gt.kb,i=Gt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*Gt.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=Gt._decryptBlock;let i=Gt._init(e),r=[],n=Ht.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Gt.POW24|n[a+1]*Gt.POW16|n[a+2]*Gt.POW8|n[a+3],h.right=n[a+4]*Gt.POW24|n[a+5]*Gt.POW16|n[a+6]*Gt.POW8|n[a+7],s(h,i);const t=h.left,e=h.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),a+=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)}}Gt.POW2=Math.pow(2,2),Gt.POW3=Math.pow(2,3),Gt.POW4=Math.pow(2,4),Gt.POW8=Math.pow(2,8),Gt.POW16=Math.pow(2,16),Gt.POW24=Math.pow(2,24),Gt.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 jt{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=Gt.decrypt(t,"dkdl"+this._getLDKey(Gt.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}}const Xt={linear:t=>t,inOutSine:t=>-(u(M*t)-1)/2},Yt=function(t,e,s,i,r,n){const o=X(e,null!=s?s:"initial"),a=X(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Wt{constructor(){this.delay=0,this.duration=Wt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=f(1,m(0,D(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=x(t,Wt.DURATION),this.delay=e||0,this._easing=Xt[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Wt.DURATION=700,Wt.SHORT_DURATION=300;class Ut extends Wt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Zt=function(t){return new Ut(t).start()},qt=function(t){return isNaN(t)?0:t};class Kt{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}push(...t){return t.forEach((t=>{a(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return a(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return a(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return a(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return a(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",qt(t[e]),qt(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",qt(t[e].x),qt(t[e].y));return this}polygon(...t){return a(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),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}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,f=t[i].py+n.y;this.curve(s,p,g,f,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const Qt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Jt extends _t{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._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},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._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=zt.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=jt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==zt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(zt.license!=It.Developer&&!jt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(It).includes(n))throw new Error(s);if(zt.license=i.lic,n==It.Evaluation||n==It.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&Ft.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Jt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Ft.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){H(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){Ft.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(te.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(t,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(te.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}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){return this.addClip(new ne(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new he(this.doc()))}clipDonut(){return this.addClip(new le(this.doc()))}clipPath(){return this.addClip(new ae(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(Ft.isElement(e)&&e.id===t){t=e;break}Ft.isElement(t)&&t.parentNode===this._defs&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_setTesting(){this._testing=!0,te.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,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),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,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;const r=e.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof r.HTMLDivElement||tt(C.invalidOuterDiv,s),e=this._container.ownerDocument;const n=this._dom=e.createElement("div");_(n.style,Qt),n.className=i,this._container.appendChild(n);const o=this._svg=e.createElementNS(t,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=e.createElement("desc");a.textContent="Created by RealChart v"+zt.version,o.appendChild(a);const h=this._defs=e.createElementNS(t,"defs");this._initDefs(e,h),o.appendChild(h),n.appendChild(o),this._root=new ie(this),o.appendChild(this._root._dom),this._htmlRoot=e.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=e.createElement("div"),n.appendChild(this._tester),at&&(this._canvas=e.createElement("canvas"))}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Jt.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=e.createElementNS(t,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=e.createElementNS(t,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{ht.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=I(s),r.style.height=I(i)),_(this._htmlRoot.style,{left:I(e.left-t.left),top:I(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,Qt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=Ft.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),ht.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&this.invalidateLayout(),this._resizeTimer=null}),s):this.invalidateLayout()}}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}Jt.CLASS_NAME="rct-control",Jt.SHADOW_FILTER="rr-chart-shadow-filter",Jt._animatable=!0;class te extends _t{constructor(e,s,i=N){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return H(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}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){let t=this._dom.getBBox();return at&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return at&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return this._ani instanceof Ut||!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}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)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(Q(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(Q(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(Q(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]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(Q(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this.addClass(t)):s(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,w(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}stopAni(){return this._ani&&(this._ani.cancel(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Zt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:x(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Zt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:x(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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(te.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return te.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(ht.isValidNum(e)||ht.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")"),ht.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=ht.getNumber(this._scaleX,1),n=ht.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}te.DEBUGGING=!1,te.TESTING=!1,te.ASSET_KEY="_asset_",te.CLIP_KEY="_clip_",te.TEMP_KEY="_temp_";class ee extends _t{constructor(e,s,i=!1){super(),this._control=s,this._dom=e.createElement("div"),i&&(this._svg=e.createElementNS(t,"svg"),Ft.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return Ft.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class se extends te{constructor(t,e){super(t,e,"g")}}class ie extends te{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class re extends te{constructor(t){super(t,N,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ne extends re{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new te(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}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 oe extends te{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ae extends re{constructor(t){super(t),this._path=new oe(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class he extends re{constructor(t){super(t),this.add(this._circle=new te(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class le extends re{constructor(t){super(t),this.add(this._donut=new oe(t))}setDonut(t,e,s,i){this._donut.setPath((new Kt).donut(t,e,s,i).end())}}class _e{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._hideFeedback()}finally{this._doCanceled()}}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){}}var ce,de,ue;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ce||(ce={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(de||(de={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ue||(ue={}));class pe extends te{constructor(t,e=void 0){super(t,e,"text"),this._layout=de.TOP,this._overflow=ue.WRAP,this._dirty=!0,this._text="",this.anchor=ce.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case de.MIDDLE:i=Math.floor(s/2);break;case de.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.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=m(0,t),(e=f(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,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);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($t.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const ge="$_TH",fe="$_TW";class me{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?bt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(ht.isDate(n)){const t=s[3]?Dt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),N),0===this._literals[2].length&&(this._literals[2]=N)}else this._literals.push(r,n,N,N);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class ye extends me{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=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))}}}class xe extends ye{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const be={t:class extends ye{tag(){return"</t>"}},b:class extends ye{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends ye{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:xe};class we{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 me).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in be){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new be[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const ve=/<br.*?>|\r\n|\n/;class Se{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,i,r,n){if(this._isVertical)return void this.buildVertical(e,s,i,r,n);const o=e.doc,a=x(this.lineHeight,1),h=this._lines,l=h.length,_=[],c=[];e.clearDom(),r=r||e;const d=e.getStyle("writing-mode"),u=this._vertical=d===rt||d===nt;for(let s=0;s<l;s++){const i=h[s];let l=0,d=0,p=null;for(let s of i.words){const i=s.prepareSpan(e.appendElement(o,"tspan"),r,n),a=i.getBBox();if(i[fe]=a.width,i[ge]=a.height,u?(l=m(l,i[fe]),d+=i[ge]):(l+=i[fe],d=m(d,i[ge])),p||(p=i),s instanceof xe){const r=o.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}c.push(p),i[ge]=d*a,i[fe]=l*a,_.push(0==s?i[fe]/2:i[fe])}if(l>0){let t=h[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(u?null!=c[s-1]&&(i=Math.floor(t[fe]-e.getAscent(t[fe]))+e.getAscent(h[s][fe])):r=t[ge]-e.getAscent(t[ge])+e.getAscent(h[s][ge]),null==c[0]&&c[s]==c.find((t=>null!=t))){const r=e.insertElement(o,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[fe]=n.width,r[ge]=t[ge]=n.height,c[0]=r}switch(d){case rt:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case nt:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}t=h[s]}if(u){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=c,r=i[fe];if(t)i.setAttribute("dx",String(d===nt?s-r/2:r/2));else switch(d){case rt:i.setAttribute("x",String((s-r)/-2));break;case nt:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(h[0][ge])}}buildVertical(e,s,i,r,n){const o=e.doc,a=x(this.lineHeight,1),h=this._lines,l=h.length,_=[];let c=0;const d=[];e.clearDom(),r=r||e;for(let s=0;s<l;s++){const i=h[s];let l=0,u=0,p=null,g=!1;for(let s of i.words){const i=s.prepareSpan(e.appendElement(o,"tspan"),r,n);" "===i.textContent&&(g=!0,i.textContent=".");const a=i.getBBox();if(i[fe]=a.width,i[ge]=a.height,g&&(i.textContent=" ",i[ge]*=.6,g=!1),l+=i[fe],u=m(u,i[ge]),p||(p=i),s instanceof xe){const r=o.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}d.push(p),i[ge]=u*a,i[fe]=l*a,c=m(l,c),_.push(0==s?i[fe]/2:i[fe])}if(l>0){let t=h[0];d[0].setAttribute("x",String((c-d[0].getBBox().width)/2));for(let s=1;s<d.length;s++)d[s]&&(d[s].setAttribute("x",String((c-d[s].getBBox().width)/2)),d[s].setAttribute("dy",String(t[ge]-e.getAscent(t[ge])+e.getAscent(h[s][ge]))),t=h[s]);e.layoutText(h[0][ge])}}layout(t,e,s,i,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=ce.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=ce.END,a=n.height-r.bottom;break;default:t.anchor=ce.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=ce.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=ce.END,o=s-r.right;break;default:t.anchor=ce.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(ve);for(let t of s)e.push((new we).parse(t))}}}class Ve{constructor(t){this.source=t}hasDef(){return!0}}class Pe extends Ve{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=i(r)?[...r]:[r,"white"],a=i(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(e,s,i,r,n){const o=e.createElementNS(t,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(e,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ae extends Pe{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ae.TYPE="lineargradient";class ke extends Pe{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return H(s.cx)||i.setAttribute("cx",s.cx),H(s.cy)||i.setAttribute("cy",s.cy),H(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}ke.TYPE="radialgradient";class Ce extends Ve{prepare(){}getEelement(e,i){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,h,l,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rct-pattern"),+i.pattern>=0){const t=Ce.STOCK[+i.pattern%Ce.STOCK.length];a=t.path,h=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else n(i.pattern)&&(a=i.pattern,l=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),o.setAttribute("d",a),h&&_(o.style,h),i.style&&_(o.style,i.style),d&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(o),r}}Ce.TYPE="pattern",Ce.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class Le extends Ve{prepare(){const t=this.source;this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&ht.shuffle(this._colors),this._index=0)}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=i(e.colors)?e.colors:[]}}Le.TYPE="colors";class Ne extends Ve{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||Ne.SIZE,height:e.height||e.width||Ne.SIZE})}}Ne.TYPE="images",Ne.SIZE=20;class Me{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(s(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(te.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ce.TYPE:i(t.colors)?e=Le.TYPE:i(t.images)&&(e=Ne.TYPE)),e)switch(e.toLowerCase()){case Ae.TYPE:return new Ae(t);case ke.TYPE:return new ke(t);case Ce.TYPE:return new Ce(t);case Le.TYPE:return new Le(t);case Ne.TYPE:return new Ne(t)}}}}let Ee=0;const Te=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},Be=["__proto__","constructor","prototype"],Oe=function(t,r){const n=s(t)?t:{};for(const t in r)if(e.call(r,t)&&!Be.includes(t)){const e=r[t];i(e)?n[t]=e.slice(0):s(e)?e._obj instanceof ut?n[t]=e:ht.isDate(e)?n[t]=new Date(e):n[t]=Oe(n[t],e):n[t]=e}return n};class Re extends _t{constructor(t){super(),this.chart=t,Ee++}init(){const t=this._op=Oe({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Re&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const r=s(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];i(n)?r[t]=n.slice(0):s(n)?n instanceof ut?r[t]=n:n._obj instanceof ut?r[t]=n._obj:this[t]instanceof Re?ht.isDate(n)&&(r[t]=new Date(n)):r[t]=this.$_mergeOptions(r[t],n):r[t]=n}}updateOptions(t,e=!0){const i=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(i,t),this.$_applyOptions(i),s(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Re)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Re?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Re)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Oe({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,s,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==s&&""!==s||(s=void 0),void 0===s?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==s||(r||(r=this._style=this._op.style={}),r[t]=String(s),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,i=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),s(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Re?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):s(n)?n._obj instanceof ut?t[r]=n._obj:ht.isDate(n)?t[r]=new Date(n):t[r]=_({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof Re)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Re.REFRESHED="refreshed",Re.defaults={visible:!0};class De{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class $e extends Re{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=x(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?bt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Se),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(ht.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=ht.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}$e.defaults=Te(Re.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Fe extends $e{getIconPos(){const t="default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition;switch(t){case"left":case"right":case"top":case"bottom":return t;default:return this.getDefaultIconPos()}}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof Ne&&(this._images=e)}this._root=this._op.iconRoot||""}getIconUrl(t){const e=this._op.icon||t;return e?this.getUrl(e):null}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof Ne?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Fe.defaults=Te($e.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ie extends Re{}const ze={};class He extends Re{static register(...t){t.forEach((t=>{ze[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}needClip(){return!0!==this._op.noClip}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.body){const o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.getAxisOf(this,!0);s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-this._x)}if(!isNaN(h)){const i=this.chart.getAxisOf(this,!1);s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=U(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=U(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Re.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}He.defaults=Te(Re.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ge extends De{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof He)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e?this.owner:void 0))})):s(t)&&n.push(this.$_loadItem(r,t,0,e?this.owner:void 0)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):N}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a.init(),a.index=s,a._load(e),a}}class je extends Wt{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t){return this.$_calcRange(t),this._axis._changed(),!0}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class Xe extends Re{}Xe.defaults=Te(Re.defaults,{minWidth:50});class Ye extends Re{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Xe(this.axis.chart)).init(),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);if(s instanceof this.chart.win.Date)try{return Dt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}catch{return Dt.getFormatter(Ye.defaults.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}else try{return bt.getFormatter(this._op.numberFormat).toStr(s)}catch{return bt.getFormatter(Ye.defaults.numberFormat).toStr(s)}}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Ye.defaults=Te(Re.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const We={};class Ue extends Re{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ze extends Ue{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ze.defaults=Te(Ue.defaults,{visible:void 0});class qe extends Ue{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return at?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}qe.defaults=Te(Ue.defaults,{align:"middle",offset:0,gap:5});class Ke extends Ue{_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ke.defaults=Te(Ue.defaults,{position:"end",gap:2});class Qe extends Ue{getRows(){if(!1===this._op.visible)return[];const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[];if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this._op.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let o=1;o<r.length;o++,n++)e[n%s]&&i.push({axis:t,from:r[o-1].value,to:r[o].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doSetSimple(t){return n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Je extends Ue{_doInit(t){t.rows=(this._rows=new Qe(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Je.defaults=Te(Ue.defaults,{visible:void 0,depthVisible:void 0});class ts extends Fe{getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}ts.defaults=Te(Fe.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class es extends Ue{_doInit(t){t.label=(this._label=new ts(this.axis.chart)).init()}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}es.defaults=Te(Ue.defaults,{front:!1,zindex:0});class ss extends es{}class is extends es{}class rs extends Ue{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return ht.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:rs.DEF_LENGTH,this._gap=this._op.gap||0}}rs.DEF_LENGTH=7,rs.defaults=Te(Ue.defaults,{visible:!1,gap:3});class ns extends Fe{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?w(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?w(i.firstText,i.text):r==e-1?w(i.lastText,i.text):this.options.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ns.defaults=Te(Fe.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class os extends Ue{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}os.defaults=Te(Ue.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class as{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}clamp(t,e=!0){return e?ht.clamp(t,this.min,this.max):ht.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class hs extends Ze{}class ls extends Re{static register(...t){t.forEach((t=>{We[t.type]=t,t.subtype&&(We[t.subtype]=t)}))}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){t.title=(this._title=new qe(this)).init(),t.unitLabel=(this._unitLabel=new Ke(this)).init(),t.line=(this._line=new Ze(this)).init(),t.sectorLine=(this._sectorLine=new hs(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new Ye(this)).init(),t.scrollBar=(this._scrollBar=new os(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return T+B*this._op.startAngle}getTotalAngle(){return B*this._op.totalAngle}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&t.push(...e.getVisibleSeries())})),t}collectValues(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=f(...s),e._yMax=m(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender(),this.guides.forEach((t=>t._prepareRender()));const s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.isSplitted()){const t=[s[0].row];for(let e=1;e<s.length;e++)t.indexOf(s[e].row)<0&&t.push(s[e].row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s.row==t&&s.isClusterable()&&(e+=x(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=x(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=x(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=x(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+ht.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[m(t,this._min),f(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new as(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return r&&(i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed()),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new je(this,t,e,(()=>{this._changed()})))}isAnimating(){return!isNaN(this._aniMin)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new is(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ss(s):new is(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),t.startAngle=x(this._op.startAngle,0),t.totalAngle=m(0,f(360,x(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=x(Math.max(0,t.row|0),0),this._col=x(Math.max(0,t.col|0),0),e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(f(...t)||0):NaN,max:t.length>0?D(m(...t)||0):NaN}}}ls.defaults=Te(Re.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class _s extends De{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let o;if(a(r)&&r>=0&&r<s.length?o=s.find((t=>t._index===r)):n(r)&&(o=s.find((t=>t.options.name===r))),o||(o=s[0]),o&&this.chart.isValidAxis(o))return o._connect(t),this.isX?t.setCol(o.col):t.setRow(o.row),o}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 r;let n=t._getAxisType(e.type);if(!n){let o;if(i(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(H(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class cs extends Re{_doPrepareRender(t){}}const ds={},us={};class ps extends cs{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:U(this._widthDim||this._sizeDim,t,t),height:U(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return U(this._leftDim,t)}getRight(t){return U(this._rightDim,t)}getTop(t){return U(this._topDim,t)}getBottom(t){return U(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._row=x(t.row|0,0),this._col=x(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}ps.defaults=Te(cs.defaults,{size:"100%"});class gs extends Re{constructor(t){super(t.chart)}}class fs extends ps{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{ds[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}fs.defaults=Te(ps.defaults,{duration:500});class ms extends ps{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{us[t.type]=t,us[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(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._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(fs._loadGauge(t,e,r)))):s(e)&&this.$_add(fs._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ms.defaults=Te(ps.defaults,{minValue:0});class ys extends De{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}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 fs)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ms)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e._op.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){if(0===Object.keys(ds).length&&0===Object.keys(us).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class xs extends fs{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return m(this._op.minValue,f(this._op.maxValue,x(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?x(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}xs.defaults=Te(fs.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class bs extends Re{constructor(t){super(t.chart),this.scale=t}}bs.defaults=Te(Re.defaults,{reversed:!1,length:7});class ws extends Fe{getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class vs extends Re{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Re(e)).init(),t.tick=(this._tick=new bs(this)).init(),t.label=(this._label=new ws(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=x(s,e);const{min:i,max:r}=this._adjustMinMax(f(e,s),m(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(m(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=x(s.options.minValue,t),e=x(s.options.maxValue,e),this._min=f(t,e),this._max=m(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=f(...t)),isNaN(i)&&(i=m(...t)),this._min=f(s,i),this._max=m(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(D(e));for(let e=1;e<t;e++)n.push(D(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(D(l=s));;){if(l+=o,l>=i){r.push(D(i));break}r.push(D(l))}return r}}vs.defaults=Te(Re.defaults,{position:"default",stepPixels:48,gap:8});class Ss extends Re{}Ss.defaults=Te(Re.defaults,{visible:!1});class Vs extends Re{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new Ss(e)).init(),t.tickLabel=(this._tickLabel=new Re(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?U(this._thicknessDim,t,0):"inside"===this._op.position?t:Vs.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=et(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Vs.defaults=Te(Re.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ps extends $e{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ps.defaults=Te($e.defaults,{animatable:!0});class As extends Ps{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:U(this._offsetXDim,t,0),y:U(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}As.defaults=Te(Ps.defaults,{offsetX:0,offsetY:0});class ks{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Cs.DEF_CENTER),this.setCenterY(Cs.DEF_CENTER),this.setRadius(Cs.DEF_RADIUS),this.setInnerRadius(Cs.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(w(t,Cs.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(w(t,Cs.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(w(t,Cs.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(w(t,Cs.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:U(this._centerXDim,t,t/2),y:U(this._centerYDim,e,e/2)}}getExtents(t){const e=U(this._radiusDim,t,t/2),s=f(e,this._innerDim?U(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?U(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=m(0,f(360,x(e,360)));this._startRad=T+B*s,this._handRad=B*s,this._sweepRad=B*i}}class Cs extends xs{_doInit(t){super._doInit(t),this._props=new ks}get label(){return this._label}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}_createLabel(){return new As(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new ks)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}Cs.DEF_CENTER="50%",Cs.DEF_RADIUS="40%",Cs.DEF_INNER="80%",Cs.defaults=Te(xs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ls extends ms{_doInit(t){this.props=new ks,t.label=(this._label=new As(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.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}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}Ls.defaults=Te(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Ns=class extends Re{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Ns.defaults=Te(Re.defaults,{visible:void 0});class Ms extends $e{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Ms.DEF_TEXT}}Ms.DEF_TEXT="표시할 데이터가 없습니다.",Ms.defaults=Te(Re.defaults,{visible:void 0});class Es extends Re{}Es.defaults=Te(Re.defaults,{visible:!1});class Ts extends Re{_doInit(t){t.line=(this._line=new Es(this.chart)).init(),t.endLine=(this._endLine=new Es(this.chart)).init(),t.gridLine=(this._gridLine=new Es(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ts.defaults=Te(Re.defaults,{});class Bs extends Re{_doInit(t){t.xSide=(this._xSide=new Ts(this.chart)).init(),t.ySide=(this._ySide=new Ts(this.chart)).init(),t.orgLine=(this._orgLine=new Es(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=f(60,m(30,x(t.angle,45)))}}Bs.defaults=Te(Re.defaults,{visible:!1,length:32,angle:32});class Os extends Re{constructor(t){super(t),this._annotations=new Ge(this)}_doInit(t){t.depth=(this._depth=new Bs(this.chart)).init(),t.image=(this._image=new Ie(null)).init(),t.emptyView=(this._emptyView=new Ms(this.chart)).init(),t.zoomButton=(this._zoomButton=new Ns(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof ps&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=d(u(r*B)*i),o=d(p(r*B)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return U(this._radiusDim,f(t,e))}setPolar(t,e){return this._cx=U(this._centerXDim,t),this._cy=U(this._centerYDim,e),this._rd=U(this._radiusDim,f(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Os.defaults=Te(Re.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Rs extends Re{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Rs.defaults=Te(Re.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ds extends Re{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class $s extends cs{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return U(this._maxWidthDim,t,t)}getMaxHeight(t){return U(this._maxHeightDim,t,t)}getMarkerSize(){return x(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=w(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Ds(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(ht.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Fs;$s.defaults=Te(cs.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const Is=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),zs=.001;class Hs{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const o=i>0,a=o?0:1;return r>0?n>0?(r=f(y(i)/2,s/2,r),n=f(y(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=f(y(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=f(y(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=f(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return E-t<zs}static arc(t,e,s,i,r,n,o,a=!1){const h=f(E,y(n-r)),l=this.isCircled(h),_=h>M?1:0,c=o?1:0,d=u(r),g=p(r),m=u(n-=l?c?zs:-.001:0),x=p(n),b=[];return b.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*x),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=f(E,y(o-n)),l=this.isCircled(h),_=h>M?1:0,c=a?1:0,d=u(n),g=p(n),m=u(o-=l?c?zs:-.001:0),x=p(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*x),l?v.push("M",t+b*m,e+w*x):v.push("L",t+b*m,e+w*x),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*g),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,d=f(E,y(o-n));const g=this.isCircled(d);let m=(n%E+E)%E,x=(o%E+E)%E;const b=[];let w,v,S,V;if(!g&&(_&&m<=M&&x>=0&&x<m||!_&&x<=M&&m>=0&&m<x))c=0,_?(w=t+s*u(n),v=e+i*p(n),S=t+s*u(M),V=e+i*p(M),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(0),v=e+i*p(0),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*u(n),v=e+i*p(n),S=t+s*u(0),V=e+i*p(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(M),v=e+i*p(M),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*u(n),v=e+i*p(n),S=t+s*u(o-=g?_?zs:-.001:0),V=e+i*p(o),_?(m=g||m<=E&&!(x>=m&&x<E)?0:m,x=g||x>M&&!(m<=x&&m>M)?M:x):(m=g||m>M&&!(x<=m&&x>M)?M:m,x=g||x<E&&!(m>=x&&m<E)?0:x);const r=t+s*u(m),a=e+i*p(m),d=t+s*u(x-=g?_?zs:-.001:0),f=e+i*p(x);c=y(x-m)>M?1:0,l(r,a,d,f),h&&(h.x1=w,h.y1=v,h.x2=S,h.y2=V)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=f(E,y(o-n)),_=this.isCircled(l),c=a?1:0,d=t+s*u(n),g=e+i*p(n),m=t+s*u(o-=_?c?zs:-.001:0),x=e+i*p(o),b=l>M?1:0,w=[];return w.push("M",d,g,"A",s,i,0,b,c,m,x),w.push(_?"M":"L",m,x+r),w.push("A",s,i,0,b,1-c,d,g+r),h&&(h.x1=d,h.y1=g,h.x2=m,h.y2=x),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){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,d=c/2,g=[];g.push("M",n+a*u(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*u(r),o+h*p(r),"L",n+l*u(r+d),o+_*p(r+d)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Fs[e](0,0,m(2*s,0),m(2*i,0));break;default:r=Fs.circle(s,i,m(f(s,i),0))}t.setPath(r)}}Fs=Hs,Hs._drawers=Object.assign({circle:t=>Fs.circle(0,0,t),none:t=>[]},Fs._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Gs extends te{static create(t,e,s,i,r,n,o=0){return new Gs(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=N,s=N){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...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 js extends oe{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Hs.box(t,e,s,i)),this}}const Xs="head",Ys="far",Ws="inside",Us="none",Zs="near",qs="displayAll",Ks="largestFirst",Qs="hidden",Js="line",ti="area",ei="circlebar",si="treemap",ii="heatmap",ri="vector",ni="wordcloud",oi="pictogram",ai="pictorialbar",hi="pictorial",li="racebar",_i="raceline";let ci=0;const di="_deleted",ui="_drop",pi="_save";class gi{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=ci++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];if(null!=i&&"object"==typeof i)for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[di]=!0}_isDeleted(){return this[di]}_setDrop(t){this[ui]=t}_getDrop(){return this[ui]}_setSave(t){this[pi]=t}_getSave(){return this[pi]}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=N}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[x(s.xField,0)],this.y=e[x(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=w(t._colorFielder(e),e.color),this.icon=w(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class fi{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach((t=>{const s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))})),e}clean(){this._points=this._points.filter((t=>!t[di]))}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class mi extends gi{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.y=e[x(s.yField,0+i)],this.z=e[x(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=w(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class yi extends gi{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[b(s.highField,s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class xi extends rs{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}xi.defaults=Te(rs.defaults,{step:1});class bi extends ns{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return i(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}bi.defaults=Te(ns.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class wi extends Je{getPositions(t){const e=t._ani,s=t._pts,i=t.options.reversed,r=t._ticks.length,n=[];if(r>0){const o=Math.max(1,t.tick.options.step||1);if(o>1)for(let t=0,a=1,h=s.length;t<=r&&a<h;t++,a+=o)n.push(e?e.getPos(s[a],i):s[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(s[t+1],i):s[t+1])}return n}}class vi extends ls{constructor(){super(...arguments),this._weights=new Map,this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getCategorySeparator(){return this._op.categorySeparator||"+"}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new as(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new wi(this)}_createTickModel(){return new xi(this)}_createLabel(){return new bi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=ht.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=f(e,1)*this.getWeight(0)*E/this._catLen),t}_doPrepareRender(){const t=this._op;this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=b(t.minPadding,t.padding,0),this._maxPad=b(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,x(t.categoryPadding,0))))}_adjustMinMax(t,e){const s=this._op;return s.minValue<t&&(t=s.minValue),s.maxValue>e&&(e=s.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights;const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:s,max:i}=this._adjustMinMax(t,e);t=Math.floor(s),e=Math.ceil(i)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));let l=0;for(const t of n.values())l+=t;h=this._len=this._minPad+this._maxPad+h-n.size+l;const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=this.getWeight(i);_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];this.getWeight(s)<=0||a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*B;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/t*e}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1];let n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed&&(n=t-n),this._ani?this._ani.getPos(n,this._op.reversed):n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);let i;return i=this._ani?this._ani.getPos(this._pts[s+2],this._op.reversed)-this._ani.getPos(this._pts[s+2-1],this._op.reversed):this._pts[s+2]-this._pts[s+2-1],y(i)}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return a(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=f(0,e.min),e.max=m(0,e.max)),e}$_collectCategories(t){const e=this._op,r=e.categories,o=this._categories=[];let a=this._weights;if(a.clear(),i(r)&&r.length>0)this._len=0,r.forEach((t=>{const e=null==t?1:m(x(t.weight,1),0),i=t&&t.icon;let r,n;null==t?n=r=null:s(t)?(r=w(t.name,t.label),n=w(t.label,t.name)):n=r=String(t),this._len+=e,o.push({c:r,t:n,i:i}),a.set(a.size,e)}));else{const s=this.chart.seriesByName(e.categorySeries),r=this.chart.seriesByName(e.weightSeries)||s,h=e.weightField,l=null==r?void 0:r.data,_=e.weightByFrequency;s&&(t=[s]);const c=[];for(const e of t)e.collectCategories(this).forEach((t=>{c.includes(t)||(c.push(t),o.push({c:t,t:t}))}));if(h&&i(l)&&l.length>0){const t=r.getPoints();let e=null;l.forEach(((s,i)=>{var r,o;const l=t.get(i);if(!l)return;const d=l.x,u=m(null!==(r=s[h])&&void 0!==r?r:1,0);if(n(d)){const t=c.indexOf(d);if(-1===t)return void(e=null);if(!a.has(t))return a.set(t,u),e=d,void(this._len+=u);_&&e===d&&(a.set(t,m((null!==(o=a.get(t))&&void 0!==o?o:0)+u,0)),this._len+=u)}else Number.isInteger(d)?(a.has(d)||(a.set(d,u),this._len+=u),e=null):e=null}))}else if(i(t)&&t.length>0){const e=new Set;for(const s of t){const t=s.collectCategories(this),i=t.length;if(0===i)continue;let r=t[0],n=1;for(let s=1;s<i;s++){const i=t[s],o=c.indexOf(r);i!==r?(-1===o||e.has(r)||(e.add(r),a.set(o,_?n:1)),r=i,n=1):n++}e.has(r)||(e.add(r),a.set(c.indexOf(r),_?n:1))}}}this._map={},o.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}vi.type="category",vi.defaults=Te(ls.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class Si extends Re{}Si.defaults=Te(Re.defaults,{visible:!1});class Vi extends Fe{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:Vi.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:Vi.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=f(1,m(0,x(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}Vi.OFFSET=4,Vi.defaults=Te(Re.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class Pi extends Re{getRadius(){return m(0,x(this._op.radius,4))}}Pi.defaults=Te(Re.defaults,{visible:!1,radius:4});class Ai extends Re{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new Si(this.chart)).init(),t.fixedArea=(this._fixedArea=new Si(this.chart)).init(),t.label=(this._label=new Vi(this.chart)).init(),t.marker=(this._marker=new Pi(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=m(0,x(t.forward,0)),t.backward=m(0,x(t.backward,0)),this._formatter=bt.getFormatter(t.numberFormat||"0.####")}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:x(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(y(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,s=0,i=0,r=0,n=0,o=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+i);h.push(o),o=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)y(s[t][r])>y(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,a),l=t=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=m(1,f(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+x(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var ki;Ai.defaults=Te(Re.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const Ci={},Li={},Ni=/\$\{detail\}/g;class Mi extends Re{}Mi.defaults=Te(Re.defaults,{visible:!1});class Ei extends Fe{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return x(this._op.offset,0)}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return m(-90,f(90,x(this._op.rotation,0)))}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=x(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ki=Ei,Ei.OFFSET=4,Ei.defaults=Te(Fe.defaults,{visible:void 0,position:"default",offset:ki.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class Ti extends Fe{_doInit(t){super._doInit(t),this._args={}}getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return x(this._op.offset,0)}getGap(){return x(this._op.gap,Ti.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,s,i){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=s,r.negativeTotal=i,r.total=s+i,r}isStackLabelVisible(t){return this._op.visibleCallback?this._op.visibleCallback(t):this.visible}getStackLabelText(t,e){if(r(this._op.textCallback)){const e=this._op.textCallback(t);if(n(e))return e}return this.getText(e)}getRotation(){return m(-90,f(90,x(this._op.rotation,0)))}getStackLabelStyle(t){if(r(this._op.styleCallback))return this._op.styleCallback(t)}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=x(t.verticalAdjust,0)}}Ti.OFFSET=4,Ti.defaults=Te(Fe.defaults,{visible:!1,align:"center",gap:Ti.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Bi={x:"xValue",y:"yValue",z:"zValue"};class Oi extends Wt{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class Ri extends Wt{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach((t=>{t.points.forEach((t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)}))}))),e.forEach((t=>{t._setDeleted()})),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach((e=>{e.points.forEach((e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))}))})),this.points.forEach((e=>{e._vr=1-t})),this.series._changed(),!0}}class Di extends Wt{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach((t=>{this.addPoint(t)})),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort(((t,e)=>t.xValue-e.xValue)),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class $i extends gi{}const Fi=12;class Ii extends Re{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{Ci[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new fi(this),this._pointArgs={},this._paletteColors=Array(Fi).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==st&&ht.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){ht.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){ht.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){ht.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){ht.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let s;if(e.tooltipDetailCallback){this._getPointCallbackArgs(this._pointArgs,t);const i=e.tooltipDetailCallback(this._pointArgs);s=n(i)?i:""}if(void 0===s){const t=e.tooltipDetail;s=n(t)?t:""}return s}getTooltipText(t,e){var s;const i=this._op;let r;if(i.tooltipCallback){this._getPointCallbackArgs(this._pointArgs,e);const t=i.tooltipCallback(this._pointArgs);n(t)&&(r=t)}if(void 0===r){const t=i.tooltipText;r=n(t)?t:null!==(s=Ii.defaults.tooltipText)&&void 0!==s?s:"",r&&(r=r.replace(Ni,this.getTooltipDetail(e)))}return r}getTooltipParam(t,e,s){return Ii.getPointTooltipParam(t,e,s)}getTooltipHeaderColor(t){return null}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}get isWidget(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(this._xAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}isXY(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}connectable(t){return!1}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return x(s,t.getXStart())}$_getXStep(t){return v(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,this._calcedColor=void 0,this._dataSourceDirty&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof vi)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(i(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>n(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>n(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else{const s=this.hasZ();this._points.forEach(((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return x(this._op.paddingRate,1)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=et(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=N}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?x(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ei.OFFSET):this._labelOff}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))}_preparePointArgs(t){this._pointLabelCallback=P(this._pointLabel.options.textCallback),this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._preparePointArgs(t),(this._argsPoint=e).assignTo(t)),t}getPointText(t,e,s){let i;return r(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),n(i))?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(r(this._op.pointStyleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(r(this._pointLabel.options.styleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(r(this._op.onPointClick))return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){r(this._op.onPointHover)&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t,e){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:N}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof gi||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new Oi(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new Oi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return i(t)&&t.forEach((t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)})),s.length>0&&(e&&this.chart.animatable()&&s.forEach((t=>{const e=t._prev=t.copy();e.ani=new Oi(this,t,this._points.count>1),e.ani.start()})),this._dataPointsChanged()),s}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof gi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof gi&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ri(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Di(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(i(t)){const s=t.map((t=>this._points.get(t))).filter((t=>null!=t));return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(i(t)){let s=[];if(t.forEach((t=>{t instanceof gi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof gi&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ri(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach((t=>this._dropAni.addPoint(t))):(this._dropAni=new Di(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders(),this._decayDuration=m(0,x(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Ei(t)}_createPoint(t){return new $i(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return r(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(i(t))return t;if(t){let e;if(t._obj instanceof ut)e=t._obj;else if(t instanceof ut)e=t;else if(Number.isFinite(t)||s(t)||h(t))return[t];if(e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=a(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Fi+1)})`:t.color;let r,o;i(e)?r=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?r=this.chart.getPaletteColors(e.split("@")[0]):o=this.chart._assets.get(e):this._colorByPoint()&&(r=this.chart.chartOptions.options.colors),o instanceof Le?this._runPoints.forEach(((t,e)=>{t.color=t.color||o.getNext()||s})):i(r)?this._runPoints.forEach(((t,e)=>{t.color=t.color||r[e%r.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=P(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=P(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[Bi[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=N}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}Ii.LEGEND_MARKER="rct-legend-item-marker",Ii.defaults=Te(Re.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}: ${detail}",tooltipDetail:"<b>${yValue}</b>",loadAnimation:"default",decayDuration:300,hoverEffect:"default",interactive:!0,paddingRate:1});class zi extends De{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}_internalSeries(){return this._series}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_clear(){}get(t){return this._items[t]}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))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof er&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof er?n.push(...t.series):t instanceof Ii&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof Ii?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(Is[e++%Is.length]),i||(s._valid=!0))}})),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=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof qi&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i._setIndex(s),i.init(),i._load(e),i}return Ii._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Ui||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Hi extends Ii{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new Ai(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Hi.defaults=Te(Ii.defaults,{});class Gi extends Re{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Gi.defaults=Te(Re.defaults,{radius:3});class ji extends gi{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return w(this.x,this.y)}legendKey(){return this._legendKey}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:"percent"===t?this._percent:e}}class Xi extends Re{_doSetSimple(t){return n(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Xi.defaults=Te(Re.defaults,{curved:!0});class Yi extends Ei{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Xi(this.chart)).init()}get connector(){return this._connector}getWidgetAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}Yi.defaults=Te(Ei.defaults,{visible:!0,convergent:!0,align:Us,dedupeMode:qs});class Wi extends Re{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?U(this._minDim,gi.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Wi.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=Y(t.minValue,!0)}}Wi.DEF_COUNT=10,Wi.defaults=Te(Re.defaults,{visible:!1,x:"기타"});class Ui extends Ii{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Wi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:U(this._centerXDim,t),y:U(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_needDecayEffect(){return!0}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=Y(v(s,e._op.center,Ui.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Y(v(i,e._op.center,Ui.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}Ui.DEF_CENTER="50%",Ui.defaults=Te(Ii.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Ui.DEF_CENTER,centerY:Ui.DEF_CENTER});class Zi extends Ui{getRadius(t,e){return U(this._radiusDim,f(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=Y(w(t._radius=e,Zi.defaults.radius),!0))}(this,t.radius)}}Zi.defaults=Te(Ui.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class qi extends Hi{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.minPointWidth}getPointWidth(t,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,m(e,i)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._op.minPointWidth=x(this.getMinPointWidth(),0)}}qi.defaults=Te(Ii.defaults,{pointWidth:1,minPointWidth:0});class Ki extends Ei{getAlign(){return this._op.align||"center"}getAlignOffset(){return x(this._op.alignOffset,0)}get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new Mi(this.chart)).init()}}Ki.defaults=Te(Ei.defaults,{align:"center",alignOffset:0});class Qi extends qi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Ki(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=m(0,b(e.depth,t.getDepth(),Qi.DEPTH)),this._distance=t.getDistance()+x(e.distance,0)):(this._depth=m(0,x(e.depth,Qi.DEPTH)),this._distance=x(e.distance,Qi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this._op.baseValue}_getLabelDefaultPos(t,e){const s=this._group;return"default"===e&&s&&s._stacked&&s.stackLabel&&s.stackLabel.visible?"inside":e}}Qi.DEPTH=10,Qi.DISTANCE=5,Qi.defaults=Te(qi.defaults,{nullAsBase:!1});class Ji extends qi{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class tr extends Ji{}class er extends Re{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Li[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Li[t.seriesType]=t}))}static collectTooltipText(t,e,s,r,n){function o(t,e,s,i){let r=e.replace(Ni,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&i(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach(((t,e)=>{let i=r;t!==s&&t.needAxes()&&(i=t.getPointAt(r.xValue)),i&&(a?(n.items.push(t),n.rows.push([o(t,h[0],i,e),o(t,h[1],i,e)])):(l&&(l+="<br>"),l+=o(t,h,r,e)))})),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ii.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return er.collectTooltipText(this._op,this._visibles,t,e,s)}getTooltipParam(t,e,s){return er.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}get stackLabel(){return this._stackLabel}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}connectable(t){return!0}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=x(this._op.layoutMax,er.LAYOUT_MAX);return t>0?t:er.LAYOUT_MAX}_doInit(t){super._doInit(t),t.stackLabel=(this._stackLabel=new Ti(this.chart)).init()}_doApply(t){super._doApply(t),e.call(t,"children")&&(this._series=[],this.$_loadSeries(this.chart,t.children))}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._legended=null,this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!ht.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}this._stackLabel._prepareRender(),super._prepareRender()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add(Ii._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add(Ii._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_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),r=this._stackTotals=new Map;if(isNaN(s))for(const[t,s]of i.entries()){s[0].yGroup=s[0].yValue||0;for(let t=1;t<s.length;t++)s[t].yGroup=s[t-1].yGroup+(s[t].yValue||0);const i=s[s.length-1].yGroup;r.set(t,{x:s[0].xValue,positiveTotal:i>=0?i:0,negativeTotal:i<0?i:0}),e.push(i)}else for(const[t,n]of i.entries()){let i=n[0].yValue||0,o=i>=s?0:-1,a=i<s?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)i=n[t].yValue||0,i>=s?(o>=0&&(n[t].yGroup=n[o].yGroup+i*(i<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+i*(i>=0?-1:1)),a=t);const h=o>=0?n[o].yGroup:0,l=a>=0?n[a].yGroup:0;r.set(t,{x:n[0].xValue,positiveTotal:h,negativeTotal:l}),o>=0&&e.push(n[o].yGroup),a>=0&&e.push(n[a].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(y(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}er.LAYOUT_MAX=100,er.defaults=Te(Re.defaults,{layout:"default",layoutMax:er.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class sr extends er{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ir extends er{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ir.defaults=Te(er.defaults,{groupWidth:1,groupPadding:.1});class rr extends Hi{isMarker(){return!0}isXY(){return!0}}rr.defaults=Te(Ii.defaults,{colorByPoint:!1});class nr extends Re{}class or extends Re{}const ar={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},hr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},lr={minPadding:0,maxPadding:0};class _r extends Re{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new nr(e)).init(),t.mask=(this._mask=new or(e)).init(),t.borderLine=(this._borderLine=new Re(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,_r.defaults.thickness)}getGap(){return x(this._op.gap,_r.defaults.gap)}getGapFar(){return x(this._op.gapFar,_r.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=_({},e.series,ar[t]())}else i.series=ar.area();s(e.xAxis)?i.xAxis=_({},e.xAxis,(hr[e.xAxis.type]||hr.linear)(),lr):i.xAxis=_({},lr),s(e.yAxis)?i.yAxis=_({},e.yAxis,(hr[e.yAxis.type]||hr.linear)(),lr):i.yAxis=_(hr.linear(),lr),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}_r.defaults=Te(Re.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class cr extends Re{_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}cr.defaults=Te(Re.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class dr extends cr{}dr.defaults=Te(cr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class ur extends Re{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o=!!r.axis;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!h(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:m(x(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:m(x(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:m(x(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return x(this._op.listMarkerGap,5)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?bt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Dt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}ur.defaults=Te(Re.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1,listGap:12,listRowGap:3,listMarkerSize:7,listMarkerGap:5});const pr="vline",gr="hline",fr="line";class mr extends He{_isVisible(){return this._op.visible&&!H(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}mr.type="image";class yr extends He{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||yr.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}yr.type="shape",yr.defaults=Te(He.defaults,{width:64,height:64,shape:"square"});class xr extends He{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?bt.getFormatter(s):N),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Dt.getFormatter(t):N)}(t.timeFormat)}}xr.type="text",xr.defaults=Te(He.defaults,{text:"Text"});class br extends Je{getPositions(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class wr extends rs{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,s,n,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,x(.85*_,60),s,n,o,l):i(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof Ar&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,s,n,o):_>0?this._getStepsByPixels(e,_,s,n,o,l):n!==o?[n,o]:[n],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?m(8,d(t/(.9*e))+1):x(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let s;if(super._doApply(t),this._stepPixels=!r(t.stepPixels)&&ht.parseTuples(t.stepPixels),e.call(t,"stepMultiples"))if(r(t.stepMultiples))s=t.stepMultiples;else{let e;if(i(t.stepMultiples)){let s=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>s&&e.push(+t)}))}s=e&&e.length>0?e:void 0,s&&(s=s.filter((t=>t>=1)),s.length>0?s.sort(((t,e)=>t-e)):s=void 0)}this._userMultiples=s}$_getStepPixels(t,e){let s=this._stepPixels;if(r(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?wr.STEP_PIXELS_P:t._isX?wr.STEP_PIXELS_X:wr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return m(1,s[e][1])}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof Ar&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),t}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=d(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new J(e)}(s<e&&i>e,"base error"),t=m(3,t);;){if(!(d((e-s)/a)+d((i-e)/a)+1>t))break;a+=h}s=e-d((e-s)/a)*a}else s=n._fixedMin;l.push(D(s));for(let e=1;e<t;e++)l.push(D(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=D(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?wr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?wr.STEP_MULTIPLES[0]:wr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,s),i(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=n.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(n.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=m(1,c(t/e))+1,l=o/(h-1);const _=function(t){return Math.pow(10,t)}(c(g(l))),u=this._getStepMultiples(_,n),p=[];let f,y=0;if(l/=_,u)if(l>u[y]){for(;y<u.length-1;y++)if(l>u[y]&&l<u[y+1]){l=l<=u[y]+(u[y+1]-u[y])/2?u[y]:u[y+1];break}}else l=u[y];for(;;){for(l*=_,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-d((s-i)/l)*l,this._step=l,p.push(D(f=i));f<r;)p.push(D(f+=l));if(!u||y>u.length-2||p.length<=a)break;l=u[++y],p.length=0}return p}}wr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],wr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],wr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],wr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],wr.defaults=Te(rs.defaults,{baseRange:!1,enableDecimals:!0});class vr extends ns{}vr.defaults=Te(ns.defaults,{numberFormat:"0.##"});class Sr extends vr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}Sr.defaults=Te(vr.defaults,{useSymbols:!0});class Vr extends Ue{getSize(t){return Math.min(.9*t,U(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=Y(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}Vr.defaults=Te(Ue.defaults,{size:"30%",space:16,gridVisible:!0});class Pr extends Ze{_isVisible(){return this._op.visible}}Pr.defaults=Te(Ze.defaults,{visible:!1});class Ar extends ls{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Pr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=Ar.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var s,i;super._doApply(t);const r=null!==(s=t.minPadding)&&void 0!==s?s:t.padding,o=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,n(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,n(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=ht.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=ht.parseTuples(o)),this._baseVal=+this._op.baseValue,this._strictMin=Y(t.strictMin,!0),this._strictMax=Y(t.strictMax,!0),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new br(this)}_createTickModel(){return new wr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=x(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=x(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof Ar&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),h=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=a||e.options.to>=h)&&this._runBreaks.splice(t,1)}this._runBreaks.length>1&&(this._runBreaks.length=1),this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let l,_,c=!1,d=a,u=h;if(this._isX)if(a===h)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,a,h);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*x(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=E*e.min/(h-a+e.min):t*=B,isNaN(this._fixedMax)&&this.getTotalAngle()+t>E&&(h=this._max=Math.max(this._calcedMax+e.min,h))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(h=this._max=Math.max(this._calcedMax+e.min/2,h))}else this._unitLen=1}if(a===h)l=[a];else if(this._runBreaks)l=this.$_calcBrokenSteps(this._runBreaks,s,a,h),_=l.slice(0),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,s,this._runBase,a,h,!1),_=l.slice(0),l.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d;)l.shift();l.length<2&&this._fixedMin<l[0]&&l.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;l.length>2&&l[1]<=d;)l.shift();if(!isNaN(r._step))for(;l[0]>d;)l.unshift(r.getNextStep(l[0],-1))}if(a=Math.min(a,l[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;l.length>1&&l[l.length-1]>u;)l.pop();l.length<2&&this._fixedMax>l[l.length-1]&&l.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;l.length>2&&l[l.length-2]>=u;)l.pop();if(!isNaN(r._step))for(;l[l.length-1]<u;)l.push(r.getNextStep(l[l.length-1],1))}h=Math.max(h,l[l.length-1])}else l.push(a+(h-a)/2);this._prevSteps=l,this._setMinMax(a,h);const p=this.$_createTicks(l,s,a,h,i);if(c&&p.length>1){const t=this._isPolar;let e=!1;const s=_;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(D(h-t)>D(t-s)))break;{const r=this._createTick(0,i+D(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach(((t,e)=>t.index=e))}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find((t=>e<t.to))||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this._op.reversed?$(t-r-i.pos):$(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=$(i)}return this._ani?this._ani.getPos(s,this._op.reversed):s}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_isLog(){return!1}$_getStartFit(){return"default"===this._op.startFit?this._isX&&!this._isPolar?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX&&!this._isPolar?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-U(t,s):e+U(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),h=!0,l=!0,_=NaN,d=NaN,u=1;if(this._series.length>0){let t,c=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||c++,u=m(u,t.getAxisPadRate())})),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[f(t._yMin,r[e][0]),m(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let c=r._sBase;a(c)&&!isNaN(c)&&(c=D(c),i?c>=0&&c<=e&&c<=s&&(e=t=c):c<=e?r.isBased(this)?e=t=c:_=x(f(_,c),c):c>=s&&(r.isBased(this)?s=t=c:d=x(m(d,c),c))),h&&!n&&(i||r.canMinPadding(this,e,t))&&(h=!1),l&&!o&&(i||r.canMaxPadding(this,s,t))&&(l=!1)}))}else h=n,l=o;n||(n=h),o||(o=l),this._fixedMin=this._fixedMax=NaN;const p=m(0,s-e),g=this.$_calcStrict(this._strictMin,e,-p),y=this.$_calcStrict(this._strictMax,s,p);let b=NaN,w=NaN,v=0,S=0;isNaN(g)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):b=this._minPadPixels:this._fixedMin=e=g,isNaN(y)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?S=this.$_getPadding(this._maxPaddings,t,u):w=this._maxPadPixels:this._fixedMax=s=y;let V=e,P=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*S;e>P&&(P=e)}}else V-=p*v,P+=p*S;if(!isNaN(b)||!isNaN(w)){isNaN(b)&&(b=0),isNaN(w)&&(w=0);const e=Math.min(b+w,.9*t),s=p-c(p*(t-e)/t),i=Math.round(s*b/e);V-=i,P+=s-i}return!isNaN(_)&&_<=e&&V<_&&(V=this._fixedMin=_),!isNaN(d)&&d>=s&&P>d&&(P=this._fixedMax=d),P=m(P,V),{min:V,max:P}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)})),0===r&&this._series.forEach((t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())})),i.length>0){const r=i.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:x(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=f(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:x(r,1),min:n}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new Vr(this),s={...t};return this._doApplyBreak(s),e.init(),e._load(s),s.from>0?e:null}}_doApplyBreak(t){}$_loadBreaks(t){if(i(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._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(_(new Vr(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new Vr(this)._initObject(),o))}}var s}}Ar.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],Ar.defaults=Te(ls.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default",unitPadding:.5});class kr extends Ar{get label(){return this._label}_createLabel(){return new Sr(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof er&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}kr.type="linear";const Cr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Lr=[[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]],Nr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Mr extends wr{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}_getValidInterval(t,e,s,i,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&Nr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Cr[e]/2&&t<Cr[e+1]/2)return this._scale=e,Lr[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,_=m(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=Cr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,f=u;if(7===this._scale){const t=h.getFullYear();let e=f.getFullYear();this._step=_=Math.ceil(_),f=new Date(e,0),e<t&&e+_>t&&(e=t,f=new Date(e,0));do{n.push(+f),e+=_,f=new Date(e,0)}while(f<=p)}else if(6===this._scale){let t=f.getFullYear(),e=f.getMonth();this._step=_=Math.ceil(_),f=new Date(t,e),f<h&&new Date(t,e+_)>h&&(e=h.getMonth(),f=new Date(h.getFullYear(),e));do{n.push(+f),f.setMonth(f.getMonth()+_)}while(f<=p)}else if(4===this._scale||5===this._scale){let t=f.getFullYear(),e=f.getMonth(),s=f.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),f=new Date(t,e,s),f<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),f=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+f),f.setDate(f.getDate()+_*i)}while(f<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:f.setMinutes(0);case 2:f.setSeconds(0);case 1:f.setMilliseconds(0)}g=f.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Nr[a],t=Cr[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const Er=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class Tr extends vr{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,a=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Er.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(a))for(let t=0;t<a.length;t++){const e=this._formats[t],i=a[t];o(i)?e.format=i:s(i)&&(o(i.format)&&(e.format=i.format),h&&o(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,s.startOfWeek);else{const e=this._formats,o=i.tick._scale,a=Dt.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,s.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek)}}return this._getText(n,null,!1,!1)}}Tr.defaults=Te(vr.defaults,{useBeginningFormat:!0});class Br extends Ar{get label(){return this._label}_createTickModel(){return new Mr(this)}_createLabel(){return new Tr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return a(t)?t:t instanceof this._dateClass?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}Br.type="time",Br.subtype="date",Br.defaults=Te(Ar.defaults,{baseValue:NaN});class Or extends yi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Rr extends tr{pointLabelCount(){return 2}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Or(t)}_getBottomValue(t){return t.lowValue}}Rr.type="barrange",Rr.defaults=Te(tr.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Dr extends gi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class $r extends Qi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Dr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}$r.defaults=Te(Qi.defaults,{colorByPoint:!1,pointOffset:0});class Fr extends $r{canDepth(){return!0}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Fr.type="bar";class Ir extends ir{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=x(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=x(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Ir.defaults=Te(ir.defaults,{depth:10,distance:5});class zr extends Ir{_canContain(t){return t instanceof Fr}}zr.type="bargroup",zr.seriesType="bar";class Hr extends te{constructor(t){super(t,Ii.LEGEND_MARKER),this.add(this._back=new Gs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new oe(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){Hs.setShape(this._marker,this._shape,t,t)}}class Gr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new oe(t)),this.insertFirst(this._area=new oe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class jr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new oe(t)),this._line.setFill("none"),this.insertFirst(this._line2=new oe(t)),this._line2.setFill("none"),this.insertFirst(this._area=new oe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Xr extends oe{constructor(t,e=N,s=N){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){ht.isNumber(t)?this.setPath(Hs.line(t,e,s,i)):t&&this.setPath(Hs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Hs.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(Hs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Hs.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(Hs.line(e,t,s,t))}}class Yr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new Xr(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Wr extends gi{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Ur extends Gi{}Ur.defaults=Te(Gi.defaults,{radius:4,hoverScale:1.75});class Zr extends Ei{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Zr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}Zr.ALIGN_GAP=4,Zr.defaults=Te(Ei.defaults,{align:"center"});class qr extends Hi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Ur(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return x(t.radius,this.marker.options.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Zr(t)}_createPoint(t){return new Wr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Yr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),f(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach((e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)})),t.length>0&&(t.sort(((t,e)=>t.xValue-e.xValue)),i[0].unshift(...t)),s.length>0&&(s.sort(((t,e)=>e.xValue-t.xValue)),i[i.length-1].push(...s))}return i}}qr.defaults=Te(Ii.defaults,{nullAsBase:!1});class Kr extends Fe{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Kr.defaults=Te(Fe.defaults,{visible:!1,offset:8});class Qr extends qr{_doInit(t){super._doInit(t),t.flag=(this._flag=new Kr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(h(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof on||this._group instanceof an?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Qr.type=Js,Qr.defaults=Te(qr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Jr extends Qr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Jr.type="spline";class tn extends Wr{}class en extends Qr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=x(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_createLegendMarker(t,e){return new Gr(t)}_createPoint(t){return new tn(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doBuildLines(t,e)}}en.type=ti,en.defaults=Te(qr.defaults,{});class sn extends tn{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[x(s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class rn extends Zr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class nn extends qr{pointLabelCount(){return 2}_createLabel(t){return new rn(t)}_createLegendMarker(t,e){return new jr(t)}_createPoint(t){return new sn(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doBuildLines(t,e){const s=super._doBuildLines(t,e),i=[];return s.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}i.push(t,e)})),i}}nn.type="arearange",nn.defaults=Te(qr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class on extends er{_canContain(t){return t instanceof Qr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}on.type="linegroup",on.seriesType=Js,on.defaults=Te(er.defaults,{lineType:"default"});class an extends er{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof en}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}an.type="areagroup",an.seriesType=ti,an.defaults=Te(er.defaults,{lineType:"default"});class hn extends tn{}class ln extends en{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new hn(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}ln.type="bellcurve",ln.defaults=Te(en.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class _n extends gi{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return _(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.min=e[x(s.minField,0+i)],this.low=e[x(s.lowField,1+i)],this.mid=e[x(s.midField,2+i)],this.high=e[x(s.highField,3+i)],this.y=e[b(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=w(e[s.minField],e.min),this.low=w(e[s.lowField],e.low),this.mid=w(e[s.midField],e.mid),this.high=w(e[s.highField],e.high),this.y=w(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=V(t.minValue,this.minValue,e),this.lowValue=V(t.lowValue,this.lowValue,e),this.midValue=V(t.midValue,this.midValue,e),this.highValue=V(t.highValue,this.highValue,e)}}class cn extends tr{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new _n(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}}cn.type="boxplot",cn.defaults=Te(tr.defaults,{tooltipText:"<b>${name}</b><br>${detail}",tooltipDetail:"min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class dn extends oe{constructor(t,e,s){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 Hs.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 Hs.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)}}const un=2*Math.PI,pn=-Math.PI/2;class gn extends te{constructor(t){super(t,Ii.LEGEND_MARKER),this._sectors=[],this.add(this._back=new Gs(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,s){if(this._size===t&&this._sectors.length===e)return void this._applyColors(s);this._size=t;const i=t/2,r=i,n=i;this._back.setBounds(0,0,t,t),this._sectors.forEach((t=>t.remove())),this._sectors=[];const o=un/e;let a=pn;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:i,ry:i,start:a,angle:o,clockwise:!0},e=new dn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(s)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const s=t&&t[e]||"#ccc";this._sectors[e].setFill(s)}}}class fn{get color(){return this.legendColor()}get series(){var t;return null===(t=this._pie)||void 0===t?void 0:t.parentSeries}get pie(){return this._pie}get sliceCount(){return this._sliceCount}get visible(){return this._visible}set visible(t){var e;this._visible!==t&&(this._visible=t,null===(e=this._pie.chart)||void 0===e||e._visibleChanged(this._pie))}legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){if(this._explicitColor)return this._explicitColor;return`var(--color-${(this._pie._paletteOffset+this.index)%Fi+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.options.legendKey;return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class mn{get field(){return this.source.field}get label(){return this.source.label}get index(){return this.source.index}getParam(t){var e;return null!==(e=this[t])&&void 0!==e?e:this.source.getParam(t)}}class yn extends mi{}class xn extends Re{get fields(){return this._fields}get categories(){return this._categories}get colors(){return this._sliceColors}get hasExplicitColors(){return this._sliceColors.length>0}get startRad(){return this._startRad}get totalRad(){return this._totalRad}get clockwise(){return this._clockwise}get innerRadiusDim(){return this._innerRadiusDim}get visibleInLegend(){return!0===this._op.visibleInLegend}get parentSeries(){return this._parentSeries}_setParentSeries(t){this._parentSeries=t}get _paletteOffset(){const t=this._parentSeries;if(!t)return 0;const e=t.chart._getSeries()._internalSeries();let s=0;for(const i of e){if(i===t)break;i instanceof bn&&i.pie&&i.pie.fields.length>0&&(s+=i.pie.fields.length)}return s}getLegendSources(){return this._legendSources}isFieldVisible(t){const e=this._legendSources;return!e||!e[t]||!1!==e[t].visible}calcSlices(t){const e=this._fields;if(!e||0===e.length||!t)return null;const s=[];for(let i=0;i<e.length;i++){if(!this.isFieldVisible(i))continue;const r=this._getFieldValue(t,e[i]),n=a(r)&&r>0?r:0;n>0&&s.push({index:i,value:n})}if(0===s.length)return null;const i=s.reduce(((t,e)=>t+e.value),0);if(i<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,o=this._totalRad;let h=this._startRad;const l=[];for(let t=0;t<s.length;t++){const e=s[t],a=n*(e.value/i)*o,_=this._legendSources[e.index];if(_){const t=new mn;t.source=_,t.value=e.value,t.percent=Math.round(e.value/i*1e4)/100,t.startAngle=h,t.angle=a,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=a}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let s=0;s<t.length;s++)t[s].color=`var(--color-${(e+t[s].index)%Fi+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,s=[],i=this._paletteOffset;for(let r=0;r<t;r++)s.push(e.length>0?e[r%e.length]:`var(--color-${(i+r)%Fi+1})`);return s}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t){return h(t)?(this._op.visible=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._fields=(t.fields||[]).map((t=>String(t))),this._categories=i(t.categories)&&t.categories.length>0?t.categories:this._fields;const e=t.colors;i(e)?this._sliceColors=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?this._sliceColors=this.chart.getPaletteColors(e.split("@")[0])||[]:this._sliceColors=this.chart.getPaletteColors(e)||[]:this._sliceColors=[],this._startRad=T+B*x(t.startAngle%360,0);const s=x(t.totalAngle,360);this._totalRad=B*m(0,f(360,s<=0?360:s)),this._clockwise=!1!==t.clockwise,t.innerRadius?this._innerRadiusDim=Y(t.innerRadius,!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,s=this._sliceColors,i=this._categories,r=e.length;this._legendSources=e.map(((e,n)=>{const o=s.length>0?s[n%s.length]:null,a=null==t?void 0:t.find((t=>t.legendKey()===this.hash+":"+e)),h=new fn;return h._pie=this,h.field=e,h.label=i[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h}))}_getFieldValue(t,e){if(t)return t[i(t)?+e:e]}}xn.defaults=Te(Re.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class bn extends rr{_doInit(t){super._doInit(t),t.pie=(this._pie=new xn(this.chart)).init(),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:U(this._minSizeDim,t),max:U(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getTooltipText(t,e){const s=this._hoveredSlice;if(s&&this._pie){const t=this._pie.options;let i;return t.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=s,i=t.tooltipCallback(this._pointArgs)),void 0===i&&(i=t.tooltipText||"${label}: ${value} (${percent}%)"),i}return super.getTooltipText(t,e)}getTooltipParam(t,e,s){var i;const r=this._hoveredSlice;return r&&null!==(i=r.getParam(s))&&void 0!==i?i:super.getTooltipParam(t,e,s)}getTooltipHeaderColor(t){var e,s;return null!==(s=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==s?s:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new yn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_createLegendMarker(t,e){const s=this._pie;if(s&&s.visible&&s.fields.length>0){const i=new gn(t);return i.render(e,s.fields.length,[]),i.setColorResolver((()=>s.getLegendSliceColors())),i}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,s=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,i=s?this._op.legendMode||"both":null;"slice"!==i&&super.getLegendSources(t),s&&"series"!==i&&e.getLegendSources().forEach((e=>t.push(e)))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=f(t,s.zValue),e=m(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e),this._pie&&this._pie.visible&&this._pie.fields.length>0&&this._visPoints.forEach((t=>{t.isNull||(t.pieSlices=this._pie.calcSlices(t.source))}))}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){n(t)&&(t=this._xAxisObj.getValue(t)),n(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}bn.type="bubble",bn.defaults=Te(rr.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class wn extends sr{_canContain(t){return t instanceof Qr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=w(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return ht.makeIntArray(0,t.length)}}wn.type="bump",wn.seriesType=Js;class vn extends gi{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.low=e[x(s.lowField,0+i)],this.close=e[x(s.closeField,1+i)],this.open=e[x(s.openField,2+i)],this.y=e[b(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=w(e[s.lowField],e.low),this.open=w(e[s.openField],e.open),this.close=w(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e),this.openValue=V(t.openValue,this.openValue,e),this.closeValue=V(t.closeValue,this.closeValue,e)}}class Sn extends tr{canCategorized(){return!0}_createPoint(t){return new vn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Kt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new oe(t,Ii.LEGEND_MARKER).setPath(s.end())}}Sn.type="candlestick",Sn.defaults=Te(tr.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Vn extends Ki{}Vn.defaults=Te(Ei.defaults,{position:"inside"});class Pn extends $r{get pointLabel(){return this._pointLabel}_createLabel(t){return new Vn(t)}}Pn.type=ei;class An extends Ir{_canContain(t){return t instanceof Pn}}An.type="circlebargroup",An.seriesType=ei;class kn extends yi{}class Cn extends Gi{}Cn.defaults=Te(Gi.defaults,{radius:4,shape:"circle"});class Ln extends tr{_doInit(t){super._doInit(t),t.marker=(this._marker=new Cn(this)).init(),t.lowMarker=(this._lowMarker=new Cn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+m(0,this.marker.options.radius)}_createPoint(t){return new kn(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=x(e.radius,s),n=e.shape||i;this._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}Ln.type="dumbbell";class Nn extends gi{}class Mn extends Qi{getSegmentSize(t){return U(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Nn(t)}_createLegendMarker(t,e){const s=new Kt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new oe(t,Ii.LEGEND_MARKER).setPath(s.end())}}Mn.type="equalizer",Mn.defaults=Te(Qi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class En extends tr{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new yi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Kt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new oe(t,Ii.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}En.type="errorbar",En.defaults=Te(tr.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Tn extends ji{}class Bn extends Tn{constructor(t,e){super(t),this.points=e}}class On extends Yi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?On.ENDED_DIST:On.OUTSIDE_DIST:this._op.distance||0}}On.OUTSIDE_DIST=25,On.ENDED_DIST=10;class Rn extends Ui{getSize(t,e){return{width:m(.1*t,U(this._widthDim,t)),height:m(.1*e,U(this._heightDim,e))}}getNeckSize(t,e){return{width:ht.clamp(U(this._neckWidthDim,t),this._minNeckWidth,t),height:ht.clamp(U(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new On(t)}_createPoint(t){return new Tn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Bn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=W(e._width,Rn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=W(e._height,Rn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=W(e._neckWidth,Rn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=W(e._neckHeight,Rn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}Rn.type="funnel",Rn.defaults=Te(Ui.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Dn extends gi{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const $n={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 Fn extends Hi{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?$n[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Dn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[x(this.yField,0)]:s(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),r.minValue<o[0]&&o.unshift(r.minValue),r.maxValue>o[o.length-1]&&o.push(r.maxValue);const t=o.length,e=o[0],s=o[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,l=e,_=l+a;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&o[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=b(this._op.baseValue,this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}}Fn.type="histogram",Fn.defaults=Te(Ii.defaults,{baseValue:0,binsNumber:"squreRoot"});class In extends Gi{}In.defaults=Te(Gi.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class zn extends gi{_assignTo(t){return _(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[x(r.xField,0)]),this.y=e[x(r.yField,0+n)],this.radius=e[x(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=w(e[t.options.radiusField],e.radius)}}class Hn extends Qi{_doInit(t){super._doInit(t),t.marker=(this._marker=new In(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new zn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=m(t.minRadius,0),n=m(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}Hn.type="lollipop";class Gn extends vn{}class jn extends Sn{_createPoint(t){return new Gn(t)}_createLegendMarker(t,e){const s=new Kt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new oe(t,Ii.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}jn.type="ohlc";class Xn extends Wr{}class Yn extends qr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Xn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+x(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Yn.type="pareto",Yn.defaults=Te(qr.defaults,{curved:!1});class Wn extends ji{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class Un extends Wn{constructor(t,e){super(t),this.points=e}}class Zn extends Fe{getDefaultIconPos(){return"left"}}class qn extends Yi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?U(this._distanceDim,e,0):t?U(s?qn.INNER_DIST:qn.INSIDE_DIST,e):"far"===this._op.align?qn.ENDED_DIST:qn.OUTSIDE_DIST}}qn.INSIDE_DIST=Y("30%",!1),qn.INNER_DIST=Y("50%",!1),qn.OUTSIDE_DIST=25,qn.ENDED_DIST=10,qn.defaults=Te(Yi.defaults,{radius:.7,rotationMode:"arc"});class Kn extends Re{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=m(0,x(t.length,0)),t.ratio=m(.3,f(.8,x(t.ratio,Kn.DEPTH_RATIO)))}}Kn.DEPTH_RATIO=.6,Kn.defaults=Te(Re.defaults,{visible:!1,length:25,ratio:Kn.DEPTH_RATIO});class Qn extends Zi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new Zn(this.chart)).init(),t.depth=(this._depth=new Kn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?U(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new qn(t)}_createPoint(t){return new Wn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Un(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=T+B*x(this._op.startAngle%360,0),this._totalRad=B*m(0,f(360,x(this._op.totalAngle,360))),this._groupPos=NaN}}Qn.type="pie",Qn.defaults=Te(Zi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Jn extends er{getPolarSize(t,e){return U(this._polarDim,f(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=Y(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Y(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof Qn}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+x(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=x(t.options.groupSize,1)/e}))}}Jn.type="piegroup",Jn.seriesType="pie",Jn.defaults=Te(er.defaults,{polarSize:"80%",innerSize:0});class to extends gi{}class eo extends rr{_createPoint(t){return new to(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}_createLegendMarker(t,e){return new Hr(t)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),f(e/2,this._op.radius)),s}}eo.type="scatter",eo.defaults=Te(rr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class so extends gi{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class io extends Ei{}io.defaults=Te(Ei.defaults,{offset:0});class ro extends Ji{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new io(t)}_createPoint(t){return new so(t)}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}ro.type="waterfall",ro.defaults=Te(Ji.defaults,{tooltipDetail:"<b>${y}</b>"});class no extends wr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],_=m(1,c(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=h/_),i=isNaN(s)?this._normalizeMin(i,t):s-d((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let f=i,m=a(f);for(l.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>l[l.length-1]&&(m<r&&(1==l.length&&m-l[l.length-1]<t||l.length>1&&m-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(m))}else{i=o(i);const t=(r=o(r))-i;let e=t/(_-1);const s=o(c(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/_);const h=1e-10*e;let d=c(i/e)*e;for(d<i&&(d+=e),l.push(n(d));d<=r+h;)d+=e,d>0&&l.push(n(d))}return l}}no.defaults=Te(wr.defaults,{arrangeDecimals:!0});class oo extends Ar{_isLog(){return!0}_createLabel(){return new Sr(this)}_createTickModel(){return new no(this)}_doApply(t){super._doApply(t);const e=this._logBase=m(2,x(t.logBase,10));this._roundThreshold=x(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=c(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,D(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=f(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:x(e*=a,1),min:o*a}}_doApplyBreak(t){t&&t.from>0&&t.to>0&&(t.from=this._log(t.from),t.to=this._log(t.to)),super._doApplyBreak(t)}}oo.type="log",oo.defaults=Te(Ar.defaults,{logBase:10,roundThrrehold:500});class ao extends Re{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}ao.defaults=Te(Re.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class ho extends De{load(t){const e=this.chart,s=this._items=[];i(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new ao(t);return s.init(),s._load(e),s}}const lo="$ctrl";class _o extends Re{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}_o.defaults=Te(Re.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class co extends Re{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==w(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}co.defaults=Te(Re.defaults,{scope:"auto"});class uo extends Re{_doInit(t){t.pointHovering=(this._pointHovering=new co(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var po;uo.defaults=Te(Re.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(po||(po={}));class go extends ct{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new pt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Me,(this._chartOptions=new uo(this)).init(),(this._title=new cr(this)).init(),(this._subtitle=new dr(this)).init(),(this._legend=new $s(this)).init(),(this._credits=new _o(this)).init(),(this._tooltip=new ur(this)).init(),this._buttons=new ho(this),go.split_class&&(this._split=new go.split_class(this)).init(),(this._body=new Os(this)).init(),(this._navigator=new _r(this)).init(),(this._exporter=new Rs(this)).init(),this._series=new zi(this),this._xAxes=new _s(this,!0),this._yAxes=new _s(this,!1),this._gauges=new ys(this),this._annotations=new Ge(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},go.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[lo]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new go(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return er.collectTooltipText(this.axis.options,this.series,t,e,s)}getTooltipParam(t,e,s){return er.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof ps?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case po.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.RIGHT:r=s.filter((t=>t._isOpposite));break;case po.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case po.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.RIGHT:r=i.filter((t=>t._isOpposite));break;case po.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in go.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Oe(n={},r.base),s(r[i])&&(n||(n={}),Oe(n,r[i])),n?Oe(n,t):t}_load(t){var e,i;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(w(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(w(t.chart,t.options)),s(t.chart)?this._credits._load(t.chart.credits):s(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(w(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(w(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(i=this._split)||void 0===i||i._load(t.split),this._annotations.load(w(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Re||s instanceof De||s instanceof Me)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t,e);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Fi;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=_({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return Oe(Oe({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?Oe(Oe({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Li[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Ci[t.toLowerCase()]}_getAxisType(t){return n(t)&&We[t.toLowerCase()]}_getGaugeType(t){return n(t)&&ds[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&us[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ze[t.toLowerCase()]}getAxesGap(){return x(this._chartOptions.options.axisGap,0)}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}go.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},ls.register(vi,kr,oo,Br),Ii.register(en,nn,Rr,Fr,ln,cn,bn,Sn,Pn,Ln,Mn,En,Rn,Fn,Qr,Jr,Hn,jn,Yn,Qn,eo,ro),er.register(an,zr,wn,An,on,Jn),er.registerSeries(an,zr,An,on,Jn),He.register(mr,yr,xr);class fo{constructor(t,e){this._modelCallback=e,this._obj=new go(t,this),this._loaded=s(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[lo]=null===(t=this[lo])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get assets(){return this._obj._assets}get chartOptions(){return this._obj.chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart";ht.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new go(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",Ee),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[lo].refresh()}}class mo{constructor(t,e){this._obj=new ut(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class yo extends _t{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){var t;null===(t=this._orphans)||void 0===t||t.clear(),this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}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()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}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){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}const xo=Object.freeze({x:0,y:0,width:0,height:0}),bo=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function wo(t){return{width:t.width,height:t.height}}function vo(t){return t.width<=0||t.height<=0}const So=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},Vo=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},Po=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},Ao=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ko=function(t,e){const s=So(t),i=So(e),r=Vo(s),n=Vo(i);for(const t of[...r,...n]){const e=Po(s,t),r=Po(i,t);if(!Ao(e,r))return!1}return!0},Co=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class Lo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Lo(t,t,t,t):new Lo(t,t,e,e):new Lo(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 Lo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=x(t.paddingLeft,0),this.right=x(t.paddingRight,0),this.top=x(t.paddingTop,0),this.bottom=x(t.paddingBottom,0),this}applyMargin(t){return this.left=x(t.marginLeft,0),this.right=x(t.marginRight,0),this.top=x(t.marginTop,0),this.bottom=x(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}}}Lo.Empty=Object.freeze(new Lo),Lo.Temp=new Lo;class No extends te{constructor(t,e=N){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return No.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}No.IGNORE_ATTRS={width:"",height:""};class Mo extends te{constructor(t,e=N){super(t,e,"g"),te.DEBUGGING&&(this.add(this._debugRect=new Gs(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),te.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Gs(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()}}class Eo extends Mo{constructor(t,e,s){super(t,e),this._margins=new Lo,this._paddings=new Lo,this.add(this._background=new Gs(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class To extends No{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 Bo extends Mo{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class Oo extends te{constructor(t,e,s){super(t,s,"image"),this._bounds=xo,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},this.onerrorProxy=()=>{},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.onerrorProxy(),this.invalidate()},window.SVGGraphicsElement&&!at||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)},this._proxy.onerror=()=>{this.onerrorProxy(),this.invalidate()})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return t||(t=NaN),e||(e=NaN),i&&(H(t)||H(e))&&(t>0&&H(e)?e=t/i.width*i.height:e>0&&H(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class Ro extends No{constructor(t,e=N){super(t),this.add(this._text=new pe(t,e)),this._text.anchor=ce.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Gs(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new pe(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s&&s!==this._failedIconUrl?(this._icon||this.add(this._icon=new Oo(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight),this._icon.onerrorProxy=()=>{var t,e;this._failedIconUrl=null===(t=this._icon)||void 0===t?void 0:t.url,null===(e=this._icon)||void 0===e||e.remove(),this._icon=null,this._box=void 0,this.invalidate()}):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=$t.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,s=this._outline,i=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,_=0,c=0,d=0,u=0;if(this._box=void 0,i){const t=i.getBBox();switch(r=x(this._model.options.iconGap,0),_=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":h+=r+_,l=Math.max(c,a);break;default:l+=r+c,h=Math.max(_,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(i)switch(this._model.getIconPos()){case"left":i.trans(d,(l-c)/2),d+=_+r,h-=_+r;break;case"right":i.trans(d+h-_,(l-c)/2),h-=_+r;break;case"top":i.trans((h-_)/2,u),u+=c+r;break;case"bottom":i.trans((h-_)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=ce.MIDDLE;break;case"right":d+=h,e.anchor=ce.END;break;default:e.anchor=ce.START}return e.trans(d,u),s&&(s.anchor=e.anchor,s.setAttr("y",e.getAttr("y")),s.trans(e.tx,e.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new pe(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class Do extends Eo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new pe(t)),this._richText=new Se}rotatedWidth(){const t=this.model.getRotation()*B,e=this.getBBox();return y(p(t)*e.height)+y(u(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*B,e=this.getBBox();return y(u(t)*e.height)+y(p(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=wo(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===rt||s===nt;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=ce.START,i||(n-=this.width/2);break;case"right":e.anchor=ce.END,i?r+=this.height:n+=this.width/2;break;default:e.anchor=ce.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}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}}class $o extends Eo{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new pe(t)),this._textView.anchor=ce.START,this._richText=new Se}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),wo(this._textView.getBBox())}_doLayout(t){const e=this._textView;let s=this._margins.top+this._paddings.top,i=0;switch(this.textAlign()){case"left":e.anchor=ce.START,i-=this.width/2;break;case"right":e.anchor=ce.END,i+=this.width/2}e.trans(i,s)}}class Fo extends Mo{constructor(t){super(t,jo.TICK_CLASS),this.add(this._lineView=new Xr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Io extends Ro{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){i?(t.prepareRich(i),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(s)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),this._text.text="")}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*B,e=this.getBBox();return y(p(t)*e.height)+y(u(t)*e.width)}rotatedHeight(){const t=this.rotation*B,e=this.getBBox();return y(u(t)*e.height)+y(p(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class zo extends te{constructor(t){super(t,void 0),this.add(this._back=new oe(t,"rct-crosshair-flag")),this.add(this._text=new pe(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Kt,n=m(s.minWidth||0,i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.options.textStyles)}}class Ho extends Mo{static isThumb(t){return t.classList.contains(Ho.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Gs(t,Ho.TRACK_CLASS)),this.add(this._thumbView=new Gs(t,Ho.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=m(0,e),this._page=f(s,e),this._pos=f(t.min+e-s,m(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=m(0,f(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=x(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}Ho.CLASS_NAME="rct-axis-scrollbar",Ho.TRACK_CLASS="rct-axis-scrollbar-track",Ho.THUMB_CLASS="rct-axis-scrollbar-thumb";const Go=/\${label}.*?/g;class jo extends Mo{constructor(t){super(t,jo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Xr(t,jo.LINE_CLASS)),this.add(this._titleView=new Do(t)),this.add(this._markContainer=new te(t,"rct-axis-ticks")),this.add(this._labelContainer=new te(t,"rct-axis-labels")),this.add(this._unitView=new $o(t)),this._labelViews=new yo(this._labelContainer,Io,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Ho(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new zo(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?f(0,this.width-n.width):m(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.options.animatable&&s.checkExtents(t,e)}}this._prevModel=s}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Xr(t,jo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&ht.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.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 Fo(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),o=e.label,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(Go)?t.setLabel(s,a,e,n.replace(Go,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,o,a){const h=t.label,l=m(0,f(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,d=(i=m(1,i))*(r=f(m(1,r),_.length)),p=n||0,g=y(p)*B,x=g<35*B;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=d){let i=0;for(let e=r;e<r+d&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(x&&b.getBBox().width*u(g)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=m(0,f(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*B))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=m(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=m(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=m(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=m(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=m(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=m(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof Ar)return this._prevWidth;const r=t.label;let n=m(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=m(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,u=t.get(0).rotation,g=u*B,f=+h.label.options.rows|0,m=u<-15&&u>=-90||u>15&&u<=90,y=t.count,b=x(h._prevRate,1);let w,v,S;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),S=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],u<-15&&u>=-90?s?r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):r?(v-=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):u>15&&u<=90?s?r?(v+=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-u:u)),t.trans(v,S))})),!m&&f<2&&y>1){let e=t.get(_?y-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?y-2:1)),e=t.get(_?0:y-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:y-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof vi&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,f=this._labelSize,m=l.tick._getGap();const y=this._reversed,b=y?x(l._prevRate,1):1;let w=y?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{var c;const x=e[t.index];if(t.setVis(!!x)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(f-e)/2-f-m-a;case"left":return-f-m-a;default:return-e-m-a}else switch(t){case"right":return n+a+m+f-e;case"center":return!p.visible&&i?(n-e)/2:n+a+m+(f-e)/2;default:return n+a+m}else if(r)switch(t){case"center":return a+(n-g-e-a+m)/2;case"right":return n-e-g+m;default:return a}else switch(t){case"left":return g-m;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-m)/2;default:return n-a-e}}(u,e.width),v=o*b-l.prev(x.pos)-e.height/2;if(t.trans(h,v),_){const s=(l._len-l._minPad-l._maxPad)/(null!==(c=l._weights.get(x.value))&&void 0!==c?c:1),h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,m,s,_,g)}else!y&&t.ty+e.height>w+1||y&&t.ty<w-1?t.setVis(!1):w=y?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}jo.AXIS_CLASS="rct-axis",jo.LINE_CLASS="rct-axis-line",jo.TICK_CLASS="rct-axis-tick";class Xo extends te{constructor(t,e,s){super(t,Xo.STYLE),this.add(this._back=new Gs(t,Xo.BACK_STYLE)),this.add(this._textView=new pe(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 Lo).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom,rx:x(parseFloat(e.rx),0),ry:x(parseFloat(e.ry),0)},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}Xo.STYLE="rct-button",Xo.BACK_STYLE="rct-button-background";class Yo extends te{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Wo extends oe{setArc(t,e,s,i,r,n){this.setPath(Hs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Uo extends Wo{setPolyline(t){this.setPath(Hs.polygon(...t))}}const Zo={};class qo extends Eo{static register(...t){t.forEach((t=>{Zo[t[0].type]=t[1]}))}constructor(t,e){super(t,qo.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new te(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}qo.CLASS_NAME="rct-annotation";const Ko={};class Qo extends Bo{static register(...t){t.forEach((t=>{Ko[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Gs(t,Qo.PANE_CLASS)),this.add(this._contentContainer=new se(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Qo.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=_(Ft.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof ia)return t;t=t.parent}}}Qo.GAUGE_CLASS="rct-gauge",Qo.PANE_CLASS="rct-gauge-pane";class Jo extends Wt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class ta extends Qo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return a(i)?bt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new Jo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class ea extends Ro{}class sa extends Mo{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new se(t,"rct-gauge-scale-ticks")),this._ticks=new yo(this._tickContainer,Xr),this.add(this._labelContainer=new se(t,"rct-gauge-scale-tick-labels")),this._labels=new yo(this._labelContainer,ea)}}class ia extends Qo{_defaultCalss(){return ia.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new se(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}ia.GAUGE_GROUP_CLASS="rct-gauge-group";class ra{static reveal(t,e){new aa(t,e)}static grow(t,e){new la(t,e)}static spread(t,e){new _a(t,e)}static fadeIn(t){new na(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);ht.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class na extends ra{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:Wt.DURATION,fill:"none"})}}class oa extends ra{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=oa.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Wt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class aa extends Wt{constructor(t,e){super(),this._series=t,this._cr=oa.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof te}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class ha extends Wt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof te}_stop(t){super._stop(t),this._series=null}}class la extends ha{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class _a extends ha{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ca extends Ro{constructor(t){super(t,"rct-series-trendline-label")}}class da extends se{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new oe(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new oe(t,"rct-series-trendline-variable")),this.add(this._line=new oe(t)),this.add(this._label=new ca(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new oe(t,"rct-series-trendline-marker")),this.add(this._endMarker=new oe(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*u(s),y:e.cy+i*p(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new Kt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new Kt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new Kt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=Hs.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),f=h.getOffsetY(p)+("center"===u?l:0),m=Math.floor((n.length-1)*c),y=(n.length-1)*c-m;let x,b;if(m>=n.length-1)x=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[m],e=n[m+1];x=t.x+(e.x-t.x)*y,b=t.y+(e.y-t.y)*y}const w=_.getBBox();switch(u){case"left":x-=w.width+g;break;case"center":x-=w.width/2+g;break;case"right":x+=g}switch(p){case"top":b-=w.height+f;break;case"middle":b-=w.height/2+f;break;case"bottom":b+=f}t||(x<0&&(x=0),b<0&&(b=0),x+w.width>o&&(x=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(x,b)}}class ua extends Wt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Va.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(Va.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class pa extends Ro{constructor(t){super(t,"rct-point-label")}}class ga extends se{constructor(t){super(t,"rct-point-labels"),this._labels=[new yo(this,pa),new yo(this,pa)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=m(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,n.getIconUrl(i.icon),r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.stopAni().setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(Co(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Ks)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ko(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ko(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ko(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ko(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===Qs&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class fa extends No{constructor(t){super(t),this.add(this._line=new oe(t))}setLine(t){this._line.setPath(t)}}class ma extends No{constructor(t){super(t,"rct-point-label-lines"),this._lines=new yo(this,fa)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class ya extends se{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}class xa extends Ro{constructor(t){super(t,"rct-stack-label")}}class ba extends se{constructor(t){super(t,"rct-stack-labels"),this._labels=new yo(this,xa),this.ignorePointer()}prepare(t){return this._labels.prepare(t),this._labels}get(t){return this._labels.get(t)}forEach(t){this._labels.forEach(t)}}const wa={},va="rct-point-hover",Sa="rct-point-unhover";class Va extends Bo{static register(...t){t.forEach((t=>{wa[t[0].type]=t[1]}))}static isPointDom(t){for(;Ft.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new ya(t,"rct-series-points")),this._labelContainer=new ga(t),this._stackLabelContainer=new ba(t)}depthEnabled(){return!1}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1),this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}_getPointColors(){return"a"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===it,this.setData("index",e._seriesIndex%Fi),this.setData("pointcolors",this._colorByPoint?this._getPointColors():N),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(va).addClass(Sa)}))):this._getPointPool().forEach((t=>{t.containsClass(Sa)&&t.removeClass(Sa).addClass(va)}))}_clearHoverClasses(t){t instanceof te&&t.removeClass(va).removeClass(Sa)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof te&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.cancel(),e.setBoolData(Va.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Oa&&r.push(new ua(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(t&&!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.cancel(),t instanceof te&&(t.setBoolData(Va.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Oa?r.push(new ua(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof $a&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&Yt(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Hi&&e.trendline.visible?(this._trendView||this.add(this._trendView=new da(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this.$_labelAnimating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){this._layoutStackLabel()}_layoutStackLabel(){const t=this.model,e=t._group;if(!e||!e._stacked)return void this._hideStackLabel();if(!e.isLastVisible(t))return void this._hideStackLabel();const s=e.stackLabel;if(!s||!s.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const i=e._stackTotals,r=e._stackPoints;i&&0!==i.size&&r&&0!==r.size?this._doLayoutStackLabel(s,i,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,s){var i;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),_=t.getOffset(),c=t.options.align,d=this._labelContainer,g=d&&d.visible,f=o._body.getPolar(h),m=this._inverted,b=this.width,w=this.height,v=a.options.reversed;this._stackLabelContainer.setVis(!0),this._stackLabelContainer.setStyleOrClass(t._style);let S=0;for(const t of e.values())0!==t.positiveTotal&&S++,0!==t.negativeTotal&&S++;const V=this._stackLabelContainer.prepare(S);let P=0;const A=f?h.getTotalAngle():0,k=m?b:w,C=m?w:b,L=m?0:w;for(const[n,b]of e.entries()){const e=[];0!==b.positiveTotal&&e.push([b.positiveTotal,!1]),0!==b.negativeTotal&&e.push([b.negativeTotal,!0]);for(const[w,S]of e){const e=V.get(P++),N=t.getCallbackArgs(o,b.x,b.positiveTotal,b.negativeTotal);if(e.setVis(t.isStackLabelVisible(N))){const o=t.getStackLabelText(N,w),b=t.getStackLabelStyle(N);e.xValue=n,e.setModel(r,t,null,b),e.setText(o),e.layout(c);const V=m?0:t.getRotation(),{width:P,height:M}=e.getBBox(),E=V*B,T=0!==V?M*y(u(E))+P*y(p(E)):M,O=0!==V?P*y(u(E))+M*y(p(E)):P;let R,D;const $=s.get(n),F=$&&null!==(i=$.find((t=>t.yGroup===w)))&&void 0!==i?i:null;if(f){const t=x(null==F?void 0:F.xPos,f.cx+f.rd*u(f.start+h.getPos(A,n))),s=x(null==F?void 0:F.yPos,f.cy+f.rd*p(f.start+h.getPos(A,n))),i=Math.atan2(s-f.cy,t-f.cx),r=a.getPos(f.rd,w)+(S!==v?-1:1)*(M/2+l);let o=0;"left"===c?o=-(P/2+_):"right"===c&&(o=P/2+_),R=f.cx+r*u(i)+-p(i)*o,D=f.cy+r*p(i)+u(i)*o,e.trans(R-P/2,D-M/2),0!==V&&e.setRotation(P/2,M/2,V)}else{const s=a.getPos(k,w),i=g&&F?d.get(F,0):null,r=i&&i.visible?i.getBBoxEx():null,o=$?$[$.length-1]:null,u=o?this.getPointView(o):null,p=(null==u?void 0:u.wPoint)||0;if(m){const i=S!==v?-1:1;if(R=L+s+i*(l+O/2)-P/2,r)if(i>0){const t=R+P/2-O/2,e=r.x+r.width-t;e>0&&(R+=e)}else{const t=R+P/2+O/2-r.x;t>0&&(R-=t)}const o=x(null==F?void 0:F.yPos,C-h.getPos(C,n)),a=v?"left"===c?"right":"right"===c?"left":c:c;D="left"===a?o-p/2-T/2-M/2-_:"right"===a?o+p/2+T/2-M/2+_:o-M/2+_,D+=M*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,R,P,k);if(null===d){e.setVis(!1);continue}R=d}else{const i=S!==v?1:-1;if(D=L-s+i*(l+T/2)-M/2,r)if(i<0){const t=D+M/2+T/2-r.y;t>0&&(D-=t)}else{const t=D+M/2-T/2,e=r.y+r.height-t;e>0&&(D+=e)}const o=x(null==F?void 0:F.xPos,h.getPos(C,n));R="left"===c?o-p/2-O/2-P/2-_:"right"===c?o+p/2+O/2-P/2+_:o-P/2+_;const a=this._applyOverflowFit(t._overflowFit,D,M,k);if(null===a){e.setVis(!1);continue}D=a}e.trans(R,D),0!==V&&e.setRotation(P/2,M/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Fi):e.index%Fi;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return x(this._growRate,1)}_getPosRate(){return x(this._posRate,1)}$_labelAnimating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||this._animations.length>0}_animating(){return this.$_labelAnimating()||!isNaN(this._prevRate)}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Hi&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const s=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===s?o-=e.wPoint/2+c.height-c.height*t._vertAdjust+p:"right"===s?o+=e.wPoint/2+c.height*t._vertAdjust+p:o-=c.height/2-c.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+c.width+p:"right"===u?n+=e.wPoint/2+p:n-=c.width/2;const g=n,f=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_applyOverflowFit(t,e,s,i){if(isFinite(t)||t===1/0){if(e+s>=i)return t===1/0?null:i+t-s;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const i=_.fit;if(isFinite(i)||i===1/0){const h=_.inverted?o:a,l=_.inverted?e.width:e.height,d=_.inverted?_.width:_.height,u=_.inverted?r:n,p=h+l>=d,g=this._applyOverflowFit(i,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(c=p?g<s+u:g+l>s-u,_.inverted?o=g:a=g),c&&_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,m(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,f(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,y(_-l),e):r.setBounds(l,-e,y(_-l),e):r.setBounds(0,-m(l,_),t,y(_-l)):o?h?r.setBounds(_,0,y(_-l),e):r.setBounds(l,0,y(_-l),e):r.setBounds(0,e-m(l,_),t,y(_-l))}_setFill(t,e){s(e)&&e[Z]?t.internalSetStyle(Z,e[Z]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=x(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==Ws)if(l?c!==Ys&&c!==Xs||(d*=-1):c===Xs&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}Va.POINT_CLASS="rct-point",Va.DATA_FOCUS="focus",Va.DATA_UNFOCUS="unfocus",Va.DATA_UNHOVER="unhover",Va.LEGEND_MARKER="rct-legend-item-marker";class Pa extends oe{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Aa extends Pa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class ka extends te{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Ca extends ka{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let La=class extends Aa{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(Hs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class Na extends Ca{constructor(t){super(t),this.add(this._topView=new oe(t)),this.add(this._frontView=new oe(t)),this.add(this._sideView=new oe(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(at&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Hs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Hs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",$t.interpolate(o?$t.BLACK:$t.WHITE,l,.2)),this._sideView.setPath(Hs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",$t.interpolate(o?$t.WHITE:$t.BLACK,l,.2))}}class Ma extends No{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Ea extends Va{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&ra.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class Ta extends Ea{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new ma(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*B,this._base=u(this._depthAngle)*e.depth,this._side=p(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,h=this._labelViews(),l=this._labelLineContainer,c=i._xAxisObj,d=i._yAxisObj,g=this._yReversed,f=this._depthExt,y=i._group?i._groupDistance:i.distance,b=f?y*(r?p(this._depthAngle):u(this._depthAngle)):0,w=f?y*(r?u(this._depthAngle):p(this._depthAngle)):0,v=2*c.unitPad(),S=x(i.options.minPointWidth,0),V=this._yLen=r?t:e,P=r?e:t,A=t=>d.getPos(V,t),k=t=>c.getPos(P,t),C=r?0:e,L=d.valueMin(),N=A(L),M=this._baseVal=i.getBaseValue(d),E=!isNaN(M),T=this._yBase=x(A(m(L,x(M,N))),N),B=this._pointOff,O=h&&_(this._labelInfo,{inverted:r,reversed:g,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:w,side:this._side,base:this._base});h&&l.setVis(i.pointLabel.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(i.pointLabel.line._style),l.prepare(i),O.pb=new Kt),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach((t=>{this._shrinkPoint(t)})),this._getPointPool().forEach(((s,l)=>{const _=s.point;if(s.setVis(!_.isNull)){const d=c.getUnitLen(P,_.xValue)*(1-v);let u=i.getPointWidth(d,S),p=A(_.yGroup),g=T;if(_.yGroup!=_.yValue){const t=M>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);g=A(r)}const f=(p-g)*n;let m=k(_.xValue)-d/2,y=C-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),m+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(m=s.xSave+(m-s.xSave)*o),_.xPos=m+=u*B,_.yPos=y,this._layoutPoint(s,l,m-b,C-T*(1-n)-g*n+w,u,f),r&&(y=P-k(_.xValue)+d/2,m=C,_.yPos=y-=i.getPointPos(d)+u/2+u*B,_.xPos=m+=E?A(_.yGroup)*n:A(_.yGroup*n)),O&&(O.labelView=h.get(_,0))&&(O.pointView=s,O.x=m,O.y=y,O.wPoint=u,O.hPoint=f,this._layoutLabel(a,O,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class Ba extends Ea{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._pointOff=+e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),d=x(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,f=this._pointOff,m=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((_,y)=>{const x=_.point;if(_.setVis(!x.isNull)){const b=h.getUnitLen(p,x.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(l.getPos(u,this._getHighValue(x))-l.getPos(u,this._getLowValue(x)))*r;let S=h.getPos(p,x.xValue)-b/2,V=g-l.getPos(u,this._getHighValue(x))*r;isNaN(n+_.wSave)||(w=_.wSave+(w-_.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+_.xSave)||(S=_.xSave+(S-_.xSave)*n),x.xPos=S+=w*f,x.yPos=V,this._layoutPoint(_,y,S,V,w,v),i&&(V=p-h.getPos(p,x.xValue)+b/2,S=g,x.yPos=V-=s.getPointPos(b)+w/2+w*f,x.xPos=S+=l.getPos(u,this._getHighValue(x))*r),a&&(m.pointView=_,m.hPoint=v,m.x=S,m.y=V,(m.labelView=a.get(x,0))&&(m.hPoint=v,this._layoutLabel(o,m,t,e)),(m.labelView=a.get(x,1))&&(i?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}}))}}class Oa extends Pa{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class Ra extends Va{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==Ws){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class Da extends Wt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class $a extends Va{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}clipInvertable(){return!1}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(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.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Da(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Gs.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s.legendMarker()||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Fa extends qo{constructor(t){super(t,Fa.CLASS_NAME),this.addToTransform(this._imageView=new Oo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),wo(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}Fa.CLASS_NAME="rct-image-annotation";class Ia extends qo{constructor(t){super(t,Ia.CLASS_NAME),this.addToTransform(this._shapeView=new oe(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case gr:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Hs.line(g,p,g+l.width,p));break;case pr:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Hs.line(g,p,g,p+l.height));break;case fr:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(Hs.line(g,p,t,s));break;default:Hs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ia.CLASS_NAME="rct-shape-annotation";class za extends qo{constructor(t){super(t,za.CLASS_NAME),this.addToTransform(this._textView=new pe(t)),this._textView.anchor=ce.START,this._richText=new Se}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=wo(this._textView.getBBox());return{width:x(o.width,h.width),height:x(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}za.CLASS_NAME="rct-text-annotation";class Ha extends yo{freeOrphans(){const t=this.getOrphans();return t&&t.forEach((t=>{t.point._vr>=1&&this.freeOrphan(t.point)})),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach((t=>{let s=e.get(t);s||(s=this.find((e=>e.point===t)),s&&this.addOrphan(t,s))}))}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class Ga extends Oa{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Hs.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),Hs.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:Math.sqrt((i-e)**2+(r-s)**2)-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class ja extends ya{}class Xa extends Va{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new ja(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new oe(t,"rct-line-series-line")),this._markers=new Ha(this._pointContainer,Ga),this.add(this._tester=new oe(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof Qr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar),super._doAfterLayout()}_runShowEffect(t){this._polar?t&&ra.grow(this):t&&ra.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._polar)}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new oe(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new yo(this._lineContainer,oe)),i.prepare(e.length);s.length<e.length;){const t=new ne(this.doc);this.control.addClip(t),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar;if(null==o||null==a)return;const l=D(m(0,f((E-y(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Hs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Hs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Hs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Hs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Hs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Hs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Hs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Hs.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof Qr&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.options.belowStyle,a=e.length;this._markers.prepare(a*s,((s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1}))}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),Hs.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,d=r.options.maxVisible,g=r.options.minVisible,y=i.pointLabel,x=y.options.align,b=y.getAlignOffset(),w=y.getOffset(),v=y.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),P=i._xAxisObj,A=i._yAxisObj,k=this._polar=i.chart._body.getPolar(P),C=!!k,{cx:L,cy:N,rd:M,start:E,total:T}=k||{},B=o?e:s,O=k?T:o?s:e,R=o?0:s,D=t.length,$=A.axisMax(),F=this._yReversed,I=A instanceof kr?i.getBaseValue(A):NaN,z=I>A.axisMin(),H=A.getPos(M,I);this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,r)=>{let y,G,j,X;k?(j=E+P.getPos(O,t.xValue),k.min=null==k.min?j:f(k.min,j),k.max=null==k.max?j:m(k.max,j),X=F?isNaN(t.yGroup)?z?H:M:z?H+(A.getPos(M,t.yGroup)-H)*h:M-A.getPos(M,$-t.yGroup)*h:isNaN(t.yGroup)?z?H:0:z?H+(A.getPos(M,t.yGroup)-H)*h:A.getPos(M,t.yGroup)*h,y=t.px=L+X*u(j),G=t.py=N+X*p(j),t.angle=j):(y=t.px=P.getPos(O,t.xValue),G=t.py=R-A.getPos(B,t.yGroup),o&&(y=A.getPos(B,t.yGroup),G=s-P.getPos(O,t.xValue))),t.xPos=y,t.yPos=G;const Y=y,W=G,U=this._markers.get(r),Z=V&&V.get(t,0);if(U&&U.setVis(!t.isNull&&(C||!a||y>=0&&y<=e&&G>=0&&G<=s))){this._prepareMakrer(U),this._layoutMarker(U,n,y,G),i._maxY,t.yGroup,i._minY,t.yGroup;const e=0==r&&null!=_?_:r==D-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=g?g:l;if(U.setStyle("opacity",e?"1":"0"),Z){Z.setContrast(null).layout(S);const e=Z.getBBox(),s=U._radius;if(Z.visible=!0,k){switch(v){case"inside":F?t.yValue<I?X-=w:X+=w:t.yValue<I?X+=w:X-=w;break;case"foot":F?t.yValue<I?X-=e.height/2+w:X+=e.height/2+w:t.yValue<I?X+=e.height/2+w:X-=e.height/2+w;break;default:F?t.yValue<I?X+=e.height/2+w:X-=e.height/2+w:t.yValue<I?X-=e.height/2+w:X+=e.height/2+w}y=L+X*u(j),G=N+X*p(j)-e.height/2,this.applyAutoRotation(Z,j,T,P.options.totalAngle)}else switch(v){case"inside":G-=e.height/2+w;break;case"foot":G+=w+(l?s:0);break;default:G-=e.height+w+(l?s:0)}switch(x){case"left":y-=e.width+(l?s:0)+b;break;case"right":y+=(l?s:0)+b;break;default:y-=e.width/2+b}this._checkLabelOverlap(Z,e,Y,W,s,s,y,G,!1,null),this._layoutLabelRotation(Z,e,y,G)}}else Z&&Z.setVis(!1)}))}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach((t=>{t.visible&&t.shrink()}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0&&e._lines.some((t=>t.length>0))))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof Qr&&this._needBelow;let o=this._buildLines(t,e._lines);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Ft.setImportantStyle(t.dom.style,Z,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Ft.setImportantStyle(t.dom.style,Z,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,h.getPos(s,l),!0):this.$_resetClips(s,i,i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),Ft.setImportantStyle(a.dom.style,Z,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Qr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new Kt;return"spline"===i?this._drawCurves(t,e,r):s instanceof Qr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Qr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof kr?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],d=c.length;let g,f;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*u(c[0].angle),f=r+_*p(c[0].angle),s.move(g,f),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*u(c[d-1].angle),f=r+_*p(c[d-1].angle),s.line(g,f))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new Kt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class Ya extends Xa{constructor(t){super(t,Ya.CLASS),this._flagView=new Ro(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.getIconUrl(),null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:d,height:u}=a,p=d/2,g=u/2,{width:f,height:m}=r,y=f/2,x=m/2,b=l>u+o,w=m>l+u+o,v=h>d+o,S=f>h+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const P=h>p&&f-h>p?h-p:h>y?f-d:0,A=l>g&&m>l+g?l-g:l>x?m-u:0;switch(_){case"top":h=P,l=b?l-u-o:0;break;case"bottom":h=P,l=w?l+o:m-u;break;case"left":h=v?h-d-o:0,l=A;break;case"right":h=S?h+o:f-d,l=A}i.trans(h,l)}}}Ya.CLASS="rct-line-series";class Wa extends Xa{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ja(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new oe(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new oe(t,"rct-areanrange-series-line")),Ft.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,d=this._labelViews(),g=this._labelContainer._textAlign,f=this._polar=i.chart._body.getPolar(h),m=i.pointLabel,y=m.options.position,x=m.options.align,b=m.getAlignOffset(),w=m.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let i=0,c=t.length;i<c;i++){const m=t[i],S=v.get(c+i),V=d&&d.get(m,1);let P,A,k;this._prepareMakrer(S),a?(P=m.px2=l.getPos(_,m.lowValue),A=m.py2=v.get(i).ty+S._radius):(P=m.px2=m.xPos,A=m.py2=m.yLow);const C=P,L=A;if(S&&S.setVis(!m.isNull&&P>=0&&P<=e&&A>=0&&A<=s)){if(this._layoutMarker(S,n,P,A),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius;if(f){switch(y){case"inside":A-=w;break;case"foot":A-=t.height/2+w;break;default:A+=t.height+w}P=f.cx+A*u(k),A=f.cy+A*p(k)-t.height/2,this.applyAutoRotation(V,k,f.total,h.options.totalAngle)}else switch(y){case"inside":A-=t.height/2+w;break;case"foot":A+=w+(o?e:0);break;default:A-=t.height+w+(o?e:0)}switch(x){case"left":P-=t.width+(o?e:0)+b;break;case"right":P+=(o?e:0)+b;break;default:P-=t.width/2+b}this._checkLabelOverlap(V,t,C,L,e,e,P,A,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}class Ua extends Xa{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new ja(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new oe(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new oe(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new yo(this._areaContainer,oe,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<f(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new ne(s)));for(;i.length<e.length;)i.push(this.control.addClip(new ne(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Z,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(Z,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof kr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:g}=l,y=new Kt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(d,h):0,x=i.chart._body.options.circular;let w,v,S,V,P=!1,A=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),y);else{g?y.move(s[0].xPos,s[0].yPos):(w=_+l*u(s[0].angle),v=c+l*p(s[0].angle),y.move(w,v),y.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)y.line(s[t].xPos,s[t].yPos);g||(w=_+l*u(s[b-1].angle),v=c+l*p(s[b-1].angle),y.line(w,v))}const k=s.map((t=>t.angle)),C=this._polar.min=f(...k),L=this._polar.max=m(...k),N=(new Kt).push(y.end());if(r)g?y.circle(_,c,l):a&&y.push(...Hs.arc(_,c,l,l,C,L,!0)),S=y.end(),P=!0,g?N.circle(_,c,l):N.push(...Hs.arc(_,c,l,l,C,L,!0)),V=N.end(),A=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;y.push("Z"),g?x?y.circle(_,c,d):y.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+u(t+s.pos/d*e/E)*d,y:c+p(t+s.pos/d*e/E)*d})))):x?y.push(...Hs.sector(_,c,d,d,0,C,L,!0)):y.polygon({x:_,y:c},...s.map((s=>({x:_+u(t+s.pos/d*e/E)*d,y:c+p(t+s.pos/d*e/E)*d})),{x:_,y:c})),S=y.end(!0),P=!0}else S=y.end();t.setPath(S),t.setAttr("fill-rule",P?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",A?"evenodd":""))}else{y.move(x(s[0].xPos,_),x(s[0].yLow,c)),y.line(x(s[0].xPos,_),x(s[0].yPos,c));for(let t=1;t<s.length;t++)y.line(x(s[t].xPos,_),x(s[t].yPos,c));y.line(x(s[s.length-1].xPos,_),x(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)y.line(x(s[t].xPos,_),x(s[t].yLow,c));t.setPath(y.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),Ft.setImportantStyle(t.dom.style,q,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),Ft.setImportantStyle(e.dom.style,q,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new ae(this.doc)));const t=Hs.arc(_,c,d,d,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Za extends Ba{constructor(t){super(t,"rct-barrange-series"),this._bars=new Ha(this._pointContainer,La)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(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}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*x(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class qa extends dn{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Ka extends Ta{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),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 Ha(this._pointContainer,qa)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:d}=l,g=o instanceof kr?t.getBaseValue(o):NaN,m=g>o.axisMin(),y=o.getPos(d,g),x=this._pointOff,b=n.getTotalAngle();let w,v,S,V,P;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const A=s.point;if(s.setVis(!A.isNull)){const r=o.getPos(d,A.yGroup)*e,k=n.getUnitLen(b,A.xValue)*(1-h),C=t.getPointWidth(k,0);let L,N,M=l.start+n.getPos(b,A.xValue)-k/2;if(M+=C*x,M+=t.getPointPos(k)+C/2,a?m?(L=y+(o.getPos(d,A.yGroup)-y)*e,N=y):(L=d,N=o.getPos(d,A.yGroup*e)):m?(L=y+(o.getPos(d,A.yGroup)-y)*e,N=y):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-C/2,angle:C,clockwise:!0}),M=s.start+s.angle/2,A.xPos=_+s.rx*u(M),A.yPos=c+s.ry*p(M),i&&(P=w.labelView=i.get(A,0))){P.layout(V);const{width:t,height:e}=P.getBBox(),i=s.ry,r=s.innerRadius*d;let o,h;o=a?m?A.yValue<g?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i-e/2-S:"head"===v?f(y,i+e/2+S):"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?r-e/2-S:"head"===v?f(d,r+e/2+S):"foot"===v?d-e/2-S:d-(d-r)/2-S:m?A.yValue<g?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*p(M),o=_+o*u(M),"outside"!==v&&P.setContrast(s.dom),this.applyAutoRotation(P,M,l.total,n.options.totalAngle),P.trans(o-t/2,h-e/2)}}}))}}class Qa extends Ka{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Ha(t,Na):new Ha(t,La)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*x(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof La){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class Ja extends Ua{constructor(t){super(t,"rct-bellcurve-series")}}class th extends Ma{constructor(t){super(t,Va.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Xr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Xr(t,"rct-boxplot-point-stem")),this.add(this._box=new Gs(t,"rct-boxplot-point-box")),this.add(this._mid=new Xr(t,"rct-boxplot-point-mid")),this.add(this._min=new Xr(t,"rct-boxplot-point-min")),this.add(this._max=new Xr(t,"rct-boxplot-point-max"))}}class eh extends Ba{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Ha(this._pointContainer,th)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class sh extends Oa{}class ih extends Ra{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new se(t,"rct-bubble-pie"))}_createMarkers(t){return new Ha(t,sh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ra.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}pointByDom(t){const e=super.pointByDom(t);if(e)return this.model._hoveredSlice=null,e;if(this._sectorMap){let e=t;for(;e;){const t=this._sectorMap.get(e);if(t)return this.model._hoveredSlice=t.slice,t.pv;e=e.parentElement}}return this.model._hoveredSlice=null,null}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_preparePie(t,e,s){const i=e.pie,r=i&&i.visible&&i.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;s.forEach((t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)})),this._pieSectors||(this._pieSectors=new yo(this._pieContainer,dn,Va.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();i.getLegendSources().forEach((e=>{e.legendMarker()||e.setLegendMarker(Gs.create(t,Va.LEGEND_MARKER,0,0,r,r,r/2))}))}else this._pieSectors&&this._pieSectors.prepare(0),this._sectorMap=null}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=i.options,n=this._inverted,o=i.needClip(!1),a=this._getGrowRate(),h=+r.rotation||0,l=i.pointLabel,_=l.options.position,c=l.getOffset(),d=this._labelContainer._textAlign,g=this._labelViews(),f=i._xAxisObj,m=i._yAxisObj,y=this._polar=i.chart._body.getPolar(f),b=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:S,max:V}=i.getPixelMinMax(v),P=n?0:e,A=Hs.getDrawer(r.shape),k=i.pie,C=k&&k.visible&&k.fields.length>0;let L,N=0;null===(s=this._markers.getOrphans())||void 0===s||s.forEach((t=>{t.setPath(A(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))})),this._markers.forEach(((s,r)=>{var l,v;const M=s.point,E=g&&(L=g.get(M,0));if(s.setVis(!M.isNull&&!isNaN(M.zValue))){const r=s._radius=i.getRadius(M.zValue,S,V),g=r*a*x(M._vr,1);let v,T;if(y){const t=y.start+f.getPos(w,M.xValue),e=m.getPos(y.rd,M.yValue);v=y.cx+e*u(t),T=y.cy+e*p(t)}else v=f.getPos(w,M.xValue),T=P-m.getPos(b,M.yValue),n&&(v=m.getPos(b,M.yValue),T=e-f.getPos(w,M.xValue));M.xPos=v,M.yPos=T;const B=!o||v>=0&&v<=t&&T>=0&&T<=e;if(C&&M.pieSlices)if(s.setVis(!1),B)k.resolveSliceColors(M.pieSlices),N=this.$_renderPieSectors(M,M.pieSlices,N,v,T,g,k.getInnerRadius(g),k.clockwise);else for(let t=0;t<M.pieSlices.length;t++)null===(l=this._pieSectors.get(N++))||void 0===l||l.setVis(!1);else s.setVis(B)&&s.setPath(A(g)).trans(v,T).rotate(h);B&&E?(L.setContrast(C&&M.pieSlices?null:s.dom),L.layout(d),this._layoutLabelView(L,_,c,r,v,T)):E&&E.setVis(!1)}else{if(C&&M.pieSlices)for(let t=0;t<M.pieSlices.length;t++)null===(v=this._pieSectors.get(N++))||void 0===v||v.setVis(!1);E&&E.setVis(!1)}}))}$_renderPieSectors(t,e,s,i,r,n,o,a){let h=s;for(const s of e){const e=this._pieSectors.get(h++);if(e){const h={cx:i,cy:r,rx:n,ry:n,innerRadius:o,start:s.startAngle,angle:y(s.angle),clockwise:a};if(e.setSector(h),e.setFill(s.color),e.setVis(!0),this._sectorMap){const a=s.startAngle+s.angle/2,h=(n+o)/2,l=i+h*u(a),_=r+h*p(a),c={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:_}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:s,pv:c})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}let rh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),o=f(n,r),a=m(1,y(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,o,t,a),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Xr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Xr(t,"rct-candlestick-point-wick")),this.add(this._body=new Gs(t))}};class nh extends Ba{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Ha(this._pointContainer,rh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}class oh extends Pa{layout(t,e,s){const i=new Kt;i.circle(t,e,s),this.setPath(i.end())}}class ah extends Ka{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Ha(t,oh)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let hh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS),this.add(this._line=new Xr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new oe(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new oe(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),Hs.setShape(r,o.shape,a,a),Hs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class lh extends Ba{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Ha(this._pointContainer,hh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}let _h=class extends No{constructor(t){super(t,Va.POINT_CLASS),this._segments=new yo(this,oe),this._decimal=0,this.add(this._back=new oe(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setPath(Hs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Hs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Hs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class ch extends Ta{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Ha(this._pointContainer,_h)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),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.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}let dh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Xr(t)),this.add(this._whiskerUp=new Xr(t)),this.add(this._whiskerDown=new Xr(t)),this.add(this._back=new Gs(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class uh extends Ba{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Ha(this._pointContainer,dh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class ph extends Pa{}class gh extends $a{constructor(t){super(t,"rct-funnel-series"),this._segments=new Ha(this._pointContainer,ph),this.add(this._lineContainer=new ma(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_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&&ra.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=D(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=D(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?x+(V-x)*(w-t)/(w-P):x+(V-x)*(t-b)/(P-b)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getWidgetAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),f=new Kt,m=i.getCenter(t,e),x=m.x-p.width/2,b=m.y-p.height/2,w=b+p.height,v=x+p.width/2,S=p.height-g.height,V=x+(p.width-g.width)/2,P=d?w-S:b+S,A=[],k=new Kt,C=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const m=n.yPos*p.height,x=(n.yPos+n.height)*p.height,M=d?w-m:b+m,E=d?w-x:b+x,T=x<S;let B,O,R,D;if(N=null==c?void 0:c.get(n),m>=S?(B=V,O=B+g.width,f.move(B,M).lines(O,M,O,E,B,E),i.ny=i.nx1=NaN):T?(B=s(M),O=B+2*(v-B),R=s(E),D=R+2*(v-R),f.move(B,M).lines(O,M,D,E,R,E),i.ny=NaN,i.nx1=R-B,i.nx2=D-B):(B=s(M),O=B+2*(v-B),R=V,D=R+g.width,f.move(B,M).lines(O,M,D,P,D,E,R,E,R,P),i.nx1=R-B,i.nx2=D-B,i.ny=y(P-M),i.nx3=R,i.nx4=D),i.setPath(f.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=T?(O-B+(D-R))/2:g.width;switch(!t&&L.layout(_||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,_,u,N,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,k,v,a,h);L.setContrast(o&&i.dom),A.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(A,c,E):(null==r?void 0:r.arrangeVertical(this,A,c,e,M,E,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,u,N,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,N,k,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let f=l;if(n?f-=h.width/2:f+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(f-g-c,e).end()):o.setLine(a.reset(0,0).line(f+c-g,e).end()),o.trans(g,p)}t||(n?f-=_+c+u.width:f+=c+_,i.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),f=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,s,h,n);let y;if(y=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(y-m-_,e).end()):o.setLine(a.reset(0,0).line(y+_-m,e).end()),o.trans(m,f)}t||(n?y-=l+_+g.width:y+=_+l,i.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let fh=class extends Aa{layout(t,e){this.setPath(Hs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class mh extends Ea{constructor(t){super(t,"rct-histogram-series"),this._bars=new Ha(this._pointContainer,fh)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,d=h.getPos(l,s.getBaseValue(h)),u=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,_)=>{const g=s.point,f=a.getPos(c,g.min),m=a.getPos(c,g.max),y=h.getPos(l,g.yValue),x=m-f+(m>f?-1:1),b=y-d;let w=f+(m-f)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(s,_,w,v+b,x,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(l,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=x,p.hPoint=b,this._layoutLabel(n,p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,o.point.yValue)*n,u=m(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class yh extends No{constructor(t){super(t,Va.POINT_CLASS),this.add(this._line=new Xr(t,"rct-lollipop-point-bar")),this.add(this._marker=new oe(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Hs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class xh extends Ta{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new Ha(this._pointContainer,yh)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}class bh extends Ma{constructor(t){super(t,Va.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,a=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_doInitChildren(t){this.add(this._tickOpen=new Xr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Xr(t,"rct-ohlc-point-tick")),this.add(this._bar=new Xr(t)),this.add(this._back=new Gs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class wh extends Ba{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Ha(this._pointContainer,bh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}class vh extends Xa{constructor(t){super(t,"rct-pareto-series")}}class Sh extends oe{setOff(t){return this.off=y(t),this}}class Vh extends dn{constructor(t){super(t,Va.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class Ph extends te{constructor(t){super(t,Va.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new dn(t))}setSides(t,e,s,i,r){const n=this.point,o=D(M),a=D(((t?n.startAngle:n.startAngle+n.angle)+M/2+E)%E),h=D(a+(t?n.angle:-n.angle)-1e-4+E)%E,l=o-(a+y(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=M/2&&!(h>=a&&h<M/2)||h>=3*M/2&&!(a<h&&a>3*M/2)?(this._outArcView=i.setOff(f(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*M/2&&h<=M/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=M/2&&h<=3*M/2?(this._outArcView=i.setOff(f(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=M&&this._outArcView.setOff(f(this._outArcView.off,this._side1View.off)),h>=M&&h<E&&this._outArcView.setOff(f(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Hs.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;at&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Hs.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Hs.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(Hs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Hs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Hs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Hs.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",$t.interpolate("#000",r,.2)),this._side2View.setStyle("fill",$t.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",$t.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",$t.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Va.DATA_FOCUS,t),this._side2View.setBoolData(Va.DATA_FOCUS,t),this._inArcView.setBoolData(Va.DATA_FOCUS,t),this._outArcView.setBoolData(Va.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class Ah extends $a{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new Kt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new Yo(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Ro(t,"rct-pie-series-inner")),this._textView._text.anchor=ce.MIDDLE,this._pointContainer.add(this._sideContainer=new se(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new ma(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,s.getIconUrl(),null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,o=r-n;this._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&ra.grow(this,(t=>{const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if((t instanceof Vh||t instanceof Ph)&&this.model.options.autoSlice){const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof Ph&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new Ha(this._pointContainer,Ph,null),n=this._sides=new yo(this._sideContainer,Sh,"rct-pie-series-side")):this._sectors=new Ha(this._pointContainer,Vh,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%E;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=D(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,_=this._rxInner,c=this._depth,d=this._ratio,g=this._sides,f=i.pointLabel,m=f.options,b=f.connector.options.curved,w=this._labelViews(),v="inside"===i.getLabelPos(f),S=x(m.radius,.7),V=this._pb,P=f.getDistance(v,l,_),A=f.getWidgetAlign();let k=null==w?void 0:w.textAlign();const C=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,L=this._slicedOff=i.getSliceOffset(l)*n,N=[],M=[],E=[],T=(null==w?void 0:w.getWidth(0))||0,B=this._sectors.count;let O,R;if(this._lineContainer.setStyleOrClass(f.connector.options.style),!w||k||A||(k="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=x(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const f=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(R=null==C?void 0:C.get(f),f.isNull)t.setVis(!1),w&&(O=w.get(f,0))&&O.setVis(!1),null==R||R.setVis(!1);else{const o=B>1&&f.sliced,g=f.startAngle,m=g+f.angle/2;let x=0,C=0;if(o&&n>=1&&!t.isDomAnimating()&&(x+=u(m)*L,C+=p(m)*L),t.trans(x,C).setVis(!0),f.xPos=a+u(m)*(L+l*S),f.yPos=h+p(m)*(L+l*S),t.render(w,null,{cx:a,cy:h,rx:l,ry:l*d,innerRadius:_,start:g,angle:y(f.angle),clockwise:r,depth:c}),w&&(O=w.get(f,0))){const r=i.getLabelOff2(f);let n;v?(null==R||R.setVis(!1),this.$_layoutLabelInside(f,O,k,r,P,o?L:0)):(n=-1===A?this.$_layoutLabelAligned(!1,f,O,k,R,V,b,r,P,o?L:0):1==A?this.$_layoutLabelEnded(!1,f,O,k,R,V,b,r,P,o?L:0,T,e,s):this.$_layoutLabelOutside(!1,f,O,k,R,V,b,r,P,o?L:0),n?N.push(O):M.push(O),this._layoutLabelRotation(O)),O.setContrast(v&&t.dom).setVis(!0),E.push(O)}else null==R||R.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.convergent,$=m.dedupeMode,F=m.overflow;w&&(v||0===A?"preserveOrder"!==$&&"largestFirst"!==$||w.dedupe(E,C,$):w.arrangeVertical(this,N,C,s,D,$,F)+w.arrangeVertical(this,M,C,s,D,$,F)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=B>1&&r.sliced,n=i.getLabelOff2(r);O=w.get(r,0),R=null==C?void 0:C.get(r),(null==O?void 0:O.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,O,k,R,V,b,n,P,t?L:0):1==A?this.$_layoutLabelEnded(!0,r,O,k,R,V,b,n,P,t?L:0,T,e,s):this.$_layoutLabelOutside(!0,r,O,k,R,V,b,n,P,t?L:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,g=this._cy,f=this._rx,m=this._ry,y=f+l,x=m+l,b=d+u(c)*y,w=g+p(c)*x,v=b<d;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let P,A,k,C=g+p(c)*m;if(v?(P=d+u(Math.PI)*f-h,A=P-S.width-a,k=d+u(Math.PI)*y-h,S.width):(P=d+u(0)*f+h,A=P+a,k=d+u(0)*y+h),r&&r.setVis(y>0)){const e=t?s.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-P),e,b-P,0).end()):r.setLine(n.reset(0,e).line(b-P,0).end()),r.setPos(P,C),!_&&r.trans(P,w)}return t||(s.setPos(A,C-S.height/2),!_&&s.trans(A,C-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d){const g=s.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,y=this._cy,x=this._rx,b=this._ry,w=x+l,v=b+l;let S=m+u(f)*w,V=y+p(f)*v;const P=S<m;!t&&!g&&s.layout(i||(P?"right":"left"));const A=s.getBBox(),k=V-A.height/2;let C,L,N,M=y+p(f)*b;if(P?(C=h+_+a,N=h+_-A.width,L=C):(C=c-h-_-a,N=c-h-_,L=C),r&&r.setVis(w>0)){const e=t?s.ty-k:0;o?r.setLine(n.reset(0,e).quad(0,e,S-L,0).end()):r.setLine(n.reset(0,e).line(S-L,0).end()),r.setPos(C,M),!g&&r.trans(L,V)}return t||(s.setPos(N,M-A.height/2),!g&&s.trans(N,M-A.height/2)),P}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),d=e.startAngle+e.angle/2,g=this._cx,f=this._cy,m=this._rx+.5*h,y=this._ry+.5*h,x=u(d)*l,b=p(d)*l,w=g+u(d)*this._rx,v=f+p(d)*this._ry,S=g+u(d)*m;let V=f+p(d)*y;const P=S<g;let A,k;return P?(A=S-.2*h,k=A):(A=S+.2*h,k=A),r&&r.setVis(m>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,A-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,A-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+x,v+b)),t||(P?k-=c.width+a:k+=a,V-=c.height/2,s.setPos(k,V),!_&&s.trans(k+x,V+b)),P}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=f(a.options.totalAngle||360,360);if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}else this._layoutLabelRotation(e);const g=h.options.align===Zs?.3:h.options.align===Us?.5:.7,m=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*g+i:.8*this._rx+i:.7*this._rx+i,y=this._deep?m*this._ratio:m,x=Math.cos(p),b=Math.sin(p);let w=this._cx+x*m,v=this._cy+b*y;e.move(w-d.width/2,v-d.height/2),w=this._cx+x*(n+m),v=this._cy+b*(n+y),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;const i=this.model,r=this._labelViews(),n=i.pointLabel.getWidgetAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(u(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,d=_.connector.options.curved,g="inside"===i.getLabelPos(_),f=r.get(h,0),m=i.pointLabel.getDistance(g,this._rx,this._rxInner);if(f){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,f,e,_.getOffset(),m,o):0===n&&this.$_layoutLabelOutside(!1,h,f,e,t,this._pb,d,_.getOffset(),m,o)}if(e){let e=f.tx,s=f.ty,i=t.tx,r=t.ty;(g||0===n)&&(f.trans(f.x,f.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(f.trans(f.tx,f.ty).transEx2(f.x,f.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class kh extends Oa{setHoverRate(t,e,s){const i=this.point,r=Hs.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._hoverRadius}}class Ch extends Ra{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Ha(t,kh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ra.grow(this)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,d=+i.jitterX||0,g=+i.jitterY||0,f=s.pointLabel,m=f.options.position,y=f.getOffset(),x=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let S;this._markers.forEach(((i,f)=>{const V=i.point,P=x&&(S=x.get(V,0));if(i.setVis(!V.isNull)){const f=Hs.getDrawer(s.getShape(V)),x=ht.jitter(V.xValue,d),A=ht.jitter(V.yGroup,g);let k,C;if(h){const t=h.start+o.getPos(w,x),e=a.getPos(h.rd,A)*l;k=h.cx+e*u(t),C=h.cy+e*p(t)}else k=o.getPos(w,x),C=v-a.getPos(b,A),r&&(k=a.getPos(b,A),C=e-o.getPos(w,x));if(V.xPos=k,V.yPos=C,i.setVis(!!h||!n||k>=0&&k<=t&&C>=0&&C<=e)){const t=i._hoverRadius||_;i.setPath(f(t)),i.trans(k,C).rotate(c),P&&this._layoutLabelView(S,m,y,t,k,C)}else P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}class Lh extends Ba{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Ha(this._pointContainer,La),this.add(this._lineContainer=new se(t,"rct-waterfall-series-lines")),this._lines=new yo(this._lineContainer,Xr)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}function Nh(t,e){return new(Zo[e._type()])(t)}function Mh(t,e){return new(wa[e._viewType()])(t)}Va.register([en,Ua],[nn,Wa],[Fr,Qa],[Rr,Za],[ln,Ja],[cn,eh],[bn,ih],[Sn,nh],[Pn,ah],[Ln,lh],[Mn,ch],[En,uh],[Rn,gh],[Fn,mh],[Qr,Ya],[Hn,xh],[jn,wh],[Yn,vh],[Qn,Ah],[eo,Ch],[ro,Lh]),qo.register([xr,za],[mr,Fa],[yr,Ia]);class Eh extends Mo{constructor(t){super(t,"rct-axis-grid"),this._lines=new yo(this,Xr)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPositions(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=x(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?x(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class Th extends te{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new oe(t)),this._mask.setStroke("none"),this.add(this._upLine=new oe(t)),this._upLine.setFill("none"),this.add(this._downLine=new oe(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(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 Kt;if(s){let t=0,s=0,n=i/2,o=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(o,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=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,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);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,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class Bh extends te{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Ro(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.options.text)){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const s=e.label.getText();e.label.prepareRich(s)}}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.setContrast(this._getContrastTarget()).layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}_getContrastTarget(){return null}}class Oh extends Bh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Uo:Xr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&s(e._style)&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="outside"!==n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="outside"!==n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="outside"!==n.position?t-h.width-l:t+l;break;default:c="outside"!==n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(Z,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class Rh extends Bh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?dn:js)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.options.position)?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:s,endValue:i}=e.options,r=!l(s)&&!l(i);this._range=r?e.axis.trimRange(f(s,i),m(s,i)):[NaN,NaN],this.setVis(e.visible&&!isNaN(this._range[0])&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[o,a]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=x(r.offsetX,0),c=x(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="outside"!==r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="outside"!==r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(m(0,f(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="outside"!==r.position?t-l.width-_:t+_;break;default:e="outside"!==r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,this._range[0]),h=i.axis.getPos(s.rd,this._range[1]);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:a/h,start:o,angle:E,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*u(s.start),s.cy+t*p(s.start))}}}class Dh extends se{constructor(){super(...arguments),this._views=new yo(this,oe)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.axisMin(),n.from),h=Math.max(o.axisMax(),n.to);if(n.axis._isHorz){const s=m(0,f(t,o.getPos(t,a))),r=m(0,f(t,o.getPos(t,h)));i.setPath(Hs.rectangle(s,0,r-s,e))}else{const s=m(0,f(e,o.getPos(e,a))),r=m(0,f(e,o.getPos(e,h)));i.setPath(Hs.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class $h extends se{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Rh?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof is?i=this._rangePool.pop()||new Rh(t,s):e instanceof ss&&(i=this._linePool.pop()||new Oh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Fh extends oe{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")),this.setStyleOrClass(t._style)}layout(t,e,s,i,r){const n=this.model.axis,o=n._isHorz,a=new Kt;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof vi&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class Ih extends Xo{constructor(t){super(t,"Reset Zoom",Ih.CLASS_NAME),this.setVis(!1)}}Ih.CLASS_NAME="rct-reset-zoom";class zh extends se{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Gs(t,"rct-empty-view-back")),this.add(this._labelView=new Ro(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class Hh extends se{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new yo(this,Xr)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class Gh extends se{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new oe(t)),this.add(this._gridContainer=new se(t,"rct-body-depth-grids")),this.add(this._lineView=new Xr(t,"rct-body-depth-side-line")),this.add(this._endView=new Xr(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(Hs.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(Hs.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new Hh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class jh extends se{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Gh(t,!0)),this.add(this._ySideView=new Gh(t,!1)),this.add(this._orgLineView=new Xr(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class Xh extends Mo{constructor(t,e){super(t,Xh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new Gs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new oe(t,"rct-body-background")),this.add(this._depthLayer=new jh(t)),this.add(this._image=new Oo(t,!0,"rct-body-image")),this.add(this._emptyView=new zh(t)),this.add(this._gridRowContainer=new Dh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new se(t,"rct-axis-grids")),this.add(this._baseContainer=new se(t,"rct-axis-bases")),this.add(this._guideContainer=new $h(t,"rct-axis-guides")),this.add(this._annotationContainer=new se(t,"rct-annotations")),this.add(this._seriesContainer=new se(t,"rct-series-container")),this.add(this._axisBreakContainer=new se(t,"rct-axis-breaks")),this.add(this._labelContainer=new se(t,"rct-label-container")),this.add(this._stackLabelContainer=new se(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new $h(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new se(t,"rct-front-annotations")),this.add(this._feedbackContainer=new se(t,"rct-feedbacks")),this.add(this._zoomButton=new Ih(t)),this._crosshairViews=new yo(this._feedbackContainer,Fh)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Jt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(Va.isPointDom(e))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart().chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof qr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=x(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s}));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=x(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=x(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}}));h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof rr){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof bn){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,ht.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(Va.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Va.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.zoom(h,l)&&(this._zoomRequested=!0)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof Oa&&e.endHover(t,!1),e.setBoolData(Va.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.cancel()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_renderBackground(t,e,s){t.setPath(Hs.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;t.setStyleOrClass(e._style),s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(this._guideClip))this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._layoutEmptyView(e,n,o)}_layoutEmptyView(t,e,s){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,s))}$_isEmptyVisible(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(Ko[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof Ar)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new Eh(t);r.set(e,s),i.add(s)}if(e instanceof Ar&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Xr(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||Mh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.forEach((t=>{this._labelContainer.dom.appendChild(t._labelContainer.dom)})),a.forEach((t=>t._stackLabelContainer.remove()));const l=new Map;for(const t of a){const e=t.model._group;e&&e._stacked&&e.isLastVisible(t.model)&&l.set(e,t)}l.forEach((t=>this._stackLabelContainer.add(t._stackLabelContainer)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof Ar&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new Th(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}Xh.BODY_CLASS="rct-body";class Yh extends te{constructor(t){super(t,Wh.HANDLE_STYLE),this.add(this._back=new Gs(t)),this.add(this._shape=new oe(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*f(t,e);const r=new Kt;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class Wh extends Mo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Wh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Wh.MASK_STYLE)}constructor(t){super(t,Wh.CLASS_NAME),this.add(this._back=new Gs(t,Wh.BACK_STYLE)),this.add(this._container=new se(t,null)),this.add(this._mask=new Gs(t,Wh.MASK_STYLE)),this.add(this._trackView=new Gs(t,Wh.TRACK_CLASS)),this.add(this._thumbView=new Gs(t,Wh.THUMB_CLASS)),this.add(this._startHandle=new Yh(t)),this.add(this._endHandle=new Yh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=Mh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_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 jo(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 jo(t)),i._simpleMode=!0)}}Wh.CLASS_NAME="rct-navigator",Wh.BACK_STYLE="rct-navigator-back",Wh.MASK_STYLE="rct-navigator-mask",Wh.HANDLE_STYLE="rct-navigator-handle",Wh.HANDLE_BACK_STYLE="rct-navigator-handle-back",Wh.TRACK_CLASS="rct-navigator-track",Wh.THUMB_CLASS="rct-navigator-thumb";class Uh extends _e{constructor(t){super(),this.chart=t}}class Zh extends Uh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=m(0,e-(o.x-n.x)),this._yStart=m(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new Gs(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=m(0,f(i.height,e-(i.y-s.y))),this._body.setZoom(0,f(m(0,this._yStart),e),this._body.width,m(f(this._yStart,i.height),e))):(t=m(0,f(i.width,t-(i.x-s.x))),this._body.setZoom(m(0,f(this._xStart,t)),0,m(f(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=m(0,f(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,f(this._yStart,r),this._body.width,y(this._yStart-r))):(i=m(0,f(o.width,i-(o.x-n.x))),this._feedback.setBounds(f(this._xStart,i),0,y(this._xStart-i),this._body.height)),!0}}class qh extends Uh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Kh extends Uh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Qh extends Uh{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(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=m(0,f(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Jh{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(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(y(this._clickX-i)>3||y(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),e.forceHideTooltip(),this._stopEvent(t)):t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):e.getButton(s)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){const t=ht.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach((t=>{if(t instanceof gi){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof $a&&t.togglePointVisible(e)}}else t.visible=e})),i.bodyView().hoverSeries(e?a.source:null)}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return Ho.isThumb(t)?new qh(this._chart,i.getScrollView(t)):Wh.isHandle(t)?new Kh(this._chart,i._navigatorView,t):Wh.isMask(t)&&r&&r.model.isZoomed()?new Qh(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Zh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,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),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class tl extends se{constructor(t){super(t,tl.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new pe(t,"rct-history-item");e.anchor=ce.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new pe(t);e.anchor=ce.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 o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}tl.TITLE_CLASS="rct-history";class el extends Mo{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Gs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new pe(t,"rct-legend-item-label")),this._label.anchor=ce.START}setMarker(t){return t===this._marker&&t.parent===this||(this._marker&&this._marker!==t&&this._marker.remove(),this.insertFirst(this._marker=t)),this._marker}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():xo,l=wo(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:m(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=x(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class sl extends Eo{constructor(t){super(t,sl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new yo(this,el)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),a=this._vertical="vertical"===e.getLayout();return this._ipr=x(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?x(n.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,f,y,x;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),f=x.mh,w++,b++):(f+=l+x.mh,f<=n?(y.push(x),w++,b++):w=0);this._wMarkers=[],g=f=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=m(s,t.mw),r=m(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),f=m(f,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),g=x.mw,w++,b++):(g+=l+x.mw,g<=r?(y.push(x),w++,b++):w=0);g=f=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=m(s,t.mh)})),e+=l*(t.length-1),g=m(g,e),f+=s,p.push(s)})),f+=_*(u.length-1)}return{width:g,height:f}}}sl.LEGEND_CLASS="rct-legend";class il extends te{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Yo(t))}layout(){}}class rl extends te{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new se(t,"rct-polar-axis-markers")),this._markViews=new yo(this._markContainer,il),this.add(this._gridContainer=new te(t,"rct-polar-axis-grids")),this._labelViews=new yo(this._labelContainer=s,Io,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(Go)?t.setLabel(s,o,e,r.replace(Go,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks;s.chart._body.getPolar(e),s.options.rotation;const i=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(i,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class nl extends rl{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new yo(this._gridContainer,Xr,nl.GRID_CLASS),e.insertFirst(this._startView=new Xr(t,nl.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Xr(t,nl.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Uo(t,nl.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/E)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+u(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",_=[],c=t.label.options.rotation||0,d="auto"===c;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),g=t.angle=o+n.pos,f=(g*O%360+360)%360,m=f>90&&f<270;if(d){const i=e-a.width/2+u(g)*(h+a.width/2),r=s-a.height/2+p(g)*(h+a.width/2);t.trans(i,r),t.setRotation(a.width/2,a.height/2,m?g*O+180:g*O)}else{const i=e+u(g)*(h+a.width/2)-a.width/2,r=s+p(g)*(h+a.height/2)-a.height/2;t.trans(i,r),t.setRotation(a.width/2,a.height/2,c)}_.push(t)}}));let g=0,f=_[g];for(let t=1;t<_.length;t++){const e=_[t],s=f.inflateBBox(-1,-1),i=e.inflateBBox(-1,-1),r=Object.assign(s,{rotation:f.rotation}),n=Object.assign(i,{rotation:e.rotation});if(ko(r,n)?(e.setVis(!1),_.splice(t,1),--t):(f=e,g=t),t===_.length-1&&_.length>1){if(ht.diffAngle(f.angle,_[0].angle)<E/6){const t=Object.assign(_[0].inflateBBox(-1,-1),{rotation:_[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});ko(t,e)&&(f.setVis(!1),_.splice(g,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+u(o)*i,s+p(o)*i),r.map((t=>{const r=t.pos;h.push(e+u(o+r)*i,s+p(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+u(o+a)*i,s+p(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+u(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+u(o+a)*i,s+p(o+a)*i))}}nl.LINE_CLASS="rct-polar-xaxis-line",nl.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",nl.GRID_CLASS="rct-polar-xaxis-grid-line";class ol extends rl{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new yo(this._gridContainer,Uo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Xr(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Uo(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof Ar&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+u(_)*i,s+p(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+u(_+n)*i,s+p(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+u(_+c)*i,s+p(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+u(t)*r[a].pos-h.width*i+o,s+p(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*u(_),s+i*p(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class al extends Xh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(Hs.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(s,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new se(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new se(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new se(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new ol(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new nl(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class hl extends Eo{constructor(t,e){super(t,e?hl.SUBTITLE_CLASS:hl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new pe(t)),this._richText=new Se}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),wo(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}hl.TITLE_CLASS="rct-title",hl.SUBTITLE_CLASS="rct-subtitle";class ll extends te{constructor(t){super(t,"rct-tooltip-row"),this.add(this._marker=new oe(t,"rct-tooltip-row-marker")),this.add(this._textView=new pe(t,"rct-tooltip-row-text")),this._textView.anchor=ce.START,this.add(this._detailView=new pe(t,"rct-tooltip-row-detail")),this._detailView.anchor=ce.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=Hs.getDrawer(o.listMarkerShape);this._marker.setPath(l(a/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||""),r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+h)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+h+this._textView.getBBox().width+x(e.options.listGap,4))):this._detailView.text=""}alignDetail(t){const e=this._marker.getBBox();this._detailView.transX(t-this._detailView.getBBox().width),this._marker.trans(e.width/2,this.r.height/2)}}class _l extends te{constructor(t){super(t,"rct-tooltip-list"),this.add(this._headerView=new pe(t)),this._headerView.anchor=ce.START,this.add(this._rowLayer=new se(t,"")),this.add(this._footerView=new pe(t)),this._footerView.anchor=ce.START,this._rows=new yo(this._rowLayer,ll)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=x(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach(((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=m(l,(r.r=r.getBBox()).width)})),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach((t=>{t.alignDetail(l)}))}}class cl extends te{constructor(t){super(t,cl.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new oe(t,"rct-tooltip-back")),this.add(this._top=new oe(t,"rct-tooltip-top")),this.add(this._textView=new pe(t,"rct-tooltip-text")),this.add(this._listView=new _l(t)),this._back.setAttr("filter","url(#"+Jt.SHADOW_FILTER+")"),this._textView.anchor=ce.START,this._richText=new Se,this.close(!0,!1)}show(t,e,s,r,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,r&&r.map((t=>t.point)));if(!_)return;const c=l.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,h,p);if(0===p.rows.length){if(u=i(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map((()=>[u,""]))}}else{const e=c.text||_.getTooltipText(t,h,null);if(u=i(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const g=e.contentWidth(),y=e.contentHeight(),x=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let P,A,k,C=V.options.reversed;t instanceof Qi&&t.getBaseValue(V)>s.point.yValue&&(C=!C),d?(x.setVis(!0),b.setVis(!1),x.layout(e.doc(),l,this._richText,this._list),P=x.getBBox()):(x.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),P=b.getBBox()),A=m(c.minWidth||0,P.width+16),k=m(c.minHeight||0,P.height+12)+w;let L=t.getTooltipHeaderColor(h);null===L&&(L=t._calcedColor,t instanceof Ui?(t.options.legendByPoint||t._colorByPoint())&&(L=h._calcedColor):t._colorByPoint()&&(L=getComputedStyle(s.dom).fill)),this._top.setFill(L);const N=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),T=e.getBounds();let B,O,R=!1;const D=l.isFollowPointer(t);if(S&&!t.isWidget)B=o-k/2-m(0,f(o-k/2,y-k)),R=D?C?A+M>n:n+A+M>g:C?A+M>E.x-T.x+E.width:E.x-T.x-M>g-A,R&&(C=!C),O=C?"left":"right",this.$_drawTooltip(0,0,A,k,O,B),C?n-=A+M:n+=M,o-=k/2;else{B=n-A/2-m(0,f(n-A/2,g-A));const t=D?o-e.getRootDistance().y:E.y-T.y-e._padding.top,s=D?y-o:T.bottom-E.bottom;if(t>=k+M||s>=k+M){(C?s>=k+M:t>=k+M)?O=C?"bottom":"top":(O=C?"top":"bottom",C=!C),this.$_drawTooltip(0,0,A,k,O,B),n-=A/2,C?o+=M:o-=k+M}else{B=o-k/2-m(0,f(o-k/2,y-k));const t=E.x-T.x;O=g-t>=A+M||t<A+M?"right":"left",this.$_drawTooltip(0,0,A,k,O,B),"right"===O?n+=M:n-=A+M,o-=k/2}}return n=m(0,f(n,g-A)),o=m(0,f(o,y-k)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(m(0,n-20),m(0,o-20)),this.transEx(n,o,N/2,!1)):this.transEx(n,o,N,!1),0===N&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:A,h:k}}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.options.hideDelay:ur.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Yt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}cl.CLASS_NAME="rct-tooltip";class dl extends ee{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new cl(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class ul extends _t{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=Ft.isHoverAt(e),i=(this._model=t).options;return Ft.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=z(i.width),isNaN(i.height)?e.style.height="":e.style.height=z(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?Ft.setStyles(this._img,{display:"",width:I(i.imageWidth),height:I(i.imageHeight)}):Ft.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(at?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=I("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=I("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",Ft.setStyles(e,{position:"absolute",textAlign:"center"}),Ft.setStyles(s,{display:at?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",Ft.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),Ft.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),at&&Ft.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class pl extends To{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new hl(t,!1)),this.add(this.subtitleView=new hl(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=m(l,c),u=h+g+_;break;default:p=l+g+c,u=m(u,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===o.alignBase?0:t.xPlot;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=m(this._hTitle,this._hSub);g=m(g,g+t(i,e,this._hTitle)),y=m(y,y+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=m(f,f+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=f;break;case"right":b=f+this._wTitle-this._wSub;break;default:b=f+(this._wTitle-this._wSub)/2}else b=m(b,b+d(r,h,this._wSub))},p=x(o.titleGap,0);let g=0,f=l,y=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=b+this._wSub+p,c();break;case"rightSide":b=f+this._wTitle+p,c();break;case"right":switch(b=f+this._wTitle+p,o.align){case"center":b=m(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=m(b,_+h-this._wSub)}c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,b=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=f-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,f=b-p-this._wTitle,c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,b=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(f-b-this._wSub)/2;break;case"right":b=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,b=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":b=f+this._wTitle+p;break;case"center":b+=f+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}}const w=x(n.offset,0),v=x(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),s.resizeByMeasured().layout().trans(b,y)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class gl extends To{_doInitChildren(t){this.add(this._legendView=new sl(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class fl extends To{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=m(n,l),o=m(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===po.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===po.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof vi?Math.floor(e):e,to:t instanceof vi?Math.floor(s):s})}))}))}}class ml extends Mo{constructor(t){super(t,"rct-credits"),this.add(this._textView=new pe(t)),this._textView.anchor=ce.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class yl extends se{}class xl extends se{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this._htmlButtons=[],this.add(this._annotationContainer=new se(t,"rct-annotations")),this.add(this._plotContainer=new se(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Xh(t,this));for(const e in po){const s=new fl(t,po[e]);this._plotContainer.add(s),this._axisSectionMap[po[e]]=s}xl.pane_class&&this.add(this._paneContainer=new xl.pane_class(t,this)),this.add(this._titleSectionView=new pl(t)),this.add(this._legendSectionView=new gl(t)),this.add(this._frontAnnotationContainer=new se(t,"rct-front-annotations")),this.add(this._creditView=new ml(t)),this.add(this._navigatorView=new Wh(t)),this.add(this._historyView=new tl(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,p,g,r)}this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,f=0,m=0,y=0,x=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=f=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=m=h.width+p+c:i-=y=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),x=m,b=s-f;const V=this._navigatorView;let P=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=P=V.mh));const A=this._legendSectionView;let k,C,L=0,N=0;if(A.visible)switch(A.resizeByMeasured().layout(),L=A.height,N=A.width,a._location){case"top":k=v+g,r-=L;break;case"bottom":r-=L,k=b-L,b-=L;break;case"right":i-=N,C=e-N;break;case"left":i-=N,x+=N,C=0}V.visible&&(b-=P,V.layout().transY(b+V.model.getGap()));let M,E=0,T=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(x,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([po.LEFT,po.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[po.TOP,po.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[po.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),x+=e.mw),(e=t[po.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[po.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0),b-=e.mh),(e=t[po.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0))),V.visible&&V.layout().transX(x);const s={x:x,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[po.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[po.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[po.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[po.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,x=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(x,b),n.layout(),M=n.getRect(),n._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=f>0?s-f+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=y>0?e-y+c:e-h.width-p}h.trans(t,i)}if(T+=0,w.visible&&w.layout({xPlot:x,wPlot:T,wChart:e}).trans(0,S),A.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":x+=T-N-e;break;case"center":x+=(T-N)/2+e;break;default:x+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-L-e;break;case"middle":b+=(E-L)/2+e;break;default:b+=e}}else if(isNaN(k)){const e=+t.offsetY||0;if(x=C,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-L-e;break;default:b=(s-L)/2+e}b+L>s&&(b=(s-L)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-L-e;break;default:b=b+(r-L)/2+e}b+L>s&&(b=(s-L)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=k,"chart"===t.alignBase)switch(n){case"left":x=s;break;case"right":x=e-N-s;break;default:x=(e-N)/2+s}else switch(n){case"left":x+=s;break;case"right":x=x+i-N-s;break;default:x+=(i-N)/2+s}x+N>e&&(x=(e-N)/2),x<0&&(x=0)}A.trans(x,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new dl(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new cl(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}forceHideTooltip(){var t,e;this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t||t.close(!0,!1):null===(e=this._tooltipView)||void 0===e||e.close(!0,!1)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new jo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(t)))}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;ht.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Ii?o.hoverSeries(t):e.options.pointHovering&&t instanceof gi&&o.hoverPoint(t)}))}}if(l instanceof Ds&&!(this._hoverItem instanceof Ds)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof sn&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in po){const s=this._axisSectionMap[po[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new al(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new ul(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,this,e,e.getAxes(s,!0),i,r):a.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const o=n[e];r&&o.visible&&o.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[po.LEFT].checkWidths(t,s,i),s-=n[po.RIGHT].checkWidths(t,s,i),i-=n[po.BOTTOM].checkHeights(t,s,i),i-=n[po.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===po.LEFT||t===po.RIGHT?s-=e.mw:t!==po.BOTTOM&&t!==po.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===po.LEFT||t===po.RIGHT?s-=e.mw:t!==po.BOTTOM&&t!==po.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var bl;!function(t){t.EXPORT="$$realchart_export"}(bl||(bl={}));class wl extends Jt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new fo(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new xl(t)}_createPointerHandler(){return new Jh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof He&&s===Re.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof fo&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===bl.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setResizeDelay(i.resizeDelay),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class vl{static getVersion(){return zt.version}static setLicenseKey(t){zt.code=t}static setLocale(t,e){e&&L(t,e),(t=>{t&&(C=A[k=t.substring(0,2)]),C||(C=A[k="ko"])})(t)}static registerLocale(t,e){L(t,e)}static setDebugging(t){te.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static setAnimatable(t){Jt._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const o=new wl(t,e);return o.chart.load(s(i)?i:{},r,n),o.chart[lo]=o,o.chart}static createData(t,e){return new mo(t||{},e)}}class Sl{static empty(){return new Sl}static create(t=0,e=0){return new Sl(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const Vl="bullet",Pl="bulletgroup",Al="circle",kl="circlegroup",Cl="clock",Ll="linear",Nl="lineargroup";class Ml{static empty(){return new Ml}static create(t=0,e=0){return new Ml(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const El=vl.getVersion,Tl=vl.setDebugging,Bl=vl.setLogging,Ol=vl.setAnimatable,Rl=vl.configure,Dl=vl.createChart,$l=vl.createData,Fl=vl.setLicenseKey;export{He as Annotation,qo as AnnotationView,Wo as ArcElement,nn as AreaRangeSeries,Wa as AreaRangeSeriesView,en as AreaSeries,an as AreaSeriesGroup,Ua as AreaSeriesView,Me as AssetCollection,ls as Axis,Pr as AxisBaseLine,_s as AxisCollection,Je as AxisGrid,Ue as AxisItem,ns as AxisLabel,Ze as AxisLine,os as AxisScrollBar,Ho as AxisScrollView,hs as AxisSectorLine,rs as AxisTick,qe as AxisTitle,jo as AxisView,Rr as BarRangeSeries,Za as BarRangeSeriesView,Fr as BarSeries,$r as BarSeriesBase,zr as BarSeriesGroup,Ir as BarSeriesGroupBase,Dr as BarSeriesPoint,Qa as BarSeriesView,Ka as BarSeriesViewBase,Qi as BasedSeries,Ta as BasedSeriesView,ln as BellCurveSeries,Ja as BellCurveSeriesView,Os as Body,Bs as BodyDepth,Xh as BodyView,cn as BoxPlotSeries,eh as BoxPlotSeriesView,Ca as BoxPointElementEx,xn as BubblePie,bn as BubbleSeries,ih as BubbleSeriesView,Pl as BulletGaugeGroupType,Vl as BulletGaugeType,wn as BumpSeriesGroup,Sn as CandlestickSeries,nh as CandlestickSeriesView,vi as CategoryAxis,wi as CategoryAxisGrid,bi as CategoryAxisLabel,xi as CategoryAxisTick,fo as Chart,wl as ChartControl,mo as ChartData,pt as ChartDataCollection,Mo as ChartElement,Re as ChartItem,go as ChartObject,uo as ChartOptions,Jh as ChartPointerHandler,$e as ChartText,xl as ChartView,Vn as CircelBarPointLabel,Pn as CircleBarSeries,An as CircleBarSeriesGroup,ah as CircleBarSeriesView,Yo as CircleElement,kl as CircleGaugeGroupType,Al as CircleGaugeType,Cs as CircularGauge,Ls as CircularGaugeGroup,As as CircularGaugeLabel,Cl as ClockGaugeType,qi as ClusterableSeries,ir as ClusterableSeriesGroup,$t as Color,Hi as ConnectableSeries,sr as ConstraintSeriesGroup,Bo as ContentView,Ar as ContinuousAxis,_o as Credits,Ye as Crosshair,gi as DataPoint,fi as DataPointCollection,Ei as DataPointLabel,Ft as Dom,Ln as DumbbellSeries,lh as DumbbellSeriesView,yo as ElementPool,Mn as EqualizerSeries,ch as EqualizerSeriesView,En as ErrorBarSeries,uh as ErrorBarSeriesView,Rs as Exporter,Rn as FunnelSeries,gh as FunnelSeriesView,fs as Gauge,ps as GaugeBase,ms as GaugeGroup,ia as GaugeGroupView,gs as GaugeItem,Ps as GaugeLabel,Vs as GaugeRangeBand,Ss as GaugeRangeLabel,vs as GaugeScale,Qo as GaugeView,ii as HeatmapSeriesType,Fn as HistogramSeries,mh as HistogramSeriesView,Fe as IconedText,mr as ImageAnnotation,Fa as ImageAnnotationView,Oo as ImageElement,se as LayerElement,$s as Legend,Ds as LegendItem,el as LegendItemView,sl as LegendView,Xr as LineElement,Zr as LinePointLabel,Qr as LineSeries,qr as LineSeriesBase,Xa as LineSeriesBaseView,on as LineSeriesGroup,Wr as LineSeriesPoint,Ya as LineSeriesView,kr as LinearAxis,Nl as LinearGaugeGroupType,Ll as LinearGaugeType,oo as LogAxis,Hn as LollipopSeries,xh as LollipopSeriesView,tr as LowRangedSeries,rr as MarkerSeries,Oa as MarkerSeriesPointView,Ra as MarkerSeriesView,or as NavigatorMask,nr as NavigiatorHandle,T as ORG_ANGLE,jn as OhlcSeries,wh as OhlcSeriesView,Wi as OthersGroup,E as PI_2,yl as PaneContainer,Yn as ParetoSeries,vh as ParetoSeriesView,Kt as PathBuilder,oe as PathElement,oi as PictogramSeriesType,ai as PictorialBarSeriesType,hi as PictorialSeriesType,Qn as PieSeries,Jn as PieSeriesGroup,qn as PieSeriesLabel,Zn as PieSeriesText,Ah as PieSeriesView,Sl as Point,Pa as PointElement,co as PointHovering,ma as PointLabelLineContainer,fa as PointLabelLineView,pa as PointLabelView,Ha as PointViewPool,O as RAD_DEG,li as RaceBarSeriesType,_i as RaceLineSeriesType,Zi as RadialSeries,Ji as RangedSeries,Wt as RcAnimation,Jt as RcControl,te as RcElement,_t as RcObject,Gs as RectElement,t as SVGNS,sa as ScaleView,eo as ScatterSeries,Ch as ScatterSeriesView,To as SectionView,dn as SectorElement,Ii as Series,ra as SeriesAnimation,er as SeriesGroup,Gi as SeriesMarker,_r as SeriesNavigator,Va as SeriesView,yr as ShapeAnnotation,Ia as ShapeAnnotationView,Ml as Size,Jr as SplineSeries,Ti as StackLabel,dr as Subtitle,Hs as SvgShapes,ce as TextAnchor,xr as TextAnnotation,za as TextAnnotationView,pe as TextElement,de as TextLayout,Br as TimeAxis,cr as Title,ur as Tooltip,si as TreemapSeriesType,Si as TrendLineArea,Vi as TrendLineLabel,Ai as Trendline,ht as Utils,xs as ValueGauge,ta as ValueGaugeView,ri as VectorSeriesType,ro as WaterfallSeries,Lh as WaterfallSeriesView,cs as Widget,Ui as WidgetSeries,Xi as WidgetSeriesConnector,Yi as WidgetSeriesLabel,ji as WidgetSeriesPoint,$a as WidgetSeriesView,ni as WordCloudSeriesType,mi as ZValuePoint,y as absv,_ as assignObj,et as buildValueRanges,U as calcPercent,Rl as configure,S as copyObj,u as cos,Dl as createChart,$l as createData,bo as createRect,Te as extend,D as fixnum,El as getVersion,V as incv,i as isArray,vo as isEmptyRect,at as isIE,a as isNumber,s as isObject,n as isString,m as maxv,f as minv,Y as parsePercentSize,x as pickNum,w as pickProp,v as pickProp3,I as pixel,wo as rectToSize,Ol as setAnimatable,Tl as setDebugging,Fl as setLicenseKey,Bl as setLogging,p as sin,F as toStr};
|
|
7
|
+
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"string"==typeof t&&t.length>0},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=function(t){return null==t||isNaN(t)},_=Object.assign,c=Math.floor,d=Math.ceil,u=Math.cos,p=Math.sin,g=Math.log10,f=Math.min,m=Math.max,y=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},w=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},S=t=>t&&_({},t),V=(t,e,s)=>t+(e-t)*s,P=function(t){return"function"==typeof t?t:null},A={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let k="ko",C=A[k]||A[k="ko"];const L=(t,e)=>{t&&s(e)&&(C=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},N=void 0,M=Math.PI,E=2*M,T=-M/2,B=2*M/360,O=360/M/2,R="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function $(t){return Math.floor(1e6*t)/1e6}function F(t){return null==t?null:String(t)}function I(t){return t+"px"}function z(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function H(t){return null==t||Number.isNaN(t)||""===t}function G(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function X(t,e){const s={};return s[t]=e,s}function Y(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)===R?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;tt(C.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 W(t,e){return Y(t,!0)||Y(e,!1)}function U(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z="fill",q="stroke",K={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},Q=function(t){const e=K[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return K[t]=e,e}return e};class J extends Error{}const tt=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},et=function(t,e,r,o=!0,a=!0,h=!1,l){let c,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:x(t.fromValue,d?d.toValue:e),toValue:x(t.toValue,r),color:t.color,style:t.style?_({},t.style):N};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),a&&c.forEach((t=>{t.fromValue=m(t.fromValue,e),t.toValue=f(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),r>o[o.length-1]&&o.push(r);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:s[f(t,s.length-1)],style:n?n[f(t,n.length-1)]:N})}else{let i=x(t.fromValue,e);const o=x(t.toValue,r),a=(o-i)/s.length;let h=0;for(;i<o;)c.push({fromValue:i,toValue:i+=a,color:s[f(h,s.length-1)],style:n?n[f(h,n.length-1)]:N}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:l}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:l})}return c},st="shuffle",it="random",rt="vertical-lr",nt="vertical-rl",ot=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const at="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class ht{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}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 dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&ht.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,ht.month_days[ht.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return _({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(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(i(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 i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(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 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()-ot}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=m(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=m(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 toStr(t){return Number.isNaN(t)||null==t?"":String(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 parseTuples(t){if(i(t)){const e=[];let s=-1/0;return t.forEach(((r,n)=>{i(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>s&&(e.push([+r[0],+r[1]]),s=r[0]):isNaN(r)||n!==t.length-1||e.push([1/0,+r])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+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 setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=this.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),ht.log(t,+new Date-s+"ms")}static clamp(t,e,s){return m(e,f(s,t))}static makeIntArray(t,e){const s=new Array(m(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isAnimation(t){return"[object Animation]"===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=y(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}static diffAngle(t,e){const s=y(t-e);return f(s,E-s)}}ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],ht.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let lt=0;class _t{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(lt++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}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 ct extends _t{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 dt=function(t){return t&&"object"==typeof t};class ut extends ct{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else dt(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&tt(C.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class pt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ut({},s):dt(s)&&i(s.values)&&(r=new ut(s.options,s.values)),this._map[e]=r}}}const gt="0".charCodeAt(0),ft="#".charCodeAt(0),mt=",".charCodeAt(0),yt="s".charCodeAt(0),xt="a".charCodeAt(0);class bt{static getFormatter(t){let e=bt.Formatters[t];return e||(bt.Formatters[t]=e=new bt(t)),e}static get Default(){return bt.getFormatter(bt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_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)===gt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ft;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===gt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===mt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===yt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===xt){s.signDisplay="never";break}}return s.minimumIntegerDigits=m(1,s.minimumIntegerDigits),s}}}bt.DEFAULT_FORMAT="",bt.Formatters={};const wt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],vt=[".","/","-",":"],St="Z".charCodeAt(0),Vt="z".charCodeAt(0),Pt="A".charCodeAt(0),At="a".charCodeAt(0),kt="y".charCodeAt(0),Ct="M".charCodeAt(0),Lt="m".charCodeAt(0),Nt="W".charCodeAt(0),Mt="w".charCodeAt(0),Et="d".charCodeAt(0),Tt="H".charCodeAt(0),Bt="h".charCodeAt(0),Ot="S".charCodeAt(0),Rt="s".charCodeAt(0);class Dt{static getFormatter(t){let e=Dt.Formatters[t];return e||(Dt.Formatters[t]=e=new Dt(t)),e}static get Default(){return Dt.getFormatter(C.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||C.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 o=s[r],a=o.length;switch(o.charCodeAt(0)){case kt:i+=a>2?t.getFullYear():G(t.getFullYear()%100);break;case Ct:i+=a>1?G(t.getMonth()+1):t.getMonth()+1;break;case Et:i+=a>1?G(t.getDate()):t.getDate();break;case Nt:i+=a>1?G(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case Mt:i+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case Tt:i+=a>1?G(t.getHours()):t.getHours();break;case Bt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?G(e):e}else i+=a>1?G(t.getHours()):t.getHours();break;case Lt:i+=a>1?G(t.getMinutes()):t.getMinutes();break;case Rt:i+=a>1?G(t.getSeconds()):t.getSeconds();break;case At:case Pt:t.getHours()<12?i+=C.am:i+=C.pm;break;case Ot:let s=t.getMilliseconds();i+=3==a?j(s):2==a?G(s):s.toString().substring(0,a);break;default:i+=o}}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(vt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),wt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Pt&&e<=St||e>=At&&e<=Vt)&&tt(C.invalidDateFormat,t)}e.push(n)}if(r<i&&ht.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ht.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||C.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Dt.Formatters={};class $t{static isBright(t){return new $t(t).isBright()}static getContrast(t,e,s){return new $t(t).getContrast(e,s)}static interpolate(t,e,s){const i=new $t(t),r=new $t(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return at?new $t(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):ht.startsWith(t,"rgba(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):ht.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new $t(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}}$t.BLACK="#000",$t.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class Ft{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:Ft.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(e,s){const i=e.createElementNS(t,"clipPath");return i.id=s,i.append(e.createElementNS(t,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(e){return Ft.isElement(e)&&e.namespaceURI===t}static isSVGClipPathElement(t){return Ft.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var It;Ft.instanceOf=function(t,e){return Ft.isElement(t)&&t.tagName===e.toUpperCase()},Ft.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(It||(It={}));const zt={name:"RealChart",version:"1.4.21",license:"enterprise",code:null};class Ht{static decode(t){const e=Ht.CHARS,s=Ht.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}}Ht.PAD="=",Ht.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Gt{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 o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=Gt.xor,i=Gt.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=Gt.xor,i=Gt.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=Gt.kb,i=Gt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*Gt.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=Gt._decryptBlock;let i=Gt._init(e),r=[],n=Ht.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Gt.POW24|n[a+1]*Gt.POW16|n[a+2]*Gt.POW8|n[a+3],h.right=n[a+4]*Gt.POW24|n[a+5]*Gt.POW16|n[a+6]*Gt.POW8|n[a+7],s(h,i);const t=h.left,e=h.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),a+=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)}}Gt.POW2=Math.pow(2,2),Gt.POW3=Math.pow(2,3),Gt.POW4=Math.pow(2,4),Gt.POW8=Math.pow(2,8),Gt.POW16=Math.pow(2,16),Gt.POW24=Math.pow(2,24),Gt.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 jt{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=Gt.decrypt(t,"dkdl"+this._getLDKey(Gt.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}}const Xt={linear:t=>t,inOutSine:t=>-(u(M*t)-1)/2},Yt=function(t,e,s,i,r,n){const o=X(e,null!=s?s:"initial"),a=X(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Wt{constructor(){this.delay=0,this.duration=Wt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=f(1,m(0,D(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=x(t,Wt.DURATION),this.delay=e||0,this._easing=Xt[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Wt.DURATION=700,Wt.SHORT_DURATION=300;class Ut extends Wt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Zt=function(t){return new Ut(t).start()},qt=function(t){return isNaN(t)?0:t};class Kt{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}push(...t){return t.forEach((t=>{a(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return a(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return a(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return a(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return a(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0,"Z"),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",qt(t[e]),qt(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",qt(t[e].x),qt(t[e].y));return this}polygon(...t){return a(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),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}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,f=t[i].py+n.y;this.curve(s,p,g,f,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const Qt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Jt extends _t{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._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},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._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=zt.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=jt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==zt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(zt.license!=It.Developer&&!jt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(It).includes(n))throw new Error(s);if(zt.license=i.lic,n==It.Evaluation||n==It.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&Ft.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Jt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Ft.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){H(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){Ft.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(te.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(t,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(te.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}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){return this.addClip(new ne(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new he(this.doc()))}clipDonut(){return this.addClip(new le(this.doc()))}clipPath(){return this.addClip(new ae(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(Ft.isElement(e)&&e.id===t){t=e;break}Ft.isElement(t)&&t.parentNode===this._defs&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_setTesting(){this._testing=!0,te.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,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),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,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;const r=e.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof r.HTMLDivElement||tt(C.invalidOuterDiv,s),e=this._container.ownerDocument;const n=this._dom=e.createElement("div");_(n.style,Qt),n.className=i,this._container.appendChild(n);const o=this._svg=e.createElementNS(t,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=e.createElement("desc");a.textContent="Created by RealChart v"+zt.version,o.appendChild(a);const h=this._defs=e.createElementNS(t,"defs");this._initDefs(e,h),o.appendChild(h),n.appendChild(o),this._root=new ie(this),o.appendChild(this._root._dom),this._htmlRoot=e.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=e.createElement("div"),n.appendChild(this._tester),at&&(this._canvas=e.createElement("canvas"))}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Jt.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=e.createElementNS(t,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=e.createElementNS(t,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{ht.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=I(s),r.style.height=I(i)),_(this._htmlRoot.style,{left:I(e.left-t.left),top:I(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),_(n.style,Qt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=Ft.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),ht.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&this.invalidateLayout(),this._resizeTimer=null}),s):this.invalidateLayout()}}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}Jt.CLASS_NAME="rct-control",Jt.SHADOW_FILTER="rr-chart-shadow-filter",Jt._animatable=!0;class te extends _t{constructor(e,s,i=N){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return H(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}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){let t=this._dom.getBBox();return at&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return at&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return this._ani instanceof Ut||!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}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)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(Q(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(Q(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(Q(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]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(Q(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this.addClass(t)):s(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,w(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}stopAni(){return this._ani&&(this._ani.cancel(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Zt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:x(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Zt({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:x(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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(te.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return te.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(ht.isValidNum(e)||ht.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")"),ht.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=ht.getNumber(this._scaleX,1),n=ht.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}te.DEBUGGING=!1,te.TESTING=!1,te.ASSET_KEY="_asset_",te.CLIP_KEY="_clip_",te.TEMP_KEY="_temp_";class ee extends _t{constructor(e,s,i=!1){super(),this._control=s,this._dom=e.createElement("div"),i&&(this._svg=e.createElementNS(t,"svg"),Ft.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return Ft.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class se extends te{constructor(t,e){super(t,e,"g")}}class ie extends te{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class re extends te{constructor(t){super(t,N,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ne extends re{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new te(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}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 oe extends te{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ae extends re{constructor(t){super(t),this._path=new oe(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class he extends re{constructor(t){super(t),this.add(this._circle=new te(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class le extends re{constructor(t){super(t),this.add(this._donut=new oe(t))}setDonut(t,e,s,i){this._donut.setPath((new Kt).donut(t,e,s,i).end())}}class _e{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._hideFeedback()}finally{this._doCanceled()}}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){}}var ce,de,ue;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ce||(ce={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(de||(de={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ue||(ue={}));class pe extends te{constructor(t,e=void 0){super(t,e,"text"),this._layout=de.TOP,this._overflow=ue.WRAP,this._dirty=!0,this._text="",this.anchor=ce.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case de.MIDDLE:i=Math.floor(s/2);break;case de.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.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=m(0,t),(e=f(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,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);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($t.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const ge="$_TH",fe="$_TW";class me{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?bt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(ht.isDate(n)){const t=s[3]?Dt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),N),0===this._literals[2].length&&(this._literals[2]=N)}else this._literals.push(r,n,N,N);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class ye extends me{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=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))}}}class xe extends ye{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const be={t:class extends ye{tag(){return"</t>"}},b:class extends ye{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends ye{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:xe};class we{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 me).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in be){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new be[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const ve=/<br.*?>|\r\n|\n/;class Se{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,i,r,n){if(this._isVertical)return void this.buildVertical(e,s,i,r,n);const o=e.doc,a=x(this.lineHeight,1),h=this._lines,l=h.length,_=[],c=[];e.clearDom(),r=r||e;const d=e.getStyle("writing-mode"),u=this._vertical=d===rt||d===nt;for(let s=0;s<l;s++){const i=h[s];let l=0,d=0,p=null;for(let s of i.words){const i=s.prepareSpan(e.appendElement(o,"tspan"),r,n),a=i.getBBox();if(i[fe]=a.width,i[ge]=a.height,u?(l=m(l,i[fe]),d+=i[ge]):(l+=i[fe],d=m(d,i[ge])),p||(p=i),s instanceof xe){const r=o.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}c.push(p),i[ge]=d*a,i[fe]=l*a,_.push(0==s?i[fe]/2:i[fe])}if(l>0){let t=h[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(u?null!=c[s-1]&&(i=Math.floor(t[fe]-e.getAscent(t[fe]))+e.getAscent(h[s][fe])):r=t[ge]-e.getAscent(t[ge])+e.getAscent(h[s][ge]),null==c[0]&&c[s]==c.find((t=>null!=t))){const r=e.insertElement(o,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[fe]=n.width,r[ge]=t[ge]=n.height,c[0]=r}switch(d){case rt:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case nt:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}t=h[s]}if(u){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=c,r=i[fe];if(t)i.setAttribute("dx",String(d===nt?s-r/2:r/2));else switch(d){case rt:i.setAttribute("x",String((s-r)/-2));break;case nt:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(h[0][ge])}}buildVertical(e,s,i,r,n){const o=e.doc,a=x(this.lineHeight,1),h=this._lines,l=h.length,_=[];let c=0;const d=[];e.clearDom(),r=r||e;for(let s=0;s<l;s++){const i=h[s];let l=0,u=0,p=null,g=!1;for(let s of i.words){const i=s.prepareSpan(e.appendElement(o,"tspan"),r,n);" "===i.textContent&&(g=!0,i.textContent=".");const a=i.getBBox();if(i[fe]=a.width,i[ge]=a.height,g&&(i.textContent=" ",i[ge]*=.6,g=!1),l+=i[fe],u=m(u,i[ge]),p||(p=i),s instanceof xe){const r=o.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}d.push(p),i[ge]=u*a,i[fe]=l*a,c=m(l,c),_.push(0==s?i[fe]/2:i[fe])}if(l>0){let t=h[0];d[0].setAttribute("x",String((c-d[0].getBBox().width)/2));for(let s=1;s<d.length;s++)d[s]&&(d[s].setAttribute("x",String((c-d[s].getBBox().width)/2)),d[s].setAttribute("dy",String(t[ge]-e.getAscent(t[ge])+e.getAscent(h[s][ge]))),t=h[s]);e.layoutText(h[0][ge])}}layout(t,e,s,i,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=ce.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=ce.END,a=n.height-r.bottom;break;default:t.anchor=ce.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=ce.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=ce.END,o=s-r.right;break;default:t.anchor=ce.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(ve);for(let t of s)e.push((new we).parse(t))}}}class Ve{constructor(t){this.source=t}hasDef(){return!0}}class Pe extends Ve{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=i(r)?[...r]:[r,"white"],a=i(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(e,s,i,r,n){const o=e.createElementNS(t,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(e,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ae extends Pe{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ae.TYPE="lineargradient";class ke extends Pe{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return H(s.cx)||i.setAttribute("cx",s.cx),H(s.cy)||i.setAttribute("cy",s.cy),H(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}ke.TYPE="radialgradient";class Ce extends Ve{prepare(){}getEelement(e,i){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,h,l,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rct-pattern"),+i.pattern>=0){const t=Ce.STOCK[+i.pattern%Ce.STOCK.length];a=t.path,h=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else n(i.pattern)&&(a=i.pattern,l=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),o.setAttribute("d",a),h&&_(o.style,h),i.style&&_(o.style,i.style),d&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(o),r}}Ce.TYPE="pattern",Ce.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class Le extends Ve{prepare(){const t=this.source;this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&ht.shuffle(this._colors),this._index=0)}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=i(e.colors)?e.colors:[]}}Le.TYPE="colors";class Ne extends Ve{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||Ne.SIZE,height:e.height||e.width||Ne.SIZE})}}Ne.TYPE="images",Ne.SIZE=20;class Me{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(s(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(te.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ce.TYPE:i(t.colors)?e=Le.TYPE:i(t.images)&&(e=Ne.TYPE)),e)switch(e.toLowerCase()){case Ae.TYPE:return new Ae(t);case ke.TYPE:return new ke(t);case Ce.TYPE:return new Ce(t);case Le.TYPE:return new Le(t);case Ne.TYPE:return new Ne(t)}}}}let Ee=0;const Te=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},Be=["__proto__","constructor","prototype"],Oe=function(t,r){const n=s(t)?t:{};for(const t in r)if(e.call(r,t)&&!Be.includes(t)){const e=r[t];i(e)?n[t]=e.slice(0):s(e)?e._obj instanceof ut?n[t]=e:ht.isDate(e)?n[t]=new Date(e):n[t]=Oe(n[t],e):n[t]=e}return n};class Re extends _t{constructor(t){super(),this.chart=t,Ee++}init(){const t=this._op=Oe({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Re&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const r=s(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];i(n)?r[t]=n.slice(0):s(n)?n instanceof ut?r[t]=n:n._obj instanceof ut?r[t]=n._obj:this[t]instanceof Re?ht.isDate(n)&&(r[t]=new Date(n)):r[t]=this.$_mergeOptions(r[t],n):r[t]=n}}updateOptions(t,e=!0){const i=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(i,t),this.$_applyOptions(i),s(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Re)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Re?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Re)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Oe({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,s,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==s&&""!==s||(s=void 0),void 0===s?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==s||(r||(r=this._style=this._op.style={}),r[t]=String(s),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,i=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),s(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Re?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):s(n)?n._obj instanceof ut?t[r]=n._obj:ht.isDate(n)?t[r]=new Date(n):t[r]=_({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof Re)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Re.REFRESHED="refreshed",Re.defaults={visible:!0};class De{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class $e extends Re{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=x(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?bt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Se),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(ht.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=ht.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}$e.defaults=Te(Re.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Fe extends $e{getIconPos(){const t="default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition;switch(t){case"left":case"right":case"top":case"bottom":return t;default:return this.getDefaultIconPos()}}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof Ne&&(this._images=e)}this._root=this._op.iconRoot||""}getIconUrl(t){const e=this._op.icon||t;return e?this.getUrl(e):null}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof Ne?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Fe.defaults=Te($e.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ie extends Re{}const ze={};class He extends Re{static register(...t){t.forEach((t=>{ze[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}needClip(){return!0!==this._op.noClip}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.body){const o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.getAxisOf(this,!0);s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-this._x)}if(!isNaN(h)){const i=this.chart.getAxisOf(this,!1);s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=U(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=U(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Re.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}He.defaults=Te(Re.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ge extends De{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof He)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e?this.owner:void 0))})):s(t)&&n.push(this.$_loadItem(r,t,0,e?this.owner:void 0)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):N}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a.init(),a.index=s,a._load(e),a}}class je extends Wt{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t){return this.$_calcRange(t),this._axis._changed(),!0}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class Xe extends Re{}Xe.defaults=Te(Re.defaults,{minWidth:50});class Ye extends Re{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Xe(this.axis.chart)).init(),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);if(s instanceof this.chart.win.Date)try{return Dt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}catch{return Dt.getFormatter(Ye.defaults.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}else try{return bt.getFormatter(this._op.numberFormat).toStr(s)}catch{return bt.getFormatter(Ye.defaults.numberFormat).toStr(s)}}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Ye.defaults=Te(Re.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const We={};class Ue extends Re{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ze extends Ue{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ze.defaults=Te(Ue.defaults,{visible:void 0});class qe extends Ue{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return at?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}qe.defaults=Te(Ue.defaults,{align:"middle",offset:0,gap:5});class Ke extends Ue{_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ke.defaults=Te(Ue.defaults,{position:"end",gap:2});class Qe extends Ue{getRows(){if(!1===this._op.visible)return[];const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[],r=this._style;if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this._op.belowColor,style:r}),s>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%s]&&i.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%s],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%s]&&i.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%s],style:r});n[n.length-1].value<t.valueMax()&&e[o%s]&&i.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%s],style:r})}return i}_doSetSimple(t){return n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Je extends Ue{_doInit(t){t.rows=(this._rows=new Qe(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Je.defaults=Te(Ue.defaults,{visible:void 0,depthVisible:void 0});class ts extends Fe{getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}ts.defaults=Te(Fe.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class es extends Ue{_doInit(t){t.label=(this._label=new ts(this.axis.chart)).init()}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}es.defaults=Te(Ue.defaults,{front:!1,zindex:0});class ss extends es{}class is extends es{}class rs extends Ue{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return ht.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:rs.DEF_LENGTH,this._gap=this._op.gap||0}}rs.DEF_LENGTH=7,rs.defaults=Te(Ue.defaults,{visible:!1,gap:3});class ns extends Fe{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?w(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?w(i.firstText,i.text):r==e-1?w(i.lastText,i.text):this.options.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ns.defaults=Te(Fe.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class os extends Ue{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}os.defaults=Te(Ue.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class as{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}clamp(t,e=!0){return e?ht.clamp(t,this.min,this.max):ht.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class hs extends Ze{}class ls extends Re{static register(...t){t.forEach((t=>{We[t.type]=t,t.subtype&&(We[t.subtype]=t)}))}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){t.title=(this._title=new qe(this)).init(),t.unitLabel=(this._unitLabel=new Ke(this)).init(),t.line=(this._line=new Ze(this)).init(),t.sectorLine=(this._sectorLine=new hs(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new Ye(this)).init(),t.scrollBar=(this._scrollBar=new os(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return T+B*this._op.startAngle}getTotalAngle(){return B*this._op.totalAngle}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&t.push(...e.getVisibleSeries())})),t}collectValues(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=f(...s),e._yMax=m(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender(),this.guides.forEach((t=>t._prepareRender()));const s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.isSplitted()){const t=[s[0].row];for(let e=1;e<s.length;e++)t.indexOf(s[e].row)<0&&t.push(s[e].row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s.row==t&&s.isClusterable()&&(e+=x(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=x(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=x(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=x(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+ht.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[m(t,this._min),f(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new as(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return r&&(i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed()),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new je(this,t,e,(()=>{this._changed()})))}isAnimating(){return!isNaN(this._aniMin)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new is(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ss(s):new is(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),t.startAngle=x(this._op.startAngle,0),t.totalAngle=m(0,f(360,x(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=x(Math.max(0,t.row|0),0),this._col=x(Math.max(0,t.col|0),0),e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(f(...t)||0):NaN,max:t.length>0?D(m(...t)||0):NaN}}}ls.defaults=Te(Re.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class _s extends De{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let o;if(a(r)&&r>=0&&r<s.length?o=s.find((t=>t._index===r)):n(r)&&(o=s.find((t=>t.options.name===r))),o||(o=s[0]),o&&this.chart.isValidAxis(o))return o._connect(t),this.isX?t.setCol(o.col):t.setRow(o.row),o}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 r;let n=t._getAxisType(e.type);if(!n){let o;if(i(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(H(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class cs extends Re{_doPrepareRender(t){}}const ds={},us={};class ps extends cs{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:U(this._widthDim||this._sizeDim,t,t),height:U(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return U(this._leftDim,t)}getRight(t){return U(this._rightDim,t)}getTop(t){return U(this._topDim,t)}getBottom(t){return U(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._row=x(t.row|0,0),this._col=x(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}ps.defaults=Te(cs.defaults,{size:"100%"});class gs extends Re{constructor(t){super(t.chart)}}class fs extends ps{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{ds[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}fs.defaults=Te(ps.defaults,{duration:500});class ms extends ps{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{us[t.type]=t,us[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(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._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(fs._loadGauge(t,e,r)))):s(e)&&this.$_add(fs._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ms.defaults=Te(ps.defaults,{minValue:0});class ys extends De{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}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 fs)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ms)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e._op.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){if(0===Object.keys(ds).length&&0===Object.keys(us).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class xs extends fs{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return m(this._op.minValue,f(this._op.maxValue,x(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?x(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}xs.defaults=Te(fs.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class bs extends Re{constructor(t){super(t.chart),this.scale=t}}bs.defaults=Te(Re.defaults,{reversed:!1,length:7});class ws extends Fe{getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class vs extends Re{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Re(e)).init(),t.tick=(this._tick=new bs(this)).init(),t.label=(this._label=new ws(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=x(s,e);const{min:i,max:r}=this._adjustMinMax(f(e,s),m(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(m(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=x(s.options.minValue,t),e=x(s.options.maxValue,e),this._min=f(t,e),this._max=m(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=f(...t)),isNaN(i)&&(i=m(...t)),this._min=f(s,i),this._max=m(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(D(e));for(let e=1;e<t;e++)n.push(D(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(D(l=s));;){if(l+=o,l>=i){r.push(D(i));break}r.push(D(l))}return r}}vs.defaults=Te(Re.defaults,{position:"default",stepPixels:48,gap:8});class Ss extends Re{}Ss.defaults=Te(Re.defaults,{visible:!1});class Vs extends Re{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new Ss(e)).init(),t.tickLabel=(this._tickLabel=new Re(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?U(this._thicknessDim,t,0):"inside"===this._op.position?t:Vs.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=et(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Vs.defaults=Te(Re.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ps extends $e{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ps.defaults=Te($e.defaults,{animatable:!0});class As extends Ps{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:U(this._offsetXDim,t,0),y:U(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}As.defaults=Te(Ps.defaults,{offsetX:0,offsetY:0});class ks{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Cs.DEF_CENTER),this.setCenterY(Cs.DEF_CENTER),this.setRadius(Cs.DEF_RADIUS),this.setInnerRadius(Cs.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(w(t,Cs.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(w(t,Cs.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(w(t,Cs.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(w(t,Cs.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:U(this._centerXDim,t,t/2),y:U(this._centerYDim,e,e/2)}}getExtents(t){const e=U(this._radiusDim,t,t/2),s=f(e,this._innerDim?U(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?U(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=m(0,f(360,x(e,360)));this._startRad=T+B*s,this._handRad=B*s,this._sweepRad=B*i}}class Cs extends xs{_doInit(t){super._doInit(t),this._props=new ks}get label(){return this._label}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}_createLabel(){return new As(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new ks)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}Cs.DEF_CENTER="50%",Cs.DEF_RADIUS="40%",Cs.DEF_INNER="80%",Cs.defaults=Te(xs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ls extends ms{_doInit(t){this.props=new ks,t.label=(this._label=new As(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.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}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}Ls.defaults=Te(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Ns=class extends Re{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Ns.defaults=Te(Re.defaults,{visible:void 0});class Ms extends $e{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Ms.DEF_TEXT}}Ms.DEF_TEXT="표시할 데이터가 없습니다.",Ms.defaults=Te(Re.defaults,{visible:void 0});class Es extends Re{}Es.defaults=Te(Re.defaults,{visible:!1});class Ts extends Re{_doInit(t){t.line=(this._line=new Es(this.chart)).init(),t.endLine=(this._endLine=new Es(this.chart)).init(),t.gridLine=(this._gridLine=new Es(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ts.defaults=Te(Re.defaults,{});class Bs extends Re{_doInit(t){t.xSide=(this._xSide=new Ts(this.chart)).init(),t.ySide=(this._ySide=new Ts(this.chart)).init(),t.orgLine=(this._orgLine=new Es(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=f(60,m(30,x(t.angle,45)))}}Bs.defaults=Te(Re.defaults,{visible:!1,length:32,angle:32});class Os extends Re{constructor(t){super(t),this._annotations=new Ge(this)}_doInit(t){t.depth=(this._depth=new Bs(this.chart)).init(),t.image=(this._image=new Ie(null)).init(),t.emptyView=(this._emptyView=new Ms(this.chart)).init(),t.zoomButton=(this._zoomButton=new Ns(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof ps&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=d(u(r*B)*i),o=d(p(r*B)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return U(this._radiusDim,f(t,e))}setPolar(t,e){return this._cx=U(this._centerXDim,t),this._cy=U(this._centerYDim,e),this._rd=U(this._radiusDim,f(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Os.defaults=Te(Re.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Rs extends Re{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Rs.defaults=Te(Re.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ds extends Re{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class $s extends cs{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return U(this._maxWidthDim,t,t)}getMaxHeight(t){return U(this._maxHeightDim,t,t)}getMarkerSize(){return x(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=w(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Ds(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(ht.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Fs;$s.defaults=Te(cs.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const Is=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),zs=.001;class Hs{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const o=i>0,a=o?0:1;return r>0?n>0?(r=f(y(i)/2,s/2,r),n=f(y(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=f(y(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=f(y(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=f(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return E-t<zs}static arc(t,e,s,i,r,n,o,a=!1){const h=f(E,y(n-r)),l=this.isCircled(h),_=h>M?1:0,c=o?1:0,d=u(r),g=p(r),m=u(n-=l?c?zs:-.001:0),x=p(n),b=[];return b.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*x),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=f(E,y(o-n)),l=this.isCircled(h),_=h>M?1:0,c=a?1:0,d=u(n),g=p(n),m=u(o-=l?c?zs:-.001:0),x=p(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*d,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*x),l?v.push("M",t+b*m,e+w*x):v.push("L",t+b*m,e+w*x),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*g),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,d=f(E,y(o-n));const g=this.isCircled(d);let m=(n%E+E)%E,x=(o%E+E)%E;const b=[];let w,v,S,V;if(!g&&(_&&m<=M&&x>=0&&x<m||!_&&x<=M&&m>=0&&m<x))c=0,_?(w=t+s*u(n),v=e+i*p(n),S=t+s*u(M),V=e+i*p(M),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(0),v=e+i*p(0),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*u(n),v=e+i*p(n),S=t+s*u(0),V=e+i*p(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*u(M),v=e+i*p(M),S=t+s*u(o),V=e+i*p(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*u(n),v=e+i*p(n),S=t+s*u(o-=g?_?zs:-.001:0),V=e+i*p(o),_?(m=g||m<=E&&!(x>=m&&x<E)?0:m,x=g||x>M&&!(m<=x&&m>M)?M:x):(m=g||m>M&&!(x<=m&&x>M)?M:m,x=g||x<E&&!(m>=x&&m<E)?0:x);const r=t+s*u(m),a=e+i*p(m),d=t+s*u(x-=g?_?zs:-.001:0),f=e+i*p(x);c=y(x-m)>M?1:0,l(r,a,d,f),h&&(h.x1=w,h.y1=v,h.x2=S,h.y2=V)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=f(E,y(o-n)),_=this.isCircled(l),c=a?1:0,d=t+s*u(n),g=e+i*p(n),m=t+s*u(o-=_?c?zs:-.001:0),x=e+i*p(o),b=l>M?1:0,w=[];return w.push("M",d,g,"A",s,i,0,b,c,m,x),w.push(_?"M":"L",m,x+r),w.push("A",s,i,0,b,1-c,d,g+r),h&&(h.x1=d,h.y1=g,h.x2=m,h.y2=x),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){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,d=c/2,g=[];g.push("M",n+a*u(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*u(r),o+h*p(r),"L",n+l*u(r+d),o+_*p(r+d)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Fs[e](0,0,m(2*s,0),m(2*i,0));break;default:r=Fs.circle(s,i,m(f(s,i),0))}t.setPath(r)}}Fs=Hs,Hs._drawers=Object.assign({circle:t=>Fs.circle(0,0,t),none:t=>[]},Fs._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Gs extends te{static create(t,e,s,i,r,n,o=0){return new Gs(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=N,s=N){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...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 js extends oe{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Hs.box(t,e,s,i)),this}}const Xs="head",Ys="far",Ws="inside",Us="none",Zs="near",qs="displayAll",Ks="largestFirst",Qs="hidden",Js="line",ti="area",ei="circlebar",si="treemap",ii="heatmap",ri="vector",ni="wordcloud",oi="pictogram",ai="pictorialbar",hi="pictorial",li="racebar",_i="raceline";let ci=0;const di="_deleted",ui="_drop",pi="_save";class gi{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=ci++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];if(null!=i&&"object"==typeof i)for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[di]=!0}_isDeleted(){return this[di]}_setDrop(t){this[ui]=t}_getDrop(){return this[ui]}_setSave(t){this[pi]=t}_getSave(){return this[pi]}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=N}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[x(s.xField,0)],this.y=e[x(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=w(t._colorFielder(e),e.color),this.icon=w(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class fi{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach((t=>{const s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))})),e}clean(){this._points=this._points.filter((t=>!t[di]))}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class mi extends gi{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.y=e[x(s.yField,0+i)],this.z=e[x(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=w(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class yi extends gi{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[b(s.highField,s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class xi extends rs{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}xi.defaults=Te(rs.defaults,{step:1});class bi extends ns{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return i(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}bi.defaults=Te(ns.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class wi extends Je{getPositions(t){const e=t._ani,s=t._pts,i=t.options.reversed,r=t._ticks.length,n=[];if(r>0){const o=Math.max(1,t.tick.options.step||1);if(o>1)for(let t=0,a=1,h=s.length;t<=r&&a<h;t++,a+=o)n.push(e?e.getPos(s[a],i):s[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(s[t+1],i):s[t+1])}return n}}class vi extends ls{constructor(){super(...arguments),this._weights=new Map,this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getCategorySeparator(){return this._op.categorySeparator||"+"}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new as(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new wi(this)}_createTickModel(){return new xi(this)}_createLabel(){return new bi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=ht.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=f(e,1)*this.getWeight(0)*E/this._catLen),t}_doPrepareRender(){const t=this._op;this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=b(t.minPadding,t.padding,0),this._maxPad=b(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,x(t.categoryPadding,0))))}_adjustMinMax(t,e){const s=this._op;return s.minValue<t&&(t=s.minValue),s.maxValue>e&&(e=s.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights;const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:s,max:i}=this._adjustMinMax(t,e);t=Math.floor(s),e=Math.ceil(i)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));let l=0;for(const t of n.values())l+=t;h=this._len=this._minPad+this._maxPad+h-n.size+l;const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=this.getWeight(i);_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];this.getWeight(s)<=0||a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*B;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/t*e}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1];let n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed&&(n=t-n),this._ani?this._ani.getPos(n,this._op.reversed):n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);let i;return i=this._ani?this._ani.getPos(this._pts[s+2],this._op.reversed)-this._ani.getPos(this._pts[s+2-1],this._op.reversed):this._pts[s+2]-this._pts[s+2-1],y(i)}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return a(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=f(0,e.min),e.max=m(0,e.max)),e}$_collectCategories(t){const e=this._op,r=e.categories,o=this._categories=[];let a=this._weights;if(a.clear(),i(r)&&r.length>0)this._len=0,r.forEach((t=>{const e=null==t?1:m(x(t.weight,1),0),i=t&&t.icon;let r,n;null==t?n=r=null:s(t)?(r=w(t.name,t.label),n=w(t.label,t.name)):n=r=String(t),this._len+=e,o.push({c:r,t:n,i:i}),a.set(a.size,e)}));else{const s=this.chart.seriesByName(e.categorySeries),r=this.chart.seriesByName(e.weightSeries)||s,h=e.weightField,l=null==r?void 0:r.data,_=e.weightByFrequency;s&&(t=[s]);const c=[];for(const e of t)e.collectCategories(this).forEach((t=>{c.includes(t)||(c.push(t),o.push({c:t,t:t}))}));if(h&&i(l)&&l.length>0){const t=r.getPoints();let e=null;l.forEach(((s,i)=>{var r,o;const l=t.get(i);if(!l)return;const d=l.x,u=m(null!==(r=s[h])&&void 0!==r?r:1,0);if(n(d)){const t=c.indexOf(d);if(-1===t)return void(e=null);if(!a.has(t))return a.set(t,u),e=d,void(this._len+=u);_&&e===d&&(a.set(t,m((null!==(o=a.get(t))&&void 0!==o?o:0)+u,0)),this._len+=u)}else Number.isInteger(d)?(a.has(d)||(a.set(d,u),this._len+=u),e=null):e=null}))}else if(i(t)&&t.length>0){const e=new Set;for(const s of t){const t=s.collectCategories(this),i=t.length;if(0===i)continue;let r=t[0],n=1;for(let s=1;s<i;s++){const i=t[s],o=c.indexOf(r);i!==r?(-1===o||e.has(r)||(e.add(r),a.set(o,_?n:1)),r=i,n=1):n++}e.has(r)||(e.add(r),a.set(c.indexOf(r),_?n:1))}}}this._map={},o.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}vi.type="category",vi.defaults=Te(ls.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class Si extends Re{}Si.defaults=Te(Re.defaults,{visible:!1});class Vi extends Fe{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:Vi.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:Vi.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=f(1,m(0,x(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}Vi.OFFSET=4,Vi.defaults=Te(Re.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class Pi extends Re{getRadius(){return m(0,x(this._op.radius,4))}}Pi.defaults=Te(Re.defaults,{visible:!1,radius:4});class Ai extends Re{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new Si(this.chart)).init(),t.fixedArea=(this._fixedArea=new Si(this.chart)).init(),t.label=(this._label=new Vi(this.chart)).init(),t.marker=(this._marker=new Pi(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=m(0,x(t.forward,0)),t.backward=m(0,x(t.backward,0)),this._formatter=bt.getFormatter(t.numberFormat||"0.####")}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:x(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(y(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,s=0,i=0,r=0,n=0,o=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+i);h.push(o),o=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)y(s[t][r])>y(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,a),l=t=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=m(1,f(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+x(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var ki;Ai.defaults=Te(Re.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const Ci={},Li={},Ni=/\$\{detail\}/g;class Mi extends Re{}Mi.defaults=Te(Re.defaults,{visible:!1});class Ei extends Fe{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return x(this._op.offset,0)}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return m(-90,f(90,x(this._op.rotation,0)))}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=x(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ki=Ei,Ei.OFFSET=4,Ei.defaults=Te(Fe.defaults,{visible:void 0,position:"default",offset:ki.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class Ti extends Fe{_doInit(t){super._doInit(t),this._args={}}getText(t){return ht.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return x(this._op.offset,0)}getGap(){return x(this._op.gap,Ti.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,s,i){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=s,r.negativeTotal=i,r.total=s+i,r}isStackLabelVisible(t){return this._op.visibleCallback?this._op.visibleCallback(t):this.visible}getStackLabelText(t,e){if(r(this._op.textCallback)){const e=this._op.textCallback(t);if(n(e))return e}return this.getText(e)}getRotation(){return m(-90,f(90,x(this._op.rotation,0)))}getStackLabelStyle(t){if(r(this._op.styleCallback))return this._op.styleCallback(t)}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=x(t.verticalAdjust,0)}}Ti.OFFSET=4,Ti.defaults=Te(Fe.defaults,{visible:!1,align:"center",gap:Ti.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Bi={x:"xValue",y:"yValue",z:"zValue"};class Oi extends Wt{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class Ri extends Wt{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach((t=>{t.points.forEach((t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)}))}))),e.forEach((t=>{t._setDeleted()})),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach((e=>{e.points.forEach((e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))}))})),this.points.forEach((e=>{e._vr=1-t})),this.series._changed(),!0}}class Di extends Wt{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach((t=>{this.addPoint(t)})),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort(((t,e)=>t.xValue-e.xValue)),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class $i extends gi{}const Fi=12;class Ii extends Re{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{Ci[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new fi(this),this._pointArgs={},this._paletteColors=Array(Fi).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==st&&ht.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){ht.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){ht.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){ht.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){ht.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let s;if(e.tooltipDetailCallback){this._getPointCallbackArgs(this._pointArgs,t);const i=e.tooltipDetailCallback(this._pointArgs);s=n(i)?i:""}if(void 0===s){const t=e.tooltipDetail;s=n(t)?t:""}return s}getTooltipText(t,e){var s;const i=this._op;let r;if(i.tooltipCallback){this._getPointCallbackArgs(this._pointArgs,e);const t=i.tooltipCallback(this._pointArgs);n(t)&&(r=t)}if(void 0===r){const t=i.tooltipText;r=n(t)?t:null!==(s=Ii.defaults.tooltipText)&&void 0!==s?s:"",r&&(r=r.replace(Ni,this.getTooltipDetail(e)))}return r}getTooltipParam(t,e,s){return Ii.getPointTooltipParam(t,e,s)}getTooltipHeaderColor(t){return null}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}get isWidget(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(this._xAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}isXY(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}connectable(t){return!1}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return x(s,t.getXStart())}$_getXStep(t){return v(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,this._calcedColor=void 0,this._dataSourceDirty&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof vi)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(i(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>n(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>n(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else{const s=this.hasZ();this._points.forEach(((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return x(this._op.paddingRate,1)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=et(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=N}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?x(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ei.OFFSET):this._labelOff}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))}_preparePointArgs(t){this._pointLabelCallback=P(this._pointLabel.options.textCallback),this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._preparePointArgs(t),(this._argsPoint=e).assignTo(t)),t}getPointText(t,e,s){let i;return r(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),n(i))?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(r(this._op.pointStyleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(r(this._pointLabel.options.styleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(r(this._op.onPointClick))return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){r(this._op.onPointHover)&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t,e){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:N}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof gi||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new Oi(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new Oi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return i(t)&&t.forEach((t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)})),s.length>0&&(e&&this.chart.animatable()&&s.forEach((t=>{const e=t._prev=t.copy();e.ani=new Oi(this,t,this._points.count>1),e.ani.start()})),this._dataPointsChanged()),s}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof gi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof gi&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ri(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Di(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(i(t)){const s=t.map((t=>this._points.get(t))).filter((t=>null!=t));return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(i(t)){let s=[];if(t.forEach((t=>{t instanceof gi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof gi&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ri(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach((t=>this._dropAni.addPoint(t))):(this._dropAni=new Di(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders(),this._decayDuration=m(0,x(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Ei(t)}_createPoint(t){return new $i(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return r(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(i(t))return t;if(t){let e;if(t._obj instanceof ut)e=t._obj;else if(t instanceof ut)e=t;else if(Number.isFinite(t)||s(t)||h(t))return[t];if(e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=a(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Fi+1)})`:t.color;let r,o;i(e)?r=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?r=this.chart.getPaletteColors(e.split("@")[0]):o=this.chart._assets.get(e):this._colorByPoint()&&(r=this.chart.chartOptions.options.colors),o instanceof Le?this._runPoints.forEach(((t,e)=>{t.color=t.color||o.getNext()||s})):i(r)?this._runPoints.forEach(((t,e)=>{t.color=t.color||r[e%r.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=P(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=P(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[Bi[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=N}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}Ii.LEGEND_MARKER="rct-legend-item-marker",Ii.defaults=Te(Re.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}: ${detail}",tooltipDetail:"<b>${yValue}</b>",loadAnimation:"default",decayDuration:300,hoverEffect:"default",interactive:!0,paddingRate:1});class zi extends De{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}_internalSeries(){return this._series}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_clear(){}get(t){return this._items[t]}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))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof er&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof er?n.push(...t.series):t instanceof Ii&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof Ii?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(Is[e++%Is.length]),i||(s._valid=!0))}})),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=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof qi&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i._setIndex(s),i.init(),i._load(e),i}return Ii._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Ui||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Hi extends Ii{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new Ai(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Hi.defaults=Te(Ii.defaults,{});class Gi extends Re{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Gi.defaults=Te(Re.defaults,{radius:3});class ji extends gi{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return w(this.x,this.y)}legendKey(){return this._legendKey}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:"percent"===t?this._percent:e}}class Xi extends Re{_doSetSimple(t){return n(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Xi.defaults=Te(Re.defaults,{curved:!0});class Yi extends Ei{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Xi(this.chart)).init()}get connector(){return this._connector}getWidgetAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}Yi.defaults=Te(Ei.defaults,{visible:!0,convergent:!0,align:Us,dedupeMode:qs});class Wi extends Re{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?U(this._minDim,gi.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Wi.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=Y(t.minValue,!0)}}Wi.DEF_COUNT=10,Wi.defaults=Te(Re.defaults,{visible:!1,x:"기타"});class Ui extends Ii{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Wi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:U(this._centerXDim,t),y:U(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_needDecayEffect(){return!0}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=Y(v(s,e._op.center,Ui.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Y(v(i,e._op.center,Ui.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}Ui.DEF_CENTER="50%",Ui.defaults=Te(Ii.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Ui.DEF_CENTER,centerY:Ui.DEF_CENTER});class Zi extends Ui{getRadius(t,e){return U(this._radiusDim,f(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=Y(w(t._radius=e,Zi.defaults.radius),!0))}(this,t.radius)}}Zi.defaults=Te(Ui.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class qi extends Hi{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.minPointWidth}getPointWidth(t,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,m(e,i)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._op.minPointWidth=x(this.getMinPointWidth(),0)}}qi.defaults=Te(Ii.defaults,{pointWidth:1,minPointWidth:0});class Ki extends Ei{getAlign(){return this._op.align||"center"}getAlignOffset(){return x(this._op.alignOffset,0)}get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new Mi(this.chart)).init()}}Ki.defaults=Te(Ei.defaults,{align:"center",alignOffset:0});class Qi extends qi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Ki(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=m(0,b(e.depth,t.getDepth(),Qi.DEPTH)),this._distance=t.getDistance()+x(e.distance,0)):(this._depth=m(0,x(e.depth,Qi.DEPTH)),this._distance=x(e.distance,Qi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this._op.baseValue}_getLabelDefaultPos(t,e){const s=this._group;return"default"===e&&s&&s._stacked&&s.stackLabel&&s.stackLabel.visible?"inside":e}}Qi.DEPTH=10,Qi.DISTANCE=5,Qi.defaults=Te(qi.defaults,{nullAsBase:!1});class Ji extends qi{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class tr extends Ji{}class er extends Re{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Li[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Li[t.seriesType]=t}))}static collectTooltipText(t,e,s,r,n){function o(t,e,s,i){let r=e.replace(Ni,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&i(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach(((t,e)=>{let i=r;t!==s&&t.needAxes()&&(i=t.getPointAt(r.xValue)),i&&(a?(n.items.push(t),n.rows.push([o(t,h[0],i,e),o(t,h[1],i,e)])):(l&&(l+="<br>"),l+=o(t,h,r,e)))})),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ii.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return er.collectTooltipText(this._op,this._visibles,t,e,s)}getTooltipParam(t,e,s){return er.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}get stackLabel(){return this._stackLabel}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}connectable(t){return!0}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=x(this._op.layoutMax,er.LAYOUT_MAX);return t>0?t:er.LAYOUT_MAX}_doInit(t){super._doInit(t),t.stackLabel=(this._stackLabel=new Ti(this.chart)).init()}_doApply(t){super._doApply(t),e.call(t,"children")&&(this._series=[],this.$_loadSeries(this.chart,t.children))}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._legended=null,this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!ht.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}this._stackLabel._prepareRender(),super._prepareRender()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add(Ii._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add(Ii._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_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),r=this._stackTotals=new Map;if(isNaN(s))for(const[t,s]of i.entries()){s[0].yGroup=s[0].yValue||0;for(let t=1;t<s.length;t++)s[t].yGroup=s[t-1].yGroup+(s[t].yValue||0);const i=s[s.length-1].yGroup;r.set(t,{x:s[0].xValue,positiveTotal:i>=0?i:0,negativeTotal:i<0?i:0}),e.push(i)}else for(const[t,n]of i.entries()){let i=n[0].yValue||0,o=i>=s?0:-1,a=i<s?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)i=n[t].yValue||0,i>=s?(o>=0&&(n[t].yGroup=n[o].yGroup+i*(i<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+i*(i>=0?-1:1)),a=t);const h=o>=0?n[o].yGroup:0,l=a>=0?n[a].yGroup:0;r.set(t,{x:n[0].xValue,positiveTotal:h,negativeTotal:l}),o>=0&&e.push(n[o].yGroup),a>=0&&e.push(n[a].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(y(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}er.LAYOUT_MAX=100,er.defaults=Te(Re.defaults,{layout:"default",layoutMax:er.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class sr extends er{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ir extends er{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ir.defaults=Te(er.defaults,{groupWidth:1,groupPadding:.1});class rr extends Hi{isMarker(){return!0}isXY(){return!0}}rr.defaults=Te(Ii.defaults,{colorByPoint:!1});class nr extends Re{}class or extends Re{}const ar={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},hr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},lr={minPadding:0,maxPadding:0};class _r extends Re{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new nr(e)).init(),t.mask=(this._mask=new or(e)).init(),t.borderLine=(this._borderLine=new Re(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,_r.defaults.thickness)}getGap(){return x(this._op.gap,_r.defaults.gap)}getGapFar(){return x(this._op.gapFar,_r.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=_({},e.series,ar[t]())}else i.series=ar.area();s(e.xAxis)?i.xAxis=_({},e.xAxis,(hr[e.xAxis.type]||hr.linear)(),lr):i.xAxis=_({},lr),s(e.yAxis)?i.yAxis=_({},e.yAxis,(hr[e.yAxis.type]||hr.linear)(),lr):i.yAxis=_(hr.linear(),lr),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}_r.defaults=Te(Re.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class cr extends Re{_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}cr.defaults=Te(Re.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class dr extends cr{}dr.defaults=Te(cr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class ur extends Re{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o=!!r.axis;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!h(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:m(x(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:m(x(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:m(x(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return x(this._op.listMarkerGap,5)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?bt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Dt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}ur.defaults=Te(Re.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1,listGap:12,listRowGap:3,listMarkerSize:7,listMarkerGap:5});const pr="vline",gr="hline",fr="line";class mr extends He{_isVisible(){return this._op.visible&&!H(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}mr.type="image";class yr extends He{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||yr.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}yr.type="shape",yr.defaults=Te(He.defaults,{width:64,height:64,shape:"square"});class xr extends He{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!H(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?bt.getFormatter(s):N),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Dt.getFormatter(t):N)}(t.timeFormat)}}xr.type="text",xr.defaults=Te(He.defaults,{text:"Text"});class br extends Je{getPositions(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class wr extends rs{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,s,n,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,x(.85*_,60),s,n,o,l):i(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof Ar&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,s,n,o):_>0?this._getStepsByPixels(e,_,s,n,o,l):n!==o?[n,o]:[n],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?m(8,d(t/(.9*e))+1):x(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let s;if(super._doApply(t),this._stepPixels=!r(t.stepPixels)&&ht.parseTuples(t.stepPixels),e.call(t,"stepMultiples"))if(r(t.stepMultiples))s=t.stepMultiples;else{let e;if(i(t.stepMultiples)){let s=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>s&&e.push(+t)}))}s=e&&e.length>0?e:void 0,s&&(s=s.filter((t=>t>=1)),s.length>0?s.sort(((t,e)=>t-e)):s=void 0)}this._userMultiples=s}$_getStepPixels(t,e){let s=this._stepPixels;if(r(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?wr.STEP_PIXELS_P:t._isX?wr.STEP_PIXELS_X:wr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return m(1,s[e][1])}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof Ar&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),t}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=d(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new J(e)}(s<e&&i>e,"base error"),t=m(3,t);;){if(!(d((e-s)/a)+d((i-e)/a)+1>t))break;a+=h}s=e-d((e-s)/a)*a}else s=n._fixedMin;l.push(D(s));for(let e=1;e<t;e++)l.push(D(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=D(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?wr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?wr.STEP_MULTIPLES[0]:wr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,s),i(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=n.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(n.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=m(1,c(t/e))+1,l=o/(h-1);const _=function(t){return Math.pow(10,t)}(c(g(l))),u=this._getStepMultiples(_,n),p=[];let f,y=0;if(l/=_,u)if(l>u[y]){for(;y<u.length-1;y++)if(l>u[y]&&l<u[y+1]){l=l<=u[y]+(u[y+1]-u[y])/2?u[y]:u[y+1];break}}else l=u[y];for(;;){for(l*=_,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-d((s-i)/l)*l,this._step=l,p.push(D(f=i));f<r;)p.push(D(f+=l));if(!u||y>u.length-2||p.length<=a)break;l=u[++y],p.length=0}return p}}wr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],wr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],wr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],wr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],wr.defaults=Te(rs.defaults,{baseRange:!1,enableDecimals:!0});class vr extends ns{}vr.defaults=Te(ns.defaults,{numberFormat:"0.##"});class Sr extends vr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}Sr.defaults=Te(vr.defaults,{useSymbols:!0});class Vr extends Ue{getSize(t){return Math.min(.9*t,U(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=Y(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}Vr.defaults=Te(Ue.defaults,{size:"30%",space:16,gridVisible:!0});class Pr extends Ze{_isVisible(){return this._op.visible}}Pr.defaults=Te(Ze.defaults,{visible:!1});class Ar extends ls{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Pr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=Ar.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var s,i;super._doApply(t);const r=null!==(s=t.minPadding)&&void 0!==s?s:t.padding,o=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,n(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,n(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=ht.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=ht.parseTuples(o)),this._baseVal=+this._op.baseValue,this._strictMin=Y(t.strictMin,!0),this._strictMax=Y(t.strictMax,!0),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new br(this)}_createTickModel(){return new wr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=x(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=x(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof Ar&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),h=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=a||e.options.to>=h)&&this._runBreaks.splice(t,1)}this._runBreaks.length>1&&(this._runBreaks.length=1),this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let l,_,c=!1,d=a,u=h;if(this._isX)if(a===h)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,a,h);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*x(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=E*e.min/(h-a+e.min):t*=B,isNaN(this._fixedMax)&&this.getTotalAngle()+t>E&&(h=this._max=Math.max(this._calcedMax+e.min,h))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(h=this._max=Math.max(this._calcedMax+e.min/2,h))}else this._unitLen=1}if(a===h)l=[a];else if(this._runBreaks)l=this.$_calcBrokenSteps(this._runBreaks,s,a,h),_=l.slice(0),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,s,this._runBase,a,h,!1),_=l.slice(0),l.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d;)l.shift();l.length<2&&this._fixedMin<l[0]&&l.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;l.length>2&&l[1]<=d;)l.shift();if(!isNaN(r._step))for(;l[0]>d;)l.unshift(r.getNextStep(l[0],-1))}if(a=Math.min(a,l[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;l.length>1&&l[l.length-1]>u;)l.pop();l.length<2&&this._fixedMax>l[l.length-1]&&l.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;l.length>2&&l[l.length-2]>=u;)l.pop();if(!isNaN(r._step))for(;l[l.length-1]<u;)l.push(r.getNextStep(l[l.length-1],1))}h=Math.max(h,l[l.length-1])}else l.push(a+(h-a)/2);this._prevSteps=l,this._setMinMax(a,h);const p=this.$_createTicks(l,s,a,h,i);if(c&&p.length>1){const t=this._isPolar;let e=!1;const s=_;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(D(h-t)>D(t-s)))break;{const r=this._createTick(0,i+D(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach(((t,e)=>t.index=e))}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find((t=>e<t.to))||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this._op.reversed?$(t-r-i.pos):$(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=$(i)}return this._ani?this._ani.getPos(s,this._op.reversed):s}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_isLog(){return!1}$_resolveFit(t){return"tick"===t||"value"===t?t:this._isX&&!this._isPolar?"value":"tick"}$_getStartFit(){return this.$_resolveFit(this._op.startFit)}$_getEndFit(){return this.$_resolveFit(this._op.endFit)}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-U(t,s):e+U(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),h=!0,l=!0,_=NaN,d=NaN,u=1;if(this._series.length>0){let t,c=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||c++,u=m(u,t.getAxisPadRate())})),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[f(t._yMin,r[e][0]),m(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let c=r._sBase;a(c)&&!isNaN(c)&&(c=D(c),i?c>=0&&c<=e&&c<=s&&(e=t=c):c<=e?r.isBased(this)?e=t=c:_=x(f(_,c),c):c>=s&&(r.isBased(this)?s=t=c:d=x(m(d,c),c))),h&&!n&&(i||r.canMinPadding(this,e,t))&&(h=!1),l&&!o&&(i||r.canMaxPadding(this,s,t))&&(l=!1)}))}else h=n,l=o;n||(n=h),o||(o=l),this._fixedMin=this._fixedMax=NaN;const p=m(0,s-e),g=this.$_calcStrict(this._strictMin,e,-p),y=this.$_calcStrict(this._strictMax,s,p);let b=NaN,w=NaN,v=0,S=0;isNaN(g)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):b=this._minPadPixels:this._fixedMin=e=g,isNaN(y)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?S=this.$_getPadding(this._maxPaddings,t,u):w=this._maxPadPixels:this._fixedMax=s=y;let V=e,P=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*S;e>P&&(P=e)}}else V-=p*v,P+=p*S;if(!isNaN(b)||!isNaN(w)){isNaN(b)&&(b=0),isNaN(w)&&(w=0);const e=Math.min(b+w,.9*t),s=p-c(p*(t-e)/t),i=Math.round(s*b/e);V-=i,P+=s-i}return!isNaN(_)&&_<=e&&V<_&&(V=this._fixedMin=_),!isNaN(d)&&d>=s&&P>d&&(P=this._fixedMax=d),P=m(P,V),{min:V,max:P}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)})),0===r&&this._series.forEach((t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())})),i.length>0){const r=i.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:x(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=f(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:x(r,1),min:n}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new Vr(this),s={...t};return this._doApplyBreak(s),e.init(),e._load(s),s.from>0?e:null}}_doApplyBreak(t){}$_loadBreaks(t){if(i(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._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(_(new Vr(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new Vr(this)._initObject(),o))}}var s}}Ar.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],Ar.defaults=Te(ls.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default",unitPadding:.5});class kr extends Ar{get label(){return this._label}_createLabel(){return new Sr(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof er&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}kr.type="linear";const Cr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Lr=[[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]],Nr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Mr extends wr{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}_getValidInterval(t,e,s,i,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&Nr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Cr[e]/2&&t<Cr[e+1]/2)return this._scale=e,Lr[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,_=m(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=Cr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,f=u;if(7===this._scale){const t=h.getFullYear();let e=f.getFullYear();this._step=_=Math.ceil(_),f=new Date(e,0),e<t&&e+_>t&&(e=t,f=new Date(e,0));do{n.push(+f),e+=_,f=new Date(e,0)}while(f<=p)}else if(6===this._scale){let t=f.getFullYear(),e=f.getMonth();this._step=_=Math.ceil(_),f=new Date(t,e),f<h&&new Date(t,e+_)>h&&(e=h.getMonth(),f=new Date(h.getFullYear(),e));do{n.push(+f),f.setMonth(f.getMonth()+_)}while(f<=p)}else if(4===this._scale||5===this._scale){let t=f.getFullYear(),e=f.getMonth(),s=f.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),f=new Date(t,e,s),f<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),f=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+f),f.setDate(f.getDate()+_*i)}while(f<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:f.setMinutes(0);case 2:f.setSeconds(0);case 1:f.setMilliseconds(0)}g=f.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Nr[a],t=Cr[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const Er=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class Tr extends vr{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,a=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Er.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(a))for(let t=0;t<a.length;t++){const e=this._formats[t],i=a[t];o(i)?e.format=i:s(i)&&(o(i.format)&&(e.format=i.format),h&&o(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,s.startOfWeek);else{const e=this._formats,o=i.tick._scale,a=Dt.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,s.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek)}}return this._getText(n,null,!1,!1)}}Tr.defaults=Te(vr.defaults,{useBeginningFormat:!0});class Br extends Ar{get label(){return this._label}_createTickModel(){return new Mr(this)}_createLabel(){return new Tr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,s,i){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,s,i)}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this._op.baseValue;return a(t)?t:n(t)?new Date(t).getTime()+x(this._offset,0):NaN}getValue(t){return a(t)?t:t instanceof this._dateClass?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}$_inferScale(t){const e=this.date(t);return 0!==e.getMilliseconds()?0:0!==e.getSeconds()?1:0!==e.getMinutes()?2:0!==e.getHours()?3:4}}Br.type="time",Br.subtype="date",Br.defaults=Te(Ar.defaults,{baseValue:NaN});class Or extends yi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Rr extends tr{pointLabelCount(){return 2}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Or(t)}_getBottomValue(t){return t.lowValue}}Rr.type="barrange",Rr.defaults=Te(tr.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Dr extends gi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class $r extends Qi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Dr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}$r.defaults=Te(Qi.defaults,{colorByPoint:!1,pointOffset:0});class Fr extends $r{canDepth(){return!0}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Fr.type="bar";class Ir extends ir{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=x(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=x(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Ir.defaults=Te(ir.defaults,{depth:10,distance:5});class zr extends Ir{_canContain(t){return t instanceof Fr}}zr.type="bargroup",zr.seriesType="bar";class Hr extends te{constructor(t){super(t,Ii.LEGEND_MARKER),this.add(this._back=new Gs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new oe(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){Hs.setShape(this._marker,this._shape,t,t)}}class Gr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new oe(t)),this.insertFirst(this._area=new oe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class jr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new oe(t)),this._line.setFill("none"),this.insertFirst(this._line2=new oe(t)),this._line2.setFill("none"),this.insertFirst(this._area=new oe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Xr extends oe{constructor(t,e=N,s=N){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){ht.isNumber(t)?this.setPath(Hs.line(t,e,s,i)):t&&this.setPath(Hs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Hs.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(Hs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Hs.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(Hs.line(e,t,s,t))}}class Yr extends Hr{constructor(t){super(t),this.insertFirst(this._line=new Xr(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Wr extends gi{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Ur extends Gi{}Ur.defaults=Te(Gi.defaults,{radius:4,hoverScale:1.75});class Zr extends Ei{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Zr.ALIGN_GAP:0:t}getPosition(){return w(this._op.position,"default")}}Zr.ALIGN_GAP=4,Zr.defaults=Te(Ei.defaults,{align:"center"});class qr extends Hi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Ur(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return b(t.radius,this.marker.options.radius,Ur.defaults.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Zr(t)}_createPoint(t){return new Wr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Yr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),f(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach((e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)})),t.length>0&&(t.sort(((t,e)=>t.xValue-e.xValue)),i[0].unshift(...t)),s.length>0&&(s.sort(((t,e)=>e.xValue-t.xValue)),i[i.length-1].push(...s))}return i}}qr.defaults=Te(Ii.defaults,{nullAsBase:!1});class Kr extends Fe{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Kr.defaults=Te(Fe.defaults,{visible:!1,offset:8});class Qr extends qr{_doInit(t){super._doInit(t),t.flag=(this._flag=new Kr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(h(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof on||this._group instanceof an?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=v(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Qr.type=Js,Qr.defaults=Te(qr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Jr extends Qr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Jr.type="spline";class tn extends Wr{}class en extends Qr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=x(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_createLegendMarker(t,e){return new Gr(t)}_createPoint(t){return new tn(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doBuildLines(t,e)}}en.type=ti,en.defaults=Te(qr.defaults,{});class sn extends tn{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[x(s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=w(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class rn extends Zr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class nn extends qr{pointLabelCount(){return 2}_createLabel(t){return new rn(t)}_createLegendMarker(t,e){return new jr(t)}_createPoint(t){return new sn(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doBuildLines(t,e){const s=super._doBuildLines(t,e),i=[];return s.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}i.push(t,e)})),i}}nn.type="arearange",nn.defaults=Te(qr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class on extends er{_canContain(t){return t instanceof Qr}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}on.type="linegroup",on.seriesType=Js,on.defaults=Te(er.defaults,{lineType:"default"});class an extends er{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof en}getBaseValue(t){return t===this._yAxisObj?v(this._op.baseValue,t.getBaseValue(),0):NaN}}an.type="areagroup",an.seriesType=ti,an.defaults=Te(er.defaults,{lineType:"default"});class hn extends tn{}class ln extends en{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new hn(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}ln.type="bellcurve",ln.defaults=Te(en.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class _n extends gi{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return _(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.min=e[x(s.minField,0+i)],this.low=e[x(s.lowField,1+i)],this.mid=e[x(s.midField,2+i)],this.high=e[x(s.highField,3+i)],this.y=e[b(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=w(e[s.minField],e.min),this.low=w(e[s.lowField],e.low),this.mid=w(e[s.midField],e.mid),this.high=w(e[s.highField],e.high),this.y=w(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=V(t.minValue,this.minValue,e),this.lowValue=V(t.lowValue,this.lowValue,e),this.midValue=V(t.midValue,this.midValue,e),this.highValue=V(t.highValue,this.highValue,e)}}class cn extends tr{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new _n(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}}cn.type="boxplot",cn.defaults=Te(tr.defaults,{tooltipText:"<b>${name}</b><br>${detail}",tooltipDetail:"min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class dn extends oe{constructor(t,e,s){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 Hs.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 Hs.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)}}const un=2*Math.PI,pn=-Math.PI/2;class gn extends te{constructor(t){super(t,Ii.LEGEND_MARKER),this._sectors=[],this.add(this._back=new Gs(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,s){if(this._size===t&&this._sectors.length===e)return void this._applyColors(s);this._size=t;const i=t/2,r=i,n=i;this._back.setBounds(0,0,t,t),this._sectors.forEach((t=>t.remove())),this._sectors=[];const o=un/e;let a=pn;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:i,ry:i,start:a,angle:o,clockwise:!0},e=new dn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(s)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const s=t&&t[e]||"#ccc";this._sectors[e].setFill(s)}}}class fn{get color(){return this.legendColor()}get series(){var t;return null===(t=this._pie)||void 0===t?void 0:t.parentSeries}get pie(){return this._pie}get sliceCount(){return this._sliceCount}get visible(){return this._visible}set visible(t){var e;this._visible!==t&&(this._visible=t,null===(e=this._pie.chart)||void 0===e||e._visibleChanged(this._pie))}legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){if(this._explicitColor)return this._explicitColor;return`var(--color-${(this._pie._paletteOffset+this.index)%Fi+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.options.legendKey;return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class mn{get field(){return this.source.field}get label(){return this.source.label}get index(){return this.source.index}getParam(t){var e;return null!==(e=this[t])&&void 0!==e?e:this.source.getParam(t)}}class yn extends mi{}class xn extends Re{get fields(){return this._fields}get categories(){return this._categories}get colors(){return this._sliceColors}get hasExplicitColors(){return this._sliceColors.length>0}get startRad(){return this._startRad}get totalRad(){return this._totalRad}get clockwise(){return this._clockwise}get innerRadiusDim(){return this._innerRadiusDim}get visibleInLegend(){return!0===this._op.visibleInLegend}get parentSeries(){return this._parentSeries}_setParentSeries(t){this._parentSeries=t}get _paletteOffset(){const t=this._parentSeries;if(!t)return 0;const e=t.chart._getSeries()._internalSeries();let s=0;for(const i of e){if(i===t)break;i instanceof bn&&i.pie&&i.pie.fields.length>0&&(s+=i.pie.fields.length)}return s}getLegendSources(){return this._legendSources}isFieldVisible(t){const e=this._legendSources;return!e||!e[t]||!1!==e[t].visible}calcSlices(t){const e=this._fields;if(!e||0===e.length||!t)return null;const s=[];for(let i=0;i<e.length;i++){if(!this.isFieldVisible(i))continue;const r=this._getFieldValue(t,e[i]),n=a(r)&&r>0?r:0;n>0&&s.push({index:i,value:n})}if(0===s.length)return null;const i=s.reduce(((t,e)=>t+e.value),0);if(i<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,o=this._totalRad;let h=this._startRad;const l=[];for(let t=0;t<s.length;t++){const e=s[t],a=n*(e.value/i)*o,_=this._legendSources[e.index];if(_){const t=new mn;t.source=_,t.value=e.value,t.percent=Math.round(e.value/i*1e4)/100,t.startAngle=h,t.angle=a,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=a}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let s=0;s<t.length;s++)t[s].color=`var(--color-${(e+t[s].index)%Fi+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,s=[],i=this._paletteOffset;for(let r=0;r<t;r++)s.push(e.length>0?e[r%e.length]:`var(--color-${(i+r)%Fi+1})`);return s}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t){return h(t)?(this._op.visible=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._fields=(t.fields||[]).map((t=>String(t))),this._categories=i(t.categories)&&t.categories.length>0?t.categories:this._fields;const e=t.colors;i(e)?this._sliceColors=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?this._sliceColors=this.chart.getPaletteColors(e.split("@")[0])||[]:this._sliceColors=this.chart.getPaletteColors(e)||[]:this._sliceColors=[],this._startRad=T+B*x(t.startAngle%360,0);const s=x(t.totalAngle,360);this._totalRad=B*m(0,f(360,s<=0?360:s)),this._clockwise=!1!==t.clockwise,t.innerRadius?this._innerRadiusDim=Y(t.innerRadius,!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,s=this._sliceColors,i=this._categories,r=e.length;this._legendSources=e.map(((e,n)=>{const o=s.length>0?s[n%s.length]:null,a=null==t?void 0:t.find((t=>t.legendKey()===this.hash+":"+e)),h=new fn;return h._pie=this,h.field=e,h.label=i[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h}))}_getFieldValue(t,e){if(t)return t[i(t)?+e:e]}}xn.defaults=Te(Re.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class bn extends rr{_doInit(t){super._doInit(t),t.pie=(this._pie=new xn(this.chart)).init(),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:U(this._minSizeDim,t),max:U(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getTooltipText(t,e){const s=this._hoveredSlice;if(s&&this._pie){const t=this._pie.options;let i;return t.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=s,i=t.tooltipCallback(this._pointArgs)),void 0===i&&(i=t.tooltipText||"${label}: ${value} (${percent}%)"),i}return super.getTooltipText(t,e)}getTooltipParam(t,e,s){var i;const r=this._hoveredSlice;return r&&null!==(i=r.getParam(s))&&void 0!==i?i:super.getTooltipParam(t,e,s)}getTooltipHeaderColor(t){var e,s;return null!==(s=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==s?s:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new yn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_createLegendMarker(t,e){const s=this._pie;if(s&&s.visible&&s.fields.length>0){const i=new gn(t);return i.render(e,s.fields.length,[]),i.setColorResolver((()=>s.getLegendSliceColors())),i}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,s=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,i=s?this._op.legendMode||"both":null;"slice"!==i&&super.getLegendSources(t),s&&"series"!==i&&e.getLegendSources().forEach((e=>t.push(e)))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=f(t,s.zValue),e=m(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e),this._pie&&this._pie.visible&&this._pie.fields.length>0&&this._visPoints.forEach((t=>{t.isNull||(t.pieSlices=this._pie.calcSlices(t.source))}))}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){n(t)&&(t=this._xAxisObj.getValue(t)),n(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}bn.type="bubble",bn.defaults=Te(rr.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class wn extends sr{_canContain(t){return t instanceof Qr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=w(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return ht.makeIntArray(0,t.length)}}wn.type="bump",wn.seriesType=Js;class vn extends gi{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.low=e[x(s.lowField,0+i)],this.close=e[x(s.closeField,1+i)],this.open=e[x(s.openField,2+i)],this.y=e[b(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=w(e[s.lowField],e.low),this.open=w(e[s.openField],e.open),this.close=w(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e),this.openValue=V(t.openValue,this.openValue,e),this.closeValue=V(t.closeValue,this.closeValue,e)}}class Sn extends tr{canCategorized(){return!0}_createPoint(t){return new vn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Kt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new oe(t,Ii.LEGEND_MARKER).setPath(s.end())}}Sn.type="candlestick",Sn.defaults=Te(tr.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Vn extends Ki{}Vn.defaults=Te(Ei.defaults,{position:"inside"});class Pn extends $r{get pointLabel(){return this._pointLabel}_createLabel(t){return new Vn(t)}}Pn.type=ei;class An extends Ir{_canContain(t){return t instanceof Pn}}An.type="circlebargroup",An.seriesType=ei;class kn extends yi{}class Cn extends Gi{}Cn.defaults=Te(Gi.defaults,{radius:4,shape:"circle"});class Ln extends tr{_doInit(t){super._doInit(t),t.marker=(this._marker=new Cn(this)).init(),t.lowMarker=(this._lowMarker=new Cn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+m(0,this.marker.options.radius)}_createPoint(t){return new kn(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=x(e.radius,s),n=e.shape||i;this._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}Ln.type="dumbbell";class Nn extends gi{}class Mn extends Qi{getSegmentSize(t){return U(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Nn(t)}_createLegendMarker(t,e){const s=new Kt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new oe(t,Ii.LEGEND_MARKER).setPath(s.end())}}Mn.type="equalizer",Mn.defaults=Te(Qi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class En extends tr{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new yi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Kt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new oe(t,Ii.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}En.type="errorbar",En.defaults=Te(tr.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Tn extends ji{}class Bn extends Tn{constructor(t,e){super(t),this.points=e}}class On extends Yi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?On.ENDED_DIST:On.OUTSIDE_DIST:this._op.distance||0}}On.OUTSIDE_DIST=25,On.ENDED_DIST=10;class Rn extends Ui{getSize(t,e){return{width:m(.1*t,U(this._widthDim,t)),height:m(.1*e,U(this._heightDim,e))}}getNeckSize(t,e){return{width:ht.clamp(U(this._neckWidthDim,t),this._minNeckWidth,t),height:ht.clamp(U(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new On(t)}_createPoint(t){return new Tn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Bn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=W(e._width,Rn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=W(e._height,Rn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=W(e._neckWidth,Rn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=W(e._neckHeight,Rn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}Rn.type="funnel",Rn.defaults=Te(Ui.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Dn extends gi{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const $n={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 Fn extends Hi{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?$n[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Dn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[x(this.yField,0)]:s(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),r.minValue<o[0]&&o.unshift(r.minValue),r.maxValue>o[o.length-1]&&o.push(r.maxValue);const t=o.length,e=o[0],s=o[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,l=e,_=l+a;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&o[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=b(this._op.baseValue,this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}}Fn.type="histogram",Fn.defaults=Te(Ii.defaults,{baseValue:0,binsNumber:"squreRoot"});class In extends Gi{}In.defaults=Te(Gi.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class zn extends gi{_assignTo(t){return _(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[x(r.xField,0)]),this.y=e[x(r.yField,0+n)],this.radius=e[x(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=w(e[t.options.radiusField],e.radius)}}class Hn extends Qi{_doInit(t){super._doInit(t),t.marker=(this._marker=new In(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new zn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=m(t.minRadius,0),n=m(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}Hn.type="lollipop";class Gn extends vn{}class jn extends Sn{_createPoint(t){return new Gn(t)}_createLegendMarker(t,e){const s=new Kt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new oe(t,Ii.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}jn.type="ohlc";class Xn extends Wr{}class Yn extends qr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Xn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+x(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Yn.type="pareto",Yn.defaults=Te(qr.defaults,{curved:!1});class Wn extends ji{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class Un extends Wn{constructor(t,e){super(t),this.points=e}}class Zn extends Fe{getDefaultIconPos(){return"left"}}class qn extends Yi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?U(this._distanceDim,e,0):t?U(s?qn.INNER_DIST:qn.INSIDE_DIST,e):"far"===this._op.align?qn.ENDED_DIST:qn.OUTSIDE_DIST}}qn.INSIDE_DIST=Y("30%",!1),qn.INNER_DIST=Y("50%",!1),qn.OUTSIDE_DIST=25,qn.ENDED_DIST=10,qn.defaults=Te(Yi.defaults,{radius:.7,rotationMode:"arc"});class Kn extends Re{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=m(0,x(t.length,0)),t.ratio=m(.3,f(.8,x(t.ratio,Kn.DEPTH_RATIO)))}}Kn.DEPTH_RATIO=.6,Kn.defaults=Te(Re.defaults,{visible:!1,length:25,ratio:Kn.DEPTH_RATIO});class Qn extends Zi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new Zn(this.chart)).init(),t.depth=(this._depth=new Kn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?U(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new qn(t)}_createPoint(t){return new Wn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Un(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=T+B*x(this._op.startAngle%360,0),this._totalRad=B*m(0,f(360,x(this._op.totalAngle,360))),this._groupPos=NaN}}Qn.type="pie",Qn.defaults=Te(Zi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Jn extends er{getPolarSize(t,e){return U(this._polarDim,f(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=Y(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Y(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof Qn}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+x(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=x(t.options.groupSize,1)/e}))}}Jn.type="piegroup",Jn.seriesType="pie",Jn.defaults=Te(er.defaults,{polarSize:"80%",innerSize:0});class to extends gi{}class eo extends rr{_createPoint(t){return new to(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}_createLegendMarker(t,e){return new Hr(t)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),f(e/2,this._op.radius)),s}}eo.type="scatter",eo.defaults=Te(rr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class so extends gi{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class io extends Ei{}io.defaults=Te(Ei.defaults,{offset:0});class ro extends Ji{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new io(t)}_createPoint(t){return new so(t)}_createLegendMarker(t,e){return Gs.create(t,Ii.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}ro.type="waterfall",ro.defaults=Te(Ji.defaults,{tooltipDetail:"<b>${y}</b>"});class no extends wr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],_=m(1,c(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=h/_),i=isNaN(s)?this._normalizeMin(i,t):s-d((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let f=i,m=a(f);for(l.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>l[l.length-1]&&(m<r&&(1==l.length&&m-l[l.length-1]<t||l.length>1&&m-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(m))}else{i=o(i);const t=(r=o(r))-i;let e=t/(_-1);const s=o(c(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/_);const h=1e-10*e;let d=c(i/e)*e;for(d<i&&(d+=e),l.push(n(d));d<=r+h;)d+=e,d>0&&l.push(n(d))}return l}}no.defaults=Te(wr.defaults,{arrangeDecimals:!0});class oo extends Ar{_isLog(){return!0}_createLabel(){return new Sr(this)}_createTickModel(){return new no(this)}_doApply(t){super._doApply(t);const e=this._logBase=m(2,x(t.logBase,10));this._roundThreshold=x(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=c(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,D(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=f(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:x(e*=a,1),min:o*a}}_doApplyBreak(t){t&&t.from>0&&t.to>0&&(t.from=this._log(t.from),t.to=this._log(t.to)),super._doApplyBreak(t)}}oo.type="log",oo.defaults=Te(Ar.defaults,{logBase:10,roundThrrehold:500});class ao extends Re{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}ao.defaults=Te(Re.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class ho extends De{load(t){const e=this.chart,s=this._items=[];i(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new ao(t);return s.init(),s._load(e),s}}const lo="$ctrl";class _o extends Re{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}_o.defaults=Te(Re.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class co extends Re{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==w(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}co.defaults=Te(Re.defaults,{scope:"auto"});class uo extends Re{_doInit(t){t.pointHovering=(this._pointHovering=new co(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var po;uo.defaults=Te(Re.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(po||(po={}));class go extends ct{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new pt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Me,(this._chartOptions=new uo(this)).init(),(this._title=new cr(this)).init(),(this._subtitle=new dr(this)).init(),(this._legend=new $s(this)).init(),(this._credits=new _o(this)).init(),(this._tooltip=new ur(this)).init(),this._buttons=new ho(this),go.split_class&&(this._split=new go.split_class(this)).init(),(this._body=new Os(this)).init(),(this._navigator=new _r(this)).init(),(this._exporter=new Rs(this)).init(),this._series=new zi(this),this._xAxes=new _s(this,!0),this._yAxes=new _s(this,!1),this._gauges=new ys(this),this._annotations=new Ge(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},go.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[lo]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new go(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return er.collectTooltipText(this.axis.options,this.series,t,e,s)}getTooltipParam(t,e,s){return er.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof ps?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case po.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.RIGHT:r=s.filter((t=>t._isOpposite));break;case po.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case po.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.RIGHT:r=i.filter((t=>t._isOpposite));break;case po.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case po.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in go.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Oe(n={},r.base),s(r[i])&&(n||(n={}),Oe(n,r[i])),n?Oe(n,t):t}_load(t){var e,i;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(w(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(w(t.chart,t.options)),s(t.chart)?this._credits._load(t.chart.credits):s(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(w(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(w(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(i=this._split)||void 0===i||i._load(t.split),this._annotations.load(w(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Re||s instanceof De||s instanceof Me)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t,e);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Fi;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=_({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return Oe(Oe({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?Oe(Oe({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Li[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Ci[t.toLowerCase()]}_getAxisType(t){return n(t)&&We[t.toLowerCase()]}_getGaugeType(t){return n(t)&&ds[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&us[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ze[t.toLowerCase()]}getAxesGap(){return x(this._chartOptions.options.axisGap,0)}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}go.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},ls.register(vi,kr,oo,Br),Ii.register(en,nn,Rr,Fr,ln,cn,bn,Sn,Pn,Ln,Mn,En,Rn,Fn,Qr,Jr,Hn,jn,Yn,Qn,eo,ro),er.register(an,zr,wn,An,on,Jn),er.registerSeries(an,zr,An,on,Jn),He.register(mr,yr,xr);class fo{constructor(t,e){this._modelCallback=e,this._obj=new go(t,this),this._loaded=s(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[lo]=null===(t=this[lo])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get assets(){return this._obj._assets}get chartOptions(){return this._obj.chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart";ht.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new go(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",Ee),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[lo].refresh()}}class mo{constructor(t,e){this._obj=new ut(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class yo extends _t{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){var t;null===(t=this._orphans)||void 0===t||t.clear(),this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}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()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}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){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}const xo=Object.freeze({x:0,y:0,width:0,height:0}),bo=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function wo(t){return{width:t.width,height:t.height}}function vo(t){return t.width<=0||t.height<=0}const So=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},Vo=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},Po=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},Ao=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ko=function(t,e){const s=So(t),i=So(e),r=Vo(s),n=Vo(i);for(const t of[...r,...n]){const e=Po(s,t),r=Po(i,t);if(!Ao(e,r))return!1}return!0},Co=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class Lo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Lo(t,t,t,t):new Lo(t,t,e,e):new Lo(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 Lo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=x(t.paddingLeft,0),this.right=x(t.paddingRight,0),this.top=x(t.paddingTop,0),this.bottom=x(t.paddingBottom,0),this}applyMargin(t){return this.left=x(t.marginLeft,0),this.right=x(t.marginRight,0),this.top=x(t.marginTop,0),this.bottom=x(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}}}Lo.Empty=Object.freeze(new Lo),Lo.Temp=new Lo;class No extends te{constructor(t,e=N){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return No.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}No.IGNORE_ATTRS={width:"",height:""};class Mo extends te{constructor(t,e=N){super(t,e,"g"),te.DEBUGGING&&(this.add(this._debugRect=new Gs(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),te.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Gs(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()}}class Eo extends Mo{constructor(t,e,s){super(t,e),this._margins=new Lo,this._paddings=new Lo,this.add(this._background=new Gs(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class To extends No{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 Bo extends Mo{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class Oo extends te{constructor(t,e,s){super(t,s,"image"),this._bounds=xo,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},this.onerrorProxy=()=>{},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.onerrorProxy(),this.invalidate()},window.SVGGraphicsElement&&!at||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)},this._proxy.onerror=()=>{this.onerrorProxy(),this.invalidate()})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return t||(t=NaN),e||(e=NaN),i&&(H(t)||H(e))&&(t>0&&H(e)?e=t/i.width*i.height:e>0&&H(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class Ro extends No{constructor(t,e=N){super(t),this.add(this._text=new pe(t,e)),this._text.anchor=ce.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Gs(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new pe(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s&&s!==this._failedIconUrl?(this._icon||this.add(this._icon=new Oo(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight),this._icon.onerrorProxy=()=>{var t,e;this._failedIconUrl=null===(t=this._icon)||void 0===t?void 0:t.url,null===(e=this._icon)||void 0===e||e.remove(),this._icon=null,this._box=void 0,this.invalidate()}):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=$t.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,s=this._outline,i=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,_=0,c=0,d=0,u=0;if(this._box=void 0,i){const t=i.getBBox();switch(r=x(this._model.options.iconGap,0),_=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":h+=r+_,l=Math.max(c,a);break;default:l+=r+c,h=Math.max(_,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(i)switch(this._model.getIconPos()){case"left":i.trans(d,(l-c)/2),d+=_+r,h-=_+r;break;case"right":i.trans(d+h-_,(l-c)/2),h-=_+r;break;case"top":i.trans((h-_)/2,u),u+=c+r;break;case"bottom":i.trans((h-_)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=ce.MIDDLE;break;case"right":d+=h,e.anchor=ce.END;break;default:e.anchor=ce.START}return e.trans(d,u),s&&(s.anchor=e.anchor,s.setAttr("y",e.getAttr("y")),s.trans(e.tx,e.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new pe(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class Do extends Eo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new pe(t)),this._richText=new Se}rotatedWidth(){const t=this.model.getRotation()*B,e=this.getBBox();return y(p(t)*e.height)+y(u(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*B,e=this.getBBox();return y(u(t)*e.height)+y(p(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=wo(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===rt||s===nt;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=ce.START,i||(n-=this.width/2);break;case"right":e.anchor=ce.END,i?r+=this.height:n+=this.width/2;break;default:e.anchor=ce.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}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}}class $o extends Eo{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new pe(t)),this._textView.anchor=ce.START,this._richText=new Se}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),wo(this._textView.getBBox())}_doLayout(t){const e=this._textView;let s=this._margins.top+this._paddings.top,i=0;switch(this.textAlign()){case"left":e.anchor=ce.START,i-=this.width/2;break;case"right":e.anchor=ce.END,i+=this.width/2}e.trans(i,s)}}class Fo extends Mo{constructor(t){super(t,jo.TICK_CLASS),this.add(this._lineView=new Xr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Io extends Ro{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){i?(t.prepareRich(i),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(s)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),this._text.text="")}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*B,e=this.getBBox();return y(p(t)*e.height)+y(u(t)*e.width)}rotatedHeight(){const t=this.rotation*B,e=this.getBBox();return y(u(t)*e.height)+y(p(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class zo extends te{constructor(t){super(t,void 0),this.add(this._back=new oe(t,"rct-crosshair-flag")),this.add(this._text=new pe(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Kt,n=m(x(s.minWidth,0),i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.options.textStyles)}}class Ho extends Mo{static isThumb(t){return t.classList.contains(Ho.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Gs(t,Ho.TRACK_CLASS)),this.add(this._thumbView=new Gs(t,Ho.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=m(0,e),this._page=f(s,e),this._pos=f(t.min+e-s,m(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=m(0,f(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=x(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}Ho.CLASS_NAME="rct-axis-scrollbar",Ho.TRACK_CLASS="rct-axis-scrollbar-track",Ho.THUMB_CLASS="rct-axis-scrollbar-thumb";const Go=/\${label}.*?/g;class jo extends Mo{constructor(t){super(t,jo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Xr(t,jo.LINE_CLASS)),this.add(this._titleView=new Do(t)),this.add(this._markContainer=new te(t,"rct-axis-ticks")),this.add(this._labelContainer=new te(t,"rct-axis-labels")),this.add(this._unitView=new $o(t)),this._labelViews=new yo(this._labelContainer,Io,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Ho(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new zo(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?f(0,this.width-n.width):m(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.options.animatable&&s.checkExtents(t,e)}}this._prevModel=s}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Xr(t,jo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&ht.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.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 Fo(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),o=e.label,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(Go)?t.setLabel(s,a,e,n.replace(Go,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,o,a){const h=t.label,l=m(0,f(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,d=(i=m(1,i))*(r=f(m(1,r),_.length)),p=n||0,g=y(p)*B,x=g<35*B;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=d){let i=0;for(let e=r;e<r+d&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(x&&b.getBBox().width*u(g)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=m(0,f(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*B))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=m(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=m(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=m(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=m(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=m(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=m(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof Ar)return this._prevWidth;const r=t.label;let n=m(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=m(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,u=t.get(0).rotation,g=u*B,f=+h.label.options.rows|0,m=u<-15&&u>=-90||u>15&&u<=90,y=t.count,b=x(h._prevRate,1);let w,v,S;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),S=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],u<-15&&u>=-90?s?r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):r?(v-=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):u>15&&u<=90?s?r?(v+=w.width,S-=p(g)*w.height/2,t.setRotation(w.width,w.height/2,-u)):(v-=w.width,S+=p(g)*w.height/2,t.setRotation(w.width,w.height/2,u)):r?(S+=p(g)*w.height/2,t.setRotation(0,w.height/2,-u)):(S-=p(g)*w.height/2,t.setRotation(0,w.height/2,u)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-u:u)),t.trans(v,S))})),!m&&f<2&&y>1){let e=t.get(_?y-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?y-2:1)),e=t.get(_?0:y-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:y-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof vi&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,f=this._labelSize,m=l.tick._getGap();const y=this._reversed,b=y?x(l._prevRate,1):1;let w=y?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{var c;const x=e[t.index];if(t.setVis(!!x)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(f-e)/2-f-m-a;case"left":return-f-m-a;default:return-e-m-a}else switch(t){case"right":return n+a+m+f-e;case"center":return!p.visible&&i?(n-e)/2:n+a+m+(f-e)/2;default:return n+a+m}else if(r)switch(t){case"center":return a+(n-g-e-a+m)/2;case"right":return n-e-g+m;default:return a}else switch(t){case"left":return g-m;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-m)/2;default:return n-a-e}}(u,e.width),v=o*b-l.prev(x.pos)-e.height/2;if(t.trans(h,v),_){const s=(l._len-l._minPad-l._maxPad)/(null!==(c=l._weights.get(x.value))&&void 0!==c?c:1),h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,m,s,_,g)}else!y&&t.ty+e.height>w+1||y&&t.ty<w-1?t.setVis(!1):w=y?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}jo.AXIS_CLASS="rct-axis",jo.LINE_CLASS="rct-axis-line",jo.TICK_CLASS="rct-axis-tick";class Xo extends te{constructor(t,e,s){super(t,Xo.STYLE),this.add(this._back=new Gs(t,Xo.BACK_STYLE)),this.add(this._textView=new pe(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 Lo).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom,rx:x(parseFloat(e.rx),0),ry:x(parseFloat(e.ry),0)},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}Xo.STYLE="rct-button",Xo.BACK_STYLE="rct-button-background";class Yo extends te{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Wo extends oe{setArc(t,e,s,i,r,n){this.setPath(Hs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Uo extends Wo{setPolyline(t){this.setPath(Hs.polygon(...t))}}const Zo={};class qo extends Eo{static register(...t){t.forEach((t=>{Zo[t[0].type]=t[1]}))}constructor(t,e){super(t,qo.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new te(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}qo.CLASS_NAME="rct-annotation";const Ko={};class Qo extends Bo{static register(...t){t.forEach((t=>{Ko[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Gs(t,Qo.PANE_CLASS)),this.add(this._contentContainer=new se(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Qo.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=_(Ft.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof ia)return t;t=t.parent}}}Qo.GAUGE_CLASS="rct-gauge",Qo.PANE_CLASS="rct-gauge-pane";class Jo extends Wt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class ta extends Qo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return a(i)?bt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new Jo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class ea extends Ro{}class sa extends Mo{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new se(t,"rct-gauge-scale-ticks")),this._ticks=new yo(this._tickContainer,Xr),this.add(this._labelContainer=new se(t,"rct-gauge-scale-tick-labels")),this._labels=new yo(this._labelContainer,ea)}}class ia extends Qo{_defaultCalss(){return ia.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new se(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}ia.GAUGE_GROUP_CLASS="rct-gauge-group";class ra{static reveal(t,e){new aa(t,e)}static grow(t,e){new la(t,e)}static spread(t,e){new _a(t,e)}static fadeIn(t){new na(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);ht.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class na extends ra{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:Wt.DURATION,fill:"none"})}}class oa extends ra{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=oa.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Wt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class aa extends Wt{constructor(t,e){super(),this._series=t,this._cr=oa.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof te}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class ha extends Wt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof te}_stop(t){super._stop(t),this._series=null}}class la extends ha{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class _a extends ha{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ca extends Ro{constructor(t){super(t,"rct-series-trendline-label")}}class da extends se{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new oe(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new oe(t,"rct-series-trendline-variable")),this.add(this._line=new oe(t)),this.add(this._label=new ca(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new oe(t,"rct-series-trendline-marker")),this.add(this._endMarker=new oe(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*u(s),y:e.cy+i*p(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new Kt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new Kt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new Kt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=Hs.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),f=h.getOffsetY(p)+("center"===u?l:0),m=Math.floor((n.length-1)*c),y=(n.length-1)*c-m;let x,b;if(m>=n.length-1)x=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[m],e=n[m+1];x=t.x+(e.x-t.x)*y,b=t.y+(e.y-t.y)*y}const w=_.getBBox();switch(u){case"left":x-=w.width+g;break;case"center":x-=w.width/2+g;break;case"right":x+=g}switch(p){case"top":b-=w.height+f;break;case"middle":b-=w.height/2+f;break;case"bottom":b+=f}t||(x<0&&(x=0),b<0&&(b=0),x+w.width>o&&(x=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(x,b)}}class ua extends Wt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Va.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(Va.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class pa extends Ro{constructor(t){super(t,"rct-point-label")}}class ga extends se{constructor(t){super(t,"rct-point-labels"),this._labels=[new yo(this,pa),new yo(this,pa)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=m(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,n.getIconUrl(i.icon),r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.stopAni().setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(Co(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Ks)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ko(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ko(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(ko(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ko(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===Qs&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class fa extends No{constructor(t){super(t),this.add(this._line=new oe(t))}setLine(t){this._line.setPath(t)}}class ma extends No{constructor(t){super(t,"rct-point-label-lines"),this._lines=new yo(this,fa)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class ya extends se{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}class xa extends Ro{constructor(t){super(t,"rct-stack-label")}}class ba extends se{constructor(t){super(t,"rct-stack-labels"),this._labels=new yo(this,xa),this.ignorePointer()}prepare(t){return this._labels.prepare(t),this._labels}get(t){return this._labels.get(t)}forEach(t){this._labels.forEach(t)}}const wa={},va="rct-point-hover",Sa="rct-point-unhover";class Va extends Bo{static register(...t){t.forEach((t=>{wa[t[0].type]=t[1]}))}static isPointDom(t){for(;Ft.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new ya(t,"rct-series-points")),this._labelContainer=new ga(t),this._stackLabelContainer=new ba(t)}depthEnabled(){return!1}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1),this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}_getPointColors(){return"a"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===it,this.setData("index",e._seriesIndex%Fi),this.setData("pointcolors",this._colorByPoint?this._getPointColors():N),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(va).addClass(Sa)}))):this._getPointPool().forEach((t=>{t.containsClass(Sa)&&t.removeClass(Sa).addClass(va)}))}_clearHoverClasses(t){t instanceof te&&t.removeClass(va).removeClass(Sa)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof te&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.cancel(),e.setBoolData(Va.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Oa&&r.push(new ua(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(t&&!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.cancel(),t instanceof te&&(t.setBoolData(Va.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Oa?r.push(new ua(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof $a&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&Yt(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Hi&&e.trendline.visible?(this._trendView||this.add(this._trendView=new da(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this.$_labelAnimating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){this._layoutStackLabel()}_layoutStackLabel(){const t=this.model,e=t._group;if(!e||!e._stacked)return void this._hideStackLabel();if(!e.isLastVisible(t))return void this._hideStackLabel();const s=e.stackLabel;if(!s||!s.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const i=e._stackTotals,r=e._stackPoints;i&&0!==i.size&&r&&0!==r.size?this._doLayoutStackLabel(s,i,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,s){var i;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),_=t.getOffset(),c=t.options.align,d=this._labelContainer,g=d&&d.visible,f=o._body.getPolar(h),m=this._inverted,b=this.width,w=this.height,v=a.options.reversed;this._stackLabelContainer.setVis(!0),this._stackLabelContainer.setStyleOrClass(t._style);let S=0;for(const t of e.values())0!==t.positiveTotal&&S++,0!==t.negativeTotal&&S++;const V=this._stackLabelContainer.prepare(S);let P=0;const A=f?h.getTotalAngle():0,k=m?b:w,C=m?w:b,L=m?0:w;for(const[n,b]of e.entries()){const e=[];0!==b.positiveTotal&&e.push([b.positiveTotal,!1]),0!==b.negativeTotal&&e.push([b.negativeTotal,!0]);for(const[w,S]of e){const e=V.get(P++),N=t.getCallbackArgs(o,b.x,b.positiveTotal,b.negativeTotal);if(e.setVis(t.isStackLabelVisible(N))){const o=t.getStackLabelText(N,w),b=t.getStackLabelStyle(N);e.xValue=n,e.setModel(r,t,null,b),e.setText(o),e.layout(c);const V=m?0:t.getRotation(),{width:P,height:M}=e.getBBox(),E=V*B,T=0!==V?M*y(u(E))+P*y(p(E)):M,O=0!==V?P*y(u(E))+M*y(p(E)):P;let R,D;const $=s.get(n),F=$&&null!==(i=$.find((t=>t.yGroup===w)))&&void 0!==i?i:null;if(f){const t=x(null==F?void 0:F.xPos,f.cx+f.rd*u(f.start+h.getPos(A,n))),s=x(null==F?void 0:F.yPos,f.cy+f.rd*p(f.start+h.getPos(A,n))),i=Math.atan2(s-f.cy,t-f.cx),r=a.getPos(f.rd,w)+(S!==v?-1:1)*(M/2+l);let o=0;"left"===c?o=-(P/2+_):"right"===c&&(o=P/2+_),R=f.cx+r*u(i)+-p(i)*o,D=f.cy+r*p(i)+u(i)*o,e.trans(R-P/2,D-M/2),0!==V&&e.setRotation(P/2,M/2,V)}else{const s=a.getPos(k,w),i=g&&F?d.get(F,0):null,r=i&&i.visible?i.getBBoxEx():null,o=$?$[$.length-1]:null,u=o?this.getPointView(o):null,p=(null==u?void 0:u.wPoint)||0;if(m){const i=S!==v?-1:1;if(R=L+s+i*(l+O/2)-P/2,r)if(i>0){const t=R+P/2-O/2,e=r.x+r.width-t;e>0&&(R+=e)}else{const t=R+P/2+O/2-r.x;t>0&&(R-=t)}const o=x(null==F?void 0:F.yPos,C-h.getPos(C,n)),a=v?"left"===c?"right":"right"===c?"left":c:c;D="left"===a?o-p/2-T/2-M/2-_:"right"===a?o+p/2+T/2-M/2+_:o-M/2+_,D+=M*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,R,P,k);if(null===d){e.setVis(!1);continue}R=d}else{const i=S!==v?1:-1;if(D=L-s+i*(l+T/2)-M/2,r)if(i<0){const t=D+M/2+T/2-r.y;t>0&&(D-=t)}else{const t=D+M/2-T/2,e=r.y+r.height-t;e>0&&(D+=e)}const o=x(null==F?void 0:F.xPos,h.getPos(C,n));R="left"===c?o-p/2-O/2-P/2-_:"right"===c?o+p/2+O/2-P/2+_:o-P/2+_;const a=this._applyOverflowFit(t._overflowFit,D,M,k);if(null===a){e.setVis(!1);continue}D=a}e.trans(R,D),0!==V&&e.setRotation(P/2,M/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Fi):e.index%Fi;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return x(this._growRate,1)}_getPosRate(){return x(this._posRate,1)}$_labelAnimating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||this._animations.length>0}_animating(){return this.$_labelAnimating()||!isNaN(this._prevRate)}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Hi&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const s=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===s?o-=e.wPoint/2+c.height-c.height*t._vertAdjust+p:"right"===s?o+=e.wPoint/2+c.height*t._vertAdjust+p:o-=c.height/2-c.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+c.width+p:"right"===u?n+=e.wPoint/2+p:n-=c.width/2;const g=n,f=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_applyOverflowFit(t,e,s,i){if(isFinite(t)||t===1/0){if(e+s>=i)return t===1/0?null:i+t-s;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const i=_.fit;if(isFinite(i)||i===1/0){const h=_.inverted?o:a,l=_.inverted?e.width:e.height,d=_.inverted?_.width:_.height,u=_.inverted?r:n,p=h+l>=d,g=this._applyOverflowFit(i,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(c=p?g<s+u:g+l>s-u,_.inverted?o=g:a=g),c&&_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,m(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,f(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,y(_-l),e):r.setBounds(l,-e,y(_-l),e):r.setBounds(0,-m(l,_),t,y(_-l)):o?h?r.setBounds(_,0,y(_-l),e):r.setBounds(l,0,y(_-l),e):r.setBounds(0,e-m(l,_),t,y(_-l))}_setFill(t,e){s(e)&&e[Z]?t.internalSetStyle(Z,e[Z]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=x(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==Ws)if(l?c!==Ys&&c!==Xs||(d*=-1):c===Xs&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}Va.POINT_CLASS="rct-point",Va.DATA_FOCUS="focus",Va.DATA_UNFOCUS="unfocus",Va.DATA_UNHOVER="unhover",Va.LEGEND_MARKER="rct-legend-item-marker";class Pa extends oe{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Aa extends Pa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class ka extends te{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Ca extends ka{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let La=class extends Aa{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(Hs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class Na extends Ca{constructor(t){super(t),this.add(this._topView=new oe(t)),this.add(this._frontView=new oe(t)),this.add(this._sideView=new oe(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(at&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Hs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Hs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",$t.interpolate(o?$t.BLACK:$t.WHITE,l,.2)),this._sideView.setPath(Hs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",$t.interpolate(o?$t.WHITE:$t.BLACK,l,.2))}}class Ma extends No{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Ea extends Va{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&ra.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class Ta extends Ea{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new ma(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*B,this._base=u(this._depthAngle)*e.depth,this._side=p(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,h=this._labelViews(),l=this._labelLineContainer,c=i._xAxisObj,d=i._yAxisObj,g=this._yReversed,f=this._depthExt,y=i._group?i._groupDistance:i.distance,b=f?y*(r?p(this._depthAngle):u(this._depthAngle)):0,w=f?y*(r?u(this._depthAngle):p(this._depthAngle)):0,v=2*c.unitPad(),S=x(i.options.minPointWidth,0),V=this._yLen=r?t:e,P=r?e:t,A=t=>d.getPos(V,t),k=t=>c.getPos(P,t),C=r?0:e,L=d.valueMin(),N=A(L),M=this._baseVal=i.getBaseValue(d),E=!isNaN(M),T=this._yBase=x(A(m(L,x(M,N))),N),B=this._pointOff,O=h&&_(this._labelInfo,{inverted:r,reversed:g,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:w,side:this._side,base:this._base});h&&l.setVis(i.pointLabel.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(i.pointLabel.line._style),l.prepare(i),O.pb=new Kt),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach((t=>{this._shrinkPoint(t)})),this._getPointPool().forEach(((s,l)=>{const _=s.point;if(s.setVis(!_.isNull)){const d=c.getUnitLen(P,_.xValue)*(1-v);let u=i.getPointWidth(d,S),p=A(_.yGroup),g=T;if(_.yGroup!=_.yValue){const t=M>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);g=A(r)}const f=(p-g)*n;let m=k(_.xValue)-d/2,y=C-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),m+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(m=s.xSave+(m-s.xSave)*o),_.xPos=m+=u*B,_.yPos=y,this._layoutPoint(s,l,m-b,C-T*(1-n)-g*n+w,u,f),r&&(y=P-k(_.xValue)+d/2,m=C,_.yPos=y-=i.getPointPos(d)+u/2+u*B,_.xPos=m+=E?A(_.yGroup)*n:A(_.yGroup*n)),O&&(O.labelView=h.get(_,0))&&(O.pointView=s,O.x=m,O.y=y,O.wPoint=u,O.hPoint=f,this._layoutLabel(a,O,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class Ba extends Ea{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._pointOff=+e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),d=x(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,f=this._pointOff,m=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((_,y)=>{const x=_.point;if(_.setVis(!x.isNull)){const b=h.getUnitLen(p,x.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(l.getPos(u,this._getHighValue(x))-l.getPos(u,this._getLowValue(x)))*r;let S=h.getPos(p,x.xValue)-b/2,V=g-l.getPos(u,this._getHighValue(x))*r;isNaN(n+_.wSave)||(w=_.wSave+(w-_.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+_.xSave)||(S=_.xSave+(S-_.xSave)*n),x.xPos=S+=w*f,x.yPos=V,this._layoutPoint(_,y,S,V,w,v),i&&(V=p-h.getPos(p,x.xValue)+b/2,S=g,x.yPos=V-=s.getPointPos(b)+w/2+w*f,x.xPos=S+=l.getPos(u,this._getHighValue(x))*r),a&&(m.pointView=_,m.hPoint=v,m.x=S,m.y=V,(m.labelView=a.get(x,0))&&(m.hPoint=v,this._layoutLabel(o,m,t,e)),(m.labelView=a.get(x,1))&&(i?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}}))}}class Oa extends Pa{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class Ra extends Va{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==Ws){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class Da extends Wt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class $a extends Va{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}clipInvertable(){return!1}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(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.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Da(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Gs.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s.legendMarker()||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Fa extends qo{constructor(t){super(t,Fa.CLASS_NAME),this.addToTransform(this._imageView=new Oo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),wo(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}Fa.CLASS_NAME="rct-image-annotation";class Ia extends qo{constructor(t){super(t,Ia.CLASS_NAME),this.addToTransform(this._shapeView=new oe(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case gr:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Hs.line(g,p,g+l.width,p));break;case pr:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Hs.line(g,p,g,p+l.height));break;case fr:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(Hs.line(g,p,t,s));break;default:Hs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ia.CLASS_NAME="rct-shape-annotation";class za extends qo{constructor(t){super(t,za.CLASS_NAME),this.addToTransform(this._textView=new pe(t)),this._textView.anchor=ce.START,this._richText=new Se}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=wo(this._textView.getBBox());return{width:x(o.width,h.width),height:x(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}za.CLASS_NAME="rct-text-annotation";class Ha extends yo{freeOrphans(){const t=this.getOrphans();return t&&t.forEach((t=>{t.point._vr>=1&&this.freeOrphan(t.point)})),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach((t=>{let s=e.get(t);s||(s=this.find((e=>e.point===t)),s&&this.addOrphan(t,s))}))}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class Ga extends Oa{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Hs.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),Hs.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((i-e)**2+(r-s)**2)-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull||!this.visible?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class ja extends ya{}class Xa extends Va{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new ja(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new oe(t,"rct-line-series-line")),this._markers=new Ha(this._pointContainer,Ga),this.add(this._tester=new oe(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof Qr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar),super._doAfterLayout()}_runShowEffect(t){this._polar?t&&ra.grow(this):t&&ra.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines(this._polar)}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new oe(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new yo(this._lineContainer,oe)),i.prepare(e.length);s.length<e.length;){const t=new ne(this.doc);this.control.addClip(t),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar;if(null==o||null==a)return;const l=D(m(0,f((E-y(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Hs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Hs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Hs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Hs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Hs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Hs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Hs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Hs.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof Qr&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.options.belowStyle,a=e.length;this._markers.prepare(a*s,((s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1}))}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),Hs.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,d=r.options.maxVisible,g=r.options.minVisible,y=i.pointLabel,x=y.options.align,b=y.getAlignOffset(),w=y.getOffset(),v=y.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),P=i._xAxisObj,A=i._yAxisObj,k=this._polar=i.chart._body.getPolar(P),C=!!k,{cx:L,cy:N,rd:M,start:E,total:T}=k||{},B=o?e:s,O=k?T:o?s:e,R=o?0:s,D=t.length,$=A.axisMax(),F=this._yReversed,I=A instanceof kr?i.getBaseValue(A):NaN,z=I>A.axisMin(),H=z?A.getPos(M,I):0;this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,y)=>{let G,j,X,Y;k?(X=E+P.getPos(O,t.xValue),k.min=null==k.min?X:f(k.min,X),k.max=null==k.max?X:m(k.max,X),Y=F?isNaN(t.yGroup)?z?H:M:z?H+(A.getPos(M,t.yGroup)-H)*h:M-A.getPos(M,$-t.yGroup)*h:isNaN(t.yGroup)?z?H:0:z?H+(A.getPos(M,t.yGroup)-H)*h:A.getPos(M,t.yGroup)*h,G=t.px=L+Y*u(X),j=t.py=N+Y*p(X),t.angle=X):(G=t.px=P.getPos(O,t.xValue),j=t.py=R-A.getPos(B,t.yGroup),o&&(G=A.getPos(B,t.yGroup),j=s-P.getPos(O,t.xValue))),t.xPos=G,t.yPos=j;const W=G,U=j,Z=this._markers.get(y),q=V&&V.get(t,0);if(Z&&Z.setVis(!t.isNull&&(C||!a||G>=0&&G<=e&&j>=0&&j<=s))){this._prepareMakrer(Z),this._layoutMarker(Z,n,G,j);const e=r.getMarkerStyle(t);e&&Z.internalSetStyleOrClass(e),i._maxY,t.yGroup,i._minY,t.yGroup;const s=0==y&&null!=_?_:y==D-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=g?g:l;if(Z.setStyle("opacity",s?"1":"0"),q){q.setContrast(null).layout(S);const e=q.getBBox(),s=Z._radius;if(q.visible=!0,k){switch(v){case"inside":F?t.yValue<I?Y-=w:Y+=w:t.yValue<I?Y+=w:Y-=w;break;case"foot":F?t.yValue<I?Y-=e.height/2+w:Y+=e.height/2+w:t.yValue<I?Y+=e.height/2+w:Y-=e.height/2+w;break;default:F?t.yValue<I?Y+=e.height/2+w:Y-=e.height/2+w:t.yValue<I?Y-=e.height/2+w:Y+=e.height/2+w}G=L+Y*u(X),j=N+Y*p(X)-e.height/2,this.applyAutoRotation(q,X,T,P.options.totalAngle)}else switch(v){case"inside":j-=e.height/2+w;break;case"foot":j+=w+(l?s:0);break;default:j-=e.height+w+(l?s:0)}switch(x){case"left":G-=e.width+(l?s:0)+b;break;case"right":G+=(l?s:0)+b;break;default:G-=e.width/2+b}this._checkLabelOverlap(q,e,W,U,s,s,G,j,!1,null),this._layoutLabelRotation(q,e,G,j)}}else q&&q.setVis(!1)}))}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach((t=>{t.visible&&t.shrink()}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0&&e._lines.some((t=>t.length>0))))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof Qr&&this._needBelow;let o=this._buildLines(t,e._lines);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Ft.setImportantStyle(t.dom.style,Z,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Ft.setImportantStyle(t.dom.style,Z,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,isNaN(l)?0:h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,isNaN(l)?0:h.getPos(s,l),!0):this.$_resetClips(s,i,isNaN(l)?i:i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),Ft.setImportantStyle(a.dom.style,Z,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Qr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new Kt;return"spline"===i?this._drawCurves(t,e,r):s instanceof Qr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Qr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof kr?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],d=c.length;let g,f;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*u(c[0].angle),f=r+_*p(c[0].angle),s.move(g,f),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*u(c[d-1].angle),f=r+_*p(c[d-1].angle),s.line(g,f))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new Kt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class Ya extends Xa{constructor(t){super(t,Ya.CLASS),this._flagView=new Ro(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.getIconUrl(),null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:d,height:u}=a,p=d/2,g=u/2,{width:f,height:m}=r,y=f/2,x=m/2,b=l>u+o,w=m>l+u+o,v=h>d+o,S=f>h+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const P=h>p&&f-h>p?h-p:h>y?f-d:0,A=l>g&&m>l+g?l-g:l>x?m-u:0;switch(_){case"top":h=P,l=b?l-u-o:0;break;case"bottom":h=P,l=w?l+o:m-u;break;case"left":h=v?h-d-o:0,l=A;break;case"right":h=S?h+o:f-d,l=A}i.trans(h,l)}}}Ya.CLASS="rct-line-series";class Wa extends Xa{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ja(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new oe(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new oe(t,"rct-areanrange-series-line")),Ft.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,d=this._labelViews(),g=this._labelContainer._textAlign,f=this._polar=i.chart._body.getPolar(h),m=i.pointLabel,y=m.options.position,x=m.options.align,b=m.getAlignOffset(),w=m.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let i=0,c=t.length;i<c;i++){const m=t[i],S=v.get(c+i),V=d&&d.get(m,1);let P,A,k;this._prepareMakrer(S),a?(P=m.px2=l.getPos(_,m.lowValue),A=m.py2=v.get(i).ty+S._radius):(P=m.px2=m.xPos,A=m.py2=m.yLow);const C=P,L=A;if(S&&S.setVis(!m.isNull&&P>=0&&P<=e&&A>=0&&A<=s)){this._layoutMarker(S,n,P,A);const t=r.getMarkerStyle(m);if(t&&S.internalSetStyleOrClass(t),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius;if(f){switch(y){case"inside":A-=w;break;case"foot":A-=t.height/2+w;break;default:A+=t.height+w}P=f.cx+A*u(k),A=f.cy+A*p(k)-t.height/2,this.applyAutoRotation(V,k,f.total,h.options.totalAngle)}else switch(y){case"inside":A-=t.height/2+w;break;case"foot":A+=w+(o?e:0);break;default:A-=t.height+w+(o?e:0)}switch(x){case"left":P-=t.width+(o?e:0)+b;break;case"right":P+=(o?e:0)+b;break;default:P-=t.width/2+b}this._checkLabelOverlap(V,t,C,L,e,e,P,A,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}class Ua extends Xa{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new ja(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new oe(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new oe(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new yo(this._areaContainer,oe,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<f(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new ne(s)));for(;i.length<e.length;)i.push(this.control.addClip(new ne(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Z,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(Z,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof kr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:g}=l,y=new Kt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(d,h):0,x=i.chart._body.options.circular;let w,v,S,V,P=!1,A=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),y);else{g?y.move(s[0].xPos,s[0].yPos):(w=_+l*u(s[0].angle),v=c+l*p(s[0].angle),y.move(w,v),y.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)y.line(s[t].xPos,s[t].yPos);g||(w=_+l*u(s[b-1].angle),v=c+l*p(s[b-1].angle),y.line(w,v))}const k=s.map((t=>t.angle)),C=this._polar.min=f(...k),L=this._polar.max=m(...k),N=(new Kt).push(y.end());if(r)g?y.circle(_,c,l):a&&y.push(...Hs.arc(_,c,l,l,C,L,!0)),S=y.end(),P=!0,g?N.circle(_,c,l):N.push(...Hs.arc(_,c,l,l,C,L,!0)),V=N.end(),A=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;y.push("Z"),g?x?y.circle(_,c,d):y.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+u(t+s.pos/d*e/E)*d,y:c+p(t+s.pos/d*e/E)*d})))):x?y.push(...Hs.sector(_,c,d,d,0,C,L,!0)):y.polygon({x:_,y:c},...s.map((s=>({x:_+u(t+s.pos/d*e/E)*d,y:c+p(t+s.pos/d*e/E)*d})),{x:_,y:c})),S=y.end(!0),P=!0}else S=y.end();t.setPath(S),t.setAttr("fill-rule",P?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",A?"evenodd":""))}else{y.move(x(s[0].xPos,_),x(s[0].yLow,c)),y.line(x(s[0].xPos,_),x(s[0].yPos,c));for(let t=1;t<s.length;t++)y.line(x(s[t].xPos,_),x(s[t].yPos,c));y.line(x(s[s.length-1].xPos,_),x(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)y.line(x(s[t].xPos,_),x(s[t].yLow,c));t.setPath(y.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),Ft.setImportantStyle(t.dom.style,q,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),Ft.setImportantStyle(e.dom.style,q,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new ae(this.doc)));const t=Hs.arc(_,c,d,d,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Za extends Ba{constructor(t){super(t,"rct-barrange-series"),this._bars=new Ha(this._pointContainer,La)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(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}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*x(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class qa extends dn{constructor(t){super(t,Va.POINT_CLASS)}savePrevs(){}}class Ka extends Ta{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),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 Ha(this._pointContainer,qa)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:d}=l,g=o instanceof kr?t.getBaseValue(o):NaN,m=g>o.axisMin(),y=o.getPos(d,g),x=this._pointOff,b=n.getTotalAngle();let w,v,S,V,P;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const A=s.point;if(s.setVis(!A.isNull)){const r=o.getPos(d,A.yGroup)*e,k=n.getUnitLen(b,A.xValue)*(1-h),C=t.getPointWidth(k,0);let L,N,M=l.start+n.getPos(b,A.xValue)-k/2;if(M+=C*x,M+=t.getPointPos(k)+C/2,a?m?(L=y+(o.getPos(d,A.yGroup)-y)*e,N=y):(L=d,N=o.getPos(d,A.yGroup*e)):m?(L=y+(o.getPos(d,A.yGroup)-y)*e,N=y):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-C/2,angle:C,clockwise:!0}),M=s.start+s.angle/2,A.xPos=_+s.rx*u(M),A.yPos=c+s.ry*p(M),i&&(P=w.labelView=i.get(A,0))){P.layout(V);const{width:t,height:e}=P.getBBox(),i=s.ry,r=s.innerRadius*d;let o,h;o=a?m?A.yValue<g?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i-e/2-S:"head"===v?f(y,i+e/2+S):"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?r-e/2-S:"head"===v?f(d,r+e/2+S):"foot"===v?d-e/2-S:d-(d-r)/2-S:m?A.yValue<g?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*p(M),o=_+o*u(M),"outside"!==v&&P.setContrast(s.dom),this.applyAutoRotation(P,M,l.total,n.options.totalAngle),P.trans(o-t/2,h-e/2)}}}))}}class Qa extends Ka{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Ha(t,Na):new Ha(t,La)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*x(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof La){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class Ja extends Ua{constructor(t){super(t,"rct-bellcurve-series")}}class th extends Ma{constructor(t){super(t,Va.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Xr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Xr(t,"rct-boxplot-point-stem")),this.add(this._box=new Gs(t,"rct-boxplot-point-box")),this.add(this._mid=new Xr(t,"rct-boxplot-point-mid")),this.add(this._min=new Xr(t,"rct-boxplot-point-min")),this.add(this._max=new Xr(t,"rct-boxplot-point-max"))}}class eh extends Ba{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Ha(this._pointContainer,th)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class sh extends Oa{}class ih extends Ra{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new se(t,"rct-bubble-pie"))}_createMarkers(t){return new Ha(t,sh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ra.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}pointByDom(t){const e=super.pointByDom(t);if(e)return this.model._hoveredSlice=null,e;if(this._sectorMap){let e=t;for(;e;){const t=this._sectorMap.get(e);if(t)return this.model._hoveredSlice=t.slice,t.pv;e=e.parentElement}}return this.model._hoveredSlice=null,null}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_preparePie(t,e,s){const i=e.pie,r=i&&i.visible&&i.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;s.forEach((t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)})),this._pieSectors||(this._pieSectors=new yo(this._pieContainer,dn,Va.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();i.getLegendSources().forEach((e=>{e.legendMarker()||e.setLegendMarker(Gs.create(t,Va.LEGEND_MARKER,0,0,r,r,r/2))}))}else this._pieSectors&&this._pieSectors.prepare(0),this._sectorMap=null}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=i.options,n=this._inverted,o=i.needClip(!1),a=this._getGrowRate(),h=+r.rotation||0,l=i.pointLabel,_=l.options.position,c=l.getOffset(),d=this._labelContainer._textAlign,g=this._labelViews(),f=i._xAxisObj,m=i._yAxisObj,y=this._polar=i.chart._body.getPolar(f),b=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:S,max:V}=i.getPixelMinMax(v),P=n?0:e,A=Hs.getDrawer(r.shape),k=i.pie,C=k&&k.visible&&k.fields.length>0;let L,N=0;null===(s=this._markers.getOrphans())||void 0===s||s.forEach((t=>{t.setPath(A(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))})),this._markers.forEach(((s,r)=>{var l,v;const M=s.point,E=g&&(L=g.get(M,0));if(s.setVis(!M.isNull&&!isNaN(M.zValue))){const r=s._radius=i.getRadius(M.zValue,S,V),g=r*a*x(M._vr,1);let v,T;if(y){const t=y.start+f.getPos(w,M.xValue),e=m.getPos(y.rd,M.yValue);v=y.cx+e*u(t),T=y.cy+e*p(t)}else v=f.getPos(w,M.xValue),T=P-m.getPos(b,M.yValue),n&&(v=m.getPos(b,M.yValue),T=e-f.getPos(w,M.xValue));M.xPos=v,M.yPos=T;const B=!o||v>=0&&v<=t&&T>=0&&T<=e;if(C&&M.pieSlices)if(s.setVis(!1),B)k.resolveSliceColors(M.pieSlices),N=this.$_renderPieSectors(M,M.pieSlices,N,v,T,g,k.getInnerRadius(g),k.clockwise);else for(let t=0;t<M.pieSlices.length;t++)null===(l=this._pieSectors.get(N++))||void 0===l||l.setVis(!1);else s.setVis(B)&&s.setPath(A(g)).trans(v,T).rotate(h);B&&E?(L.setContrast(C&&M.pieSlices?null:s.dom),L.layout(d),this._layoutLabelView(L,_,c,r,v,T)):E&&E.setVis(!1)}else{if(C&&M.pieSlices)for(let t=0;t<M.pieSlices.length;t++)null===(v=this._pieSectors.get(N++))||void 0===v||v.setVis(!1);E&&E.setVis(!1)}}))}$_renderPieSectors(t,e,s,i,r,n,o,a){let h=s;for(const s of e){const e=this._pieSectors.get(h++);if(e){const h={cx:i,cy:r,rx:n,ry:n,innerRadius:o,start:s.startAngle,angle:y(s.angle),clockwise:a};if(e.setSector(h),e.setFill(s.color),e.setVis(!0),this._sectorMap){const a=s.startAngle+s.angle/2,h=(n+o)/2,l=i+h*u(a),_=r+h*p(a),c={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:_}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:s,pv:c})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}let rh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),o=f(n,r),a=m(1,y(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,o,t,a),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Xr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Xr(t,"rct-candlestick-point-wick")),this.add(this._body=new Gs(t))}};class nh extends Ba{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Ha(this._pointContainer,rh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}class oh extends Pa{layout(t,e,s){const i=new Kt;i.circle(t,e,s),this.setPath(i.end())}}class ah extends Ka{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Ha(t,oh)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let hh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS),this.add(this._line=new Xr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new oe(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new oe(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),Hs.setShape(r,o.shape,a,a),Hs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class lh extends Ba{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Ha(this._pointContainer,hh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}let _h=class extends No{constructor(t){super(t,Va.POINT_CLASS),this._segments=new yo(this,oe),this._decimal=0,this.add(this._back=new oe(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setPath(Hs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Hs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Hs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class ch extends Ta{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Ha(this._pointContainer,_h)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),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.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}let dh=class extends Ma{constructor(t){super(t,Va.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Xr(t)),this.add(this._whiskerUp=new Xr(t)),this.add(this._whiskerDown=new Xr(t)),this.add(this._back=new Gs(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class uh extends Ba{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Ha(this._pointContainer,dh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class ph extends Pa{}class gh extends $a{constructor(t){super(t,"rct-funnel-series"),this._segments=new Ha(this._pointContainer,ph),this.add(this._lineContainer=new ma(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_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&&ra.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=D(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=D(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?x+(V-x)*(w-t)/(w-P):x+(V-x)*(t-b)/(P-b)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getWidgetAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),f=new Kt,m=i.getCenter(t,e),x=m.x-p.width/2,b=m.y-p.height/2,w=b+p.height,v=x+p.width/2,S=p.height-g.height,V=x+(p.width-g.width)/2,P=d?w-S:b+S,A=[],k=new Kt,C=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const m=n.yPos*p.height,x=(n.yPos+n.height)*p.height,M=d?w-m:b+m,E=d?w-x:b+x,T=x<S;let B,O,R,D;if(N=null==c?void 0:c.get(n),m>=S?(B=V,O=B+g.width,f.move(B,M).lines(O,M,O,E,B,E),i.ny=i.nx1=NaN):T?(B=s(M),O=B+2*(v-B),R=s(E),D=R+2*(v-R),f.move(B,M).lines(O,M,D,E,R,E),i.ny=NaN,i.nx1=R-B,i.nx2=D-B):(B=s(M),O=B+2*(v-B),R=V,D=R+g.width,f.move(B,M).lines(O,M,D,P,D,E,R,E,R,P),i.nx1=R-B,i.nx2=D-B,i.ny=y(P-M),i.nx3=R,i.nx4=D),i.setPath(f.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=T?(O-B+(D-R))/2:g.width;switch(!t&&L.layout(_||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,_,u,N,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,k,v,a,h);L.setContrast(o&&i.dom),A.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(A,c,E):(null==r?void 0:r.arrangeVertical(this,A,c,e,M,E,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,u,N,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,N,k,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let f=l;if(n?f-=h.width/2:f+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(f-g-c,e).end()):o.setLine(a.reset(0,0).line(f+c-g,e).end()),o.trans(g,p)}t||(n?f-=_+c+u.width:f+=c+_,i.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),f=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,s,h,n);let y;if(y=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(y-m-_,e).end()):o.setLine(a.reset(0,0).line(y+_-m,e).end()),o.trans(m,f)}t||(n?y-=l+_+g.width:y+=_+l,i.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let fh=class extends Aa{layout(t,e){this.setPath(Hs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class mh extends Ea{constructor(t){super(t,"rct-histogram-series"),this._bars=new Ha(this._pointContainer,fh)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,d=h.getPos(l,s.getBaseValue(h)),u=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,_)=>{const g=s.point,f=a.getPos(c,g.min),m=a.getPos(c,g.max),y=h.getPos(l,g.yValue),x=m-f+(m>f?-1:1),b=y-d;let w=f+(m-f)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(s,_,w,v+b,x,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(l,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=x,p.hPoint=b,this._layoutLabel(n,p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,o.point.yValue)*n,u=m(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class yh extends No{constructor(t){super(t,Va.POINT_CLASS),this.add(this._line=new Xr(t,"rct-lollipop-point-bar")),this.add(this._marker=new oe(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Hs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class xh extends Ta{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new Ha(this._pointContainer,yh)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}class bh extends Ma{constructor(t){super(t,Va.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,a=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_doInitChildren(t){this.add(this._tickOpen=new Xr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Xr(t,"rct-ohlc-point-tick")),this.add(this._bar=new Xr(t)),this.add(this._back=new Gs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class wh extends Ba{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Ha(this._pointContainer,bh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}class vh extends Xa{constructor(t){super(t,"rct-pareto-series")}}class Sh extends oe{setOff(t){return this.off=y(t),this}}class Vh extends dn{constructor(t){super(t,Va.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class Ph extends te{constructor(t){super(t,Va.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new dn(t))}setSides(t,e,s,i,r){const n=this.point,o=D(M),a=D(((t?n.startAngle:n.startAngle+n.angle)+M/2+E)%E),h=D(a+(t?n.angle:-n.angle)-1e-4+E)%E,l=o-(a+y(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=M/2&&!(h>=a&&h<M/2)||h>=3*M/2&&!(a<h&&a>3*M/2)?(this._outArcView=i.setOff(f(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*M/2&&h<=M/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=M/2&&h<=3*M/2?(this._outArcView=i.setOff(f(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=M&&this._outArcView.setOff(f(this._outArcView.off,this._side1View.off)),h>=M&&h<E&&this._outArcView.setOff(f(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Hs.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;at&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Hs.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Hs.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(Hs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Hs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Hs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Hs.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",$t.interpolate("#000",r,.2)),this._side2View.setStyle("fill",$t.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",$t.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",$t.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Va.DATA_FOCUS,t),this._side2View.setBoolData(Va.DATA_FOCUS,t),this._inArcView.setBoolData(Va.DATA_FOCUS,t),this._outArcView.setBoolData(Va.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class Ah extends $a{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new Kt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new Yo(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Ro(t,"rct-pie-series-inner")),this._textView._text.anchor=ce.MIDDLE,this._pointContainer.add(this._sideContainer=new se(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new ma(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,s.getIconUrl(),null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,o=r-n;this._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&ra.grow(this,(t=>{const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if((t instanceof Vh||t instanceof Ph)&&this.model.options.autoSlice){const e=this._sectors.count>1&&this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof Ph&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new Ha(this._pointContainer,Ph,null),n=this._sides=new yo(this._sideContainer,Sh,"rct-pie-series-side")):this._sectors=new Ha(this._pointContainer,Vh,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%E;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=D(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,_=this._rxInner,c=this._depth,d=this._ratio,g=this._sides,f=i.pointLabel,m=f.options,b=f.connector.options.curved,w=this._labelViews(),v="inside"===i.getLabelPos(f),S=x(m.radius,.7),V=this._pb,P=f.getDistance(v,l,_),A=f.getWidgetAlign();let k=null==w?void 0:w.textAlign();const C=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,L=this._slicedOff=i.getSliceOffset(l)*n,N=[],M=[],E=[],T=(null==w?void 0:w.getWidth(0))||0,B=this._sectors.count;let O,R;if(this._lineContainer.setStyleOrClass(f.connector.options.style),!w||k||A||(k="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=x(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const f=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(R=null==C?void 0:C.get(f),f.isNull)t.setVis(!1),w&&(O=w.get(f,0))&&O.setVis(!1),null==R||R.setVis(!1);else{const o=B>1&&f.sliced,g=f.startAngle,m=g+f.angle/2;let x=0,C=0;if(o&&n>=1&&!t.isDomAnimating()&&(x+=u(m)*L,C+=p(m)*L),t.trans(x,C).setVis(!0),f.xPos=a+u(m)*(L+l*S),f.yPos=h+p(m)*(L+l*S),t.render(w,null,{cx:a,cy:h,rx:l,ry:l*d,innerRadius:_,start:g,angle:y(f.angle),clockwise:r,depth:c}),w&&(O=w.get(f,0))){const r=i.getLabelOff2(f);let n;v?(null==R||R.setVis(!1),this.$_layoutLabelInside(f,O,k,r,P,o?L:0)):(n=-1===A?this.$_layoutLabelAligned(!1,f,O,k,R,V,b,r,P,o?L:0):1==A?this.$_layoutLabelEnded(!1,f,O,k,R,V,b,r,P,o?L:0,T,e,s):this.$_layoutLabelOutside(!1,f,O,k,R,V,b,r,P,o?L:0),n?N.push(O):M.push(O),this._layoutLabelRotation(O)),O.setContrast(v&&t.dom).setVis(!0),E.push(O)}else null==R||R.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.convergent,$=m.dedupeMode,F=m.overflow;w&&(v||0===A?"preserveOrder"!==$&&"largestFirst"!==$||w.dedupe(E,C,$):w.arrangeVertical(this,N,C,s,D,$,F)+w.arrangeVertical(this,M,C,s,D,$,F)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=B>1&&r.sliced,n=i.getLabelOff2(r);O=w.get(r,0),R=null==C?void 0:C.get(r),(null==O?void 0:O.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,O,k,R,V,b,n,P,t?L:0):1==A?this.$_layoutLabelEnded(!0,r,O,k,R,V,b,n,P,t?L:0,T,e,s):this.$_layoutLabelOutside(!0,r,O,k,R,V,b,n,P,t?L:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,g=this._cy,f=this._rx,m=this._ry,y=f+l,x=m+l,b=d+u(c)*y,w=g+p(c)*x,v=b<d;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let P,A,k,C=g+p(c)*m;if(v?(P=d+u(Math.PI)*f-h,A=P-S.width-a,k=d+u(Math.PI)*y-h,S.width):(P=d+u(0)*f+h,A=P+a,k=d+u(0)*y+h),r&&r.setVis(y>0)){const e=t?s.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-P),e,b-P,0).end()):r.setLine(n.reset(0,e).line(b-P,0).end()),r.setPos(P,C),!_&&r.trans(P,w)}return t||(s.setPos(A,C-S.height/2),!_&&s.trans(A,C-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d){const g=s.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,y=this._cy,x=this._rx,b=this._ry,w=x+l,v=b+l;let S=m+u(f)*w,V=y+p(f)*v;const P=S<m;!t&&!g&&s.layout(i||(P?"right":"left"));const A=s.getBBox(),k=V-A.height/2;let C,L,N,M=y+p(f)*b;if(P?(C=h+_+a,N=h+_-A.width,L=C):(C=c-h-_-a,N=c-h-_,L=C),r&&r.setVis(w>0)){const e=t?s.ty-k:0;o?r.setLine(n.reset(0,e).quad(0,e,S-L,0).end()):r.setLine(n.reset(0,e).line(S-L,0).end()),r.setPos(C,M),!g&&r.trans(L,V)}return t||(s.setPos(N,M-A.height/2),!g&&s.trans(N,M-A.height/2)),P}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),d=e.startAngle+e.angle/2,g=this._cx,f=this._cy,m=this._rx+.5*h,y=this._ry+.5*h,x=u(d)*l,b=p(d)*l,w=g+u(d)*this._rx,v=f+p(d)*this._ry,S=g+u(d)*m;let V=f+p(d)*y;const P=S<g;let A,k;return P?(A=S-.2*h,k=A):(A=S+.2*h,k=A),r&&r.setVis(m>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,A-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,A-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+x,v+b)),t||(P?k-=c.width+a:k+=a,V-=c.height/2,s.setPos(k,V),!_&&s.trans(k+x,V+b)),P}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=f(a.options.totalAngle||360,360);if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}else this._layoutLabelRotation(e);const g=h.options.align===Zs?.3:h.options.align===Us?.5:.7,m=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*g+i:.8*this._rx+i:.7*this._rx+i,y=this._deep?m*this._ratio:m,x=Math.cos(p),b=Math.sin(p);let w=this._cx+x*m,v=this._cy+b*y;e.move(w-d.width/2,v-d.height/2),w=this._cx+x*(n+m),v=this._cy+b*(n+y),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;const i=this.model,r=this._labelViews(),n=i.pointLabel.getWidgetAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(u(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,d=_.connector.options.curved,g="inside"===i.getLabelPos(_),f=r.get(h,0),m=i.pointLabel.getDistance(g,this._rx,this._rxInner);if(f){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,f,e,_.getOffset(),m,o):0===n&&this.$_layoutLabelOutside(!1,h,f,e,t,this._pb,d,_.getOffset(),m,o)}if(e){let e=f.tx,s=f.ty,i=t.tx,r=t.ty;(g||0===n)&&(f.trans(f.x,f.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(f.trans(f.tx,f.ty).transEx2(f.x,f.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class kh extends Oa{setHoverRate(t,e,s){const i=this.point,r=Hs.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._hoverRadius}}class Ch extends Ra{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Ha(t,kh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ra.grow(this)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,d=+i.jitterX||0,g=+i.jitterY||0,f=s.pointLabel,m=f.options.position,y=f.getOffset(),x=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let S;this._markers.forEach(((i,f)=>{const V=i.point,P=x&&(S=x.get(V,0));if(i.setVis(!V.isNull)){const f=Hs.getDrawer(s.getShape(V)),x=ht.jitter(V.xValue,d),A=ht.jitter(V.yGroup,g);let k,C;if(h){const t=h.start+o.getPos(w,x),e=a.getPos(h.rd,A)*l;k=h.cx+e*u(t),C=h.cy+e*p(t)}else k=o.getPos(w,x),C=v-a.getPos(b,A),r&&(k=a.getPos(b,A),C=e-o.getPos(w,x));if(V.xPos=k,V.yPos=C,i.setVis(!!h||!n||k>=0&&k<=t&&C>=0&&C<=e)){const t=i._hoverRadius||_;i.setPath(f(t)),i.trans(k,C).rotate(c),P&&this._layoutLabelView(S,m,y,t,k,C)}else P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}class Lh extends Ba{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Ha(this._pointContainer,La),this.add(this._lineContainer=new se(t,"rct-waterfall-series-lines")),this._lines=new yo(this._lineContainer,Xr)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}function Nh(t,e){return new(Zo[e._type()])(t)}function Mh(t,e){return new(wa[e._viewType()])(t)}Va.register([en,Ua],[nn,Wa],[Fr,Qa],[Rr,Za],[ln,Ja],[cn,eh],[bn,ih],[Sn,nh],[Pn,ah],[Ln,lh],[Mn,ch],[En,uh],[Rn,gh],[Fn,mh],[Qr,Ya],[Hn,xh],[jn,wh],[Yn,vh],[Qn,Ah],[eo,Ch],[ro,Lh]),qo.register([xr,za],[mr,Fa],[yr,Ia]);class Eh extends Mo{constructor(t){super(t,"rct-axis-grid"),this._lines=new yo(this,Xr)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPositions(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.setClass("rct-axis-grid-line"),e.internalSetStyleOrClass(t._style)})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=x(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?x(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class Th extends te{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new oe(t)),this._mask.setStroke("none"),this.add(this._upLine=new oe(t)),this._upLine.setFill("none"),this.add(this._downLine=new oe(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(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 Kt;if(s){let t=0,s=0,n=i/2,o=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(o,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=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,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);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,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class Bh extends te{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Ro(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.options.text)){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const s=e.label.getText();e.label.prepareRich(s)}}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.setContrast(this._getContrastTarget()).layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}_getContrastTarget(){return null}}class Oh extends Bh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Uo:Xr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&s(e._style)&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="outside"!==n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="outside"!==n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="outside"!==n.position?t-h.width-l:t+l;break;default:c="outside"!==n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(Z,"none"),n&&n.trans(s.cx+a*u(s.start),s.cy+a*p(s.start))}}class Rh extends Bh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?dn:js)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.options.position)?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:s,endValue:i}=e.options,r=!l(s)&&!l(i);this._range=r?e.axis.trimRange(f(s,i),m(s,i)):[NaN,NaN],this.setVis(e.visible&&!isNaN(this._range[0])&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[o,a]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=x(r.offsetX,0),c=x(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="outside"!==r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="outside"!==r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(m(0,f(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="outside"!==r.position?t-l.width-_:t+_;break;default:e="outside"!==r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,this._range[0]),h=i.axis.getPos(s.rd,this._range[1]);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:a/h,start:o,angle:E,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*u(s.start),s.cy+t*p(s.start))}}}class Dh extends se{constructor(){super(...arguments),this._views=new yo(this,oe)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.valueMin(),n.from),h=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const s=m(0,f(t,o.getPos(t,a))),r=m(0,f(t,o.getPos(t,h)));i.setPath(Hs.rectangle(s,0,r-s,e))}else{const s=m(0,f(e,o.getPos(e,a))),r=m(0,f(e,o.getPos(e,h)));i.setPath(Hs.rectangle(0,e-s,t,s-r))}i.internalClearStyleAndClass(),i.setFill("none"),i.setFill(n.color),n.style&&i.internalSetStyleOrClass(n.style)}))}}class $h extends se{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Rh?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof is?i=this._rangePool.pop()||new Rh(t,s):e instanceof ss&&(i=this._linePool.pop()||new Oh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Fh extends oe{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")),this.setStyleOrClass(t._style)}layout(t,e,s,i,r){const n=this.model.axis,o=n._isHorz,a=new Kt;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof vi&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class Ih extends Xo{constructor(t){super(t,"Reset Zoom",Ih.CLASS_NAME),this.setVis(!1)}}Ih.CLASS_NAME="rct-reset-zoom";class zh extends se{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Gs(t,"rct-empty-view-back")),this.add(this._labelView=new Ro(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class Hh extends se{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new yo(this,Xr)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class Gh extends se{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new oe(t)),this.add(this._gridContainer=new se(t,"rct-body-depth-grids")),this.add(this._lineView=new Xr(t,"rct-body-depth-side-line")),this.add(this._endView=new Xr(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(Hs.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(Hs.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new Hh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class jh extends se{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Gh(t,!0)),this.add(this._ySideView=new Gh(t,!1)),this.add(this._orgLineView=new Xr(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class Xh extends Mo{constructor(t,e){super(t,Xh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new Gs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new oe(t,"rct-body-background")),this.add(this._depthLayer=new jh(t)),this.add(this._image=new Oo(t,!0,"rct-body-image")),this.add(this._emptyView=new zh(t)),this.add(this._gridRowContainer=new Dh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new se(t,"rct-axis-grids")),this.add(this._baseContainer=new se(t,"rct-axis-bases")),this.add(this._guideContainer=new $h(t,"rct-axis-guides")),this.add(this._annotationContainer=new se(t,"rct-annotations")),this.add(this._seriesContainer=new se(t,"rct-series-container")),this.add(this._axisBreakContainer=new se(t,"rct-axis-breaks")),this.add(this._labelContainer=new se(t,"rct-label-container")),this.add(this._stackLabelContainer=new se(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new $h(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new se(t,"rct-front-annotations")),this.add(this._feedbackContainer=new se(t,"rct-feedbacks")),this.add(this._zoomButton=new Ih(t)),this._crosshairViews=new yo(this._feedbackContainer,Fh)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Jt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(Va.isPointDom(e))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart().chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof qr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=x(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s}));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=x(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=x(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}}));h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof rr){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof bn){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,ht.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(Va.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Va.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.zoom(h,l)&&(this._zoomRequested=!0)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof Oa&&e.endHover(t,!1),e.setBoolData(Va.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.cancel()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_renderBackground(t,e,s){t.setPath(Hs.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;t.setStyleOrClass(e._style),s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(this._guideClip))this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._layoutEmptyView(e,n,o)}_layoutEmptyView(t,e,s){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,s))}$_isEmptyVisible(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(Ko[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof Ar)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new Eh(t);r.set(e,s),i.add(s)}if(e instanceof Ar&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Xr(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||Mh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.forEach((t=>{this._labelContainer.dom.appendChild(t._labelContainer.dom)})),a.forEach((t=>t._stackLabelContainer.remove()));const l=new Map;for(const t of a){const e=t.model._group;e&&e._stacked&&e.isLastVisible(t.model)&&l.set(e,t)}l.forEach((t=>this._stackLabelContainer.add(t._stackLabelContainer)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof Ar&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new Th(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}Xh.BODY_CLASS="rct-body";class Yh extends te{constructor(t){super(t,Wh.HANDLE_STYLE),this.add(this._back=new Gs(t)),this.add(this._shape=new oe(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*f(t,e);const r=new Kt;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class Wh extends Mo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Wh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Wh.MASK_STYLE)}constructor(t){super(t,Wh.CLASS_NAME),this.add(this._back=new Gs(t,Wh.BACK_STYLE)),this.add(this._container=new se(t,null)),this.add(this._mask=new Gs(t,Wh.MASK_STYLE)),this.add(this._trackView=new Gs(t,Wh.TRACK_CLASS)),this.add(this._thumbView=new Gs(t,Wh.THUMB_CLASS)),this.add(this._startHandle=new Yh(t)),this.add(this._endHandle=new Yh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=Mh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_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 jo(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 jo(t)),i._simpleMode=!0)}}Wh.CLASS_NAME="rct-navigator",Wh.BACK_STYLE="rct-navigator-back",Wh.MASK_STYLE="rct-navigator-mask",Wh.HANDLE_STYLE="rct-navigator-handle",Wh.HANDLE_BACK_STYLE="rct-navigator-handle-back",Wh.TRACK_CLASS="rct-navigator-track",Wh.THUMB_CLASS="rct-navigator-thumb";class Uh extends _e{constructor(t){super(),this.chart=t}}class Zh extends Uh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=m(0,e-(o.x-n.x)),this._yStart=m(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new Gs(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=m(0,f(i.height,e-(i.y-s.y))),this._body.setZoom(0,f(m(0,this._yStart),e),this._body.width,m(f(this._yStart,i.height),e))):(t=m(0,f(i.width,t-(i.x-s.x))),this._body.setZoom(m(0,f(this._xStart,t)),0,m(f(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=m(0,f(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,f(this._yStart,r),this._body.width,y(this._yStart-r))):(i=m(0,f(o.width,i-(o.x-n.x))),this._feedback.setBounds(f(this._xStart,i),0,y(this._xStart-i),this._body.height)),!0}}class qh extends Uh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Kh extends Uh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Qh extends Uh{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(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=m(0,f(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Jh{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(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(y(this._clickX-i)>3||y(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),e.forceHideTooltip(),this._stopEvent(t)):t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):e.getButton(s)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){const t=ht.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach((t=>{if(t instanceof gi){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof $a&&t.togglePointVisible(e)}}else t.visible=e})),i.bodyView().hoverSeries(e?a.source:null)}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return Ho.isThumb(t)?new qh(this._chart,i.getScrollView(t)):Wh.isHandle(t)?new Kh(this._chart,i._navigatorView,t):Wh.isMask(t)&&r&&r.model.isZoomed()?new Qh(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Zh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,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),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class tl extends se{constructor(t){super(t,tl.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new pe(t,"rct-history-item");e.anchor=ce.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new pe(t);e.anchor=ce.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 o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}tl.TITLE_CLASS="rct-history";class el extends Mo{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Gs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new pe(t,"rct-legend-item-label")),this._label.anchor=ce.START}setMarker(t){return t===this._marker&&t.parent===this||(this._marker&&this._marker!==t&&this._marker.remove(),this.insertFirst(this._marker=t)),this._marker}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():xo,l=wo(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:m(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=x(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class sl extends Eo{constructor(t){super(t,sl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new yo(this,el)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),a=this._vertical="vertical"===e.getLayout();return this._ipr=x(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?x(n.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,f,y,x;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),f=x.mh,w++,b++):(f+=l+x.mh,f<=n?(y.push(x),w++,b++):w=0);this._wMarkers=[],g=f=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=m(s,t.mw),r=m(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),f=m(f,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),g=x.mw,w++,b++):(g+=l+x.mw,g<=r?(y.push(x),w++,b++):w=0);g=f=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=m(s,t.mh)})),e+=l*(t.length-1),g=m(g,e),f+=s,p.push(s)})),f+=_*(u.length-1)}return{width:g,height:f}}}sl.LEGEND_CLASS="rct-legend";class il extends te{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Yo(t))}layout(){}}class rl extends te{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new se(t,"rct-polar-axis-markers")),this._markViews=new yo(this._markContainer,il),this.add(this._gridContainer=new te(t,"rct-polar-axis-grids")),this._labelViews=new yo(this._labelContainer=s,Io,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(Go)?t.setLabel(s,o,e,r.replace(Go,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks;s.chart._body.getPolar(e),s.options.rotation;const i=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(i,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class nl extends rl{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new yo(this._gridContainer,Xr,nl.GRID_CLASS),e.insertFirst(this._startView=new Xr(t,nl.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Xr(t,nl.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Uo(t,nl.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/E)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+u(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",_=[],c=t.label.options.rotation||0,d="auto"===c;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),g=t.angle=o+n.pos,f=(g*O%360+360)%360,m=f>90&&f<270;if(d){const i=e-a.width/2+u(g)*(h+a.width/2),r=s-a.height/2+p(g)*(h+a.width/2);t.trans(i,r),t.setRotation(a.width/2,a.height/2,m?g*O+180:g*O)}else{const i=e+u(g)*(h+a.width/2)-a.width/2,r=s+p(g)*(h+a.height/2)-a.height/2;t.trans(i,r),t.setRotation(a.width/2,a.height/2,c)}_.push(t)}}));let g=0,f=_[g];for(let t=1;t<_.length;t++){const e=_[t],s=f.inflateBBox(-1,-1),i=e.inflateBBox(-1,-1),r=Object.assign(s,{rotation:f.rotation}),n=Object.assign(i,{rotation:e.rotation});if(ko(r,n)?(e.setVis(!1),_.splice(t,1),--t):(f=e,g=t),t===_.length-1&&_.length>1){if(ht.diffAngle(f.angle,_[0].angle)<E/6){const t=Object.assign(_[0].inflateBBox(-1,-1),{rotation:_[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});ko(t,e)&&(f.setVis(!1),_.splice(g,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+u(o)*i,s+p(o)*i),r.map((t=>{const r=t.pos;h.push(e+u(o+r)*i,s+p(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+u(o+a)*i,s+p(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+u(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+u(o+a)*i,s+p(o+a)*i))}}nl.LINE_CLASS="rct-polar-xaxis-line",nl.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",nl.GRID_CLASS="rct-polar-xaxis-grid-line";class ol extends rl{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new yo(this._gridContainer,Uo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Xr(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Uo(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof Ar&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+u(_)*i,s+p(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+u(_+n)*i,s+p(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+u(_+c)*i,s+p(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+u(t)*r[a].pos-h.width*i+o,s+p(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*u(_),s+i*p(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class al extends Xh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(Hs.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(s,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new se(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new se(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new se(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new ol(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new nl(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class hl extends Eo{constructor(t,e){super(t,e?hl.SUBTITLE_CLASS:hl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new pe(t)),this._richText=new Se}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),wo(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}hl.TITLE_CLASS="rct-title",hl.SUBTITLE_CLASS="rct-subtitle";class ll extends te{constructor(t){super(t,"rct-tooltip-row"),this.add(this._marker=new oe(t,"rct-tooltip-row-marker")),this.add(this._textView=new pe(t,"rct-tooltip-row-text")),this._textView.anchor=ce.START,this.add(this._detailView=new pe(t,"rct-tooltip-row-detail")),this._detailView.anchor=ce.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=Hs.getDrawer(o.listMarkerShape);this._marker.setPath(l(a/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||""),r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+h)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+h+this._textView.getBBox().width+x(e.options.listGap,4))):this._detailView.text=""}alignDetail(t){const e=this._marker.getBBox();this._detailView.transX(t-this._detailView.getBBox().width),this._marker.trans(e.width/2,this.r.height/2)}}class _l extends te{constructor(t){super(t,"rct-tooltip-list"),this.add(this._headerView=new pe(t)),this._headerView.anchor=ce.START,this.add(this._rowLayer=new se(t,"")),this.add(this._footerView=new pe(t)),this._footerView.anchor=ce.START,this._rows=new yo(this._rowLayer,ll)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=x(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach(((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=m(l,(r.r=r.getBBox()).width)})),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach((t=>{t.alignDetail(l)}))}}class cl extends te{constructor(t){super(t,cl.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new oe(t,"rct-tooltip-back")),this.add(this._top=new oe(t,"rct-tooltip-top")),this.add(this._textView=new pe(t,"rct-tooltip-text")),this.add(this._listView=new _l(t)),this._back.setAttr("filter","url(#"+Jt.SHADOW_FILTER+")"),this._textView.anchor=ce.START,this._richText=new Se,this.close(!0,!1)}show(t,e,s,r,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,r&&r.map((t=>t.point)));if(!_)return;const c=l.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,h,p);if(0===p.rows.length){if(u=i(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map((()=>[u,""]))}}else{const e=c.text||_.getTooltipText(t,h,null);if(u=i(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const g=e.contentWidth(),y=e.contentHeight(),x=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let P,A,k,C=V.options.reversed;t instanceof Qi&&t.getBaseValue(V)>s.point.yValue&&(C=!C),d?(x.setVis(!0),b.setVis(!1),x.layout(e.doc(),l,this._richText,this._list),P=x.getBBox()):(x.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),P=b.getBBox()),A=m(c.minWidth||0,P.width+16),k=m(c.minHeight||0,P.height+12)+w;let L=t.getTooltipHeaderColor(h);null===L&&(L=t._calcedColor,t instanceof Ui?(t.options.legendByPoint||t._colorByPoint())&&(L=h._calcedColor):t._colorByPoint()&&(L=getComputedStyle(s.dom).fill)),this._top.setFill(L);const N=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),T=e.getBounds();let B,O,R=!1;const D=l.isFollowPointer(t);if(S&&!t.isWidget)B=o-k/2-m(0,f(o-k/2,y-k)),R=D?C?A+M>n:n+A+M>g:C?A+M>E.x-T.x+E.width:E.x-T.x-M>g-A,R&&(C=!C),O=C?"left":"right",this.$_drawTooltip(0,0,A,k,O,B),C?n-=A+M:n+=M,o-=k/2;else{B=n-A/2-m(0,f(n-A/2,g-A));const t=D?o-e.getRootDistance().y:E.y-T.y-e._padding.top,s=D?y-o:T.bottom-E.bottom;if(t>=k+M||s>=k+M){(C?s>=k+M:t>=k+M)?O=C?"bottom":"top":(O=C?"top":"bottom",C=!C),this.$_drawTooltip(0,0,A,k,O,B),n-=A/2,C?o+=M:o-=k+M}else{B=o-k/2-m(0,f(o-k/2,y-k));const t=E.x-T.x;O=g-t>=A+M||t<A+M?"right":"left",this.$_drawTooltip(0,0,A,k,O,B),"right"===O?n+=M:n-=A+M,o-=k/2}}return n=m(0,f(n,g-A)),o=m(0,f(o,y-k)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(m(0,n-20),m(0,o-20)),this.transEx(n,o,N/2,!1)):this.transEx(n,o,N,!1),0===N&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:A,h:k}}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.options.hideDelay:ur.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Yt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}cl.CLASS_NAME="rct-tooltip";class dl extends ee{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new cl(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class ul extends _t{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=Ft.isHoverAt(e),i=(this._model=t).options;return Ft.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=z(i.width),isNaN(i.height)?e.style.height="":e.style.height=z(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?Ft.setStyles(this._img,{display:"",width:I(i.imageWidth),height:I(i.imageHeight)}):Ft.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(at?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=I("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=I("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",Ft.setStyles(e,{position:"absolute",textAlign:"center"}),Ft.setStyles(s,{display:at?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",Ft.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),Ft.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),at&&Ft.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class pl extends To{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new hl(t,!1)),this.add(this.subtitleView=new hl(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=m(l,c),u=h+g+_;break;default:p=l+g+c,u=m(u,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===o.alignBase?0:t.xPlot;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=m(this._hTitle,this._hSub);g=m(g,g+t(i,e,this._hTitle)),y=m(y,y+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=m(f,f+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=f;break;case"right":b=f+this._wTitle-this._wSub;break;default:b=f+(this._wTitle-this._wSub)/2}else b=m(b,b+d(r,h,this._wSub))},p=x(o.titleGap,0);let g=0,f=l,y=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=b+this._wSub+p,c();break;case"rightSide":b=f+this._wTitle+p,c();break;case"right":switch(b=f+this._wTitle+p,o.align){case"center":b=m(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=m(b,_+h-this._wSub)}c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,b=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=f-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,f=b-p-this._wTitle,c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,b=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(f-b-this._wSub)/2;break;case"right":b=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,b=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":b=f+this._wTitle+p;break;case"center":b+=f+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=y+this._hSub+p;break;default:u(),y=g+this._hTitle+p}}const w=x(n.offset,0),v=x(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),s.resizeByMeasured().layout().trans(b,y)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class gl extends To{_doInitChildren(t){this.add(this._legendView=new sl(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class fl extends To{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=m(n,l),o=m(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===po.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===po.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof vi?Math.floor(e):e,to:t instanceof vi?Math.floor(s):s})}))}))}}class ml extends Mo{constructor(t){super(t,"rct-credits"),this.add(this._textView=new pe(t)),this._textView.anchor=ce.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class yl extends se{}class xl extends se{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this._htmlButtons=[],this.add(this._annotationContainer=new se(t,"rct-annotations")),this.add(this._plotContainer=new se(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Xh(t,this));for(const e in po){const s=new fl(t,po[e]);this._plotContainer.add(s),this._axisSectionMap[po[e]]=s}xl.pane_class&&this.add(this._paneContainer=new xl.pane_class(t,this)),this.add(this._titleSectionView=new pl(t)),this.add(this._legendSectionView=new gl(t)),this.add(this._frontAnnotationContainer=new se(t,"rct-front-annotations")),this.add(this._creditView=new ml(t)),this.add(this._navigatorView=new Wh(t)),this.add(this._historyView=new tl(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,p,g,r)}this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,f=0,m=0,y=0,x=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=f=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=m=h.width+p+c:i-=y=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),x=m,b=s-f;const V=this._navigatorView;let P=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=P=V.mh));const A=this._legendSectionView;let k,C,L=0,N=0;if(A.visible)switch(A.resizeByMeasured().layout(),L=A.height,N=A.width,a._location){case"top":k=v+g,r-=L;break;case"bottom":r-=L,k=b-L,b-=L;break;case"right":i-=N,C=e-N;break;case"left":i-=N,x+=N,C=0}V.visible&&(b-=P,V.layout().transY(b+V.model.getGap()));let M,E=0,T=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(x,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([po.LEFT,po.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[po.TOP,po.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[po.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),x+=e.mw),(e=t[po.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[po.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0),b-=e.mh),(e=t[po.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0))),V.visible&&V.layout().transX(x);const s={x:x,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[po.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[po.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[po.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[po.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,x=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(x,b),n.layout(),M=n.getRect(),n._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=f>0?s-f+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=y>0?e-y+c:e-h.width-p}h.trans(t,i)}if(T+=0,w.visible&&w.layout({xPlot:x,wPlot:T,wChart:e}).trans(0,S),A.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":x+=T-N-e;break;case"center":x+=(T-N)/2+e;break;default:x+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-L-e;break;case"middle":b+=(E-L)/2+e;break;default:b+=e}}else if(isNaN(k)){const e=+t.offsetY||0;if(x=C,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-L-e;break;default:b=(s-L)/2+e}b+L>s&&(b=(s-L)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-L-e;break;default:b=b+(r-L)/2+e}b+L>s&&(b=(s-L)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=k,"chart"===t.alignBase)switch(n){case"left":x=s;break;case"right":x=e-N-s;break;default:x=(e-N)/2+s}else switch(n){case"left":x+=s;break;case"right":x=x+i-N-s;break;default:x+=(i-N)/2+s}x+N>e&&(x=(e-N)/2),x<0&&(x=0)}A.trans(x,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new dl(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new cl(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}forceHideTooltip(){var t,e;this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t||t.close(!0,!1):null===(e=this._tooltipView)||void 0===e||e.close(!0,!1)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new jo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(t)))}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;ht.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Ii?o.hoverSeries(t):e.options.pointHovering&&t instanceof gi&&o.hoverPoint(t)}))}}if(l instanceof Ds&&!(this._hoverItem instanceof Ds)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof sn&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in po){const s=this._axisSectionMap[po[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new al(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new ul(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,this,e,e.getAxes(s,!0),i,r):a.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const o=n[e];r&&o.visible&&o.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[po.LEFT].checkWidths(t,s,i),s-=n[po.RIGHT].checkWidths(t,s,i),i-=n[po.BOTTOM].checkHeights(t,s,i),i-=n[po.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===po.LEFT||t===po.RIGHT?s-=e.mw:t!==po.BOTTOM&&t!==po.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===po.LEFT||t===po.RIGHT?s-=e.mw:t!==po.BOTTOM&&t!==po.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Nh(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var bl;!function(t){t.EXPORT="$$realchart_export"}(bl||(bl={}));class wl extends Jt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new fo(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new xl(t)}_createPointerHandler(){return new Jh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof He&&s===Re.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof fo&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===bl.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setResizeDelay(i.resizeDelay),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class vl{static getVersion(){return zt.version}static setLicenseKey(t){zt.code=t}static setLocale(t,e){e&&L(t,e),(t=>{t&&(C=A[k=t.substring(0,2)]),C||(C=A[k="ko"])})(t)}static registerLocale(t,e){L(t,e)}static setDebugging(t){te.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static setAnimatable(t){Jt._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const o=new wl(t,e);return o.chart.load(s(i)?i:{},r,n),o.chart[lo]=o,o.chart}static createData(t,e){return new mo(t||{},e)}}class Sl{static empty(){return new Sl}static create(t=0,e=0){return new Sl(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const Vl="bullet",Pl="bulletgroup",Al="circle",kl="circlegroup",Cl="clock",Ll="linear",Nl="lineargroup";class Ml{static empty(){return new Ml}static create(t=0,e=0){return new Ml(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const El=vl.getVersion,Tl=vl.setDebugging,Bl=vl.setLogging,Ol=vl.setAnimatable,Rl=vl.configure,Dl=vl.createChart,$l=vl.createData,Fl=vl.setLicenseKey;export{He as Annotation,qo as AnnotationView,Wo as ArcElement,nn as AreaRangeSeries,Wa as AreaRangeSeriesView,en as AreaSeries,an as AreaSeriesGroup,Ua as AreaSeriesView,Me as AssetCollection,ls as Axis,Pr as AxisBaseLine,_s as AxisCollection,Je as AxisGrid,Ue as AxisItem,ns as AxisLabel,Ze as AxisLine,os as AxisScrollBar,Ho as AxisScrollView,hs as AxisSectorLine,rs as AxisTick,qe as AxisTitle,jo as AxisView,Rr as BarRangeSeries,Za as BarRangeSeriesView,Fr as BarSeries,$r as BarSeriesBase,zr as BarSeriesGroup,Ir as BarSeriesGroupBase,Dr as BarSeriesPoint,Qa as BarSeriesView,Ka as BarSeriesViewBase,Qi as BasedSeries,Ta as BasedSeriesView,ln as BellCurveSeries,Ja as BellCurveSeriesView,Os as Body,Bs as BodyDepth,Xh as BodyView,cn as BoxPlotSeries,eh as BoxPlotSeriesView,Ca as BoxPointElementEx,xn as BubblePie,bn as BubbleSeries,ih as BubbleSeriesView,Pl as BulletGaugeGroupType,Vl as BulletGaugeType,wn as BumpSeriesGroup,Sn as CandlestickSeries,nh as CandlestickSeriesView,vi as CategoryAxis,wi as CategoryAxisGrid,bi as CategoryAxisLabel,xi as CategoryAxisTick,fo as Chart,wl as ChartControl,mo as ChartData,pt as ChartDataCollection,Mo as ChartElement,Re as ChartItem,go as ChartObject,uo as ChartOptions,Jh as ChartPointerHandler,$e as ChartText,xl as ChartView,Vn as CircelBarPointLabel,Pn as CircleBarSeries,An as CircleBarSeriesGroup,ah as CircleBarSeriesView,Yo as CircleElement,kl as CircleGaugeGroupType,Al as CircleGaugeType,Cs as CircularGauge,Ls as CircularGaugeGroup,As as CircularGaugeLabel,Cl as ClockGaugeType,qi as ClusterableSeries,ir as ClusterableSeriesGroup,$t as Color,Hi as ConnectableSeries,sr as ConstraintSeriesGroup,Bo as ContentView,Ar as ContinuousAxis,_o as Credits,Ye as Crosshair,gi as DataPoint,fi as DataPointCollection,Ei as DataPointLabel,Ft as Dom,Ln as DumbbellSeries,lh as DumbbellSeriesView,yo as ElementPool,Mn as EqualizerSeries,ch as EqualizerSeriesView,En as ErrorBarSeries,uh as ErrorBarSeriesView,Rs as Exporter,Rn as FunnelSeries,gh as FunnelSeriesView,fs as Gauge,ps as GaugeBase,ms as GaugeGroup,ia as GaugeGroupView,gs as GaugeItem,Ps as GaugeLabel,Vs as GaugeRangeBand,Ss as GaugeRangeLabel,vs as GaugeScale,Qo as GaugeView,ii as HeatmapSeriesType,Fn as HistogramSeries,mh as HistogramSeriesView,Fe as IconedText,mr as ImageAnnotation,Fa as ImageAnnotationView,Oo as ImageElement,se as LayerElement,$s as Legend,Ds as LegendItem,el as LegendItemView,sl as LegendView,Xr as LineElement,Zr as LinePointLabel,Qr as LineSeries,qr as LineSeriesBase,Xa as LineSeriesBaseView,on as LineSeriesGroup,Wr as LineSeriesPoint,Ya as LineSeriesView,kr as LinearAxis,Nl as LinearGaugeGroupType,Ll as LinearGaugeType,oo as LogAxis,Hn as LollipopSeries,xh as LollipopSeriesView,tr as LowRangedSeries,rr as MarkerSeries,Oa as MarkerSeriesPointView,Ra as MarkerSeriesView,or as NavigatorMask,nr as NavigiatorHandle,T as ORG_ANGLE,jn as OhlcSeries,wh as OhlcSeriesView,Wi as OthersGroup,E as PI_2,yl as PaneContainer,Yn as ParetoSeries,vh as ParetoSeriesView,Kt as PathBuilder,oe as PathElement,oi as PictogramSeriesType,ai as PictorialBarSeriesType,hi as PictorialSeriesType,Qn as PieSeries,Jn as PieSeriesGroup,qn as PieSeriesLabel,Zn as PieSeriesText,Ah as PieSeriesView,Sl as Point,Pa as PointElement,co as PointHovering,ma as PointLabelLineContainer,fa as PointLabelLineView,pa as PointLabelView,Ha as PointViewPool,O as RAD_DEG,li as RaceBarSeriesType,_i as RaceLineSeriesType,Zi as RadialSeries,Ji as RangedSeries,Wt as RcAnimation,Jt as RcControl,te as RcElement,_t as RcObject,Gs as RectElement,t as SVGNS,sa as ScaleView,eo as ScatterSeries,Ch as ScatterSeriesView,To as SectionView,dn as SectorElement,Ii as Series,ra as SeriesAnimation,er as SeriesGroup,Gi as SeriesMarker,_r as SeriesNavigator,Va as SeriesView,yr as ShapeAnnotation,Ia as ShapeAnnotationView,Ml as Size,Jr as SplineSeries,Ti as StackLabel,dr as Subtitle,Hs as SvgShapes,ce as TextAnchor,xr as TextAnnotation,za as TextAnnotationView,pe as TextElement,de as TextLayout,Br as TimeAxis,cr as Title,ur as Tooltip,si as TreemapSeriesType,Si as TrendLineArea,Vi as TrendLineLabel,Ai as Trendline,ht as Utils,xs as ValueGauge,ta as ValueGaugeView,ri as VectorSeriesType,ro as WaterfallSeries,Lh as WaterfallSeriesView,cs as Widget,Ui as WidgetSeries,Xi as WidgetSeriesConnector,Yi as WidgetSeriesLabel,ji as WidgetSeriesPoint,$a as WidgetSeriesView,ni as WordCloudSeriesType,mi as ZValuePoint,y as absv,_ as assignObj,et as buildValueRanges,U as calcPercent,Rl as configure,S as copyObj,u as cos,Dl as createChart,$l as createData,bo as createRect,Te as extend,D as fixnum,El as getVersion,V as incv,i as isArray,vo as isEmptyRect,at as isIE,a as isNumber,s as isObject,n as isString,m as maxv,f as minv,Y as parsePercentSize,x as pickNum,w as pickProp,v as pickProp3,I as pixel,wo as rectToSize,Ol as setAnimatable,Tl as setDebugging,Fl as setLicenseKey,Bl as setLogging,p as sin,F as toStr};
|