realchart 1.4.32 → 1.5.0

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart v1.4.32
3
+ * RealChart v1.5.0
4
4
  * Copyright (C) 2023-2026 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,function(t){"use strict";const e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=function(t){return null==t||isNaN(t)},l=Object.assign,c=Math.floor,_=Math.ceil,d=Math.cos,u=Math.sin,p=Math.log10,g=Math.min,f=Math.max,m=Math.abs,y=Math.PI,b=2*y,x=-y/2,w=y/180,v=180/y;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const S="undefined"!=typeof navigator?navigator.userAgent:"",V=S?navigator.appVersion:"";S.match(/Trident.*rv\:11\./),V?.indexOf("MSIE 10"),V?.indexOf("MSIE 9");const C="undefined"!=typeof window&&window.devicePixelRatio||1,A=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},P=function(t,e){return void 0!==t?t:e},k=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},L=(t,e,i)=>t+(e-t)*i;function T(t){return t+"px"}function N(t){return null==t||Number.isNaN(t)||""===t}function M(t){return t<10?"0"+t:String(t)}function E(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function B(t,e){const i={};return i[t]=e,i}const O=(t,e)=>t.replace("%1",e),D=(t,e)=>{throw new Error(O(t,e))};function R(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}class $ extends Error{}const I=(new Date).getTime(),F=class t{static setLogging(t){this.LOGGING=t}static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static warn(...t){this.LOGGING&&console.warn(...t)}static warnIf(t,...e){this.LOGGING&&t&&console.warn(...e)}static now(){return+new Date}static parseDate(t,e){const i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(g(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}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,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(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 getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getEnumValues(t){return Object.keys(t).map(e=>t[e])}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-I}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=s(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return f(e,g(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=f(e,t)),isNaN(i)||(t=g(i,t)),t}static makeIntArray(t,e){const i=new Array(f(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}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,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],i=t[0];for(let s=1;s<t.length;s++)e=g(e,t[s]),i=f(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||s(t))?e.split(".").reduce((t,e)=>t?t[e]:void 0,t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let n=0;n<s;n++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};F.LOGGING=!1,F.week_days=["일","월","화","수","목","금","토"],F.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],F.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]];let z=F;const H=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],G=["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"],j=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(z.startsWith(e,"rgb(")&&z.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(z.startsWith(e,"rgba(")&&z.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(z.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return n(e)?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,n=.5){const o=new t(null);return r<n?(o.r=Math.ceil(e.r+(i.r-e.r)*(r/n)),o.g=Math.ceil(e.g+(i.g-e.g)*(r/n)),o.b=Math.ceil(e.b+(i.b-e.b)*(r/n)),o.a=(i.a+e.a)/2):(o.r=Math.ceil(i.r+(s.r-i.r)*((r-n)/(1-n))),o.g=Math.ceil(i.g+(s.g-i.g)*((r-n)/(1-n))),o.b=Math.ceil(i.b+(s.b-i.b)*((r-n)/(1-n))),o.a=(s.a+i.a)/2),o}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(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}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 i;e>6?(i=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)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};j.TRANSPARENT=new j("rgba(0,0,0,0)"),j.WHITE=new j("rgb(255,255,255)"),j.BLACK=new j("rgb(0,0,0)"),j.COLORS=function(){const t={};for(let e=0;e<H.length;e++)t[H[e]]=G[e];return t}();const W=Object.freeze({x:0,y:0,width:0,height:0});function Y(t){return{width:t.width,height:t.height}}let X=0;class U{constructor(){this._hash=++X,this._disposed=!1,this._disposing=!1}dispose(){return this._disposed||this._disposing||(this._disposing=!0,this._doDispose(),this._disposed=!0),null}_doDispose(){}get hash(){return this._hash}get disposing(){return this._disposing}get orphaned(){return this._disposed}_throwError(t){throw new Error(t)}}class Z extends Error{}const q=function(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(s(t)&&s(r)){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!q(t[e],r[e]))return!1;return!0}if(i(t)&&i(r)){const i=Object.keys(t),s=Object.keys(r);if(i.length!==s.length)return!1;for(const s of i){if(!e.call(r,s))return!1;if(!q(t[s],r[s]))return!1}return!0}return!1},K=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)){let e=r[t];s(e)?n[t]=e.slice(0):e instanceof Date?n[t]=new Date(e):i(e)?n[t]=K(n[t],e):n[t]=e}return n},Q=class t extends U{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}_doDispose(){this._children&&(this._children.forEach(t=>t.dispose()),this._children=void 0)}prop(t,e){const i=this._op[t];return void 0!==i?i:void 0!==e?e:this.constructor.defaults[t]}num(t,e){return function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t}(this._op[t],e,this.constructor.defaults[t])}bool(t,e,i=!1){const s=this._op[t];return void 0===s?e??this.constructor.defaults[t]??i:Boolean(s)}propAt(t,e){const i=this._resolvePath(t);if(-1!==i)return 0===i?this.prop(t,e):i.rest?i.child.propAt(i.rest,e):void 0}numAt(t,e){const i=this._resolvePath(t);return-1===i?NaN:0===i?this.num(t,e):i.rest?i.child.numAt(i.rest,e):NaN}boolAt(t,e,i=!1){const s=this._resolvePath(t);return-1!==s&&(0===s?this.bool(t,e,i):!!s.rest&&s.child.boolAt(s.rest,e,i))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){const t=e[r];s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);return e?e.saveOptions():this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t){return this.clearOptions(!0),this.$_load(t)}saveOption(t){return this._children&&this._children.has(t)?this._findChild(t).saveOptions():this._op[t]}saveOptions(t,e=!1,r=!1,n=!1){const o={};let a,h;return s(t)?a=t:i(t)&&([a,h]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,e,r,h,n),o}saveTo(t,e,r=!1,n=!1,o=!1){let a,h;return s(e)?a=e:i(e)&&([a,h]=this.$_splitProps(e)),this._doSave(t,a,this.constructor.defaults,r,n,h,o),t}updateOptions(t,e=!0){const i=this._op;let s,r;if(void 0!==t&&!this._doSetSimple(i,t)){const e={};for(const i in t)this._doUpdateProp(i,t[i])?(r??=[]).push(i):this._findChild(i)?(s??=[]).push(i):t[i]!==this.prop(i)&&(this.$_validateOptions(i,t[i]),e[i]=t[i],(r??=[]).push(i));K(i,e)}return this._doApply(i),s?.forEach(e=>this._findChild(e).updateOptions(t[e])),e&&this._optionChanged(r),this}updateOption(t,e,r=!0,n=!1){if(this._doUpdateProp(t,e))return this._doApply(this._op),r&&this._optionChanged(t),this;const o=this._findChild(t);if(o)o.updateOptions(e);else{const o=this._op;(n||e!==this.prop(t))&&(this.$_validateOptions(t,e),s(e)?e=e.slice(0):e instanceof Date?e=new Date(e):i(e)&&(e=K({},e)),o[t]=e,this._doApply(o),r&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r=!a(s)||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(t,i=!0){const s=this._op,r=this._findChild(t);return r?r.clearOptions(!0):e.call(s,t)&&(delete s[t],this._doApply(s),i&&this._optionChanged(t)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);return-1===r?this:0===r?this.updateOption(t,e,i,s):r.rest?r.child.updateAt(r.rest,e,i,s):(r.child.updateOptions(e,i),this)}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}removeAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.removeAt(i.rest,e):(i.child.clearOptions(!0,e),this)}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach(t=>e(t)),i._doApply(i._op)}(this),e&&this._optionChanged(),this}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))q(s[t],r[t])&&delete s[t];t&&i._children&&i._children.forEach(t=>e(t))}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e._init(),e}_attachRef(t,e){(this._children??=new Map).set(t,e)}_findChild(t){return this._children?.get(t)}_isChildCollection(t){return!1}_getChildItem(t,e){}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._findChild(i);if(r)return{child:r,rest:s};if(s&&this._isChildCollection(i)){const t=s.indexOf("."),e=t<0?s:s.substring(0,t),r=this._getChildItem(i,e);if(r)return{child:r,rest:t<0?"":s.substring(t+1)}}return e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_doLoad(t,r){for(const n in r)if(e.call(r,n)){let e,o=r[n];this._doLoadProp(n,o)?t[n]=o:(e=this._findChild(n))?e.$_load(o):s(o)?t[n]=o.slice(0):o instanceof Date?t[n]=new Date(o):i(o)?t[n]=Object.assign({},o):t[n]=o}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doUpdateProp(t,e){return!1}_doApply(t){}_doSave(t,r,n,o,a,h,l=!1){const c=this._op,_=this._children,d=r&&r.length>0,u=l&&d,p=d?r:Object.keys(c);for(const i of p)if(!_||!_.has(i)){const r=e.call(c,i);if(!r&&!a&&!u)continue;const o=n[i],h=r?c[i]:o;(a||u||!q(h,o))&&(this._doSaveProp(t,i,h)||(s(h)?t[i]=this._doSaveArray(i,h)||h.slice():void 0!==h?t[i]=h:u&&(t[i]=void 0)))}_?.forEach((s,n)=>{const c=null!=h&&e.call(h,n),_=d&&r.indexOf(n)>=0;if(d&&!c&&!_)return;const u=c||_;if(o||u){const e=c&&i(h[n])?h[n]:void 0,r=l&&u,o=s.saveOptions(e,!0,a,r);(r||a||Object.keys(o).length>0)&&(t[n]=o)}})}_doSaveProp(t,e,i){return!1}_doSaveArray(e,i){return i.map(e=>e instanceof t?e.saveOptions([],!0):e)}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof Z?e:new Z(`Invalid value for option "${t}": ${e.message}`)}}$_splitProps(t){const e=[];let i;for(const s of Object.keys(t))this._children?.has(s)?(i??={})[s]=t[s]:e.push(s);return[e,i]}_doValidateOptions(t,e){}};Q.defaults={};let J=Q;const tt=class t extends U{constructor(t){super(),this._cssWidth=0,this._cssHeight=0,this._dpr=1,this._canvas=t.createElement("canvas");const e=this._canvas.getContext("2d");if(!e)throw new Error("CanvasRenderer: 2d context not available.");this._ctx=e}static registerShape(e,i){t.SHAPES.set(e,i)}static unregisterShape(e){return t.SHAPES.delete(e)}static shapeNames(){return Array.from(t.SHAPES.keys())}static _builtinShapes(){const t=new Map;return t.set("circle",(t,e,i,s)=>{t.arc(e,i,s/2,0,2*Math.PI)}),t.set("square",(t,e,i,s)=>{const r=s/2;t.rect(e-r,i-r,s,s)}),t.set("diamond",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i),t.lineTo(e,i+r),t.lineTo(e-r,i),t.closePath()}),t.set("triangle",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i+r),t.lineTo(e-r,i+r),t.closePath()}),t.set("triangle-down",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i+r),t.lineTo(e+r,i-r),t.lineTo(e-r,i-r),t.closePath()}),t.set("star",(t,e,i,s)=>{const r=s/2,n=.4*r,o=Math.PI/5;let a=-Math.PI/2;t.moveTo(e+r*Math.cos(a),i+r*Math.sin(a));for(let s=1;s<10;s++){a+=o;const h=1&s?n:r;t.lineTo(e+h*Math.cos(a),i+h*Math.sin(a))}t.closePath()}),t.set("plus",(t,e,i,s)=>{const r=s/2,n=s/6;t.moveTo(e-n,i-r),t.lineTo(e+n,i-r),t.lineTo(e+n,i-n),t.lineTo(e+r,i-n),t.lineTo(e+r,i+n),t.lineTo(e+n,i+n),t.lineTo(e+n,i+r),t.lineTo(e-n,i+r),t.lineTo(e-n,i+n),t.lineTo(e-r,i+n),t.lineTo(e-r,i-n),t.lineTo(e-n,i-n),t.closePath()}),t.set("cross",(t,e,i,s)=>{const r=s/2,n=s/6,o=Math.SQRT1_2,a=[[-n,-r],[n,-r],[n,-n],[r,-n],[r,n],[n,n],[n,r],[-n,r],[-n,n],[-r,n],[-r,-n],[-n,-n]];for(let s=0;s<a.length;s++){const r=a[s][0]*o-a[s][1]*o,n=a[s][0]*o+a[s][1]*o;0===s?t.moveTo(e+r,i+n):t.lineTo(e+r,i+n)}t.closePath()}),t.set("wye",(t,e,i,s)=>{const r=s/2,n=s/6/2,o=[];for(let t=0;t<3;t++){const e=-Math.PI/2+t*Math.PI*2/3,i=Math.cos(e),s=Math.sin(e),a=[i*r,s*r],h=[i*n-s*n,s*n+i*n],l=[i*n+s*n,s*n-i*n];o.push(h,a,l)}t.moveTo(e+o[0][0],i+o[0][1]);for(let s=1;s<o.length;s++)t.lineTo(e+o[s][0],i+o[s][1]);t.closePath()}),t}static _applyLine(t,e){t.strokeStyle=e?.color??"#000",t.lineWidth=e?.width??1,t.lineCap=e?.cap??"butt",t.lineJoin=e?.join??"miter",t.globalAlpha=e?.alpha??1,e?.dash?t.setLineDash(e.dash):t.setLineDash([])}static _applyFill(t,e){t.fillStyle=e?.color??"#000",t.globalAlpha=e?.alpha??1}static _applyText(t,e){t.fillStyle=e?.color??"#000",t.font=e?.font??"12px sans-serif",t.textAlign=e?.align??"start",t.textBaseline=e?.baseline??"alphabetic",t.globalAlpha=e?.alpha??1}static _roundRectPath(t,e,i,s,r,n){const o=Math.min(s,r)/2;let a,h,l,c;Array.isArray(n)?(a=Math.min(o,Math.max(0,n[0]??0)),h=Math.min(o,Math.max(0,n[1]??a)),l=Math.min(o,Math.max(0,n[2]??a)),c=Math.min(o,Math.max(0,n[3]??h))):a=h=l=c=Math.min(o,Math.max(0,n));const _=t;a!==h||h!==l||l!==c||"function"!=typeof _.roundRect?(t.moveTo(e+a,i),t.lineTo(e+s-h,i),h>0&&t.arcTo(e+s,i,e+s,i+h,h),t.lineTo(e+s,i+r-l),l>0&&t.arcTo(e+s,i+r,e+s-l,i+r,l),t.lineTo(e+c,i+r),c>0&&t.arcTo(e,i+r,e,i+r-c,c),t.lineTo(e,i+a),a>0&&t.arcTo(e,i,e+a,i,a),t.closePath()):_.roundRect(e,i,s,r,a)}static _splinePath(t,e,i,s=!1){const r=e.length;if(r<2)return;if(s||t.moveTo(e[0][0],e[0][1]),2===r)return void t.lineTo(e[1][0],e[1][1]);const n=i/6;for(let i=0;i<r-1;i++){const s=e[i-1]??e[i],r=e[i],o=e[i+1],a=e[i+2]??o,h=r[0]+(o[0]-s[0])*n,l=r[1]+(o[1]-s[1])*n,c=o[0]-(a[0]-r[0])*n,_=o[1]-(a[1]-r[1])*n;t.bezierCurveTo(h,l,c,_,o[0],o[1])}}_doDispose(){}get canvas(){return this._canvas}get context(){return this._ctx}get width(){return this._cssWidth}get height(){return this._cssHeight}get pixelRatio(){return this._dpr}attatch(t){return t.appendChild(this._canvas),this}detach(){const t=this._canvas.parentElement;return t&&t.removeChild(this._canvas),this}prepare(t,e,i=!0){const s=this._canvas.parentElement,r=Math.max(0,Math.floor(A(t,s&&s.clientWidth))),n=Math.max(0,Math.floor(A(e,s&&s.clientHeight)));return this._cssWidth===r&&this._cssHeight===n&&this._dpr===C||(this._canvas.width=Math.round(r*C),this._canvas.height=Math.round(n*C),this._canvas.style.width=r+"px",this._canvas.style.height=n+"px",this._cssWidth=r,this._cssHeight=n,this._dpr=C),this._ctx.setTransform(C,0,0,C,0,0),i&&this._ctx.clearRect(0,0,r,n),this}clear(){return this._ctx.clearRect(0,0,this._cssWidth,this._cssHeight),this}save(){return this._ctx.save(),this}restore(){return this._ctx.restore(),this}translate(t,e){return this._ctx.translate(t,e),this}rotate(t){return this._ctx.rotate(t),this}scale(t,e=t){return this._ctx.scale(t,e),this}clip(t,e,i,s){const r=this._ctx;return r.beginPath(),r.rect(t,e,i,s),r.clip(),this}resolveStroke(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map((t,e)=>({offset:e/n,color:t}));return{color:this.createLinearGradient(e,i,s,r,o)}}resolveFill(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map((t,e)=>({offset:e/n,color:t}));return{color:this.createLinearGradient(e,i,s,r,o)}}line(e,i,s,r,n){const o=this._ctx;return o.save(),t._applyLine(o,n),o.beginPath(),o.moveTo(e,i),o.lineTo(s,r),o.stroke(),o.restore(),this}hline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(i)+.5:i;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(e,o),n.lineTo(e+s,o),n.stroke(),n.restore(),this}vline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(e)+.5:e;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(o,i),n.lineTo(o,i+s),n.stroke(),n.restore(),this}polyline(e,i){if(e&&e.length>1){const s=this._ctx;s.save(),t._applyLine(s,i),s.beginPath(),s.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)s.lineTo(e[t][0],e[t][1]);s.stroke(),s.restore()}return this}spline(e,i,s=1){if(e&&e.length>1){const r=this._ctx;r.save(),t._applyLine(r,i),r.beginPath(),t._splinePath(r,e,s),r.stroke(),r.restore()}return this}polygon(e,i,s){if(e&&e.length>2){const r=this._ctx;r.save(),r.beginPath(),r.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)r.lineTo(e[t][0],e[t][1]);r.closePath(),i&&(t._applyFill(r,i),r.fill()),s&&(t._applyLine(r,s),r.stroke()),r.restore()}return this}rect(e,i,s,r,n,o){const a=this._ctx;if(a.save(),n&&(t._applyFill(a,n),a.fillRect(e,i,s,r)),o){const n=1===(o.width??1)?.5:0;t._applyLine(a,o),a.strokeRect(Math.floor(e)+n,Math.floor(i)+n,s,r)}return a.restore(),this}roundRect(e,i,s,r,n,o,a){if(s>0&&r>0){const h=this._ctx;h.save(),h.beginPath(),t._roundRectPath(h,e,i,s,r,n),o&&(t._applyFill(h,o),h.fill()),a&&(t._applyLine(h,a),h.stroke()),h.restore()}return this}circle(e,i,s,r,n){if(s>0){const o=this._ctx;o.save(),o.beginPath(),o.arc(e,i,s,0,2*Math.PI),r&&(t._applyFill(o,r),o.fill()),n&&(t._applyLine(o,n),o.stroke()),o.restore()}return this}arc(e,i,s,r,n,o,a=!1){if(s>0){const h=this._ctx;h.save(),t._applyLine(h,o),h.beginPath(),h.arc(e,i,s,r,n,a),h.stroke(),h.restore()}return this}pie(e,i,s,r,n,o,a,h=!1){if(s>0){const l=this._ctx;l.save(),l.beginPath(),l.moveTo(e,i),l.arc(e,i,s,r,n,h),l.closePath(),o&&(t._applyFill(l,o),l.fill()),a&&(t._applyLine(l,a),l.stroke()),l.restore()}return this}ring(e,i,s,r,n,o,a,h){if(r>0&&s>=0&&s<r){const l=this._ctx;l.save(),l.beginPath(),l.arc(e,i,r,n,o,!1),l.arc(e,i,s,o,n,!0),l.closePath(),a&&(t._applyFill(l,a),l.fill()),h&&(t._applyLine(l,h),l.stroke()),l.restore()}return this}shape(e,i,s,r,n,o){if(r>0){const a=t.SHAPES.get(e);if(!a){const e=this._ctx;e.save(),e.beginPath(),a(e,i,s,r),n&&(t._applyFill(e,n),e.fill()),o&&(t._applyLine(e,o),e.stroke()),e.restore()}}return this}bar(e,i,s,r,n,o){const a=this._ctx,h=Math.round(e),l=Math.round(i),c=Math.max(1,Math.round(s)),_=Math.max(1,Math.round(r));if(a.save(),n&&(t._applyFill(a,n),a.fillRect(h,l,c,_)),o){const e=o.width??1,i=1===e?.5:0,s=1===e?1:0;t._applyLine(a,o),a.strokeRect(h+i,l+i,c-s,_-s)}return a.restore(),this}area(e,i,s,r){if(e&&e.length>1){const n=this._ctx;n.save(),n.beginPath(),n.moveTo(e[0][0],i);for(let t=0;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);if(n.lineTo(e[e.length-1][0],i),n.closePath(),s&&(t._applyFill(n,s),n.fill()),r){n.beginPath(),n.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);t._applyLine(n,r),n.stroke()}n.restore()}return this}splineArea(e,i,s,r,n=1){if(e&&e.length>1){const o=this._ctx;o.save(),o.beginPath(),o.moveTo(e[0][0],i),o.lineTo(e[0][0],e[0][1]),t._splinePath(o,e,n,!0),o.lineTo(e[e.length-1][0],i),o.closePath(),s&&(t._applyFill(o,s),o.fill()),r&&(o.beginPath(),t._splinePath(o,e,n),t._applyLine(o,r),o.stroke()),o.restore()}return this}text(e,i,s,r){if(null!=e&&""!==e){const n=this._ctx;n.save(),t._applyText(n,r),n.fillText(e,i,s),n.restore()}return this}measureText(t,e){const i=this._ctx;i.save(),e&&(i.font=e);const s=i.measureText(t);return i.restore(),s}drawImage(t,e,i,s,r,n,o,a,h){const l=this._ctx;return void 0!==n&&void 0!==o&&void 0!==a&&void 0!==h&&void 0!==s&&void 0!==r?l.drawImage(t,n,o,a,h,e,i,s,r):void 0!==s&&void 0!==r?l.drawImage(t,e,i,s,r):l.drawImage(t,e,i),this}createLinearGradient(t,e,i,s,r){const n=this._ctx.createLinearGradient(t,e,i,s);for(const t of r)n.addColorStop(t.offset,t.color);return n}createRadialGradient(t,e,i,s,r,n,o){const a=this._ctx.createRadialGradient(t,e,i,s,r,n);for(const t of o)a.addColorStop(t.offset,t.color);return a}verticalGradient(t,e,i){return this.createLinearGradient(0,t,0,e,i)}horizontalGradient(t,e,i){return this.createLinearGradient(t,0,e,0,i)}blit(t,e,i,s,r){return this._cssWidth>0&&this._cssHeight>0&&t.drawImage(this._canvas,0,0,this._canvas.width,this._canvas.height,e,i,s??this._cssWidth,r??this._cssHeight),this}};tt.SHAPES=tt._builtinShapes();const et=(new Date).getTime(),it="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class st{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&st.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(g(i,st.month_days[st.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,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!s(t))return l({},t)}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}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 i=parseFloat(t);return isFinite(i)?i:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(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()-et}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}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 i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static parseTuples(t){if(s(t)){const e=[];let i=-1/0;return t.forEach((r,n)=>{s(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>i&&(e.push([+r[0],+r[1]]),i=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=s(t)?[]:{};for(let i of Object.keys(t))e[i]=this.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(t,e){const i=+new Date;e(),st.log(t,+new Date-i+"ms")}static clamp(t,e,i){return f(e,g(i,t))}static makeIntArray(t,e){const i=new Array(f(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length;e;){const i=Math.floor(Math.random()*e),s=t[--e];t[e]=t[i],t[i]=s}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,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%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 i=m(t-e);return g(i,b-i)}}st.LOGGING=!1,st.week_days=["일","월","화","수","목","금","토"],st.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],st.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]],st.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const rt={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 nt="ko",ot=rt[nt]||rt[nt="ko"];const at=(t,e)=>{t&&i(e)&&(ot=rt[t.substring(0,2)]=Object.assign(rt.ko,rt.en,e))};class ht extends U{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 i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}const lt=function(t){return t&&"object"==typeof t};class ct extends ht{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),s(e)&&e.forEach(t=>this._rows.push(this.$_readRow(t)))}$_buildOptions(t){const e=t.fields;let i;i=s(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(s(t))for(let i=0;i<this._fields.length;i++)e[this._fields[i]]=t[i];else lt(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,i){this._checkRow(t);const s=this._rows[t],r=s[e];i!==r&&(s[e]=i,this._rows[t]=s,this._fireEvent("onDataValueChanged",t,e,i,r),this._changed())}getValues(t,e=0,i=-1){const s=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(i)||i<0||i>s.length)&&(i=s.length);for(let n=e;n<i;n++)r.push(s[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)&&D(ot.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class _t{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const i=t[e];let r;s(i)?r=new ct({},i):lt(i)&&s(i.values)&&(r=new ct(i.options,i.values)),this._map[e]=r}}}const dt="%".charCodeAt(0),ut=void 0,pt={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"},gt=function(t){const e=pt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return pt[t]=e,e}return e};function ft(t){return parseFloat(t.toPrecision(12))}function mt(t){return Math.floor(1e6*t)/1e6}const yt=function(t,e,r,o=!0,a=!0,h=!1,c){let _,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),s(t))_=[],t.forEach(t=>{if(i(t)&&n(t.color)){const i={fromValue:A(t.fromValue,d?d.toValue:e),toValue:A(t.toValue,r),color:t.color,style:t.style?l({},t.style):ut};i.fromValue<i.toValue&&(_.push(i),d=i)}}),_=_.sort((t,e)=>t.fromValue-e.fromValue).filter(t=>t.toValue>=e&&t.fromValue<r),a&&_.forEach(t=>{t.fromValue=f(t.fromValue,e),t.toValue=g(t.toValue,r)});else if(i(t)&&s(t.colors)&&t.colors.length>0){const i=t.colors,n=s(t.styles)?t.styles:null;if(_=[],s(t.steps)&&t.steps.length>0){const o=s(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++)_.push({fromValue:o[t],toValue:o[t+1],color:i[g(t,i.length-1)],style:n?n[g(t,n.length-1)]:ut})}else{let s=A(t.fromValue,e);const o=A(t.toValue,r),a=(o-s)/i.length;let h=0;for(;s<o;)_.push({fromValue:s,toValue:s+=a,color:i[g(h,i.length-1)],style:n?n[g(h,n.length-1)]:ut}),h++}}if(h&&_&&_.length>0){let t=0,i=e;for(;t<_.length;)_[t].fromValue>i&&_.splice(t,0,{fromValue:i,toValue:_[t].fromValue,color:c}),i=_[t].toValue,t++;_[t-1].toValue<r&&_.push({fromValue:_[t-1].toValue,toValue:r,color:c})}return _},bt="shuffle",xt="random",wt="vertical-lr",vt="vertical-rl",St="fill",Vt="stroke";function Ct(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function At(t,e,i){let s,r=!1;if(null==t){if(e)return null;s=i||0,r=!0}else if("string"==typeof t){const i=t.trim();if(0===i.length?s=NaN:i.charCodeAt(i.length-1)===dt?s=1===i.length?NaN:parseFloat(i):(s=parseFloat(i),r=!0),isNaN(s)){if(e)return null;kt(ot.invalidSizeValue,t)}}else if(s=+t,isNaN(s)){if(e)return null;s=i||0,r=!0}else r=!0;return{size:s,fixed:r}}function Pt(t,e){return At(t,!0)||At(e,!1)}const kt=(t,e)=>{throw new Error(O(t,e))},Lt="http://www.w3.org/2000/svg",Tt=function(t){return"function"==typeof t?t:null},Nt=function(t){return"string"==typeof t&&t.length>0},Mt=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):s):s},Et="0".charCodeAt(0),Bt="#".charCodeAt(0),Ot=",".charCodeAt(0),Dt="s".charCodeAt(0),Rt="a".charCodeAt(0);class $t{static getFormatter(t){let e=$t.Formatters[t];return e||($t.Formatters[t]=e=new $t(t)),e}static get Default(){return $t.getFormatter($t.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 i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===Et;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Bt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Et;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Ot){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===Dt){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===Rt){i.signDisplay="never";break}}return i.minimumIntegerDigits=f(1,i.minimumIntegerDigits),i}}}$t.DEFAULT_FORMAT="",$t.Formatters={};const It=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Ft=[".","/","-",":"],zt="Z".charCodeAt(0),Ht="z".charCodeAt(0),Gt="A".charCodeAt(0),jt="a".charCodeAt(0),Wt="y".charCodeAt(0),Yt="M".charCodeAt(0),Xt="m".charCodeAt(0),Ut="W".charCodeAt(0),Zt="w".charCodeAt(0),qt="d".charCodeAt(0),Kt="H".charCodeAt(0),Qt="h".charCodeAt(0),Jt="S".charCodeAt(0),te="s".charCodeAt(0);class ee{static getFormatter(t){let e=ee.Formatters[t];return e||(ee.Formatters[t]=e=new ee(t)),e}static get Default(){return ee.getFormatter(ot.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||ot.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case Wt:s+=a>2?t.getFullYear():M(t.getFullYear()%100);break;case Yt:s+=a>1?M(t.getMonth()+1):t.getMonth()+1;break;case qt:s+=a>1?M(t.getDate()):t.getDate();break;case Ut:s+=a>1?M(z.weekOfYear(t,e)+1):z.weekOfMonth(t,e,!0)+1;break;case Zt:s+=a>1?z.long_week_days[t.getDay()]:z.week_days[t.getDay()];break;case Kt:s+=a>1?M(t.getHours()):t.getHours();break;case Qt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?M(e):e}else s+=a>1?M(t.getHours()):t.getHours();break;case Xt:s+=a>1?M(t.getMinutes()):t.getMinutes();break;case te:s+=a>1?M(t.getSeconds()):t.getSeconds();break;case jt:case Gt:t.getHours()<12?s+=ot.am:s+=ot.pm;break;case Jt:let i=t.getMilliseconds();s+=3==a?E(i):2==a?M(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(Ft.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),It.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Gt&&e<=zt||e>=jt&&e<=Ht)&&D(ot.invalidDateFormat,t)}e.push(n)}if(r<s&&z.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&z.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||ot.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ee.Formatters={};class ie{static isBright(t){return new ie(t).isBright()}static getContrast(t,e,i){return new ie(t).getContrast(e,i)}static interpolate(t,e,i){const s=new ie(t),r=new ie(e),n=1-i,o=Math.round(s.r*i+r.r*n),a=Math.round(s.g*i+r.g*n),h=Math.round(s.b*i+r.b*n),l=s.a*i+r.a*(1-i);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return it?new ie(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(z.startsWith(t,"rgb(")&&z.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):z.startsWith(t,"rgba(")&&z.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):z.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 ie(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 i;e>6?(i=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)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}ie.BLACK="#000",ie.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class se{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 i in e)t.setAttribute(i,e[i])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,i){t.setProperty(e,i,"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,i=""){return t.style.display=e?i:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let i=null;"string"==typeof e?i=e:se.isSVGClipPathElement(e)&&(i=e.id||null),i?t.setAttribute("clip-path",`url(#${i})`):t.removeAttribute("clip-path")}static createClipRect(t,e){const i=t.createElementNS(Lt,"clipPath");return i.id=e,i.append(t.createElementNS(Lt,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,i,s,r){return t.setAttribute("x",e),t.setAttribute("y",i),t.setAttribute("width",s),t.setAttribute("height",r),t}static isSVGElement(t){return se.isElement(t)&&t.namespaceURI===Lt}static isSVGClipPathElement(t){return se.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,i){i?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var re;se.instanceOf=function(t,e){return se.isElement(t)&&t.tagName===e.toUpperCase()},se.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(re||(re={}));const ne={name:"RealChart",version:"1.4.32",license:"enterprise",code:null};class oe{static decode(t){const e=oe.CHARS,i=oe.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}oe.PAD="=",oe.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class ae{static union(t,e){const i=e.s3[255&t];t>>=8;const s=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^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=ae.xor,s=ae.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=ae.xor,s=ae.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map(function(t){return 255&t.charCodeAt(0)});const i=ae.kb,s=ae._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map(function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*ae.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)}),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=ae._decryptBlock;let s=ae._init(e),r=[],n=oe.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*ae.POW24|n[a+1]*ae.POW16|n[a+2]*ae.POW8|n[a+3],h.right=n[a+4]*ae.POW24|n[a+5]*ae.POW16|n[a+6]*ae.POW8|n[a+7],i(h,s);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)}}ae.POW2=Math.pow(2,2),ae.POW3=Math.pow(2,3),ae.POW4=Math.pow(2,4),ae.POW8=Math.pow(2,8),ae.POW16=Math.pow(2,16),ae.POW24=Math.pow(2,24),ae.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 he{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 i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}}return!1}static decrypt(t){const e={},i=ae.decrypt(t,"dkdl"+this._getLDKey(ae.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}const le=new Map;function ce(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const _e=function(t){const e=location.hostname;let i;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(i=ne.code||window.realChartLic,!i)throw new Error(s)}catch(t){throw new Error(s)}const r=he.decrypt(i);if(!function(t,e){if("RealChart"===t)return!0;const i=ce(e),s=le.get(t);return!!s&&s.has(i)}(r.name,t)||"RealChart"!==ne.name)throw new Error(s);try{const t=r.server.toLowerCase(),i=location.pathname.toLowerCase();if(ne.license!=re.Developer&&!he.includedDomains(t,e.toLowerCase(),i))throw new Error(s);const n=r.lic.toLowerCase();if(!Object.values(re).includes(n))throw new Error(s);if(ne.license=r.lic,n==re.Evaluation||n==re.Limited){const t=r.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)}return!0},de={linear:t=>t,inOutSine:t=>-(d(y*t)-1)/2},ue=function(t,e,i,s,r,n){const o=B(e,null!=i?i:"initial"),a=B(e,s),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class pe{constructor(){this.delay=0,this.duration=pe.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,i=t-this._started-this.delay;let s=g(1,f(0,ft(i/this.duration)));this._easing&&(s=this._easing(s)),this._rate=s,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(s,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{i>=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,i=null){this._started&&this._stop(!0),this.duration=A(t,pe.DURATION),this.delay=e||0,this._easing=de[i],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}}pe.DURATION=700,pe.SHORT_DURATION=300;class ge extends pe{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var i,s;null===(s=(i=this.props).endHandler)||void 0===s||s.call(i,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 fe=function(t){return new ge(t).start()},me=function(t){return isNaN(t)?0:t};class ye{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=>{o(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)}),this}move(t,e){return o(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return o(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return o(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,i){return t?this._path.push("L",e,i):this._path.push("M",e,i),this}vline(t,e,i){return this._path.push("M",t,e,"L",t,i),this}hline(t,e,i){return this._path.push("M",e,t,"L",i,t),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}quad(t,e,i,s){return o(t)?this._path.push("Q",t,e,i,s):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0,"Z"),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",me(t[e]),me(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",me(t[e].x),me(t[e].y));return this}polygon(...t){return o(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,i){return 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`),this}donut(t,e,i,s){return this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 1 ${2*i} 0 a ${i} ${i} 0 1 1 ${2*-i} 0 Z`),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 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const i={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),i}}getPoints(t,e,i=!0){const s=[];for(;t<this._path.length&&s.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)s.push({x:this._path[t+1],y:this._path[t+2]}),i&&this._path.splice(t,3);return s}spline(t,e,i){let s=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void this.line(t[s+1].px,t[s+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[s+1].px-t[s].px,y:t[s+1].py-t[s].py};let l={x:0,y:0},c=Math.sqrt(h.x*h.x+h.y*h.y);if(0===c)return void this.line(t[i].px,t[i].py);h.x/=c,h.y/=c;let _=t[s+1].px-t[s].px,d=t[s].px,u=t[s].py;for(++s;s!=i;s++){a.x=-h.x,a.y=-h.y,h.x=t[s+1].px-t[s].px,h.y=t[s+1].py-t[s].py,c=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=c,h.y/=c,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*_*r,n.y=-l.y*_*r;const i=d+o.x,p=u+o.y,g=t[s].px+n.x,f=t[s].py+n.y;this.curve(i,p,g,f,t[s].px,t[s].py),_=t[s+1].px-t[s].px,o.x=l.x*_*r,o.y=l.y*_*r,d=t[s].px,u=t[s].py}this.curve(d+o.x,u+o.y,t[s].px,t[s].py,t[s].px,t[s].py)}closedSpline(t,e){const i=t.length;if(i<3)return void this.line(t[1].px,t[1].py);const s=.17,r=e?e=>t[(e+i)%i]:e=>e<0?t[0]:e>=i?t[i-1]:t[e];for(let t=0,n=i-(e?0:1);t<n;t++){const e=r(t-1),i=r(t),n=r(t+1),o=r(t+2),a=i.px+(n.px-e.px)*s,h=i.py+(n.py-e.py)*s,l=n.px-(o.px-i.px)*s,c=n.py-(o.py-i.py)*s;this.curve(a,h,l,c,n.px,n.py)}}}const be={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 xe extends U{constructor(t,e,i){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=>{},_e(e),!t&&se.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,i||xe.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),se.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,i){N(e)?(this._root.dom.removeAttribute("data-"+t),i&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),i&&this._dom.setAttribute("data-"+t,e))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){se.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let i=e.length-1;i>=0;i--)e[i].hasAttribute(t)&&e[i].remove()}clearAssetDefs(){this.$_clearDefs(we.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(Lt,"clipPath")).forEach(t=>t.remove())}clearTemporaryDefs(){this.$_clearDefs(we.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,i=NaN,s=NaN,r=0){return this.addClip(new Ae(this.doc(),t,e,i,s,r,r))}clipCircle(){return this.addClip(new Le(this.doc()))}clipDonut(){return this.addClip(new Te(this.doc()))}clipPath(){return this.addClip(new ke(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(se.isElement(e)&&e.id===t){t=e;break}se.isElement(t)&&t.parentNode===this._defs&&this._defs.removeChild(t)}containerToElement(t,e,i){const s=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+s.x,y:i-r.y+s.y}}svgToElement(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+s.left,y:i-r.top+s.top}}elementToSvg(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-s.left,y:i+r.top-s.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,we.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_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,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.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(t,e,i){if(this._inited)return;const s=t.defaultView;e instanceof s.HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof s.HTMLDivElement||D(ot.invalidOuterDiv,e),t=this._container.ownerDocument;const r=this._dom=t.createElement("div");l(r.style,be),r.className=i,this._container.appendChild(r);const n=this._svg=t.createElementNS(Lt,"svg");n.classList.add("rct-svg"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=t.createElement("desc");o.textContent="Created by RealChart v"+ne.version,n.appendChild(o);const a=this._defs=t.createElementNS(Lt,"defs");this._initDefs(t,a),n.appendChild(a),r.appendChild(n),this._root=new Ve(this),n.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),r.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),r.appendChild(this._tester),it&&(this._canvas=t.createElement("canvas"))}_initDefs(t,e){let i=t.createElementNS(Lt,"filter");i.setAttribute("id",xe.SHADOW_FILTER);const s=t.createElementNS(Lt,"feGaussianBlur");s.setAttribute("stdDeviation","1.5"),s.setAttribute("in","SourceAlpha"),i.appendChild(s);const r=t.createElementNS(Lt,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),i.appendChild(r);const n=t.createElementNS(Lt,"feFlood");n.setAttribute("flood-color","#000"),i.appendChild(n);const o=t.createElementNS(Lt,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),i.appendChild(o);const a=t.createElementNS(Lt,"feMerge"),h=t.createElementNS(Lt,"feMergeNode"),l=t.createElementNS(Lt,"feMergeNode");l.setAttribute("in","SourceGraphic"),a.appendChild(h),a.appendChild(l),i.appendChild(a),e.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{st.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._svg.clientWidth,s=this._svg.clientHeight,r=this._canvas;!r||r.width===i&&r.height==s||(r.width=i,r.height=s,r.style.width=T(i),r.style.height=T(s)),l(this._htmlRoot.style,{left:T(e.left-t.left),top:T(e.top-t.top)});const n=this._container.firstElementChild;if(n.removeAttribute("style"),l(n.style,be),i>0&&s>0){this._doRenderBackground(n,this._root,i,s);const t=this._padding=se.getPadding(this._root.dom);this._doRender({x:t.left,y:t.top,width:i-t.left-t.right,height:s-t.top-t.bottom})}}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),st.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,i,s){}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const s=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout(()=>{s&&this.invalidateLayout(),this._resizeTimer=null},i):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)}}xe.CLASS_NAME="rct-control",xe.SHADOW_FILTER="rr-chart-shadow-filter",xe._animatable=!0;class we extends U{constructor(t,e,i=ut){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(Lt,i||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDispose(){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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,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(t,e){const i=t.createElementNS(Lt,e);return this._dom.appendChild(i),i}insertElement(t,e,i){const s=t.createElementNS(Lt,e);return this._dom.insertBefore(s,i),s}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 N(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,i,s){return this.trans(t,e),this.resize(i,s),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 it&&(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 i=this._dom.getBBox();return it&&(i={x:i.x,y:i.y,width:i.width,height:i.height}),i.x+=this._tx,i.y+=this._ty,i.x-=t,i.width+=2*t,i.y-=e,i.height+=2*e,i}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 ge||!!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=st.isValidNum(t)?t:this._tx,e=st.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 i;this._updateTransform(),e&&(null===(i=this.control)||void 0===i||i.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,i=0,s=!0){if(t=st.isValidNum(t)?t:this._tx,e=st.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(i>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:i,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",()=>{this.$_cleanMove(r,s)}),r.addEventListener("cancel",()=>{this.$_cleanMove(r,s)})):this.$_cleanMove(r,s)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,i=0,s=!0){if(t=st.isValidNum(t)?t:this._tx,e=st.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(i>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:i,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)}),a.addEventListener("cancel",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)})):(this._dom.style.transformOrigin="",this.$_cleanMove(a,s))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&st.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&st.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}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(gt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(gt(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const i=this.dom.style;for(let s of t)s in this._styles&&(i.removeProperty(gt(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(gt(i),this._styles[i]=t[i],"important")}}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this._dom.setAttribute(s,r),i[s]=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)):i(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):i(t)&&this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):i(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let i=!1;return e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}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,P(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=fe({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,i)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!i&&this.remove(),null==e||e(this)},from:A(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=fe({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(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:A(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,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(we.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 i=this.parent._dom,s=this._dom,r=t.length;if(e){const n=e.sort((e,i)=>t.indexOf(e)-t.indexOf(i))[e.length-1];this!==n&&(s.remove(),n===t[r-1]?i.appendChild(s):i.insertBefore(s,t[t.indexOf(n)+1].dom))}else r>1&&s!==i.lastElementChild&&(s.remove(),i.appendChild(s))}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 we.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(st.isValidNum(e)||st.isValidNum(i))&&(e=e||0,i=i||0,s.push("translate("+e+","+i+")")),this._rotation&&s.push("rotate("+this._rotation+" "+st.pick(this._originX,t.getAttribute("x"),0)+" "+st.pick(this._originY,t.getAttribute("y")||0)+")"),st.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")");const r=st.getNumber(this._scaleX,1),n=st.getNumber(this._scaleY,1);return 1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length?s.join(" "):""}}we.DEBUGGING=!1,we.TESTING=!1,we.ASSET_KEY="_asset_",we.CLIP_KEY="_clip_",we.TEMP_KEY="_temp_";class ve extends U{constructor(t,e,i=!1){super(),this._control=e,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(Lt,"svg"),se.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"}_doDispose(){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,i,s){return se.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${i}px`,height:`${s}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 we{constructor(t,e){super(t,e,"g")}}class Ve extends we{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Ce extends we{constructor(t){super(t,ut,"clipPath");const e=this._id=st.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Ae extends Ce{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new we(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,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.x=t,this._rect.y=e,this._rect.resize(i,s),this}resize(t,e,i){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 Pe extends we{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 ke extends Ce{constructor(t){super(t),this._path=new Pe(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class Le extends Ce{constructor(t){super(t),this.add(this._circle=new we(t,null,"circle"))}setCircle(t,e,i){this._circle.setAttrs({cx:t,cy:e,r:i})}}class Te extends Ce{constructor(t){super(t),this.add(this._donut=new Pe(t))}setDonut(t,e,i,s){this._donut.setPath((new ye).donut(t,e,i,s).end())}}class Ne{constructor(){this.dragging=!1}start(t,e,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this.dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this.dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,i){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,i){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_doCompleted(t,e,i){}_doEnded(t,e){}}var Me,Ee,Be;t.TextAnchor=void 0,(Me=t.TextAnchor||(t.TextAnchor={})).START="start",Me.MIDDLE="middle",Me.END="end",t.TextLayout=void 0,(Ee=t.TextLayout||(t.TextLayout={})).TOP="top",Ee.MIDDLE="middle",Ee.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Be||(Be={}));class Oe extends we{constructor(e,i=void 0){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._overflow=Be.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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(e){const i=this.getBBox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(s)}this.y=r}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=f(0,t),(e=g(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.setStyleOrClass(ie.isBright(getComputedStyle(t).fill)?e:i),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let i=super.setStyle(t,e);return i&&this.layoutText(),i}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 De="$_TH",Re="$_TW";class $e{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?$t.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=i[r+2]||"";else if(z.isDate(n)){const t=i[3]?ee.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+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),ut),0===this._literals[2].length&&(this._literals[2]=ut)}else this._literals.push(r,n,ut,ut);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ie extends $e{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class Fe extends Ie{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach(t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}}),super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-link")}}const ze={t:class extends Ie{tag(){return"</t>"}},b:class extends Ie{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-bold")}},i:class extends Ie{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-italic")}},a:Fe};class He{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new $e).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in ze){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new ze[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const Ge=/<br.*?>|\r\n|\n/;class je{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,i,s,r){if(this._isVertical)return void this.buildVertical(t,e,i,s,r);const n=t.doc,o=A(this.lineHeight,1),a=this._lines,h=a.length,l=[],c=[];t.clearDom(),s=s||t;const _=t.getStyle("writing-mode"),d=this._vertical=_===wt||_===vt;for(let e=0;e<h;e++){const i=a[e];let h=0,_=0,u=null;for(let e of i.words){const i=e.prepareSpan(t.appendElement(n,"tspan"),s,r),o=i.getBBox();if(i[Re]=o.width,i[De]=o.height,d?(h=f(h,i[Re]),_+=i[De]):(h+=i[Re],_=f(_,i[De])),u||(u=i),e instanceof Fe){const s=n.createElementNS(Lt,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}c.push(u),i[De]=_*o,i[Re]=h*o,l.push(0==e?i[Re]/2:i[Re])}if(h>0){let e=a[0];for(let i=1;i<c.length;i++)if(c[i]){let s=0,r=0;if(d?null!=c[i-1]&&(s=Math.floor(e[Re]-t.getAscent(e[Re]))+t.getAscent(a[i][Re])):r=e[De]-t.getAscent(e[De])+t.getAscent(a[i][De]),null==c[0]&&c[i]==c.find(t=>null!=t)){const r=t.insertElement(n,"tspan",c[i]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();s+=o.width,r[Re]=o.width,r[De]=e[De]=o.height,c[0]=r}switch(_){case wt:c[i].setAttribute("dx",String(s)),c[i].setAttribute("y","0");break;case vt:c[i].setAttribute("dx",String(-s)),c[i].setAttribute("y","0");break;default:c[i].setAttribute("x","0"),c[i].setAttribute("dy",String(r))}e=a[i]}if(d){const e=t.parent.dom.classList.contains("rct-annotation"),i=t.getBBox().width,[s]=c,r=s[Re];if(e)s.setAttribute("dx",String(_===vt?i-r/2:r/2));else switch(_){case wt:s.setAttribute("x",String((i-r)/-2));break;case vt:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(a[0][De])}}buildVertical(t,e,i,s,r){const n=t.doc,o=A(this.lineHeight,1),a=this._lines,h=a.length,l=[];let c=0;const _=[];t.clearDom(),s=s||t;for(let e=0;e<h;e++){const i=a[e];let h=0,d=0,u=null,p=!1;for(let e of i.words){const i=e.prepareSpan(t.appendElement(n,"tspan"),s,r);" "===i.textContent&&(p=!0,i.textContent=".");const o=i.getBBox();if(i[Re]=o.width,i[De]=o.height,p&&(i.textContent=" ",i[De]*=.6,p=!1),h+=i[Re],d=f(d,i[De]),u||(u=i),e instanceof Fe){const s=n.createElementNS(Lt,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}_.push(u),i[De]=d*o,i[Re]=h*o,c=f(h,c),l.push(0==e?i[Re]/2:i[Re])}if(h>0){let e=a[0];_[0].setAttribute("x",String((c-_[0].getBBox().width)/2));for(let i=1;i<_.length;i++)_[i]&&(_[i].setAttribute("x",String((c-_[i].getBBox().width)/2)),_[i].setAttribute("dy",String(e[De]-t.getAscent(e[De])+t.getAscent(a[i][De]))),e=a[i]);t.layoutText(a[0][De])}}layout(e,i,s,r,n){const o=e.getBBox();let a=0,h=0;if(this._vertical)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(Ge);for(let t of i)e.push((new He).parse(t))}}}class We{constructor(t){this.source=t}hasDef(){return!0}}class Ye extends We{_setStops(t,e){e.setAttribute("id",this.source.id);const i=this.source.color,r=null==this.source.opacity?1:this.source.opacity,n=s(i)?[...i]:[i,"white"],o=s(r)?[...r]:Array(n.length).fill(r);1===n.length&&n.push("white"),n.forEach((i,s)=>{!function(t,e,i,s,r){const n=t.createElementNS(Lt,"stop");n.setAttribute("offset",String(i)),n.setAttribute("stop-color",s),n.setAttribute("stop-opacity",String(r)),e.appendChild(n)}(t,e,s/(n.length-1),i,null==o[s]?1:o[s])})}prepare(){}}class Xe extends Ye{getEelement(t,e){const i=t.createElementNS(Lt,"linearGradient");let{x1:s,x2:r,y1:n,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),e.dir){case"up":n=1;break;case"right":r=1;break;case"left":s=1;break;default:o=1}return i.setAttribute("x1",s),i.setAttribute("y1",n),i.setAttribute("x2",r),i.setAttribute("y2",o),i}}Xe.TYPE="lineargradient";class Ue extends Ye{getEelement(t,e){const i=t.createElementNS(Lt,"radialGradient");return N(e.cx)||i.setAttribute("cx",e.cx),N(e.cy)||i.setAttribute("cy",e.cy),N(e.r)||i.setAttribute("r",e.r),this._setStops(t,i),i}}Ue.TYPE="radialgradient";class Ze extends We{prepare(){}getEelement(t,e){const s=t.createElementNS(Lt,"pattern"),r=t.createElementNS(Lt,"path");let o,a,h,c,_=!1;if(s.setAttribute("id",e.id),s.setAttribute("patternUnits","userSpaceOnUse"),r.classList.add("rct-pattern"),+e.pattern>=0){const t=Ze.STOCK[+e.pattern%Ze.STOCK.length];o=t.path,a=t.style,_=!t.fill,h=t.width||20,c=t.height||20}else n(e.pattern)&&(o=e.pattern,h=e.width||e.height||20,c=e.height||e.width||20);s.setAttribute("width",String(h)),s.setAttribute("height",String(c)),r.setAttribute("d",o),a&&l(r.style,a),e.style&&l(r.style,e.style),_&&(r.style.fill="none");let d=e.backgroundStyle;if(n(d)||i(d)){const e=t.createElementNS(Lt,"rect");s.append(e),e.style.fill=n(d)?d:d.fill,e.setAttribute("width",String(h)),e.setAttribute("height",String(c))}return s.append(r),s}}Ze.TYPE="pattern",Ze.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 qe extends We{prepare(){const t=this.source;this._colors=s(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&st.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]}getAt(t){const e=this._colors;if(null==e?void 0:e.length)return this._index<0?e[Math.floor(st.randomLike(t)*e.length)]:e[t%e.length]}hasDef(){return!1}getEelement(t,e){this._colors=s(e.colors)?e.colors:[]}}qe.TYPE="colors";class Ke extends We{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 i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}})}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||Ke.SIZE,height:e.height||e.width||Ke.SIZE})}}Ke.TYPE="images",Ke.SIZE=20;class Qe{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(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(i(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(i=>{const s=i.getEelement(t,i.source);s.setAttribute(we.ASSET_KEY,"1"),e.addDef(s)})}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(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ze.TYPE:s(t.colors)?e=qe.TYPE:s(t.images)&&(e=Ke.TYPE)),e)switch(e.toLowerCase()){case Xe.TYPE:return new Xe(t);case Ue.TYPE:return new Ue(t);case Ze.TYPE:return new Ze(t);case qe.TYPE:return new qe(t);case Ke.TYPE:return new Ke(t)}}}}let Je=0;const ti=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},ei=["__proto__","constructor","prototype"],ii=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)&&!ei.includes(t)){const e=r[t];s(e)?n[t]=e.slice(0):i(e)?e._obj instanceof ct?n[t]=e:st.isDate(e)?n[t]=new Date(e):n[t]=ii(n[t],e):n[t]=e}return n};class si extends J{constructor(t){super(),this.chart=t,Je++}_addChild(t,e){return super._addChild(t,e)}_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.prop("visible")}num(t,e){const i=this._op[t];return Mt(i,e,this.constructor.defaults[t])}_load(t){var e;const i=this._op,s=this.visible;return this._config=t,void 0===t||this._doSetSimple(i,t)||this._doLoad(i,t),this._doApply(i),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this)),i}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this._load(t),this}saveOptions(t,e=!0,i=!1,s=!1){return void 0===t&&arguments.length<=1?super.saveOptions(void 0,!0,i,s):"boolean"==typeof t?super.saveOptions(void 0,t,i,s):super.saveOptions(t,e,i,s)}updateOptions(t,e=!0){var s;const r=this.visible;if(i(t)){const e={},i=[];for(const s in t)this._findChild(s)?this._doUpdateProp(s,t[s])||i.push(s):e[s]=t[s];super.updateOptions(e,!1),i.forEach(e=>{this._findChild(e).updateOptions(t[e],!1)})}else super.updateOptions(t,!1);return this.visible!==r&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),e&&this._optionChanged(),this}updateOption(t,e,i=!0,s=!1){var r;const n=this.visible;let o=!1;if(this._doUpdateProp(t,e))this._doApply(this._op),o=!0;else{const i=this._findChild(t);i?(i.updateOptions(e,!1),o=!0):(s||e!==this.prop(t))&&(super.updateOption(t,e,!1,s),o=!0)}return this.visible!==n&&(null===(r=this.chart)||void 0===r||r._visibleChanged(this)),o&&i&&this._optionChanged(t),this}toggleOption(t,e=!0){var i;const s=this.visible;return super.toggleOption(t,!1),this.visible!==s&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),e&&this._optionChanged(t),this}removeOption(t,i=!0){var s;const r=this.visible,n=this._findChild(t);let o=!1;return n?(n.clearOptions(!0,!1),o=!0):e.call(this._op,t)&&(super.removeOption(t,!1),o=!0),this.visible!==r&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),o&&i&&this._optionChanged(t),this}clearOptions(t=!0,e=!0){var i;const s=this.visible;return super.clearOptions(t,!1),this.visible!==s&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),e&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,i,s=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==i&&""!==i||(i=void 0),void 0===i?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==i||(r||(r=this._style=this._op.style={}),r[t]=String(i),n=!0),n&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(t)){n||(n=this._style=this._op.style={});for(const e in t){let i=t[e];n[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_optionChanged(t){this._changed(t)}_doLoad(t,r){var n;if(null!=(null==r?void 0:r.template)){const t=null===(n=this.chart)||void 0===n?void 0:n.assignTemplates;t&&(r=t(r))}for(const n in r)if(e.call(r,n)){let e=r[n];const o=this._findChild(n);this._doLoadProp(n,e)?t[n]=e:o?o._load(e):s(e)?t[n]=e.slice(0):i(e)?e._obj instanceof ct?t[n]=e._obj:st.isDate(e)?t[n]=new Date(e):t[n]=l({},e):t[n]=e}}_doSetSimple(t,e){return a(e)?(t.visible=e,!0):super._doSetSimple(t,e)}_doLoadProp(t,e){return"visible"===t&&(this._op.visible=e,!0)}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=At(this[i]=s,!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}si.REFRESHED="refreshed",si.defaults=ti(J.defaults,{visible:!0});class ri{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 ni extends si{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=A(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?$t.getFormatter(t):null)}_setText(t){t!==this._text&&this.prepareRich(this._text=t);const e=this.num("lineHeight");return!isNaN(e)&&this._richTextImpl&&(this._richTextImpl.lineHeight=e),this}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new je),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.num("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(this.prop("text"))}_getNumberText(t,e,i){if(st.isValidNum(t)){const s=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(s&&(t=s.toNum(t)),n=st.scaleNumber(t,r,i)),s?n?s.toStr(n.value)+n.symbol:s.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this._getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(r=o+r),a&&(r+=a),r}}ni.defaults=ti(si.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class oi extends ni{getIconPos(){const t=this.prop("iconPosition"),e="default"===t?this.getDefaultIconPos():t;switch(e){case"left":case"right":case"top":case"bottom":return e;default:return this.getDefaultIconPos()}}_doPrepareRender(t){this._images=null;const e=this.prop("imageList");if(e){const i=t._assets.get(e);i instanceof Ke&&(this._images=i)}this._root=this.prop("iconRoot")||""}getIconUrl(t){const e=this.prop("icon")||t;return n(e)?this.getUrl(e):null}getUrl(t){if(t){n(t)||(t=String(t));const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Ke?i.getImage(r):s}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}oi.defaults=ti(ni.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class ai extends si{}const hi={};class li extends si{static register(...t){t.forEach(t=>{hi[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.prop("noClip")}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const i=this.chart.isInverted();let s,r;if(this.body){const n=+this.prop("x1"),o=+this.prop("x2"),a=+this.prop("y1"),h=+this.prop("y2");if(this._x=this._y=this._w=this._h=NaN,!isNaN(n)){const a=this.chart.getAxisOf(this,!0);i?this._y=e-a.getPos(e,n):this._x=a.getPos(t,n),isNaN(o)||(i?r=this._h=e-a.getPos(e,o)-this._y:s=this._w=a.getPos(t,o)-this._x)}if(!isNaN(a)){const n=this.chart.getAxisOf(this,!1);i?this._x=n.getPos(t,a):this._y=e-n.getPos(e,a),isNaN(h)||(i?s=this._w=n.getPos(t,h)-this._x:r=this._h=e-n.getPos(e,h)-this._y)}}return isNaN(s)?s=R(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=R(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:s,height:r}}getPosition(t,e,i,s,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this.prop("align")){case"center":h+=(s-n)/2+a.x;break;case"right":h+=s-a.x-n;break;default:this._anchorObj?h+=(s-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=i,this.prop("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(si.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,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=this.prop("name")||`annotation ${this.index+1}`,this._row=isNaN(this.num("row"))?NaN:this.num("row")|0,this._col=isNaN(this.num("col"))?NaN:this.num("col")|0,(s=this.prop("offsetX"))!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(this.prop("offsetY")),this._setDims(t,"width","height")}_doPrepareRender(t){}}li.defaults=ti(si.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class ci extends ri{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(i=>{const s=i.prop("row"),r=i.prop("col");return t===s&&e===r})}getAnnotation(t){const e=this._map[t];if(e instanceof li)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={};s(t)?t.forEach((t,i)=>{n.push(this.$_loadItem(r,t,i,e?this.owner:void 0))}):i(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.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):ut})}$_loadItem(t,e,i,s){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,s);return a.init(),a.index=i,a._load(e),a}}class _i extends pe{constructor(t,e,i,s){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=i,this.start(s)}getPos(t,e){const i=this._axis,s=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=i._vlen;if(s<=0)return t;if(s>=r)o=s<=0?a:a+a*(s-r)/s*(1-n),t=t*o/a;else{o=a+a*(r-s)/r*(1-n),t=t*a/o}return t+this._offset*(o/s)*(1-n)*(e?-1:1)}_doUpdate(t,e){return this.$_calcRange(t),this._axis._changed(),!0}_stop(t){t||this._doUpdate(1,0),super._stop(t)}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const i=this._axis.axisMin(),s=this._axis.axisMax();this._axisLen=s-i,this._offset=i-e}}class di extends si{}di.defaults=ti(si.defaults,{minWidth:50});class ui extends si{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=this._addChild("flag",new di(this.axis.chart)),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this.prop("type")}getFlag(t,e){const i=this.axis.axisValueAt(t,e);if(i instanceof this.chart.win.Date)try{return ee.getFormatter(this.prop("timeFormat")).toStr(new Date(i),this.chart.startOfWeek)}catch{return ee.getFormatter(ui.defaults.timeFormat).toStr(new Date(i),this.chart.startOfWeek)}else try{return $t.getFormatter(this.prop("numberFormat")).toStr(i)}catch{return $t.getFormatter(ui.defaults.numberFormat).toStr(i)}}moved(t,e,i){const s=this.prop("onChange");s&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=i.slice(0),s(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t,e){return r(e)?(this._op.visible=!0,this._op.onChange=e,!0):super._doSetSimple(t,e)}}ui.defaults=ti(si.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const pi={};class gi extends si{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class fi extends gi{_isVisible(){const t=this.prop("visible");return null==t?this.axis._isX:t}_doSetSimple(t,e){return n(e)?(this._op.visible=!0,this._op.style={stroke:e},!0):super._doSetSimple(t,e)}}fi.defaults=ti(gi.defaults,{visible:void 0});class mi extends gi{getGap(){return this._gap}getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return it?"vertical"===e?0:"opposite"===this.axis.prop("position")?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.prop("position")?90:270}return this._rotation}getTextOrientation(){return this.prop("textOrientation")||"upright"}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;super._doApply(t),function(t){let i=+t;Number.isNaN(i)||90===i||270===i||-90===i||-270===i||(i=0),e._rotation=i}(this.prop("rotation"));const i=parseFloat(String(this.prop("gap")));this._gap=isNaN(i)?mi.defaults.gap:i}}mi.defaults=ti(gi.defaults,{align:"middle",offset:0,gap:5});class yi extends gi{_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}yi.defaults=ti(gi.defaults,{position:"end",gap:2});class bi extends gi{getRows(){if(!1===this.prop("visible"))return[];const t=this.axis,e=this.prop("colors"),i=e?e.length:0,s=[],r=this._style;if(this.prop("belowColor")&&t.isBaseVisible()&&s.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this.prop("belowColor"),style:r}),i>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%i]&&s.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%i],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%i]&&s.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%i],style:r});n[n.length-1].value<t.valueMax()&&e[o%i]&&s.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%i],style:r})}return s}_doSetSimple(t,e){return n(e)?(this._op.colors=[e,null],!0):s(e)?(this._op.colors=e,!0):super._doSetSimple(t,e)}}class xi extends gi{_doInit(t){this._rows=this._addChild("rows",new bi(this.axis))}get rows(){return this._rows}_isVisible(){const t=this.prop("visible");return this.axis._isPolar?!1!==t:null==t?!this.axis._isX:t}}xi.defaults=ti(gi.defaults,{visible:void 0,depthVisible:void 0});class wi extends oi{getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}wi.defaults=ti(oi.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class vi extends gi{_doInit(t){this._label=this._addChild("label",new wi(this.axis.chart))}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const i=this._op;if(s(i.col)){for(const t of i.col)if(e==t)return!0;return!1}if(!isNaN(i.col)&&e!=i.col)return!1;if(s(i.row)){for(const e of i.row)if(t==e)return!0;return!1}return!(!isNaN(i.row)&&t!=i.row)}}vi.defaults=ti(gi.defaults,{front:!1,zindex:0});class Si extends vi{}class Vi extends vi{}class Ci extends gi{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}isShowLast(){return!1!==this.prop("showLast")}isShowFirst(){return!1!==this.prop("showFirst")}_doSetSimple(t,e){return st.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._inside="inside"===this.prop("location");const e=this.prop("length");this._length=isFinite(e)?+e:Ci.DEF_LENGTH,this._gap=this.num("gap",Ci.defaults.gap)}}Ci.DEF_LENGTH=7,Ci.defaults=ti(gi.defaults,{visible:!1,gap:3});class Ai extends gi{_getLength(){return this._length}_getCount(){return this._count}_doSetSimple(t,e){return st.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._length=this.num("length",Ai.defaults.length),this._count=f(1,c(this.num("count",Ai.defaults.count)))}}Ai.defaults=ti(gi.defaults,{visible:!1,count:4,length:4});class Pi extends gi{}Pi.defaults=ti(gi.defaults,{visible:!1});class ki extends oi{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){const i=t.index,s=this.prop("textCallback");if(s){const e=s(this.axis.getTickLabelArgs(i,t.value));if(null!=e)return e}const r=this.prop("text"),n=this.prop("firstText"),o=this.prop("lastText");return 1==e?P(null!=o?o:n,r):0==i?P(n,r):i==e-1?P(o,r):r}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===this.prop("location")}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ki.defaults=ti(oi.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Li extends gi{getThickness(){return Math.max(0,this.num("thickness",Li.defaults.thickness))}getMinThumbSize(){return Math.max(0,this.num("minThumbSize",Li.defaults.minThumbSize))}getGap(){return Math.max(0,this.num("gap",Li.defaults.gap))}getGapFar(){return Math.max(0,this.num("gapFar",Li.defaults.gapFar))}}Li.defaults=ti(gi.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class Ti{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?st.clamp(t,this.min,this.max):st.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,i){if(t>e){const i=t;t=e,e=i}const s=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(s&&e>=t&&(isNaN(i)||o/r>=i)&&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 Ni extends fi{}class Mi extends si{static register(...t){t.forEach(t=>{pi[t.type]=t,t.subtype&&(pi[t.subtype]=t)})}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._minorValues=[],this._minorMarkPoints=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){this._title=this._addChild("title",new mi(this)),this._unitLabel=this._addChild("unitLabel",new yi(this)),this._line=this._addChild("line",new fi(this)),this._sectorLine=this._addChild("sectorLine",new Ni(this)),this._tick=this._addChild("tick",this._createTickModel()),this._label=this._addChild("label",this._createLabel()),this._grid=this._addChild("grid",this._createGrid()),this._crosshair=this._addChild("crosshair",new ui(this)),this._scrollBar=this._addChild("scrollBar",new Li(this))}_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(){const t=this.prop("visible");return!0===t||!1!==t&&!this._isEmpty}_isVisible(){return this.checkVisible()}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 x+w*this.num("startAngle")}getTotalAngle(){return w*this._totalAngle}isArced(){return this._totalAngle>0&&this._totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach(e=>{e.visible&&t.push(...e.getVisibleSeries())}),t}unitPad(){return 0}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.prop("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 i=e.needAxes()?[]:null;e.collectValues(this,i),i&&(e._yMin=g(...i),e._yMax=f(...i),t.push(...i))})}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.prop("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 i=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&i.length>0)if(t.isSplitted()){const t=[i[0].row];for(let e=1;e<i.length;e++)t.indexOf(i[e].row)<0&&t.push(i[e].row);t.forEach(t=>{let e=0,s=0;i.forEach(i=>{i.row==t&&i.isClusterable()&&(e+=A(i.groupWidth(),1))}),i.forEach(i=>{if(i.row==t&&i.isClusterable()){const t=A(i.groupWidth(),1)/e;i.setCluster(t,s),s+=t}})})}else{let t=0,e=0;i.forEach(e=>{e.isClusterable()&&(t+=A(e.groupWidth(),1))}),i.forEach(i=>{if(i.isClusterable()){const s=A(i.groupWidth(),1)/t;i.setCluster(s,e),e+=s}})}}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+st.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),g(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Ti(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,i=NaN){const s=this._prepareZoom(),r=s.resize(t,e,i);return r&&(s.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.bool("reversed"),t*this._prevRate)}checkExtents(t,e){var i;null===(i=this._ani)||void 0===i||i.cancel(),this._min===t&&this._max===e||(this._ani=new _i(this,t,e,()=>{this._changed()}))}isAnimating(){return null!=this._ani}_posValue(){const t=this.prop("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 i=this,r=this.guides,n=function(t){var e;t!==i._guides&&(i._guides=t,e=s(t)?t:[t],r.length=0,e.forEach(t=>{let e;e="range"===t.type?new Vi(i):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new Si(i):new Vi(i),e.init(),e._load(t),r.push(e)}))};super._doApply(t),this._name=this.prop("name")||`-axis-${this._index+1}`,this._row=A(Math.max(0,this.num("row")|0),0),this._col=A(Math.max(0,this.num("col")|0),0),this._totalAngle=f(0,g(360,this.num("totalAngle"))),e.call(this._op,"guide")?n(this.prop("guide")):e.call(this._op,"guides")&&n(this._op.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?ft(g(...t)||0):NaN,max:t.length>0?ft(f(...t)||0):NaN}}}Mi.defaults=ti(si.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 Ei extends ri{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;s(t)?t.forEach((t,i)=>this._items.push(this.$_loadAxis(e,t,i))):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(i=>{(e<=2||i._isHorz)&&i._buildTicks(t,e)})}connect(t){const e=this.isX,i=this._items,s=t.options,r=e?s.xAxis:s.yAxis;let a;if(o(r)&&r>=0&&r<i.length?a=i.find(t=>t._index===r):n(r)&&(a=i.find(t=>t.prop("name")===r)),a||(a=i[0]),a&&this.chart.isValidAxis(a))return a._connect(t),this.isX?t.setCol(a.col):t.setRow(a.row),a}forEach(t){for(let e=0,i=this._items.length;e<i&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach(t=>t.resetZoom())}$_loadAxis(t,e,i){var r;let n=t._getAxisType(e.type);if(!n){let o;if(s(e.categories))o="category";else if(this.isX){const s=t._getSeries()._internalItems();if(s.length>0){o="category";for(const t of s)if(!t.canCategorized()){if(e.name&&t.prop("xAxis")===e.name){o=void 0;break}if(t.prop("xAxis")===i){o=void 0;break}if(N(t.prop("xAxis"))&&0===i){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=i,o.init(),o._load(e),o}}class Bi extends si{_doPrepareRender(t){}}const Oi={},Di={};class Ri extends Bi{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:R(this._widthDim||this._sizeDim,t,t),height:R(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return R(this._leftDim,t)}getRight(t){return R(this._rightDim,t)}getTop(t){return R(this._topDim,t)}getBottom(t){return R(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=this.prop("name")||`Gauge ${this.index+1}`,this._row=A(this.num("row")|0,0),this._col=A(this.num("col")|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}Ri.defaults=ti(Bi.defaults,{size:"100%"});class $i extends Ri{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach(t=>{Oi[t.type]=t})}static _loadGauge(t,e,i){let s=t._getGaugeType(e.type);s||(s=t._getGaugeType(i||t.gaugeType));const r=new s(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}$i.defaults=ti(Ri.defaults,{duration:500});class Ii extends Ri{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach(t=>{Di[t.type]=t,Di[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.prop("minValue"),max:this.prop("maxValue")}}_doApply(t){super._doApply(t),e.call(this._op,"children")&&this.$_loadGauges(this.chart,this.prop("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();s(e)?e.forEach((e,i)=>this.$_add($i._loadGauge(t,e,r))):i(e)&&this.$_add($i._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)}}Ii.defaults=ti(Ri.defaults,{minValue:0});class Fi extends ri{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(i=>{const s=i.row||0,r=i.col||0;return t===s&&e===r})}getGauge(t){const e=this._map[t];if(e instanceof $i)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={};s(t)?t.forEach((t,i)=>{r.push(this.$_loadItem(e,t,i))}):i(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach(t=>{if(t.name&&(n[t.name]=t),t instanceof Ii)for(let e=0;e<t.count();e++){const i=t.get(e);i.name&&(n[i.name]=i),this._gauges.push(i)}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,i){if(0===Object.keys(Oi).length&&0===Object.keys(Di).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=s(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=i,n}}class zi extends $i{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),this._label=this._addChild("label",this._createLabel())}get label(){return this._label}getValue(){return f(this.prop("minValue"),g(this.prop("maxValue"),A(this._runValue,this.prop("value"))))}_setValueRate(t){this._runValue=this._prevValue+(this.prop("value")-this._prevValue)*t}updateValue(t){t!==this.prop("value")&&(this._op.value=t,this._changed())}getLabel(t,e){return t.prop("text")||(t.prop("prefix")||"")+"${value}"+(t.prop("suffix")||"")}getParam(t){switch(t){case"value":return this.label.prop("animatable")?A(this._runValue,this.prop("value")):this.prop("value");case"min":return this.prop("minValue");case"max":return this.prop("maxValue")}}calcedMinMax(){return{min:this.prop("minValue"),max:this.prop("maxValue")}}}zi.defaults=ti($i.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class Hi extends si{constructor(t){super(t.chart),this.scale=t}}Hi.defaults=ti(si.defaults,{reversed:!1,length:7});class Gi extends oi{getText(t){return st.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class ji extends si{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._line=this._addChild("line",new si(e)),this._tick=this._addChild("tick",new Hi(this)),this._label=this._addChild("label",new Gi(e))}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,i=NaN){i=A(i,e);const{min:s,max:r}=this._adjustMinMax(g(e,i),f(e,i));return this._steps=this._buildSteps(t,s,r)}buildGroupSteps(t,e){const{min:i,max:s}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,i,s)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const i=this.gauge;return t=A(i.prop("minValue"),t),e=A(i.prop("maxValue"),e),this._min=g(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let i=e.prop("minValue"),s=e.prop("maxValue");return isNaN(i)&&(i=g(...t)),isNaN(s)&&(s=f(...t)),this._min=g(i,s),this._max=f(s,i),{min:this._min,max:this._max}}_buildSteps(t,e,i){let s;const r=this.prop("steps"),n=this.prop("stepCount"),o=this.prop("stepInterval"),a=this.prop("stepPixels");return s=Array.isArray(r)?r.slice(0):n>0?this._getStepsByCount(n,e,i):o>0?this._getStepsByInterval(o,e,i):a>0?this._getStepsByPixels(t,a,e,i):[e,i],this._min=s[0],this._max=s[s.length-1],s}_getStepsByCount(t,e,i){let s=(i-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(s))),n=[];s=this._step=Math.ceil(s/r)*r,n.push(ft(e));for(let e=1;e<t;e++)n.push(ft(n[e-1]+s));return n}_getStepsByInterval(t,e,i){const s=[];let r;for(s.push(r=e);r<i;)s.push(r+=t);return this._step=t,s}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,i,s){const r=[],n=s-i;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,c=0;if(o/=a,h)if(o>h[c]){for(;c<h.length-1;c++)if(o>h[c]&&o<h[c+1]){o=h[++c];break}}else o=h[c];for(o*=a,this._step=o,r.push(ft(l=i));;){if(l+=o,l>=s){r.push(ft(s));break}r.push(ft(l))}return r}}ji.defaults=ti(si.defaults,{position:"default",stepPixels:48,gap:8});class Wi extends si{}Wi.defaults=ti(si.defaults,{visible:!1});class Yi extends si{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._rangeLabel=this._addChild("rangeLabel",new Wi(e)),this._tickLabel=this._addChild("tickLabel",new si(e))}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?R(this._thicknessDim,t,0):"inside"===this.prop("position")?t:Yi.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("ranges"))!==e._ranges&&(e._ranges=i,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=yt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Yi.defaults=ti(si.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Xi extends ni{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Xi.defaults=ti(ni.defaults,{animatable:!0});class Ui extends Xi{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:R(this._offsetXDim,t,0),y:R(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ui.defaults=ti(Xi.defaults,{offsetX:0,offsetY:0});class Zi{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(qi.DEF_CENTER),this.setCenterY(qi.DEF_CENTER),this.setRadius(qi.DEF_RADIUS),this.setInnerRadius(qi.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=At(P(t,qi.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=At(P(t,qi.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=At(P(t,qi.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=At(P(t,qi.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=At(t,!0))}getCenter(t,e){return{x:R(this._centerXDim,t,t/2),y:R(this._centerYDim,e,e/2)}}getExtents(t){const e=R(this._radiusDim,t,t/2),i=g(e,this._innerDim?R(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?R(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=A(t%360,0),s=f(0,g(360,A(e,360)));this._startRad=x+w*i,this._handRad=w*i,this._sweepRad=w*s}}class qi extends zi{_doInit(t){super._doInit(t),this._props=new Zi}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 Ui(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(this.prop("centerX")),e.setCenterY(this.prop("centerY")),e.setRadius(this.prop("radius")),e.setInnerRadius(this.prop("innerRadius")),e.setValueRadius(this.prop("valueRadius"))}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new Zi)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.prop("startAngle"),e.prop("sweepAngle")):this._props.prepareAngles(this.prop("startAngle"),this.prop("sweepAngle"))}}qi.DEF_CENTER="50%",qi.DEF_RADIUS="40%",qi.DEF_INNER="80%",qi.defaults=ti(zi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ki extends Ii{_doInit(t){this._props=new Zi,this._label=this._addChild("label",new Ui(this.chart))}get label(){return this._label}getProps(){return this._props}setChildExtents(t){const e=this._visibles.length;if(e>0){const i=this.num("itemGap");let s=t.radius;const r=(s-t.inner-i*(e-1))/e;this._visibles.forEach((t,e)=>{const n=t._childProps;n.setRadius(s),n.setInnerRadius(s-r),s-=r+i})}}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(this.prop("centerX")),e.setCenterY(this.prop("centerY")),e.setRadius(this.prop("radius")),e.setInnerRadius(this.prop("innerRadius")),e.setValueRadius(this.prop("valueRadius"))}}Ki.defaults=ti(Ii.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Qi=class extends si{constructor(t){super(t.chart),this.body=t}_isVisible(){var t,e,i,s;return!1!==this.prop("visible")&&!!(null===(e=null===(t=this.body)||void 0===t?void 0:t.isZoomed)||void 0===e?void 0:e.call(t))&&!!(null===(s=null===(i=this.body)||void 0===i?void 0:i.canZoom)||void 0===s?void 0:s.call(i))}};Qi.defaults=ti(si.defaults,{visible:void 0});class Ji extends ni{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this.prop("text")||this.chart._body.emptyView.prop("text")||Ji.DEF_TEXT}}function ts(t,e){return e._vlen>0?e._vlen:f(0,A(t.rd,0)-A(t.rdInner,0))}function es(t,e,i){const s=A(t.rdInner,0),r=ts(t,e);return r<=0?s:s+e.getPos(r,i)}function is(t,e,i,s){const r=A(t.rdInner,0),n=ts(t,e);return n<=0?r:r+e.getPos(n,i)*s}Ji.DEF_TEXT="표시할 데이터가 없습니다.",Ji.defaults=ti(si.defaults,{visible:void 0});class ss extends oi{getDefaultIconPos(){return"left"}}class rs extends si{}rs.defaults=ti(si.defaults,{visible:!1});class ns extends si{_doInit(t){this._line=this._addChild("line",new rs(this.chart)),this._endLine=this._addChild("endLine",new rs(this.chart)),this._gridLine=this._addChild("gridLine",new rs(this.chart))}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}ns.defaults=ti(si.defaults,{});class os extends si{_doInit(t){this._xSide=this._addChild("xSide",new ns(this.chart)),this._ySide=this._addChild("ySide",new ns(this.chart)),this._orgLine=this._addChild("orgLine",new rs(this.chart))}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this.bool("visible")&&this.num("length")>=0}_doSetSimple(t,e){return o(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._angle=g(60,f(30,this.num("angle")))}prop(t,e){return"angle"===t?this._angle:super.prop(t,e)}}os.defaults=ti(si.defaults,{visible:!1,length:32,angle:32});class as extends si{constructor(t){super(t),this._annotations=new ci(this)}_doInit(t){this._depth=this._addChild("depth",new os(this.chart)),this._image=this._addChild("image",new ai(null)),this._emptyView=this._addChild("emptyView",new Ji(this.chart)),this._innerText=this._addChild("innerText",new ss(this.chart)),this._zoomButton=this._addChild("zoomButton",new Qi(this))}anchorByName(t){var e;const i=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return i instanceof Ri&&this.contains(i)?i:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get innerText(){return this._innerText}hasInner(){return!!(this._innerRadiusDim&&this._innerRadiusDim.size>0)}get zoomButton(){return this._zoomButton}canZoom(){const t=this.prop("zoomType");return!this.chart.isEmpty(!0)&&("x"===t||"y"===t||"both"===t)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const i=this._depth.num("length"),s=this._depth.prop("angle"),r=_(d(s*w)*i),n=_(u(s*w)*i);return{depth:i,angle:s,base:r,side:n,wBody:t-r,hBody:e-n}}}getRadius(t,e){return R(this._radiusDim,g(t,e))}getInnerRadius(t){const e=this._innerRadiusDim;return e&&e.size>0?e.size/(e.fixed?t:100):0}getInnerRadiusPx(t){const e=this.getInnerRadius(t);return e>0?g(e*t,t):0}setPolar(t,e){return this._cx=R(this._centerXDim,t),this._cy=R(this._centerYDim,e),this._rd=R(this._radiusDim,g(t,e)),this._rdInner=this.getInnerRadiusPx(this._rd),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,rdInner:this._rdInner,cyclic:t&&!t.isArced()&&t.getTotalAngle()>0}: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 i=this,s=function(t){t!==i._anns&&(i._anns=t,i._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","innerRadius","centerX","centerY"),e.call(this._op,"annotation")?s(this.prop("annotation")):e.call(this._op,"annotations")&&s(this._op.annotations)}_doPrepareRender(t){this._annotations.prepareRender(),this._innerText._prepareRender()}}as.defaults=ti(si.defaults,{circular:!0,zoomType:"none",radius:"45%",innerRadius:0,centerX:"50%",centerY:"50%"});class hs extends si{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,i){this._module&&this._module.exportToImage(t,e,i)}}hs.defaults=ti(si.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ls extends si{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class cs extends Bi{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){const t=this.prop("layout");if("auto"!==t||"body"===this._location)return t;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return R(this._maxWidthDim,t,t)}getMaxHeight(t){return R(this._maxHeightDim,t,t)}getMarkerSize(){return this.num("markerSize",10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map(t=>t.source):t.source}_isVisible(){const t=this.prop("visible");return!0===t&&this._visItems.length>0||!1!==t&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t),this._location=this.prop("location")||"bottom",this._items=this._getLegendSources().map(t=>new ls(this,t)),this.prop("reversed")&&(this._items=this._items.reverse());const e=this._itemMap={},i=this._visItems=[];this._items.forEach(t=>{const s=t.source.legendKey();if(st.isNotEmpty(s)&&""!==s){const r=e[s];r?r.push(t):(e[s]=[t],i.push(t))}else i.push(t)})}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var _s;cs.defaults=ti(Bi.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 ds=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),us=.001;class ps{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,i,s){return["M",t,e,"L",i,s]}static arrowParts(t,e,i,s,r){const n=i-t,o=s-e,a=Math.sqrt(n*n+o*o);if(a<.001)return{body:this.line(t,e,i,s),head:[]};const h=null!=r?f(1,g(r,.9*a)):g(.15*a,12),l=Math.atan2(o,n),c=y/6,_=i+h*d(l+Math.PI-c),p=s+h*u(l+Math.PI-c),m=i+h*d(l+Math.PI+c),b=s+h*u(l+Math.PI+c);return{body:["M",t,e,"L",(_+m)/2,(p+b)/2],head:["M",_,p,"L",i,s,"L",m,b,"Z"]}}static polygon(...t){let e=0;const i=["M",t[e],t[e+1]];for(;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i.push("Z"),i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){const o=s>0,a=o?0:1;return r>0?n>0?(r=g(m(s)/2,i/2,r),n=g(m(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=g(m(s)/2,i/2,r),["M",t,e,"v",s+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s-r,"Z"]):n>0?(n=g(m(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n:+n),"h",i,"v",-s+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=g(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static isCircled(t){return b-t<us}static arc(t,e,i,s,r,n,o,a=!1){const h=g(b,m(n-r)),l=this.isCircled(h),c=h>y?1:0,_=o?1:0,p=d(r),f=u(r),x=d(n-=l?_?us:-.001:0),w=u(n),v=[];return v.push("M",t+i*p,e+s*f,"A",i,s,0,c,_,t+i*x,e+s*w),l&&v.push("M",t,e),a&&v.push("Z"),v}static sector(t,e,i,s,r,n,o,a){const h=g(b,m(o-n)),l=this.isCircled(h),c=h>y?1:0,_=a?1:0,p=d(n),f=u(n),x=d(o-=l?_?us:-.001:0),w=u(o),v=i*r,S=s*r,V=[];return V.push("M",t+i*p,e+s*f,"A",i,s,0,c,_,t+i*x,e+s*w),l?V.push("M",t+v*x,e+S*w):V.push("L",t+v*x,e+S*w),r>0&&V.push("A",v,S,0,c,1-_,t+v*p,e+S*f),V.push("Z"),V}static donut(t,e,i,s){return["M",t-i,e,"a",i,i,0,1,1,2*i,0,"a",i,i,0,1,1,2*-i,0,"Z","M",t-s,e,"a",s,s,0,1,0,2*s,0,"a",s,s,0,1,0,2*-s,0,"Z"]}static arc3d(t,e,i,s,r,n,o,a,h){function l(t,e,n,o){v.push("M",t,e,"A",i,s,0,_,c,n,o),v.push("L",n,o+r),v.push("A",i,s,0,_,1-c,t,e+r),v.push("Z")}const c=a?1:0;let _,p=g(b,m(o-n));const f=this.isCircled(p);let x=(n%b+b)%b,w=(o%b+b)%b;const v=[];let S,V,C,A;if(!f&&(c&&x<=y&&w>=0&&w<x||!c&&w<=y&&x>=0&&x<w))_=0,c?(S=t+i*d(n),V=e+s*u(n),C=t+i*d(y),A=e+s*u(y),l(S,V,C,A),h&&(h.x1=S,h.y1=V),S=t+i*d(0),V=e+s*u(0),C=t+i*d(o),A=e+s*u(o),l(S,V,C,A),h&&(h.x2=C,h.y2=A)):(S=t+i*d(n),V=e+s*u(n),C=t+i*d(0),A=e+s*u(0),l(S,V,C,A),h&&(h.x1=S,h.y1=V),S=t+i*d(y),V=e+s*u(y),C=t+i*d(o),A=e+s*u(o),l(S,V,C,A),h&&(h.x2=C,h.y2=A));else{S=t+i*d(n),V=e+s*u(n),C=t+i*d(o-=f?c?us:-.001:0),A=e+s*u(o),c?(x=f||x<=b&&!(w>=x&&w<b)?0:x,w=f||w>y&&!(x<=w&&x>y)?y:w):(x=f||x>y&&!(w<=x&&w>y)?y:x,w=f||w<b&&!(x>=w&&x<b)?0:w);const r=t+i*d(x),a=e+s*u(x),p=t+i*d(w-=f?c?us:-.001:0),g=e+s*u(w);_=m(w-x)>y?1:0,l(r,a,p,g),h&&(h.x1=S,h.y1=V,h.x2=C,h.y2=A)}return v}static arc3dInner(t,e,i,s,r,n,o,a,h){const l=g(b,m(o-n)),c=this.isCircled(l),_=a?1:0,p=t+i*d(n),f=e+s*u(n),x=t+i*d(o-=c?_?us:-.001:0),w=e+s*u(o),v=l>y?1:0,S=[];return S.push("M",p,f,"A",i,s,0,v,_,x,w),S.push(c?"M":"L",x,w+r),S.push("A",i,s,0,v,1-_,p,f+r),h&&(h.x1=p,h.y1=f,h.x2=x,h.y2=w),S.push("Z"),S}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*u(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/4,_=2*Math.PI/5,p=_/2,g=[];g.push("M",n+a*d(r),o+h*u(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*u(r),"L",n+l*d(r+p),o+c*u(r+p)),r+=_;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=_s[e](0,0,f(2*i,0),f(2*s,0));break;default:r=_s.circle(i,s,f(g(i,s),0))}t.setPath(r)}}_s=ps,ps._drawers=Object.assign({circle:t=>_s.circle(0,0,t),none:t=>[]},_s._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class gs extends we{static create(t,e,i,s,r,n,o=0){return new gs(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=ut,i=ut){super(t,e,"rect"),this.rect=i}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,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}resizeRect(t,e){const i=this.getStyle("border-radius");return this.resize(t,e),i&&this.dom.setAttribute("rx",i),this}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setBox(t,e,i,s){this.rect=s<0?{x:t,y:e+s,width:i,height:-s}:{x:t,y:e,width:i,height:s}}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 fs extends Pe{constructor(t,e){super(t,e)}setBox(t,e,i,s){return this.setPath(ps.box(t,e,i,s)),this}}const ms="head",ys="far",bs="inside",xs="none",ws="near",vs="displayAll",Ss="largestFirst",Vs="hidden",Cs="line",As="area",Ps="circlebar";let ks=0;const Ls="_deleted",Ts="_drop",Ns="_save";class Ms{static getSum(t){let e=0;for(const i of t)isNaN(i.y)||(e+=i.y);return e}constructor(t){this.pid=ks++,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:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(s(e.drillDown)||i(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,i,s;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 s=null!==(i=this[e[0]])&&void 0!==i?i:r[e[0]];if(null!=s&&"object"==typeof s)for(let t=1;t<e.length;t++)s=s[e[t]];return s}return null!==(s=this[t])&&void 0!==s?s:r[t]}_setDeleted(){this._prev=this.copy(),this[Ls]=!0}_isDeleted(){return this[Ls]}_setDrop(t){this[Ts]=t}_getDrop(){return this[Ts]}_setSave(t){this[Ns]=t}_getSave(){return this[Ns]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=ut}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return l(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 i=t.options,s=+i.colorField,r=+i.iconField;e.length>1?(this.x=e[A(i.xField,0)],this.y=e[A(i.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var i,s,r,n;this.x=(i=t._xFielder(e),s=e.x,r=e.name,n=e.label,void 0!==i?i:void 0!==s?s:null!=r?r:n),this.y=k(t._yFielder(e),e.y,e.value),this.color=P(t._colorFielder(e),e.color),this.icon=P(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 Es{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 s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find(i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue)))}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach(t=>{const i=this._points.indexOf(t);i>=0&&(t._setDeleted(),e.push(t),this._points.splice(i,1))}),e}clean(){this._points=this._points.filter(t=>!t[Ls])}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,i=this._points.length;e<i&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,i=t._zoom;if(this._owner.needAxes()&&i){const i=t._range;let s=t.axisToData(i.min),r=t.axisToData(i.max);return t.continuous()?e.filter(t=>t.xValue>=s&&r>=t.xValue).slice(0):e.filter(t=>t.xValue>s-.5&&r+.5>t.xValue).slice(0)}return e}}class Bs extends Ms{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(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 i=t.options,s=e.length>2?1:0;s>0&&(this.x=e[A(i.xField,0)]),this.y=e[A(i.yField,0+s)],this.z=e[A(i.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=P(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=L(t.zValue,this.zValue,e)}}class Os extends Ms{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 l(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 i=t.options,s=e.length>2?1:0;this.low=e[A(i.lowField,0+s)],this.y=e[Mt(i.highField,i.yField,1+s)],s>0&&(this.x=e[A(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=P(e[t.prop("lowField")],e.low),this.y=k(e[t.prop("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=L(t.lowValue,this.lowValue,e)}}class Ds extends Ci{getPosition(){const t=this.prop("position");return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Ds.defaults=ti(Ci.defaults,{step:1});class Rs extends ki{getTick(t,e){if(null!=e){const t=this.axis,i=e.levels;if((null==i?void 0:i.length)&&t.hasCategoryTree())return i[0];const r=this._getText(e,e,!1,!1),n=r.lastIndexOf(this.sep);return s(t.prop("categoryField"))&&n>0?r.substring(n+this.sep.length):r}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}Rs.defaults=ti(ki.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class $s extends xi{getPositions(t,e){if(t.isNumericScale())return t._ticks.filter(t=>isFinite(t.pos)).map(t=>t.pos);const i=t._ani,s=t.prop("reversed"),r=[],n=t._pts;if(t._ticks.length>0){if(Math.max(1,t.tick.prop("step")||1)>1){const e=t.axisMin();for(const o of t._ticks){const t=o.value-e+1;t>0&&t<n.length&&r.push(i?i.getPos(n[t],s):n[t])}t._ticks[0].value!==e&&n.length>1&&r.unshift(i?i.getPos(n[1],s):n[1])}else for(let t=1,e=n.length-2;t<=e;t++)r.push(i?i.getPos(n[t],s):n[t])}return r}}class Is extends Mi{constructor(){super(...arguments),this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeOp=null,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],this._weights=new Map,this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1,this._numericScale=!1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){const e=this._pts,i=e.length;if(i<3)return-1;let s=2,r=i-2;for(;s<=r;){const i=s+r>>>1;if(t<e[i-1])r=i-1;else{if(!(t>=e[i]))return this._catMin+i-2;s=i+1}}return-1}getCategorySeparator(){return this.prop("categorySeparator")||"+"}isCategoryTreeEnabled(){return null!=this._categoryTreeOp}hasCategoryTree(){return!this._isPolar&&this._categoryTreeDepth>1&&this._categoryTreeGroups.length>0&&this.isCategoryTreeEnabled()}$_resolveCategoryTreeOp(t){if(!1===t||null==t)return null;if(!0===t)return Is.categoryTreeDefaults;if(!1===t.visible)return null;const e={...Is.categoryTreeDefaults,...t};return i(t.divider)&&i(Is.categoryTreeDefaults.divider)&&(e.divider={...Is.categoryTreeDefaults.divider,...t.divider}),i(t.band)&&(e.band={visible:!0,...t.band}),e}$_normalizeDivider(t){const e=Is.categoryTreeDividerDefaults;return!1===t?{...e,visible:!1}:!0===t||null==t?{...e}:{...e,...t}}$_isDividerOn(t){var e;const s=this._categoryTreeOp,r=null===(e=null==s?void 0:s.levels)||void 0===e?void 0:e[t],n=null==r?void 0:r.divider;if(void 0!==n){if(!1===n)return!1;if(!0===n)return!0;if(i(n)&&void 0!==n.visible)return!1!==n.visible}return!1!==this.$_normalizeDivider(null==s?void 0:s.divider).visible}$_dividerProp(t,e){var s;const r=this._categoryTreeOp,n=null===(s=null==r?void 0:r.levels)||void 0===s?void 0:s[t];return i(null==n?void 0:n.divider)&&void 0!==n.divider[e]?!1!==n.divider[e]:!1===(null==r?void 0:r.divider)?this.$_isDividerOn(t):i(null==r?void 0:r.divider)&&void 0!==r.divider[e]?!1!==r.divider[e]:this.$_isDividerOn(t)}isLevelVisible(t){var e,i;const s=this._categoryTreeOp;return null==s||!1!==(null===(i=null===(e=s.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.visible)}getLevelRotation(t){var e,i,s;const r=this._categoryTreeOp,n=null===(s=null===(i=null===(e=null==r?void 0:r.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.label)||void 0===s?void 0:s.rotation,o=this.$_resolveLevelRotation(n);if(void 0!==o)return o;const a=this.$_resolveLevelRotation(this.label.prop("rotation"));return void 0!==a?a:"auto"}$_resolveLevelRotation(t){return"auto"===t?"auto":o(t)?+t%360:void 0}getLevelStyle(t){var e,i,s,r;return null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.style}getLevelAlign(t){var e,i,s,r;const n=null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.align;if(null!=n)return n;const o=this.label;return o.prop("fillToCategory")&&o.prop("align")||"center"}getCategoryTreeDepth(){return this._categoryTreeDepth}getCategoryTreeGroups(){return this._categoryTreeGroups}getDividerLevel(){return this._categoryTreeDividerLevel}getDividerEnds(t){return null==t?this._categoryTreeDividerEnds:this._categoryTreeLevelEnds[t]||[]}$_groupsAtLevel(t){return this._categoryTreeLevelGroups[t]||[]}isDividerBetween(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"between")}isDividerEdge(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"edge")}isDividerBelow(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"below")}isDividerTopCap(){const t=this._categoryTreeOp;if(!t||!this.hasCategoryTree())return!1;const e=t.divider;return!1!==e&&(!0===e||null==e||(!i(e)||!1!==e.visible&&!1!==e.edge))}isDividerVisible(){if(!this.hasCategoryTree())return!1;if(this.isDividerTopCap())return!0;for(let t=0;t<this._categoryTreeDepth;t++)if(this.$_dividerProp(t,"between")||this.$_dividerProp(t,"edge")||this.$_dividerProp(t,"below"))return!0;return!1}getBandLevel(){return this.getDividerLevel()}$_resolveDividerStyle(t){if(!1===t)return;if(!0===t)return"rct-axis-tree-divider";if(n(t))return t;if(i(t)&&Object.keys(t).length>0)return t;const e=this.line._style;return n(e)||i(e)&&Object.keys(e).length>0?e:"rct-axis-tree-divider"}$_dividerStyleOf(t){if(i(t))return t.style}getDividerStyle(t){var e,i;if(null!=t){if(!this.isDividerBetween(t)&&!this.isDividerEdge(t)&&!this.isDividerBelow(t))return;const i=this._categoryTreeOp,s=null===(e=null==i?void 0:i.levels)||void 0===e?void 0:e[t],r=this.$_dividerStyleOf(null==s?void 0:s.divider),n=this.$_dividerStyleOf(null==i?void 0:i.divider),o=void 0!==r?r:n;return this.$_resolveDividerStyle(o)}return this.$_resolveDividerStyle(this.$_dividerStyleOf(null===(i=this._categoryTreeOp)||void 0===i?void 0:i.divider))}$_isBandEnabled(){const t=this._categoryTreeOp;return null!=t&&(!1!==t.band&&(!0===t.band||!!i(t.band)&&!1!==t.band.visible))}isBandVisible(){return this.$_isBandEnabled()&&this.hasCategoryTree()&&this.getBandGroups().length>0}getBandGroups(){const t=this.getBandLevel();return t<0?[]:this.$_groupsAtLevel(t)}getBandColor(t){const e=this._bandColors;return e[(t%e.length+e.length)%e.length]}$_resolveBandColors(t){const e=i(null==t?void 0:t.band)?t.band.colors:null;return s(e)&&e.length>0?e:["var(--rct-axis-tree-band-0-fill)","var(--rct-axis-tree-band-1-fill)"]}getCategoryTreeSpan(t,e,i){return this.$_getSpanFromPts(t,e,i)}getDividerPos(t,e){return this.$_getDividerPosFromPts(t,e)}getDividerLinePositions(t){const e=this._categories.length;if(0===e)return[];const i=[this.$_getCategoryEdgePos(0,t,"left")];for(const e of this._categoryTreeDividerEnds)i.push(this.getDividerPos(e,t));return i.push(this.$_getCategoryEdgePos(e-1,t,"right")),i}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}getLabelY(t,e){return t*(this.prop("reversed")?A(this._prevRate,1):1)-this.prev(e)}getLabelX(t,e){const i=A(this._prevRate,1);return this.prev(e)+(this.prop("reversed")?t*(1-i):0)}_type(){return"category"}unitPad(){return this._catPad}isNumericScale(){return this._numericScale}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new Ti(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new $s(this)}_createTickModel(){return new Ds(this)}_createLabel(){return new Rs(this)}_doApply(t){super._doApply(t),this._categoryTreeOp=this.$_resolveCategoryTreeOp(this.prop("categoryTree")),this._bandColors=this.$_resolveBandColors(this._categoryTreeOp)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this.$_buildCategoryTree(),this._isEmpty?this._values=st.makeIntArray(0,this._categories.length):super.collectValues(),this.$_resolveNumericScale()}getStartAngle(){let t=super.getStartAngle(),e=+this.prop("startOffset");return e>0&&(t-=g(e,1)*this.getWeight(0)*b/this._catLen),t}_doPrepareRender(){this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=Mt(this.prop("minPadding"),this.prop("padding"),0),this._maxPad=Mt(this.prop("maxPadding"),this.prop("padding"),0),this._catPad=Math.max(0,Math.min(.5,this.num("categoryPadding"))))}_adjustMinMax(t,e){return this.$_applyRangeOptions(t,e)}_doBuildTicks(t,e,i,s){if(this._numericScale)return this.$_doBuildNumericTicks(t,e);const r=this._label;let n=this._weights;const o=this._tick,a=o.prop("step")||1,h=[];this._zoom||(t=Math.floor(t),e=Math.ceil(e)),this._catMin=t,this._catMax=e;let l=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(l,a));let c=0;for(const t of n.values())c+=t;l=this._len=this._minPad+this._maxPad+l-n.size+c;const _=this._pts=[];if(l>0){let i=this._minPad;_.push(0);for(let s=t;s<=e;s++)_.push(i/l),i+=this.getWeight(s);_.push(i/l),_.push((i+this._maxPad)/l)}const d=this._catStart,u=this._catStep,p=o.isShowFirst();let g=1;!p&&a>1&&(g=1+a);let f=!1,m=!1;for(let i=g;i<_.length-2;i+=a){const s=t+(i-1),n=this._categories[s/u-d];this.getWeight(s)<=0||(s===t&&(f=!0),s===e&&(m=!0),h.push({index:i-1,pos:NaN,value:s,label:r.getTick(i-1,n?n.t:s)}))}if(p&&!f){const e=this._categories[t/u-d];h.unshift({index:0,pos:NaN,value:t,label:r.getTick(0,e?e.t:t)})}if(!0===o.prop("showLast")&&!m){const i=e-t,s=this._categories[e/u-d];h.push({index:i,pos:NaN,value:e,label:r.getTick(i,s?s.t:e)})}return!p&&h.length>0&&h[0].value===t&&h.shift(),!o.isShowLast()&&h.length>0&&h[h.length-1].value===e&&h.pop(),this._setMinMax(t,e),h}_calcPoints(t,e){if(this._numericScale)return this.$_scaleNumericPts(t),super._calcPoints(Math.max(0,t),e),void(this._isPolar||this.$_updateMarkPoints());const i=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<i.length;t++)i[t]=0;else for(let t=0;t<i.length;t++)i[t]/=this._vlen;for(let e=0;e<i.length;e++)i[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this.getTotalAngle();if(0===t)for(let t=0;t<i.length;t++)i[t]=0;else for(let s=0;s<i.length;s++)i[s]=i[s]/t*e}}else this.$_updateMarkPoints()}$_scaleNumericPts(t){const e=this._minPad+1+this._maxPad,i=Math.max(0,t),s=this._pts=[0,this._minPad/e,(this._minPad+1)/e,1];for(let t=0;t<s.length;t++)s[t]*=i}$_updateMarkPoints(){const t=this._tick,e=this._markPoints=this._markPoints||[];if(this._numericScale||"edge"!==t.getPosition()){const t=this._ticks;e.length=t.length;for(let i=0;i<t.length;i++)e[i]=t[i].pos}else{const t=this._pts,i=t.length-2;e.length=i;for(let s=0;s<i;s++)e[s]=t[s+1]}}getPos(t,e){if(this._numericScale)return this.$_getNumericPos(t,e);const i=this._pts,s=this.$_slotIndex(e);if(s<0||s+2>=i.length)return NaN;const r=i[s+1];let n=r+(i[s+2]-r)*(e-Math.floor(e+.5)+.5);return this.prop("reversed")&&(n=t-n),this._ani?this._ani.getPos(n,this.prop("reversed")):n}valueAt(t,e){if(this._numericScale)return this.$_numericValueAt(t,e);const i=this._pts;this.prop("reversed")&&(e=t-e);const s=i.length;if(s<3)return;let r=1,n=s-2,o=-1;for(;r<=n;){const t=r+n>>>1;e>=i[t]&&i[t+1]>=e?(o=t,n=t-1):e<i[t]?n=t-1:r=t+1}if(o>=0){const t=i[o],s=i[o+1];return this._catMin+o-(1-(e-t)/(s-t))}}getUnitLen(t,e){if(this._numericScale)return this.getLabelLength(t,e);const i=this.$_slotIndex(e),s=this._pts;if(i<0||i+2>=s.length)return NaN;let r;return r=this._ani?this._ani.getPos(s[i+2],this.prop("reversed"))-this._ani.getPos(s[i+1],this.prop("reversed")):s[i+2]-s[i+1],m(r)}getLabelLength(t,e){if(this._numericScale){const e=this._ticks.length;return e<2?NaN:Math.floor(t/e)}const i=this.$_slotIndex(e),s=this._pts;return i<0||i+2>=s.length?NaN:i>this._tstep?s[i+2]-s[i+2-this._tstep]:s[i+2+this._tstep-1]-s[i+1]}getValue(t){if(o(t))return t;const e=this._map[t];return void 0!==e?e:NaN}getXLabel(t){var e,i;const r=this._categories[t];if(!r)return t;const n=r.levels,o=this.prop("categoryField");return(null==n?void 0:n.length)&&s(o)&&o.length>1?this.hasCategoryTree()?n[0]:n[n.length-1]:null!==(i=null!==(e=r.t)&&void 0!==e?e:r.c)&&void 0!==i?i:t}_doCalculateRange(t){if(0===t.length)return this.$_hasExplicitCategories()&&this._categories.length>0?this.$_applyRangeOptions(0,this._categories.length-1):this.$_applyRangeOptions(0,0);let{min:e,max:i}=super._doCalculateRange(t);return this._isX||(e=g(0,e),i=f(0,i)),this.$_applyRangeOptions(e,i)}$_hasExplicitCategories(){const t=this.prop("categories");return s(t)&&t.length>0}$_hasDefinedTickRange(){const t=this._op;return o(t.minValue)&&!isNaN(t.minValue)&&o(t.maxValue)&&!isNaN(t.maxValue)}$_applyRangeOptions(t,e){const i=this._op,s=i.minValue,r=i.maxValue,n=o(s)&&!isNaN(s),a=o(r)&&!isNaN(r);return n&&a?this._numericScale?{min:g(s,t),max:f(r,e)}:{min:s,max:r}:(n&&s<t&&(t=s),a&&r>e&&(e=r),{min:t,max:e})}$_isValidCategoryIndex(t){return Number.isInteger(t)&&t>=0&&t<this._categories.length}$_needsNumericScaleForExplicitCategories(t){if(!this.$_hasExplicitCategories()||0===t.length)return!1;const e=this._categories.length;let i=0;for(const e of t)if(isFinite(e)){if(!Number.isInteger(e))return!0;i=f(i,m(e))}return i>f(2*e,Is.NUMERIC_SCALE_SPAN_THRESHOLD)}$_shouldUseNumericScale(t,e){const i=e-t+1,s=this._values;if(0===s.length||!isFinite(i)||i<=0)return!1;const r=new Set;for(const t of s)isFinite(t)&&r.add(t);const n=r.size;return 0!==n&&(i>Is.NUMERIC_SCALE_SPAN_THRESHOLD&&i>n*Is.NUMERIC_SCALE_SPAN_FACTOR)}$_resolveNumericScale(){if(this._numericScale=!1,this.$_hasDefinedTickRange()){const t=Math.floor(this.prop("minValue")),e=Math.ceil(this.prop("maxValue"));return void(this.$_shouldUseNumericScale(t,e)&&(this._numericScale=!0))}if(this.$_hasExplicitCategories())return void(this._numericScale=this.$_needsNumericScaleForExplicitCategories(this._values));if(this._categories.length>0||0===this._values.length)return;const t=super._doCalculateRange(this._values);let e=this._isX?t.min:g(0,t.min),i=this._isX?t.max:f(0,t.max);({min:e,max:i}=this.$_applyRangeOptions(e,i)),this.$_shouldUseNumericScale(Math.floor(e),Math.ceil(i))&&(this._numericScale=!0)}$_doBuildNumericTicks(t,e){const i=this._label;this._catMin=t,this._catMax=e,this._catLen=e-t;const s=this.$_buildNumericTickValues(t,e),r=[];for(let t=0;t<s.length;t++){const e=s[t],n=this.$_hasExplicitCategories()&&this.$_isValidCategoryIndex(e)?this.getXLabel(e):String(e);r.push({index:t,pos:NaN,value:e,label:i.getTick(t,n)})}return this._setMinMax(t,e),r}$_buildNumericTickValues(t,e){const i=e-t;if(!isFinite(i)||i<=0)return[t];let s=i/10;if(s<=0||!isFinite(s))return[t,e];const r=Math.pow(10,Math.floor(Math.log10(s))),n=s/r,o=(n<=1?1:n<=2?2:n<=5?5:10)*r,a=[];let h=Math.ceil(t/o)*o;for(h>t&&a.push(t);h<=e+1e-4*o;h+=o)a.push(parseFloat(h.toPrecision(12)));return(0===a.length||a[a.length-1]<e)&&a.push(e),a}$_getNumericPos(t,e){const i=this._catMin,s=this._catMax-i,r=this._pts;if(!isFinite(e)||s<=0||r.length<3)return s<=0?t/2:NaN;const n=r[1];let o=n+(r[r.length-2]-n)*((e-i)/s);this.prop("reversed")&&(o=t-o);const a=mt(o);return this._ani?this._ani.getPos(a,this.prop("reversed")):a}$_numericValueAt(t,e){const i=this._pts;if(i.length<3)return;this.prop("reversed")&&(e=t-e);const s=i[1],r=i[i.length-2],n=this._catMax-this._catMin;if(r===s||n<=0)return this._catMin;const o=(e-s)/(r-s);return this._catMin+o*n}$_slotIndex(t){if(!isFinite(t))return-1;const e=Math.floor(t-this._catMin+.5);return e<0||e>this._catMax-this._catMin?-1:e}$_getSpanFromPts(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=A(i,this._vlen),a=f(t,r),h=g(e,n);if(a>h||!s.length)return{center:NaN,size:0};let l=s[a-r+1],c=s[h-r+2];if(null==l||null==c)return{center:NaN,size:0};if(this.prop("reversed")){const t=o-c;c=o-l,l=t}return this._ani&&(l=this._ani.getPos(l,this.prop("reversed")),c=this._ani.getPos(c,this.prop("reversed"))),{center:(l+c)/2,size:Math.abs(c-l)}}$_getDividerPosFromPts(t,e){return this.$_getCategoryEdgePos(t,e,"right")}$_getCategoryEdgePos(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=A(e,this._vlen),a="left"===i?1:2;let h=s[f(g(t,n),r)-r+a];return null==h?NaN:(this.prop("reversed")&&(h=o-h),this._ani?this._ani.getPos(h,this.prop("reversed")):h)}$_parseCategoryLevels(t){const e=this.prop("categoryField");if(!s(e)||e.length<2||null==t)return;const i=this.getCategorySeparator(),r=t.split(i);return r.length===e.length?r:void 0}$_pushCategory(t,e,i){const s=this.$_parseCategoryLevels(t),r=this._categories;(null==s?void 0:s.length)&&(e=s[s.length-1]),r.push({c:t,t:e,i:i,levels:s})}$_buildCategoryTree(){var t,e,i,s;const r=this._categories;if(this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],!this.isCategoryTreeEnabled()||!r.length||this._isPolar)return;const n=null!==(e=null===(t=r[0].levels)||void 0===t?void 0:t.length)&&void 0!==e?e:0;if(n<2)return;if(!r.every(t=>{var e;return(null===(e=t.levels)||void 0===e?void 0:e.length)===n&&t.levels.every(t=>null!=t&&""!==t)}))return;this._categoryTreeDepth=n;for(let t=0;t<n;t++){const e=this._categoryTreeLevelGroups[t]=[];let n=0;for(;n<r.length;){const o=null===(i=r[n].levels)||void 0===i?void 0:i[t];let a=n+1;for(;a<r.length&&(null===(s=r[a].levels)||void 0===s?void 0:s[t])===o;)a++;const h={level:t,start:n,end:a-1,label:o};this._categoryTreeGroups.push(h),e.push(h),n=a}this._categoryTreeLevelEnds[t]=e.slice(0,-1).map(t=>t.end)}let o=-1,a=1/0;for(let t=0;t<n;t++){const e=this.$_groupsAtLevel(t);e.length>1&&e.some(t=>t.end>t.start)&&e.length<a&&(a=e.length,o=t)}o>=0&&(this._categoryTreeDividerLevel=o,this._categoryTreeDividerEnds=this.getDividerEnds(o))}$_collectCategories(t){var e,r;const o=this._op,a=o.categories,h=this._categories=[];let l=this._weights;if(l.clear(),s(a)&&a.length>0)this._len=0,a.forEach(t=>{const e=null==t?1:f(A(t.weight,1),0),s=t&&t.icon;let r,n;null==t?n=r=null:i(t)?(r=P(t.name,t.label),n=P(t.label,t.name)):n=r=String(t),this._len+=e,this.$_pushCategory(r,n,s),l.set(l.size,e)});else{const i=this.chart.seriesByName(o.categorySeries),a=this.chart.seriesByName(o.weightSeries)||i,h=o.weightField,c=null==a?void 0:a.data,_=o.weightByFrequency;i&&(t=[i]);const d=new Map;for(const e of t){const t=e.collectCategories(this);for(let e=0,i=t.length;e<i;e++){const i=t[e];d.has(i)||(d.set(i,d.size),this.$_pushCategory(i,i))}}if(h&&s(c)&&c.length>0){const t=a.getPoints();let i=null;for(let s=0,o=c.length;s<o;s++){const o=c[s],a=t.get(s);if(!a)continue;const u=a.x,p=f(null!==(e=o[h])&&void 0!==e?e:1,0);if(n(u)){const t=d.get(u);if(void 0===t){i=null;continue}if(!l.has(t)){l.set(t,p),i=u,this._len+=p;continue}_&&i===u&&(l.set(t,f((null!==(r=l.get(t))&&void 0!==r?r:0)+p,0)),this._len+=p)}else Number.isInteger(u)?(l.has(u)||(l.set(u,p),this._len+=p),i=null):i=null}}else if(s(t)&&t.length>0){const e=new Set;for(const i of t){const t=i.collectCategories(this),s=t.length;if(0===s)continue;let r=t[0],n=1;for(let i=1;i<s;i++){const s=t[i],o=d.get(r);s!==r?(void 0===o||e.has(r)||(e.add(r),l.set(o,_?n:1)),r=s,n=1):n++}if(!e.has(r)){e.add(r);const t=d.get(r);void 0!==t&&l.set(t,_?n:1)}}}}this._map={},h.forEach((t,e)=>{const i=t.v=e;null!=t.c&&(this._map[t.c]=i)})}}Is.type="category",Is.categoryTreeDividerDefaults={visible:!0,edge:!0,between:!0,below:!0},Is.categoryTreeDefaults={visible:!0,divider:{...Is.categoryTreeDividerDefaults},band:!1},Is.defaults=ti(Mi.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+",categoryTree:!1}),Is.NUMERIC_SCALE_SPAN_THRESHOLD=1e3,Is.NUMERIC_SCALE_SPAN_FACTOR=10;class Fs extends si{}Fs.defaults=ti(si.defaults,{visible:!1});class zs extends oi{getAlign(t,e,i,s){let r=this._align;return"auto"===r&&(r=t?i?"left":"right":s<=0?e?"left":"right":s>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,i){let s=this._verticalAlign;return"auto"===s&&(s=t?"middle":i?"bottom":"top"),s}getAlignPolar(t){let e=this._align;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100||i>=260&&i<=280?"center":i>100&&i<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._verticalAlign;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100?"bottom":i>=260&&i<=280?"top":"middle"}return e}getOffsetX(t){const e=this.prop("offsetX");return isNaN(e)?"center"===t?0:zs.OFFSET:e}getOffsetY(t){const e=this.prop("offsetY");return isNaN(e)?"middle"===t?0:zs.OFFSET:e}getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),this._position=g(1,f(0,this.num("position",1)));const e=this.prop("align");this._align="left"===e||"center"===e||"right"===e?e:"auto";const i=this.prop("verticalAlign");this._verticalAlign="top"===i||"middle"===i||"bottom"===i?i:"auto"}prop(t,e){return"position"===t?this._position:"align"===t?this._align:"verticalAlign"===t?this._verticalAlign:super.prop(t,e)}}zs.OFFSET=4,zs.defaults=ti(oi.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class Hs extends si{getRadius(){return f(0,A(this.prop("radius"),4))}}Hs.defaults=ti(si.defaults,{visible:!1,radius:4});class Gs extends si{constructor(t){super(t.chart),this.owner=t,this._points=[],this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),this._variableArea=this._addChild("variableArea",new Fs(this.chart)),this._fixedArea=this._addChild("fixedArea",new Fs(this.chart)),this._label=this._addChild("label",new zs(this.chart)),this._marker=this._addChild("marker",new Hs(this.chart))}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,i,s){return this._minX=t,this._maxX=e,this._minY=i,this._maxY=s,this}_doPrepareRender(t){this._label._prepareRender();const e=this.prop("type"),i=this.owner,s=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+this.prop("resolution")||5)),r=this._minX>0?0:(this._maxX-this._minX)/s-this._minX,n=this._minY>0?0:(this._maxY-this._minY)/s-this._minY,o=i._visPoints.filter(t=>!t.isNull).map(t=>({x:t.xValue+r,y:t.yValue+n})).sort((t,e)=>t.x-e.x),a=(this["_"+e]||this._linear).call(this,this._formatter,o);if(this._points=[],a&&"function"==typeof a.evaluator){if(o.length>0){const t=o[0].x,i=o[o.length-1].x,s=this._forward>0?this._forward:0;let r=t-(this._backward>0?this._backward:0),n=i+s;if("logarithmic"===e||"power"===e){const t=Number.EPSILON||1e-12;r<=0&&(r=t)}const h=i-t,l=n-r,c=h>0?Math.ceil(this._res*l/h):this._res;for(let t=0;t<=c;t++){const e=r+(n-r)*t/c,i=a.evaluator(e);Number.isFinite(i)&&this._points.push({x:e,y:i})}}}else if(a&&Array.isArray(a.points)){const t=this.prop("maExtrapolation");if("movingAverage"===e&&"flat"===t||"linear"===t){const e=this._forward>0?this._forward:0,i=this._backward>0?this._backward:0,s=a.points;if(s.length>0){const r=s[0],n=s[s.length-1],o=n.x-r.x,a="flat"===t;if(i>0){const t=Math.max(2,Math.ceil(this._res*i/o)),e=i/t;if(a){const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}else if(s.length>=2){const i=s[0],n=s[1],o=(n.y-i.y)/(n.x-i.x);for(let s=t;s>0;s--){const t=r.x-e*s,n=i.y+o*(t-i.x);this._points.push({x:t,y:n})}}else{const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}}if(this._points.push(...s),e>0){const t=Math.max(2,Math.ceil(this._res*e/o)),i=e/t;if(a){const e=n.y;for(let s=1;s<=t;s++)this._points.push({x:n.x+i*s,y:e})}else if(s.length>=2){const e=s[s.length-1],r=s[s.length-2],o=(e.y-r.y)/(e.x-r.x);for(let s=1;s<=t;s++){const t=n.x+i*s,r=e.y+o*(t-e.x);this._points.push({x:t,y:r})}}else{const e=n.y;for(let s=1;s<=t;s++)this._points.push({x:n.x+i*s,y:e})}}}}else this._points.push(...a.points)}this._expr=a&&a.expr,this._points.forEach(t=>{t.x-=r,t.y-=n})}getLabel(){return""}_doApply(t){super._doApply(t),this._forward=f(0,this.num("forward",0)),this._backward=f(0,this.num("backward",0)),this._formatter=$t.getFormatter(this.prop("numberFormat")||"0.####")}_calcLine(t){const e=t.length;let i=0,s=0,r=0,n=0;t.forEach(t=>{i+=t.x,s+=t.y,r+=t.x*t.y,n+=t.x*t.x});const o=e*n-i*i,a=0===o?0:(e*r-i*s)/o;return{m:a,a:(s-a*i)/e}}_linear(t,e){if(e.length>1){const{m:i,a:s}=this._calcLine(e),r=t=>i*t+s;return{expr:`y = ${t.toStr(i)}x + ${t.toStr(s)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:A(t.y,0)})),{m:s,a:r}=this._calcLine(i),n=t=>t<=0?NaN:r+Math.log(t)*s;return{expr:`y = ${t.toStr(s)}log(x) ${r>0?"+":"-"} ${t.toStr(m(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:Math.log(t.y)})),{m:s,a:r}=this._calcLine(i),n=Math.exp(r),o=t=>t<=0?NaN:n*t**s;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(s)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,i=0,s=0,r=0,n=0,o=0;t.forEach(t=>{e+=t.x,i+=t.y,s+=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=i*s-o*o,h=Math.exp((s*r-o*n)/a);return{m:(i*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const i=e.map(t=>({x:t.x,y:t.y})),{m:s,a:r}=this._calcLine2(i),n=r,o=t=>n*Math.exp(s*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(s)}x))`,evaluator:o}}return{}}_polynomial(t,e){const i=e.length;if(i>1){const s=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let s=0;s<i;s++)n+=e[s].x**t*e[s].y;s.push(n),n=0;const h=[];for(let s=0;s<a;s++){for(let r=0;r<i;r++)o+=e[r].x**(t+s);h.push(o),o=0}r.push(h)}r.push(s);const h=function(t,e){const i=t,s=t.length-1,r=[e];for(let t=0;t<s;t++){let e=t;for(let r=t+1;r<s;r++)m(i[t][r])>m(i[t][e])&&(e=r);for(let r=t;r<s+1;r++){const s=i[r][t];i[r][t]=i[r][e],i[r][e]=s}for(let e=t+1;e<s;e++)for(let r=s;r>=t;r--)i[r][e]-=i[r][t]*i[t][e]/i[t][t]}for(let t=s-1;t>=0;t--){let e=0;for(let n=t+1;n<s;n++)e+=i[n][t]*r[n];r[t]=(i[s][t]-e)/i[t][t]}return r}(r,a),l=t=>h.reduce((e,i,s)=>e+i*t**s,0);return{expr:"y = "+(h.map((e,i)=>{const s=+e;if(!isFinite(s)||0===s)return"";const r=t.toStr(s);if("0"===r)return"";if(0===i)return s<0?`-${r}`:`${r}`;return`${s<0?"- ":"+ "}${r}${1===i?"x":`x^${i}`}`}).filter(t=>t).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const i=e.length,s=f(1,g(i-1,this.prop("movingInterval"))),r=[];let n=s;for(;n<=i;){const t=e.slice(n-s,n).reduce((t,e)=>t+A(e.y,0),0);r.push({x:e[n-1].x,y:t/s}),n++}return{expr:`y = movingAverage(${t.toStr(s)})`,points:r}}}var js;Gs.defaults=ti(si.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const Ws={},Ys={},Xs=/\$\{detail\}/g;class Us extends si{}Us.defaults=ti(si.defaults,{visible:!1});class Zs extends oi{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){const i=this.prop("textField");if(i){const e=t.getProp(i);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return st.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return this.num("offset")}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return f(-90,g(90,this.num("rotation",0)))}_isVisible(){return this.prop("visible")||r(this.prop("visibleCallback"))}_doSetSimple(t,e){return r(e)?(this._op.visibleCallback=e,this._op.visible=!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._overflowFit=(()=>{const t=this.prop("overflowFit");return"hidden"===t?1/0:"none"===t?NaN:+t})(),this._vertAdjust=this.num("verticalAdjust")}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}js=Zs,Zs.OFFSET=4,Zs.defaults=ti(oi.defaults,{visible:void 0,position:"default",offset:js.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class qs extends oi{_doInit(t){super._doInit(t),this._args={}}getText(t){return st.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return this.num("offset",0)}getGap(){return this.num("gap",qs.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,i,s){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=i,r.negativeTotal=s,r.total=i+s,r}isStackLabelVisible(t){const e=this.prop("visibleCallback");return e?e(t):this.visible}getStackLabelText(t,e){const i=this.prop("textCallback");if(r(i)){const e=i(t);if(n(e))return e}return this.getText(e)}getRotation(){return f(-90,g(90,this.num("rotation",0)))}getStackLabelStyle(t){const e=this.prop("styleCallback");if(r(e))return e(t)}_isVisible(){return this.prop("visible")||r(this.prop("visibleCallback"))}_doApply(t){super._doApply(t),this._overflowFit=(()=>{const t=this.prop("overflowFit");return"hidden"===t?1/0:"none"===t?NaN:+t})(),this._vertAdjust=this.num("verticalAdjust")}}qs.OFFSET=4,qs.defaults=ti(oi.defaults,{visible:!1,align:"center",gap:qs.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Ks={x:"xValue",y:"yValue",z:"zValue"};class Qs extends pe{constructor(t,e,i){super(),this.series=t,this.point=e,this.delay=i?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 Js extends pe{constructor(t,e,i){super(),this.series=t,this.points=e,i&&(i.cancel(),this._prevAnis=i._prevAnis?[...i._prevAnis,i]:[i],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 i=this._prevVrs.get(e);void 0!==i&&(e._vr=i*(1-t))})}),this.points.forEach(e=>{e._vr=1-t}),this.series._changed(),!0}}class tr extends pe{constructor(t,e,i){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach(t=>{this.addPoint(t)}),this._interval=i,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 i=this._points;for(let t=i.length-1;t>=0;t--)i[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(i[t]._vr)||i[t]._vr>=1)&&i.splice(t,1);return 0!==i.length&&(this.series._changed(),!0)}}class er extends Ms{}const ir=12;class sr extends si{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach(t=>{Ws[t.type]=t})}static _loadSeries(t,e,i,s){let r=t._getSeriesType(i.type);if(!r&&i.type&&console.error(`Unknown series type: '${i.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+i.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(i),n}static getPointTooltipParam(t,e,i){switch(i){case"series":return t.displayName();case"name":return e.getParam(i)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[i]);default:return e.getParam(i)}}_doInit(t){this._points=new Es(this),this._pointArgs={},this._paletteColors=Array(ir).fill(0).map((t,e)=>e);this.chart.general.prop("paletteMode")==bt&&st.shuffle(this._paletteColors),this._pointLabel=this._addChild("pointLabel",this._createLabel(this.chart))}onDataValueChanged(t,e,i,s,r){st.log("onDataValueChanged",e,i,s,r);const n=this._runPoints[e];if(n){const t={};t[i]=s,this.updatePoint(n,t)}}onDataRowUpdated(t,e,i){}onDataRowAdded(t,e){st.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){st.log("onDataRowDeleted",e);const i=this._runPoints[e];i&&this.removePoint(i)}onDataChanged(t){st.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){let e;const i=this.prop("tooltipDetailCallback");if(i){this._getPointCallbackArgs(this._pointArgs,t);const s=i(this._pointArgs);e=n(s)?s:""}if(void 0===e){const t=this.prop("tooltipDetail");e=n(t)?t:""}return e}getTooltipText(t,e){let i;const s=this.prop("tooltipCallback");if(s){this._getPointCallbackArgs(this._pointArgs,e);const t=s(this._pointArgs);n(t)&&(i=t)}if(void 0===i){const t=this.prop("tooltipText");i=n(t)?t:"",i&&(i=i.replace(Xs,this.getTooltipDetail(e)))}return i}getTooltipParam(t,e,i){return sr.getPointTooltipParam(t,e,i)}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 i=[];return this._points.forEach(s=>{e>=s.xValue&&s.xValue>=t&&i.push(s)}),i}_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.prop("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.prop("label")||this.name}legendKey(){return this[this.prop("legendKey")]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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.prop("noClip"):this.prop("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.prop("xStart")),i=isNaN(e)?t.getValue(this.chart.general.getXStart(t)):e;return A(i,t.getXStart())}$_getXStep(t){return k(this.prop("xStep"),this.chart.general.prop("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 Is)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.prop("categoryField");if(null!=e){if(s(e)){const i=e.length-1,s=t.getCategorySeparator();return this._points._internalPoints().filter(t=>n(t.getProp(e[i]))).map(t=>e.map(e=>t.getProp(e)).join(s))}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 i=this.$_getXStart(t),s=this.$_getXStep(t);n(s)&&(s=s.trim());const r=n(s)?NaN:st.getNumber(s);this._points.forEach((e,o)=>{let a=t.getValue(e.x);isFinite(a)||(a=i,isFinite(r)?i+=r:n(s)&&(i=t.incStep(i,s))),e.xValue=a}),e&&this._runPoints.forEach(t=>{!1!==t.visible&&e.push(t.xValue)})}else{const i=this.hasZ();this._points.forEach((e,s)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let s=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(s)&&t&&(s=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(i?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),s=e._prev.yValue+(s-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=s,e.isNull=!isFinite(s)}}),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 i=this._visPoints,s=i.length;if(s>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=i[0],o=n.xValue,a=o,h=n.yValue,l=h,c=r?n.zValue:null,_=c;n.vindex=0;for(let t=1;t<s;t++)n=i[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<s;t++){const e=i[t].zValue;isNaN(_)&&!isNaN(e)?c=_=e:e>_?_=e:e<c&&(c=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],i=e.map(t=>t.y).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e),s=e.map(t=>t.x).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e);i.length>0&&(h=Math.min(h,i[0]),l=Math.max(l,i[i.length-1])),s.length>0&&(o=Math.min(o,s[0]),a=Math.max(a,s[s.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=c,e.zMax=this._maxZ=_)}this.$_prepareViewRanges(i),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return this.num("paddingRate")}_getRangeMinMax(t){let e,i;return"x"===t?(e=this._minX,i=this._maxX):"z"===t?(e=this._minZ,i=this._maxZ):(e=this._minY,i=this._maxY),{min:e,max:i}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:i,max:s}=this._getRangeMinMax(e);(this._runRanges=yt(this.prop("viewRanges"),i,s,!1,!1,!0,this._runColor))?t.forEach((t,i)=>{this._setViewRange(t,e)}):t.forEach((t,e)=>{t.range=ut})}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.prop("visibleInLegend")&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.prop("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?A(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Zs.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=Tt(this._pointLabel.prop("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,i){let s;return r(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),n(s))?s:(s=t.getPointText(e),null!=s?s:i)}getPointStyle(t){const e=this.prop("pointStyleCallback");if(r(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}getPointLabelStyle(t){if(r(this._pointLabel.prop("styleCallback")))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.prop("styleCallback")(this._pointArgs)}pointClicked(t){const e=this.prop("onPointClick");if(r(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}pointHovered(t){const e=this.prop("onPointHover");r(e)&&(t&&this._getPointCallbackArgs(this._pointArgs,t),e(t?this._pointArgs:null))}getViewRangeAxis(){return this.prop("viewRangeValue")||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.prop("visibleCallback")?(this._getPointCallbackArgs(this._pointArgs,t),e.prop("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 i=this.getPointAt(t);return i?i[e]:ut}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,i=!0){if(t instanceof Ms||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.cancel(),s=t.updateValues(this,e),s&&i&&this.chart.animatable()&&(s.ani=new Qs(this,t,!1),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const i=this._doAddPoint(t);if(i){if(this._points.add(i),e&&this.chart.animatable()&&this._needAddAnimation()){const t=i._prev=i.copy();t.ani=new Qs(this,i,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return i}addPoints(t,e=!0){const i=[];return s(t)&&t.forEach(t=>{const e=this._doAddPoint(t);e&&i.push(e)&&this._points.add(e)}),i.length>0&&(e&&this.chart.animatable()&&i.forEach(t=>{const e=t._prev=t.copy();e.ani=new Qs(this,t,this._points.count>1),e.ani.start()}),this._dataPointsChanged()),i}_needDecayEffect(){return!1}removePointAt(t,e=!0){const i=this._points.get(t);return this.removePoint(i,e)}removePoint(t,e=!0){if(t instanceof Ms||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Ms&&this._points.contains(t)){let i=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Js(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new tr(this,[t],this._decayDuration)).start(),i=!0)}else this._points.remove(t)&&(i=!0);if(i)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(s(t)){const i=t.map(t=>this._points.get(t)).filter(t=>null!=t);return this.removePoints(i,e)}return 0}removePoints(t,e=!0){if(s(t)){let i=[];if(t.forEach(t=>{t instanceof Ms||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Ms&&this._points.contains(t)&&i.indexOf(t)<0&&i.push(t)}),i.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Js(this,i,this._decayAni).start(),this._changed(),i.length;i=this._points.removeAll(i),i.length>0&&(this._dropAni?i.forEach(t=>this._dropAni.addPoint(t)):(this._dropAni=new tr(this,i,this._decayDuration)).start())}else i=this._points.removeAll(i);if(i.length>0)return this._doPointsRemoved(i),this._dataPointsChanged(),i.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=this.prop("name")||`Series ${this.index+1}`,this._setData(this.prop("data")),this._createFielders(),this._decayDuration=f(0,this.num("decayDuration",300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Zs(t)}_createPoint(t){return new er(t)}$_addPoint(t,e){const i=this._createPoint(t);return i.index=e,i.parse(this),(i.isNull||(i.isNull=null==t||null==i.y))&&(this._containsNull=!0),i}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return gs.create(t,sr.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 i=`_${e}er`;(!this[i]||e in t&&this[`_${e}`]!==t[e])&&(this[i]=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(s(t))return t;if(t){let e;if(t._obj instanceof ct)e=t._obj;else if(t instanceof ct)e=t;else if(Number.isFinite(t)||i(t)||a(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){this._doLoadPoints(t);const e=this.prop("onPointsLoaded");return r(e)&&e(this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this.prop("pointColors"),e=this.prop("color"),i=this._runColor=o(e)?`var(--color-${Math.max(1,(Math.floor(e)-1)%ir+1)})`:e;let r,a;s(t)?r=t:n(t)?t.endsWith("@pal")||t.endsWith("@palette")?r=this.chart.getPaletteColors(t.split("@")[0]):a=this.chart._assets.get(t):this._colorByPoint()&&(r=this.chart.general.prop("colors")),a instanceof qe?this._runPoints.forEach((t,e)=>{t.color=t.color||a.getAt(e)||i}):s(r)?this._runPoints.forEach((t,e)=>{t.color=t.color||r[e%r.length]||i}):this._runPoints.forEach((t,e)=>{t.color=t.color||i}),this._preparePointArgs(this._pointArgs),this._labelPosCallback=Tt(this._pointLabel.prop("position")),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=Tt(this._pointLabel.prop("offset")),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const i=t[Ks[e]];for(const e of this._runRanges)if(i>=e.fromValue&&i<=e.toValue)return void(t.range=e);t.range=ut}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}sr.LEGEND_MARKER="rct-legend-item-marker",sr.defaults=ti(si.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 rr extends ri{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(i=>t===i.row&&e===i.col)}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof yr&&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 i=[];return this._items.forEach(s=>{s._valid&&!s._legended&&(t<0||t===s.row)&&(e<0||e===s.col)&&(s.getLegendSources(i),s._legended=t>=0&&e>=0)}),i}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=[];s(t)?t.forEach((t,i)=>{r.push(this.$_loadItem(e,t,i))}):i(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach(t=>{t instanceof yr?n.push(...t.series):t instanceof sr&&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 i=this.$_loadItem(this.chart,t,this._series.length);if(i)return i._needAnimate=e,this._items.push(i),this._series.push(i),this.$_add(i),i}remove(t){let e;if(t instanceof sr?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.prop("zOrder")||0)-(+e.prop("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(i=>{if(i.visible){const s=i._group;(s?s.visible&&s._valid:i._valid)&&(t.push(i),i.hasShape()&&i.setShape(ds[e++%ds.length]),s||(i._valid=!0))}}),this._visibleSeries=t.sort((t,e)=>{let i=+(t._group?t._group.prop("zOrder"):t.prop("zOrder"))||0,s=+(e._group?e._group.prop("zOrder"):e.prop("zOrder"))||0;return i===s&&t._group&&t._group===e._group?(+t.prop("zOrder")||0)-(+e.prop("zOrder")||0):i-s});const i=1===this._visibleSeries.filter(t=>t.isClusterable()).length;this._visibleSeries.forEach((t,e)=>{t instanceof ur&&(t._single=i)}),this._visibles.forEach(t=>t._prepareRender())}prepareAfter(){this._visibles.forEach(t=>t.prepareAfter())}updateOptions(t,e){if(null==t)return;const i=this.chart,r=s(t)?t:[t];for(r.forEach((t,e)=>{e<this._items.length?this._items[e].updateOptions(t,!1):this._items.push(this.$_loadItem(i,t,e))});this._items.length>r.length;){const t=this._items.pop();if(t instanceof yr)t.series.forEach(t=>{const e=this._series.indexOf(t);e>=0&&this._series.splice(e,1),t.name&&delete this._map[t.name]});else if(t instanceof sr){const e=this._series.indexOf(t);e>=0&&this._series.splice(e,1),t.name&&delete this._map[t.name]}}this.$_rebuildSeriesList()}$_rebuildSeriesList(){const t=this._series=[];this._items.forEach(e=>{e instanceof yr?t.push(...e.series):e instanceof sr&&t.push(e)}),this._map={},this._widget=!0,t.forEach(t=>this.$_add(t)),this.chart._op.series=this._items.map(t=>t.options)}$_loadItem(t,e,i){const r=s(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const s=new r(t);return s._setIndex(i),s.init(),s._load(e),s}return sr._loadSeries(t,i,e)}$_add(t){!this._widget||t instanceof _r||(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 nr extends sr{_doInit(t){super._doInit(t),this._trendline=this._addChild("trendline",new Gs(this))}get trendline(){return this._trendline}connectable(t){return!0}}nr.defaults=ti(sr.defaults,{});class or extends si{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){const e=this.prop("styleCallback");if(e)return this.series._getPointCallbackArgs(this._args,t),e(this._args)}_doSetSimple(t,e){return n(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}}or.defaults=ti(si.defaults,{radius:3});class ar extends Ms{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return P(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 hr extends si{_doSetSimple(t,e){return n(e)?(this.setStyle("stroke",e,!1),!0):super._doSetSimple(t,e)}}hr.defaults=ti(si.defaults,{curved:!0});class lr extends Zs{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),this._connector=this._addChild("connector",new hr(this.chart))}get connector(){return this._connector}getWidgetAlign(){const t=this.prop("align");return"near"===t?-1:"far"===t?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}lr.defaults=ti(Zs.defaults,{visible:!0,convergent:!0,align:xs,dedupeMode:vs});class cr extends si{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this._save;let i,s=this.num("maxCount");return i=this._minDim?R(this._minDim,Ms.getSum(t)):+this.prop("minValue"),isNaN(s)&&isNaN(i)&&(s=cr.DEF_COUNT),(this._dirty=!e||e.value!==i||e.count!==s)&&(isNaN(i)||(t=t.filter(t=>t.y>=i)),s>0&&t.length>s&&(s>1&&s--,t=t.slice(0,s)),this._save={count:s,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=At(this.prop("minValue"),!0)}}cr.DEF_COUNT=10,cr.defaults=ti(si.defaults,{visible:!1,x:"기타"});class _r extends sr{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),this._othersGroup=this._addChild("othersGroup",new cr(this.chart))}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:R(this._centerXDim,t),y:R(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.prop("legendByPoint")?!1!==this.prop("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.prop("zeroInLegend"))}_doApply(t){const e=this;var i,s;super._doApply(t),i=this.prop("centerX"),s=this.prop("centerY"),i!==e._centerX&&(e._centerX=i,e._centerXDim=At(k(i,e.prop("center"),_r.DEF_CENTER),!0)),s!==e._centerY&&(e._centerY=s,e._centerYDim=At(k(s,e.prop("center"),_r.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach(t=>this._sum+=t.yValue);const i=this.getSum();this._runPoints.forEach(t=>t._percent=100*t.yValue/i)}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.prop("legendKey"),i=this.othersGroup;if(i.visible){if(!this._groupedPoints&&(this._groupedPoints=i.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({x:i.prop("x"),maxCount:i.prop("maxCount"),minValue:i.prop("minValue")},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,i)=>(t.vindex=i,t._legendKey=t[e],t))}}_r.DEF_CENTER="50%",_r.defaults=ti(sr.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:_r.DEF_CENTER,centerY:_r.DEF_CENTER});class dr extends _r{getRadius(t,e){return R(this._radiusDim,g(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=At(P(t._radius=e,dr.defaults.radius),!0))}(this,this.prop("radius"))}}dr.defaults=ti(_r.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class ur extends nr{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this.prop("pointWidth")}getMinPointWidth(){return this.prop("minPointWidth")}getPointWidth(t,e){const i=this._group;let s=t;return i?(s*=i._clusterWidth,s*=1-2*i.prop("groupPadding"),s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,f(e,s)}getPointPos(t){const e=this._group;let i=t,s=0;return e?(s=i*e._clusterPos,i*=e._clusterWidth,s+=i*e.prop("groupPadding"),i-=i*e.prop("groupPadding")*2,s+=i*this._childPos,i*=this._childWidth):(s=i*this._clusterPos,i*=this._clusterWidth),s+=i*this._pointPad,s}isClusterable(){return!1!==this.prop("clusterable")}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender();const t=this.prop("pointPadding");this._pointPad=isNaN(t)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,t)),this._op.minPointWidth=A(this.getMinPointWidth(),0)}}ur.defaults=ti(sr.defaults,{pointWidth:1,minPointWidth:0});class pr extends Zs{getAlign(){return this.prop("align")||"center"}getAlignOffset(){return this.num("alignOffset",0)}get line(){return this._line}_doInit(t){super._doInit(t),this._line=this._addChild("line",new Us(this.chart))}}pr.defaults=ti(Zs.defaults,{align:"center",alignOffset:0});class gr extends ur{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new pr(t)}_doPrepareRender(){const t=this._group;if(super._doPrepareRender(),t?(this._depth=f(0,Mt(this.prop("depth"),t.getDepth(),gr.DEPTH)),this._distance=t.getDistance()+A(this.prop("distance"),0)):(this._depth=f(0,A(this.prop("depth"),gr.DEPTH)),this._distance=A(this.prop("distance"),gr.DISTANCE)),this.prop("nullAsBase")&&null!=this.prop("baseValue")){const t=this.prop("baseValue");this._runPoints.forEach(e=>{e.isNull&&(e.y=t,e.isNull=!1)})}this._base=k(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this.prop("baseValue")}_getLabelDefaultPos(t,e){const i=this._group;return"default"===e&&i&&i._stacked&&i.stackLabel&&i.stackLabel.visible?"inside":e}}gr.DEPTH=10,gr.DISTANCE=5,gr.defaults=ti(ur.defaults,{nullAsBase:!1});class fr extends ur{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach(t=>{if(e){const i=this._getBottomValue(t);!isNaN(i)&&e.push(i)}})}}class mr extends fr{}class yr extends si{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach(t=>{Ys[t.type]=t})}static registerSeries(...t){t.forEach(t=>{Ys[t.seriesType]=t})}static collectTooltipText(t,e,i,r,n){function o(t,e,i,s){let r=e.replace(Xs,t.getTooltipDetail(i));return r=r.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+s+"."),r}const a=e.length>1&&s(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 s=r;t!==i&&t.needAxes()&&(s=t.getPointAt(r.xValue)),s&&(a?(n.items.push(t),n.rows.push([o(t,h[0],s,e),o(t,h[1],s,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,i,s){let r=s.indexOf("."),n=parseInt(s.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(i.xValue);o&&(e=t[n],i=o,s=s.substring(r+1))}return s.startsWith("series.")&&(e=t[+s.substring(7)]||e,s="series"),sr.getPointTooltipParam(e,i,s)}isGroupTooltip(){return!0}getTooltipText(t,e,i){return yr.collectTooltipText({tooltipHeader:this.prop("tooltipHeader"),tooltipRow:this.prop("tooltipRow"),tooltipListRow:this.prop("tooltipListRow"),tooltipFooter:this.prop("tooltipFooter")},this._visibles,t,e,i)}getTooltipParam(t,e,i){return yr.inflateTooltipParam(this._visibles,t,e,i)}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.prop("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(i=>{i.collectRanges(t,e)})}prepareReferents(t){this._series.forEach(e=>e.prepareReferents(t))}collectCategories(t){let e=[];return this._visibles.forEach(i=>e=e.concat(i.collectCategories(t))),e}getLegendSources(t){var e;if(!1!==this.prop("visibleInLegend")&&this.visible){const i=this._series,s=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.prop("reversed"))||"fill"!==this.prop("layout")&&"stack"!==this.prop("layout"))i.forEach(t=>t.getLegendSources(s));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(s);this.prop("reversedInLegend")&&s.reverse(),t.push(...s)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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=this.num("layoutMax",yr.LAYOUT_MAX);return t>0?t:yr.LAYOUT_MAX}_doInit(t){super._doInit(t),this._stackLabel=this._addChild("stackLabel",new qs(this.chart))}_doLoad(t,i){super._doLoad(t,i),e.call(i,"children")&&this._syncChildren(i.children)}updateOptions(t,i=!0){return t&&e.call(t,"children")?(super.updateOptions(t,!1),this._syncChildren(t.children),i&&this._changed(),this):super.updateOptions(t,i)}_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.prop("layout")||"fill"===this.prop("layout"),this._visibles=this._series.filter(t=>t.visible).sort((t,e)=>(+t.prop("zOrder")||0)-(+e.prop("zOrder")||0)),!(this._seriesChanged=!st.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){}_syncChildren(t){const e=this.chart,r=this._seriesType(),n=this._series,o=[],a=(t,i)=>{const s=t.type||r;let a=n[i];a&&a._type()===s?(a._setIndex(i),a._load(t),o.push(a)):(a=sr._loadSeries(e,i,t,r),a._group=this,o.push(a))};s(t)?t.forEach((t,e)=>a(t,e)):i(t)&&a(t,0),this._series=o}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach(i=>{i.collectValues(t,e)})}$_collectPoints(t){const e=this._visibles,i=this._stackPoints=new Map;e.forEach(e=>{e.collectValues(t,null)}),e[0]._runPoints.forEach(t=>{i.set(t.xValue,[t])});for(let t=1;t<e.length;t++)e[t]._runPoints.forEach(t=>{const e=i.get(t.xValue);e?e.push(t):i.set(t.xValue,[t])});return i}$_collectStack(t,e){const i=this.getBaseValue(t),s=this.$_collectPoints(t),r=this._stackTotals=new Map;if(isNaN(i))for(const[t,i]of s.entries()){i[0].yGroup=i[0].yValue||0;for(let t=1;t<i.length;t++)i[t].yGroup=i[t-1].yGroup+(i[t].yValue||0);const s=i[i.length-1].yGroup;r.set(t,{x:i[0].xValue,positiveTotal:s>=0?s:0,negativeTotal:s<0?s:0}),e.push(s)}else for(const[t,n]of s.entries()){let s=n[0].yValue||0,o=s>=i?0:-1,a=s<i?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)s=n[t].yValue||0,s>=i?(o>=0&&(n[t].yGroup=n[o].yGroup+s*(s<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+s*(s>=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 i=this.getBaseValue(t),s=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(i))for(const t of r.values()){const i=t.reduce((t,e)=>t+(e.yValue||0),0);if(0===i){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)/i*s,r=e.yGroup=e.yValue+r;e.push(s)}}else for(const t of r.values()){const r=t.reduce((t,e)=>t+(m(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*s,e.yValue<i?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}yr.LAYOUT_MAX=100,yr.defaults=ti(si.defaults,{layout:"default",layoutMax:yr.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class br extends yr{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class xr extends yr{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this.prop("groupWidth")}isClusterable(){return!1!==this.prop("clusterable")}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}xr.defaults=ti(yr.defaults,{groupWidth:1,groupPadding:.1});class wr extends nr{isMarker(){return!0}isXY(){return!0}}wr.defaults=ti(sr.defaults,{colorByPoint:!1});class vr extends si{}class Sr extends si{}const Vr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Cr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Ar={minPadding:0,maxPadding:0};class Pr extends si{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;this._handle=this._addChild("handle",new vr(e)),this._mask=this._addChild("mask",new Sr(e)),this._borderLine=this._addChild("borderLine",new si(e))}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return Math.max(0,this.num("thickness",Pr.defaults.thickness))}getGap(){return Math.max(0,this.num("gap",Pr.defaults.gap))}getGapFar(){return Math.max(0,this.num("gapFar",Pr.defaults.gapFar))}getHandleOverflow(){return Pr.HANDLE_TRACK_OFFSET+Pr.HANDLE_RADIUS}getSize(){const t=f(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=l({},e.series,Vr[t]())}else s.series=Vr.area();i(e.xAxis)?s.xAxis=l({},e.xAxis,(Cr[e.xAxis.type]||Cr.linear)(),Ar):s.xAxis=l({},Ar),i(e.yAxis)?s.yAxis=l({},e.yAxis,(Cr[e.yAxis.type]||Cr.linear)(),Ar):s.yAxis=l(Cr.linear(),Ar),this._chartConfig=s,this._axisType=s.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this.prop("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.bool("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()}}Pr.HANDLE_RADIUS=9.75,Pr.HANDLE_TRACK_HEIGHT=6,Pr.HANDLE_TRACK_OFFSET=Pr.HANDLE_TRACK_HEIGHT/2,Pr.defaults=ti(si.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class kr extends si{constructor(){super(...arguments),this._gap=10}getGap(){return this._gap}_doApply(t){super._doApply(t);const e=parseFloat(String(this.prop("gap")));this._gap=isNaN(e)?kr.defaults.gap:e}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}kr.defaults=ti(si.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Lr extends kr{}Lr.defaults=ti(kr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Tr extends si{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:i,_point:s,_ctx:r}=this,n=i._group,o=!!r.axis;let a=i,h=s;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const i=Number(t[1])||0;e=e.replace(i+".",""),a=o?r.series[i]:n.getVisibleSeries()[i]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(s.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,i){let s=P(this.prop("scope"),"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this.prop("noClip");return!!a(t)&&t}isFollowPointer(t){const e=this.prop("followPointer");return e||!1!==e&&(null==t?void 0:t.followPointer())}getHeaderHeight(){return this.bool("simpleMode")?0:f(this.num("headerHeight"),0)}getTailSize(){return this.bool("simpleMode")?0:f(this.num("tailSize"),0)}getBorderRadius(){return this.bool("simpleMode")?0:f(this.num("borderRadius"),0)}hasListMarker(){return"none"!==this.prop("listMarkerShape")}getMarkerSize(){return this.hasListMarker()?this.num("listMarkerSize")||7:0}getMarkerGap(){return this.hasListMarker()?this.num("listMarkerGap"):0}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("numberFormat"))!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?$t.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?ee.getFormatter(e._timeFormat):void 0)}(this.prop("timeFormat"))}}Tr.defaults=ti(si.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,listMarkerShape:"circle",listMarkerSize:7,listMarkerGap:5});const Nr="vline",Mr="hline",Er="line",Br="arrow";class Or extends li{getImageUrl(){const t=this.prop("imageUrl");if(!n(t))return t;const e=t.indexOf("::");if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Ke?i.getImage(r):s}return t}_isVisible(){return this.prop("visible")&&!N(this.prop("imageUrl"))}_doSetSimple(t,e){return n(e)?(this._op.imageUrl=e,!0):super._doSetSimple(t,e)}}Or.type="image";class Dr extends li{getShape(){return this.prop("shape")||Dr.defaults.shape}hasCustomPath(){return n(this.prop("path"))&&this.prop("path").length>0}getHeadSize(){return this.getShape()!==Br?Dr.defaults.headSize:this._headSize}_doApply(t){if(super._doApply(t),this.getShape()!==Br)return;const e=Dr.defaults;this._headSize=f(1,this.num("headSize",e.headSize)),this._style=this.$_resolveArrowStyle()}_doSetSimple(t,e){return n(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}$_resolveArrowStyle(){const t=this._style;if(n(t))return t;const e=i(t)?{...t}:{},s=this.prop("lineWidth");return null!=s?e.strokeWidth=`${f(1,A(s,1))}px`:e.strokeWidth||e["stroke-width"]||(e.strokeWidth="1px"),e.stroke||(e.stroke="#555"),e.fill||(e.fill=e.stroke),e}}Dr.type="shape",Dr.defaults=ti(li.defaults,{width:64,height:64,shape:"square",headSize:12});class Rr extends li{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this.prop("textOrientation")||"upright"}_isVisible(){return this.prop("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("numberFormat"))!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?$t.getFormatter(i):ut),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?ee.getFormatter(t):ut)}(this.prop("timeFormat"))}}Rr.type="text",Rr.defaults=ti(li.defaults,{text:"Text"});class $r extends xi{_doInit(t){super._doInit(t),this._minorGrid=this._addChild("minorGrid",new Pi(this.axis))}get minorGrid(){return this._minorGrid}getPositions(t,e){return t.hasBreak()?t._ticks.filter(e=>!t.isBreak(e.value)).map(i=>t.getPos(e,i.value)):t._ticks.map(i=>t.getPos(e,i.value))}getMinorPositions(t,e){if(!this._minorGrid.visible||t.isEmpty()||t._minorValues.length<1)return[];if(t._vlen===e&&t._minorMarkPoints.length===t._minorValues.length)return t._minorMarkPoints;const i=[];return t._minorValues.forEach(s=>{const r=t.getPos(e,s);isFinite(r)&&i.push(r)}),i}}class Ir extends Ci{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,i,s,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,i,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},c=this.$_getStepPixels(e,l);let _,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,_=a?this._getStepsByPixels(e,A(.85*c,60),i,n,o,l):s(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof jr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,i,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,i,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,i,n,o):c>0?this._getStepsByPixels(e,c,i,n,o,l):n!==o?[n,o]:[n],_}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?f(8,_(t/(.9*e))+1):A(this.prop("maxCount"),1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){super._doApply(t);const i=!r(this.prop("stepPixels"))&&st.parseTuples(this.prop("stepPixels"));let n;if(this._stepPixels=i&&i.every(([,t])=>t>0)?i:void 0,e.call(this._op,"stepMultiples")){const t=this.prop("stepMultiples");if(r(t))n=t;else{let e;if(s(t)){let i=Number.MIN_SAFE_INTEGER;e=[],t.forEach(t=>{!isNaN(+t)&&t>i&&e.push(+t)})}n=e&&e.length>0?e:void 0,n&&(n=n.filter(t=>t>=1),n.length>0?n.sort((t,e)=>t-e):n=void 0)}}this._userMultiples=n}$_getStepPixels(t,e){let i=this._stepPixels;if(r(i)&&(i=i.call(void 0,e)),!i){const t=this.axis;i=t._isPolar?Ir.STEP_PIXELS_P:t._isX?Ir.STEP_PIXELS_X:Ir.STEP_PIXELS_Y}for(let e=0;e<i.length;e++)if(t<=i[e][0])return f(1,i[e][1])}_findBaseAxis(){if(null!=this.prop("baseAxis")){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.prop("baseAxis"));e!==t&&e instanceof jr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<_(t/e)*e&&(t=_(t/e)*e),t}_getStepsByCount(t,e,i,s,r){i>e?(i=e,e=NaN):s<e&&(s=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=s-i;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=_(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))i=this._normalizeMin(i,h);else{for(!function(t,e){if(!t)throw new $(e)}(i<e&&s>e,"base error"),t=f(3,t);;){if(!(_((e-i)/a)+_((s-e)/a)+1>t))break;a+=h}i=e-_((e-i)/a)*a}else i=n._fixedMin;l.push(ft(i));for(let e=1;e<t;e++)l.push(ft(l[e-1]+a));return l}_getStepsByInterval(t,e,i,s){const r=[];let n;if(i=ft(this._normalizeMin(i,t)),isNaN(e))for(r.push(n=i);n<s;)r.push(n=ft(n+t));else{for(r.push(n=e);n>i;)r.unshift(n=ft(n-t));for(n=e;n<s;)r.push(n=ft(n+t))}return this._step=t,r}_getStepMultiples(t,e){var i;return(null!==(i=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==i?i:this.prop("fineStep"))?Ir.STEP_MULTIPLES[2]:this.prop("enableDecimals")&&1===t?Ir.STEP_MULTIPLES[0]:Ir.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,i){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,i),s(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?i=>i>=t&&i<=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,i,s,r,n){s>=i?s=i:r<=i&&(r=i);const o=r-s;if(0===o||t<=0)return isNaN(s)?[]:[s];const a=this.getMaxCount(t,e);let h=f(1,c(t/e))+1,l=o/(h-1);const d=function(t){return Math.pow(10,t)}(c(p(l))),u=this._getStepMultiples(d,n),g=[];let m,y=0;if(l/=d,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*=d,(l<=0||!isFinite(l))&&(l=o/h),s=isNaN(i)?this._normalizeMin(s,l):i-_((i-s)/l)*l,this._step=l,g.push(ft(m=s));m<r;)g.push(ft(m+=l));if(!u||y>u.length-2||g.length<=a)break;l=u[++y],g.length=0}return g}}Ir.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],Ir.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],Ir.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],Ir.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],Ir.defaults=ti(Ci.defaults,{baseRange:!1,enableDecimals:!0});class Fr extends ki{}Fr.defaults=ti(ki.defaults,{numberFormat:"0.##"});class zr extends Fr{getTick(t,e){return this._getText(null,e,"*"===this.prop("useSymbols")||this.prop("useSymbols")&&this.axis.tick.canUseNumSymbols(),!1)}}zr.defaults=ti(Fr.defaults,{useSymbols:!0});class Hr extends gi{getSize(t){return Math.min(.9*t,R(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._space=A(this.num("space"),0),this._sizeDim=At(null!==(e=this.prop("size"))&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}prop(t,e){return"space"===t?this._space:super.prop(t,e)}}Hr.defaults=ti(gi.defaults,{size:"30%",space:16,gridVisible:!0});class Gr extends fi{_isVisible(){return this.prop("visible")}}Gr.defaults=ti(fi.defaults,{visible:!1});class jr extends Mi{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),this._baseLine=this._addChild("baseLine",new Gr(this)),this._minorTick=this._addChild("minorTick",new Ai(this))}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get minorTick(){return this._minorTick}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.prop("gridVisible")&&(t===e.prop("from")||t===e.prop("to"))}return!1}$_getPadding(t,e,i){if(!t){if(this._isX&&this._isPolar)return 0;t=jr.PADDINGS}for(let s=0;s<t.length;s++)if(e<=t[s][0])return t[s][1]*i;return 0}_doApply(t){var i,s;super._doApply(t);const r=null!==(i=this.prop("minPadding"))&&void 0!==i?i:this.prop("padding"),o=null!==(s=this.prop("maxPadding"))&&void 0!==s?s:this.prop("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=st.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=st.parseTuples(o)),this._baseVal=+this.prop("baseValue"),this._strictMin=At(this.prop("strictMin"),!0),this._strictMax=At(this.prop("strictMax"),!0),e.call(this._op,"break")&&this.$_loadBreaks(this.prop("break"))}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new $r(this)}_createTickModel(){return new Ir(this)}_prepareRender(){super._prepareRender(),this._minorTick._prepareRender()}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=A(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=A(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,i){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,i,s){if(isNaN(t)||isNaN(e))return[];if(s>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,i,s),this.$_createTicks(t,i,this._min,this._max,s)}const r=this._tick,n=r._baseAxis instanceof jr&&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(i,this._calcedMin=t,this._calcedMax=e);if(n&&r.prop("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.prop("from"))||isNaN(e.prop("to"))||e.prop("from")<=a||e.prop("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=i/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():i,a,h);if(e){if(this._unitLen=e.len,_=!0,!this._zoom||t)if(e.min=e.min*(2*this.num("unitPadding")),t){let t=o.polarMargin;isNaN(t)?t=b*e.min/(h-a+e.min):t*=w,isNaN(this._fixedMax)&&this.getTotalAngle()+t>b&&(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,i,a,h),c=l.slice(0),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,i,this._runBase,a,h,!1),c=l.slice(0),l.length>0){const t=!0===r.prop("showFirst"),e=!0===r.prop("showLast");if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d&&!t;)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&&!t;)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&&!e;)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&&!e;)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,i,a,h,s);if(_&&p.length>1){const t=this._isPolar;let e=!1;const i=c;let s,r;if(i[0]<=a){for(r=-1;r<l.length-1&&i[r+1]<l[0];)r++;for(;r>=0&&(s=i[r])>=a;){const t=this.dataToAxis(p[0].value),i=this.dataToAxis(p[1].value);if(s<t&&t-s>=i-t&&("tick"===this.$_getStartFit()||s>a)){const t=this._createTick(0,s);p.unshift(t),l.unshift(s),e=!0}r--}}if(i[i.length-1]>=h){for(r=i.length;r>0&&i[r-1]>l[l.length-1];)r--;for(;r<i.length&&(s=i[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(s>=t&&s-t>=t-i&&("tick"===this.$_getEndFit()||s<h)){const t=this._createTick(0,s);p.push(t),l.push(s),e=!0}r++}}else if(t&&h>i[i.length-1])for(;(s=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(!(ft(h-t)>ft(t-i)))break;{const r=this._createTick(0,s+ft(t-i));p.push(r),l.push(r.value),e=!0}}e&&p.forEach((t,e)=>t.index=e)}return p}$_createTicks(t,e,i,s,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const i=this._createTick(e,t[e]);i.value!==o&&(n.push(i),o=i.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}$_buildMinorValues(t){if(!isFinite(t)||t<1||this._ticks.length<2)return[];const e=this._ticks,i=[];for(let s=0;s<e.length-1;s++){const r=e[s].value,n=e[s+1].value;if(this._canInterpolateMinorSegment(r,n)&&(!this.hasBreak()||!this.isBreak(r)&&!this.isBreak(n)))for(let e=1;e<=t;e++){const s=this._interpolateMinorValue(r,n,e,t);isFinite(s)&&i.push(s)}}return i}_canInterpolateMinorSegment(t,e){return t!==e&&isFinite(t)&&isFinite(e)}_interpolateMinorValue(t,e,i,s){return ft(t+(e-t)*i/(s+1))}_calcPoints(t,e){super._calcPoints(t,e),this._minorTick.visible||this.grid.minorGrid.visible?this.$_calcMinorPoints(t):(this._minorValues=[],this._minorMarkPoints=[]),this._markPoints=this._ticks.map(t=>t.pos)}$_calcMinorPoints(t){const e=this.$_buildMinorValues(this._minorTick._getCount()),i=[],s=[];e.forEach(e=>{const r=this.getPos(t,e);isFinite(r)&&(i.push(e),s.push(r))}),this._minorValues=i,this._minorMarkPoints=s}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,i,s){let r=0,n=i;const o=[n],a=this._sects=[],h=e-t.reduce((t,e)=>t+e.prop("space"),0);t.forEach(t=>{const e=t.getSize(h),i=Math.max(0,t.prop("space")),s={from:n,to:t.prop("from"),pos:r,len:e};r+=e,a.push(s,t._sect={from:t.prop("from"),to:t.prop("to"),pos:r,len:i}),r+=i;this.$_buildBrokenSteps(s).forEach(t=>{t>s.from&&t<=s.to&&o.push(t)}),i>0&&o.push(t.prop("to"))});const l=t[t.length-1];if(s>l.prop("to")){const t={from:l.prop("to"),to:s,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 i;if(this._runBreaks){const s=this._sects.find(t=>e<t.to)||this._lastSect,r=s.len*(e-s.from)/(s.to-s.from);i=this.prop("reversed")?mt(t-r-s.pos):mt(r+s.pos)}else{let s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this.prop("reversed")&&(s=t-s,isNaN(this._prevRate)||(s+=this._prevSize-t)),i=mt(s)}return this._ani?this._ani.getPos(i,this.prop("reversed")):i}valueAt(t,e){if(this._isHorz?this.prop("reversed")&&(e=t-e):this.prop("reversed")||(e=t-e),this._runBreaks){let t=0;for(const i of this._sects){if(e>=t&&e<t+i.len)return(i.to-i.from)*(e-t)/i.len+i.from;t+=i.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.prop("startFit"))}$_getEndFit(){return this.$_resolveFit(this.prop("endFit"))}$_calcStrict(t,e,i){if(t)return t.fixed?t.size:i<0?e-R(t,i):e+R(t,i)}_adjustMinMax(t,e,i){const s=this._isLog();let r,n=this.isZoomed(),a=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=f(u,t.getAxisPadRate())}),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach(t=>{const e=t._type();r[e]?r[e]=[g(t._yMin,r[e][0]),f(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]})),this._series.forEach(r=>{let c=r._sBase;o(c)&&!isNaN(c)&&(c=ft(c),s?c>=0&&c<=e&&c<=i&&(e=t=c):c<=e?r.isBased(this)?e=t=c:_=A(g(_,c),c):c>=i&&(r.isBased(this)?i=t=c:d=A(f(d,c),c))),h&&!n&&(s||r.canMinPadding(this,e,t))&&(h=!1),l&&!a&&(s||r.canMaxPadding(this,i,t))&&(l=!1)})}else h=n,l=a;n||(n=h),a||(a=l),this._fixedMin=this._fixedMax=NaN;const p=f(0,i-e),m=this.$_calcStrict(this._strictMin,e,-p),y=this.$_calcStrict(this._strictMax,i,p);let b=NaN,x=NaN,w=0,v=0;isNaN(m)?n?this._fixedMin=e:isNaN(this._minPadPixels)?w=this.$_getPadding(this._minPaddings,t,u):b=this._minPadPixels:this._fixedMin=e=m,isNaN(y)?a?this._fixedMax=i:isNaN(this._maxPadPixels)?v=this.$_getPadding(this._maxPaddings,t,u):x=this._maxPadPixels:this._fixedMax=i=y;let S=e,V=i;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*w;e<S&&(S=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*v;e>V&&(V=e)}}else S-=p*w,V+=p*v;if(!isNaN(b)||!isNaN(x)){isNaN(b)&&(b=0),isNaN(x)&&(x=0);const e=Math.min(b+x,.9*t),i=p-c(p*(t-e)/t),s=Math.round(i*b/e);S-=s,V+=i-s}return!isNaN(_)&&_<=e&&S<_&&(S=this._fixedMin=_),!isNaN(d)&&d>=i&&V>d&&(V=this._fixedMax=d),V=f(V,S),{min:S,max:V}}$_calcXUnitLength(t,e,i){const s=[];let r=0;if(this._series.forEach(t=>{t.visible&&t.isClusterable()&&(s.push(...t._getVisiblePoints()),r++)}),0===r&&this._series.forEach(t=>{t.visible&&!t.isXY()&&s.push(...t._getVisiblePoints())}),s.length>0){const r=s.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,i)}}_calcUnitLen(t,e,i,s){if(t.length<2){if(this._ticks.length>0){const t=(s-i)/Math.max(8,this._ticks.length);return{len:A(e*=t/(s-i+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=g(n,t[e]-t[e-1]);return r*=n/(s-i+n),isFinite(r)||(r=e/2),{len:A(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new Hr(this),i={...t};return i.from=this.getValue(i.from),i.to=this.getValue(i.to),!isNaN(i.from)&&!isNaN(i.to)&&i.from>i.to&&([i.from,i.to]=[i.to,i.from]),this._doApplyBreak(i),e.init(),e._load(i),isNaN(i.from)||isNaN(i.to)?null:e}}_doApplyBreak(t){}$_loadBreaks(t){if(s(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){return e.prop("from")<t.prop("to")}function e(t,e){t._op.to=e.prop("to")}const i=this._breaks.sort((t,e)=>t.prop("from")-e.prop("from")).filter(t=>t.visible&&t.prop("to")>t.prop("from"));if(this._mergedBreaks=null,i.length>0){const s=this._mergedBreaks=[];s.push(new Hr(this)._initObject().loadOptions(i[0].options,!1));for(let r=1;r<i.length;r++){const n=s[s.length-1],o=i[r];t(n,o)?e(n,o):s.push(new Hr(this)._initObject().loadOptions(o.options,!1))}}}}jr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],jr.defaults=ti(Mi.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class Wr extends jr{get label(){return this._label}_createLabel(){return new zr(this)}_adjustMinMax(t,e,i){const s=super._adjustMinMax(t,e,i),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof yr&&"fill"===r[0].prop("layout")&&(s.max=r[0].getLayoutMax()),s}}Wr.type="linear";const Yr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Xr=[[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]],Ur={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Zr extends Ir{getNextStep(t,e){const i=new Date(t);switch(e*=this._step,this._scale){case 7:i.setFullYear(i.getFullYear()+e);break;case 6:i.setMonth(i.getMonth()+e);break;case 5:i.setDate(i.getDate()+7*e);break;case 4:i.setDate(i.getDate()+e);break;case 3:i.setHours(i.getHours()+e);break;case 2:i.setMinutes(i.getMinutes()+e);break;case 1:i.setSeconds(i.getSeconds()+e);break;case 0:i.setMilliseconds(i.getMilliseconds()+e)}return+i}_getValidInterval(t,e,i,s,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&Ur.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>=Yr[e]/2&&t<Yr[e+1]/2)return this._scale=e,Xr[e];this._scale=7}_getStepsByPixels(t,e,i,s,r){const n=[],o=r-s;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,c=f(1,Math.floor(o/(l-1)));const _=this._getStepMultiples(c),d=Yr[this._scale];if(c/=d,_)if(c>_[0]){let t=0;for(;t<_.length-1;t++)if(c>_[t]&&c<_[t+1]){c=_[t+1];break}}else c=_[0];const u=a.date(s),p=a.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<h&&new Date(t,e+c)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+c)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),i=m.getDate();const s=5===this._scale?7:1;this._step=c=Math.ceil(c),m=new Date(t,e,i),m<h&&new Date(t,e,i+s*c)>h&&(i=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),i));do{n.push(+m),m.setDate(m.getDate()+c*s)}while(m<=p)}else{switch(this._step=c,c*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+c>t&&(g=t);do{n.push(g),g+=c}while(g<=r)}return n}_getStepsByInterval(t,e,i,s){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,c;this._scale=Ur[a],t=Yr[this._scale];let _=new Date(i);switch(this._scale){case 7:const t=n.getFullYear();let e=_.getFullYear();_.setMonth(0,1),e<t&&t<e+h&&(_=new Date(t,0));break;case 6:_.setDate(1),_.setHours(0,0,0,0),c=new Date(_),c.setMonth(c.getMonth()+h),_<n&&n<c&&(_=new Date(n),_.setDate(1),_.setHours(0,0,0,0));break;case 5:case 4:let i=5===this._scale?7:1;_.setHours(0,0,0,0),c=new Date(_),c.setDate(c.getDate()+h*i),_<n&&c>n&&(_=new Date(n),_.setHours(0,0,0,0));break;case 3:_.setMinutes(0);case 2:_.setSeconds(0);case 1:_.setMilliseconds(0)}if(this._step=h,i=+_,isNaN(e))for(o.push(l=i);l<s;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>i;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<s;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,i,s)}_getStepsBySteps(t,e,i){const s=super._getStepsBySteps(t,e,i);if(s.length>=2){const t=(s[s.length-1]-s[0])/(s.length-1);this._getStepMultiples(t)}else this._getStepMultiples(Yr[4]);return s}buildSteps(t,e,i,s,r,n=!1){const o=super.buildSteps(t,e,i,s,r,n);if(void 0===this._scale&&o.length>=2){const t=(o[o.length-1]-o[0])/(o.length-1);this._getStepMultiples(t)}return o}}const qr=[{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 Kr extends Fr{_doApply(t){super._doApply(t);const e=n(this.prop("timeFormat"))?this.prop("timeFormat"):void 0,r=n(this.prop("beginningFormat"))?this.prop("beginningFormat"):void 0,o=this.prop("timeFormats"),a=this.prop("useBeginningFormat");if(this._formats=qr.map(t=>l(t)),e&&this._formats.forEach(t=>{t.format=t.beginningFormat=e}),a&&r&&this._formats.forEach(t=>{t.beginningFormat=r}),s(o))for(let t=0;t<o.length;t++){const e=this._formats[t],s=o[t];Nt(s)?e.format=s:i(s)&&(Nt(s.format)&&(e.format=s.format),a&&Nt(s.beginningFormat)&&(e.beginningFormat=s.beginningFormat))}}getTick(t,e){const i=this.chart,s=this.axis,r=s.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,i.startOfWeek);else{const e=this._formats,o=s.tick._scale,a=ee.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,i.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek)}}return this._getText(n,null,!1,!1)}}Kr.defaults=ti(Fr.defaults,{useBeginningFormat:!0});class Qr extends jr{get label(){return this._label}_createTickModel(){return new Zr(this)}_createLabel(){return new Kr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,i,s){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,i,s)}collectValues(){this._offset=60*A(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this.prop("baseValue");return o(t)?t:n(t)?new Date(t).getTime()+A(this._offset,0):NaN}getValue(t){return o(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 i=parseFloat(e);if(0!=i){let s=new Date(t);switch(e.charAt(e.length-1)){case"y":s.setFullYear(s.getFullYear()+i);break;case"m":s.setMonth(s.getMonth()+i);break;case"d":s.setDate(s.getDate()+i);break;case"w":s.setDate(s.getDate()+7*i);break;case"h":s.setHours(s.getHours()+i);break;case"n":s.setMinutes(s.getMinutes()+i);break;case"s":s.setSeconds(s.getSeconds()+i)}return+s}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.prop("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}}Qr.type="time",Qr.subtype="date",Qr.defaults=ti(jr.defaults,{baseValue:NaN});class Jr extends Os{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class tn extends mr{pointLabelCount(){return 2}_createLegendMarker(t,e){return gs.create(t,sr.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Jr(t)}_getBottomValue(t){return t.lowValue}}tn.type="barrange",tn.defaults=ti(mr.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class en extends Ms{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class sn extends gr{canCategorized(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createPoint(t){return new en(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}sn.defaults=ti(gr.defaults,{colorByPoint:!1,pointOffset:0});class rn extends sn{canDepth(){return!0}_createLegendMarker(t,e){return gs.create(t,sr.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}rn.type="bar";class nn extends xr{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}getDepth(){return this.prop("depth")}getDistance(){return this._distance}_doApply(t){super._doApply(t),this._distance=f(0,this.num("distance"))}_doPrepareSeries(t){const e=this.prop("layout");if("default"===e){const e=t.length>1?t.map(t=>t.prop("pointWidth")).reduce((t,e)=>t+e,0):t[0].prop("pointWidth");let i=0;t.forEach(t=>{t._childWidth=t.prop("pointWidth")/e,t._childPos=i,i+=t._childWidth})}if("overlap"===e){let e=this.getDistance();t.forEach(t=>{t._groupDistance=e+=A(t.prop("distance"),0),e+=t.depth})}else t.forEach(t=>{t._groupDistance=t.distance})}}nn.defaults=ti(xr.defaults,{depth:10,distance:5});class on extends nn{_canContain(t){return t instanceof rn}}on.type="bargroup",on.seriesType="bar";class an extends we{constructor(t){super(t,sr.LEGEND_MARKER),this.add(this._back=new gs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new Pe(t))}render(t,e){const i=Math.max(8,2*e),s=2.1*i;t===this._shape&&e===this._rd&&i===this._size||(this._shape=t,this._rd=e,this._size=i,this._back.resize(1,i),this._renderShape(e,s,i),this._marker.trans(s/2-e,i/2-e))}_renderShape(t,e,i){ps.setShape(this._marker,this._shape,t,t)}}class hn extends an{constructor(t){super(t),this.insertFirst(this._line=new Pe(t)),this.insertFirst(this._area=new Pe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,i){const s=["M",0,i/2,"L",e,0],r=["M",0,i/2,"L",e,0,"L",e,i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,i)}}class ln extends an{constructor(t){super(t),this.insertFirst(this._line=new Pe(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Pe(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Pe(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,i){const s=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i],r=["M",0,i,"L",e/2,.7*i,"L",e,i],n=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i,"L",e,i,"L",e/2,.7*i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,i)}}class cn extends Pe{constructor(t,e=ut,i=ut){super(t,e),i&&this.setLine(i)}setLine(t,e,i,s){o(t)?this.setPath(ps.line(t,e,i,s)):t&&this.setPath(ps.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(ps.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(ps.line(t,e,t,i))}setHLine(t,e,i){this.setPath(ps.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(ps.line(e,t,i,t))}}class _n extends an{constructor(t){super(t),this.insertFirst(this._line=new cn(t))}_renderShape(t,e,i){this._line&&(this._line.setHLine(i/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,i)}}class dn extends Ms{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class un extends or{}un.defaults=ti(or.defaults,{radius:4,hoverScale:1.75});class pn extends or{constructor(t){super(t),this.series=t}getPosition(){return P(this.prop("position"),pn.defaults.position)}getShape(){return P(this.prop("shape"),pn.defaults.shape)}getRadius(){return Mt(NaN,this.prop("radius"),pn.defaults.radius)}getRotation(){return P(this.prop("rotation"),pn.defaults.rotation)}getArrowStyleOverrides(t){const e=pn.STYLE_ISOLATION,s={};return n(t)?(s.stroke=e.stroke,s.strokeWidth=e.strokeWidth,s):(i(t)&&null==t.strokeDasharray&&(s.strokeDasharray=e.strokeDasharray),s)}getArrowStyle(t){const e=t&&this.getMarkerStyle(t);return e?i(e)?this.$_applyStyleIsolation(l({},e)):e:this._runStyle||this.$_buildRunStyle()}buildArrowSlots(t){if(!this.visible||t.length<2)return[];let e=-1,i=-1;for(let s=0;s<t.length;s++)t[s].isNull||(e<0&&(e=s),i=s);if(e<0||i<0||e===i)return[];switch(this.getPosition()){case"start":return[{index:e,at:"start"}];case"both":return[{index:e,at:"start"},{index:i,at:"end"}];default:return[{index:i,at:"end"}]}}calcAutoAngle(t,e,i){const s=this.series.getLineType(),r=P(this.series.prop("stepDir"),"forward"),n=this.$_neighborIndex(t,e,-1),o=this.$_neighborIndex(t,e,1);return"end"===i?n<0?0:this.calcSegmentAngle(t[n],t[e],s,r,"end"):o<0?0:this.calcSegmentAngle(t[e],t[o],s,r,"start")}calcSegmentAngle(t,e,i,s,r){let n=0,o=0;if("step"===i)switch(s){case"backward":"start"===r?(n=0,o=e.py-t.py):(n=e.px-t.px,o=0);break;case"center":"start"===r?(n=(t.px+e.px)/2-t.px,o=0):(n=e.px-(t.px+e.px)/2,o=0);break;default:"start"===r?(n=e.px-t.px,o=0):(n=0,o=e.py-t.py)}else n=e.px-t.px,o=e.py-t.py;return 0===n&&0===o?0:Math.atan2(o,n)*v+90}calcArrowAngle(t,e,i){const s=this.getRotation();if("auto"===s||"auto-reverse"===s){let r=this.calcAutoAngle(t,e,i);return"auto-reverse"===s&&(r+=180),r}return A(+s,0)}_doPrepareRender(t){this._runStyle=this.$_buildRunStyle()}$_buildRunStyle(){const t=this.prop("style");if(n(t))return t;const e=l({},i(t)?t:{});return e.fill||(e.fill=this.series._runColor),this.$_applyStyleIsolation(e)}$_applyStyleIsolation(t){return null==t.stroke&&(t.stroke=pn.STYLE_ISOLATION.stroke),t.stroke===pn.STYLE_ISOLATION.stroke&&null==t.strokeWidth&&(t.strokeWidth=pn.STYLE_ISOLATION.strokeWidth),t}$_neighborIndex(t,e,i){for(let s=e+i;s>=0&&s<t.length;s+=i)if(!t[s].isNull)return s;return-1}}pn.defaults=ti(or.defaults,{visible:!1,shape:"triangle",radius:6,rotation:"auto",position:"end"}),pn.STYLE_ISOLATION={stroke:"none",strokeDasharray:"",strokeWidth:""};class gn extends Zs{getAlignOffset(){const t=+this.prop("alignOffset");return isNaN(t)?"left"===this.prop("align")||"right"===this.prop("align")?gn.ALIGN_GAP:0:t}getPosition(){return P(this.prop("position"),"default")}}gn.ALIGN_GAP=4,gn.defaults=ti(Zs.defaults,{align:"center"});class fn extends nr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new un(this))}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return Mt(t.radius,this.marker.prop("radius"),un.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 gn(t)}_createPoint(t){return new dn(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.prop("shape")||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new _n(t)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),g(e/2,this.marker.prop("radius"))),i}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const i=t.length,s=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();s.push(e)}else{let e=0;for(;e<i;){const r=[];for(;e<i&&t[e].isNull;)e++;for(;e<i&&!t[e].isNull;)r.push(t[e++]);r.length>0&&s.push(r)}}if(e){const t=[],i=[];e.forEach(e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&i.push(e)}),t.length>0&&(t.sort((t,e)=>t.xValue-e.xValue),s[0].unshift(...t)),i.length>0&&(i.sort((t,e)=>e.xValue-t.xValue),s[s.length-1].push(...i))}return s}}fn.defaults=ti(sr.defaults,{nullAsBase:!1});class mn extends oi{constructor(t){super(t.chart),this.series=t}label(){const t=this.prop("text")||this.series.displayName();return this._getText(t,null,!1,!1)}getDefaultIconPos(){return"left"}}mn.defaults=ti(oi.defaults,{visible:!1,offset:8});class yn extends fn{_doInit(t){super._doInit(t),this._flag=this._addChild("flag",new mn(this)),this._arrow=this._addChild("arrow",new pn(this))}get flag(){return this._flag}get arrow(){return this._arrow}backDir(){return"backward"===this.prop("stepDir")?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this.prop("connectEnds");if(a(e))return e;if(!t||"spline"===this.prop("lineType"))return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof Cn||this._group instanceof An?this._group.prop("lineType"):this.prop("lineType")}_connectNulls(){return this.prop("connectNullPoints")}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){super._doPrepareRender(),this._base=k(this._getGroupBase(),this._yAxisObj.getBaseValue(),0);const t=this.num("baseValue");this.prop("nullAsBase")&&!isNaN(t)&&this._runPoints.forEach(e=>{e.isNull&&(e.y=t,e.isNull=!1)}),this.flag._prepareRender(),this.arrow._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}yn.type=Cs,yn.defaults=ti(fn.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class bn extends yn{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}bn.type="spline";class xn extends dn{}class wn extends yn{_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 i=t[t.length-1].toPoint();i.py=t[t.length-1].yLow,e.push(i),i=t[0].toPoint(),i.py=A(t[0].yLow,t[0].py),e.push(i)}return e}const e=this._group,i=this._lines,s=this._areas=[];if(e&&e._stacked){const e=[].concat(...i);s.push(e),s.push(t(e))}else i.forEach(e=>{const i=e.slice(0);s.push(i),s.push(t(i))})}_createLegendMarker(t,e){return new hn(t)}_createPoint(t){return new xn(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,i=[];let s=0;for(;s<e;){const r=t[s].isNull,n=[];do{n.push(t[s++])}while(s<e&&t[s].isNull==r);i.push(n)}return i}return super._doBuildLines(t,e)}}wn.type=As,wn.defaults=ti(fn.defaults,{});class vn extends xn{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 l(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 i=t.options,s=e.length>2?1:0;this.low=e[A(i.lowField,0+s)],this.y=e[A(i.yField,1+s)],s>0&&(this.x=e[A(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=P(e[t.prop("lowField")],e.low),this.y=k(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=L(t.lowValue,this.lowValue,e)}}class Sn extends gn{getPosition(){return"default"===this.prop("position")||null==this.prop("position")?"foot":this.prop("position")}}class Vn extends fn{pointLabelCount(){return 2}_createLabel(t){return new Sn(t)}_createLegendMarker(t,e){return new ln(t)}_createPoint(t){return new vn(t)}getLineType(){return this.prop("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 i=super._doBuildLines(t,e),s=[];return i.forEach(t=>{const e=[];for(let i=t.length-1;i>=0;i--){const s=t[i],r=s.toPoint();r.py=s.yLow,e.push(r)}s.push(t,e)}),s}}Vn.type="arearange",Vn.defaults=ti(fn.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Cn extends yr{_canContain(t){return t instanceof yn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}Cn.type="linegroup",Cn.seriesType=Cs,Cn.defaults=ti(yr.defaults,{lineType:"default"});class An extends yr{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const i=this._visibles[e-1],s=t._areas,r=i._areas;for(let t=0;t<s.length;t+=2)s[t+1]=r[t].reverse();this.prop("layout")}}}_canContain(t){return t instanceof wn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}An.type="areagroup",An.seriesType=As,An.defaults=ti(yr.defaults,{lineType:"default"});class Pn extends xn{}class kn extends wn{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new Pn(t)}_doLoadData(t){const e=super._doLoadData(t);if(s(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.prop("name")===this.prop("source")||t.index===this.prop("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)),i=this._loadTable(e);this._doLoadPoints(i),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,i){const s=i-t;return{x:i,y:Math.exp(-s*s/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},i=t.length;if(i<1)return;const s=t.reduce((t,e)=>t+e,0)/i,r=Math.sqrt(t.reduce((t,e)=>t+Math.pow(e-s,2))/(i-1)),n=r/this.num("pointsInSigma"),o=s-this.num("sigmas")*r,a=s+this.num("sigmas")*r;let h=s;const l=[];for(l.push(e(s,r,h));h>o;)h-=n,l.unshift(e(s,r,h));for(h=s;h<a;)h+=n,l.push(e(s,r,h));return l}}kn.type="bellcurve",kn.defaults=ti(wn.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Ln extends Ms{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 l(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 i=t.options,s=e.length>5?1:0;s>0&&(this.x=e[A(i.xField,0)]),this.min=e[A(i.minField,0+s)],this.low=e[A(i.lowField,1+s)],this.mid=e[A(i.midField,2+s)],this.high=e[A(i.highField,3+s)],this.y=e[Mt(i.maxField,t.prop("yField"),4+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.min=P(e[i.minField],e.min),this.low=P(e[i.lowField],e.low),this.mid=P(e[i.midField],e.mid),this.high=P(e[i.highField],e.high),this.y=P(e[i.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=L(t.minValue,this.minValue,e),this.lowValue=L(t.lowValue,this.lowValue,e),this.midValue=L(t.midValue,this.midValue,e),this.highValue=L(t.highValue,this.highValue,e)}}class Tn extends mr{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Ln(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return gs.create(t,sr.LEGEND_MARKER,0,0,e,e,2)}}Tn.type="boxplot",Tn.defaults=ti(mr.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 Nn extends Pe{constructor(t,e,i){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,i&&this._assignShape(i,!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 ps.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 ps.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 Mn=2*Math.PI,En=-Math.PI/2;class Bn extends we{constructor(t){super(t,sr.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,i){if(this._size===t&&this._sectors.length===e)return void this._applyColors(i);this._size=t;const s=t/2,r=s,n=s;this._back.setBounds(0,0,t,t),this._sectors.forEach(t=>t.remove()),this._sectors=[];const o=Mn/e;let a=En;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:s,ry:s,start:a,angle:o,clockwise:!0},e=new Nn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(i)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const i=t&&t[e]||"#ccc";this._sectors[e].setFill(i)}}}class On{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)%ir+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.prop("legendKey");return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class Dn{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 Rn extends Bs{}class $n extends si{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.prop("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 i=0;for(const s of e){if(s===t)break;s instanceof In&&s.pie&&s.pie.fields.length>0&&(i+=s.pie.fields.length)}return i}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 i=[];for(let s=0;s<e.length;s++){if(!this.isFieldVisible(s))continue;const r=this._getFieldValue(t,e[s]),n=o(r)&&r>0?r:0;n>0&&i.push({index:s,value:n})}if(0===i.length)return null;const s=i.reduce((t,e)=>t+e.value,0);if(s<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,a=this._totalRad;let h=this._startRad;const l=[];for(let t=0;t<i.length;t++){const e=i[t],o=n*(e.value/s)*a,c=this._legendSources[e.index];if(c){const t=new Dn;t.source=c,t.value=e.value,t.percent=Math.round(e.value/s*1e4)/100,t.startAngle=h,t.angle=o,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=o}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let i=0;i<t.length;i++)t[i].color=`var(--color-${(e+t[i].index)%ir+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,i=[],s=this._paletteOffset;for(let r=0;r<t;r++)i.push(e.length>0?e[r%e.length]:`var(--color-${(s+r)%ir+1})`);return i}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t,e){return a(e)?(this._op.visible=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._fields=(this.prop("fields")||[]).map(t=>String(t)),this._categories=s(this.prop("categories"))&&this.prop("categories").length>0?this.prop("categories"):this._fields;const e=this.prop("colors");s(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=x+w*A(this.num("startAngle")%360,0);const i=this.num("totalAngle",360);this._totalRad=w*f(0,g(360,i<=0?360:i)),this._clockwise=this.bool("clockwise"),this.prop("innerRadius")?this._innerRadiusDim=At(this.prop("innerRadius"),!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,i=this._sliceColors,s=this._categories,r=e.length;this._legendSources=e.map((e,n)=>{const o=i.length>0?i[n%i.length]:null,a=null==t?void 0:t.find(t=>t.legendKey()===this.hash+":"+e),h=new On;return h._pie=this,h.field=e,h.label=s[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h})}_getFieldValue(t,e){if(t)return t[s(t)?+e:e]}}$n.defaults=ti(si.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class In extends wr{_doInit(t){super._doInit(t),this._pie=this._addChild("pie",new $n(this.chart)),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this.prop("shape")||"circle"}getPixelMinMax(t){return{min:R(this._minSizeDim,t),max:R(this._maxSizeDim,t)}}getRadius(t,e,i){let s=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getTooltipText(t,e){const i=this._hoveredSlice;if(i&&this._pie){let t;const s=this._pie.prop("tooltipCallback");return s&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=i,t=s(this._pointArgs)),void 0===t&&(t=this._pie.prop("tooltipText")||"${label}: ${value} (${percent}%)"),t}return super.getTooltipText(t,e)}getTooltipParam(t,e,i){var s;const r=this._hoveredSlice;return r&&null!==(s=r.getParam(i))&&void 0!==s?s:super.getTooltipParam(t,e,i)}getTooltipHeaderColor(t){var e,i;return null!==(i=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==i?i:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new Rn(t)}_getNoClip(t){const e=super._getNoClip(t);return!a(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createLegendMarker(t,e){const i=this._pie;if(i&&i.visible&&i.fields.length>0){const s=new Bn(t);return s.render(e,i.fields.length,[]),s.setColorResolver(()=>i.getLegendSliceColors()),s}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,i=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,s=i?this.prop("legendMode")||"both":null;"slice"!==s&&super.getLegendSources(t),i&&"series"!==s&&e.getLegendSources().forEach(e=>t.push(e))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach(i=>{i.isNull||isNaN(i.zValue)||(t=g(t,i.zValue),e=f(e,i.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 i=0;i<this._points.count;i++){const s=this._points.get(i);if(s.xValue===t&&s.yValue===e)return s}}}In.type="bubble",In.defaults=ti(wr.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 Fn extends br{_canContain(t){return t instanceof yn}_doConstraintYValues(t){const e={};t.forEach(t=>{t._visPoints.forEach(t=>{if(!1!==t.visible){const i=t.xValue,s=e[i];s?s.push(t):e[i]=[t]}})});for(const t in e)e[t].sort((t,e)=>t.yValue-e.yValue).forEach((t,e)=>{t.yLabel=P(t.yLabel,t.yValue),t.yValue=t.yGroup=e});return st.makeIntArray(0,t.length)}}Fn.type="bump",Fn.seriesType=Cs;class zn extends Ms{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(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 i=t.options,s=e.length>4?1:0;s>0&&(this.x=e[A(i.xField,0)]),this.low=e[A(i.lowField,0+s)],this.close=e[A(i.closeField,1+s)],this.open=e[A(i.openField,2+s)],this.y=e[Mt(i.highField,t.prop("yField"),3+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.low=P(e[i.lowField],e.low),this.open=P(e[i.openField],e.open),this.close=P(e[i.closeField],e.close),this.y=k(e[i.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=L(t.lowValue,this.lowValue,e),this.openValue=L(t.openValue,this.openValue,e),this.closeValue=L(t.closeValue,this.closeValue,e)}}class Hn extends mr{canCategorized(){return!0}_createPoint(t){return new zn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const i=new ye;return i.rect(0,.2*e,e,.6*e),i.vline(e/2,0,e),new Pe(t,sr.LEGEND_MARKER).setPath(i.end())}}Hn.type="candlestick",Hn.defaults=ti(mr.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Gn extends pr{}Gn.defaults=ti(Zs.defaults,{position:"inside"});class jn extends sn{get pointLabel(){return this._pointLabel}_createLabel(t){return new Gn(t)}}jn.type=Ps;class Wn extends nn{_canContain(t){return t instanceof jn}}Wn.type="circlebargroup",Wn.seriesType=Ps;class Yn extends Os{}class Xn extends or{}Xn.defaults=ti(or.defaults,{radius:4,shape:"circle"});class Un extends mr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new Xn(this)),this._lowMarker=this._addChild("lowMarker",new Xn(this))}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)+f(0,this.marker.prop("radius"))}_createPoint(t){return new Yn(t)}prepareAfter(){const t=this.marker.prop("radius"),e=this.marker.prop("shape"),i=A(this.lowMarker.prop("radius"),t),s=this.lowMarker.prop("shape")||e;this._visPoints.forEach(r=>{r.radius=t,r.shape=e,r.lowRadius=i,r.lowShape=s}),super.prepareAfter()}}Un.type="dumbbell";class Zn extends Ms{}class qn extends gr{getSegmentSize(t){return R(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Zn(t)}_createLegendMarker(t,e){const i=new ye;return i.rect(0,0,e,.4*e),i.rect(0,.6*e,e,.4*e),new Pe(t,sr.LEGEND_MARKER).setPath(i.end())}}qn.type="equalizer",qn.defaults=ti(gr.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class Kn extends mr{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Os(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const i=(new ye).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),s=new Pe(t,sr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}_getBottomValue(t){return t.lowValue}}Kn.type="errorbar",Kn.defaults=ti(mr.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Qn extends ar{}class Jn extends Qn{constructor(t,e){super(t),this.points=e}}class to extends lr{getDistance(){return isNaN(this.prop("distance"))?"far"===this.prop("align")?to.ENDED_DIST:to.OUTSIDE_DIST:this.prop("distance")||0}}to.OUTSIDE_DIST=25,to.ENDED_DIST=10;class eo extends _r{getSize(t,e){return{width:f(.1*t,R(this._widthDim,t)),height:f(.1*e,R(this._heightDim,e))}}getNeckSize(t,e){return{width:st.clamp(R(this._neckWidthDim,t),this._minNeckWidth,t),height:st.clamp(R(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new to(t)}_createPoint(t){return new Qn(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new Jn(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("width"))!==e._width&&(e._width=i,e._widthDim=Pt(e._width,eo.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Pt(e._height,eo.defaults.height))}(this.prop("height")),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Pt(e._neckWidth,eo.defaults.neckWidth))}(this.prop("neckWidth")),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Pt(e._neckHeight,eo.defaults.neckHeight))}(this.prop("neckHeight")),this._minNeckWidth=Math.max(0,+this.num("minNeckWidth"))}}eo.type="funnel",eo.defaults=ti(_r.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class io extends Ms{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const so={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 ro extends nr{getBinCount(t){const e=A(this.prop("binWidth"),0);if(e>0)return t/e;return A(this.prop("binsNumber"),0)<1?so[this.prop("binsNumber")||"squreRoot"](t):void 0}_createPoint(t){return new io(t)}_doLoadPoints(t){function e(t){let e;return e=s(t)?t[A(this.yField,0)]:i(t)?k(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=[];let n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);isNaN(s)||n.push(s)}if(n.length>0){n=n.sort((t,e)=>t-e);const t=this.num("minValue"),e=this.num("maxValue");t<n[0]&&n.unshift(t),e>n[n.length-1]&&n.push(e);const i=n.length,s=n[0],o=n[i-1],a=this.getBinCount(i),h=this._binInterval=(o-s)/a;let l=0,c=s,_=c+h;for(let t=0;t<a;t++){let e=0;if(t==a-1)e=i-l;else for(;l<i&&n[l]<_;)e++,l++;r.push({x:c,y:e,min:c,max:t===a-1?o:_}),c=_,_=c+h}}super._doLoadPoints(r)}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=Mt(this.prop("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,sr.LEGEND_MARKER,0,0,e,e,2)}}ro.type="histogram",ro.defaults=ti(sr.defaults,{baseValue:0,binsNumber:"squreRoot"});class no extends or{}no.defaults=ti(or.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class oo extends Ms{_assignTo(t){return l(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const i=+t.prop("colorField"),s=+t.prop("iconField"),r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[A(r.xField,0)]),this.y=e[A(r.yField,0+n)],this.radius=e[A(r.radiusField,1+n)],isNaN(i)||(this.color=e[i]),isNaN(s)||(this.icon=e[s])}_readObject(t,e){super._readObject(t,e),this.radius=P(e[t.prop("radiusField")],e.radius)}}class ao extends gr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new no(this))}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.prop("radius")}_createPoint(t){return new oo(t)}prepareAfter(){const t=this.marker,e=t.prop("radius"),i=t.prop("shape"),s=this.prop("radiusField"),r=f(t.num("minRadius"),0),n=f(t.num("maxRadius"),r);if(s){const t=this._runPoints.map(t=>t.radius).filter(t=>"number"==typeof t&&!Number.isNaN(t)),e=Math.min(...t),s=Math.max(...t)-e||1;this._runPoints.forEach(t=>{const o=(t.radius-e)/s;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=i})}else this._runPoints.forEach(t=>{var s;t.radius=null!==(s=t.radius)&&void 0!==s?s:e,t.shape=i});super.prepareAfter()}}ao.type="lollipop";class ho extends zn{}class lo extends Hn{_createPoint(t){return new ho(t)}_createLegendMarker(t,e){const i=new ye;i.vline(e/2,0,e),i.hline(.4*e,e/2,e),i.hline(.7*e,0,e/2);const s=new Pe(t,sr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}}lo.type="ohlc";class co extends dn{}class _o extends fn{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new co(t)}_referOtherSeries(t){if(t.prop("name")===this.prop("source")||t.index===this.prop("source"))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const i=[],s=t.reduce((t,e)=>t+A(e.yValue,0),0);let r=0;t.forEach(t=>{t.isNull||i.push({x:t.xValue,y:r+=100*t.yValue/s})}),e._doLoadPoints(i),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}_o.type="pareto",_o.defaults=ti(fn.defaults,{curved:!1});class uo extends ar{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 l(super._assignTo(t),{sliced:this.sliced})}}class po extends uo{constructor(t,e){super(t),this.points=e}}class go extends oi{getDefaultIconPos(){return"left"}}class fo extends lr{getDistance(t,e,i){return i>0&&(e-=e*i),this._distanceDim?R(this._distanceDim,e,0):t?R(i?fo.INNER_DIST:fo.INSIDE_DIST,e):"far"===this.prop("align")?fo.ENDED_DIST:fo.OUTSIDE_DIST}}fo.INSIDE_DIST=At("30%",!1),fo.INNER_DIST=At("50%",!1),fo.OUTSIDE_DIST=25,fo.ENDED_DIST=10,fo.defaults=ti(lr.defaults,{radius:.7,rotationMode:"arc"});class mo extends si{getLength(){return this.visible?this._runLength:0}prop(t,e){return"length"===t?this._runLength:"ratio"===t?this._runRatio:super.prop(t,e)}_isVisible(){return this.prop("visible")&&this._runLength>0}_doSetSimple(t,e){return o(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._runLength=f(0,this.num("length")),this._runRatio=f(.3,g(.8,this.num("ratio",mo.DEPTH_RATIO)))}}mo.DEPTH_RATIO=.6,mo.defaults=ti(si.defaults,{visible:!1,length:25,ratio:mo.DEPTH_RATIO});class yo extends dr{_doInit(t){super._doInit(t),this._innerText=this._addChild("innerText",new go(this.chart)),this._depth=this._addChild("depth",new mo(this.chart))}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?R(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new fo(t)}_createPoint(t){return new uo(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new po(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset")}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=x+w*A(this.prop("startAngle")%360,0);let t=this.num("totalAngle",360);t<=0&&(t=360),this._totalRad=w*f(0,g(360,t)),this._groupPos=NaN}}yo.type="pie",yo.defaults=ti(dr.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class bo extends yr{getPolarSize(t,e){return R(this._polarDim,g(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 i;super._doApply(t),(i=this.prop("polarSize"))!==e._polarSize&&(e._polarSize=i,e._polarDim=At(i,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=At(t,!0))}(this.prop("innerSize"))}needAxes(){return!1}_canContain(t){return t instanceof yo}_doPrepareSeries(t){const e=t.map(t=>t.prop("groupSize")).reduce((t,e)=>t+A(e,1),0);let i=0;t.forEach(t=>{t._groupPos=i,i+=t._groupSize=A(t.prop("groupSize"),1)/e})}}bo.type="piegroup",bo.seriesType="pie",bo.defaults=ti(yr.defaults,{polarSize:"80%",innerSize:0});class xo extends Ms{}class wo extends wr{_createPoint(t){return new xo(t)}_getNoClip(t){const e=super._getNoClip(t);return!a(e)||e}_createLegendMarker(t,e){return new an(t)}_colorByPoint(){return this.prop("colorByPoint")}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this.prop("shape")||this._defShape}hasShape(){return!0}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),g(e/2,this.prop("radius"))),i}}wo.type="scatter",wo.defaults=ti(wr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class vo extends Ms{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 So extends Zs{}So.defaults=ti(Zs.defaults,{offset:0});class Vo extends fr{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new So(t)}_createPoint(t){return new vo(t)}_createLegendMarker(t,e){return gs.create(t,sr.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,i=t[0],s=i.y=i.save=i._isSum?0:i.y,r=s,n=s,o=i.from=0,a=0,h=i.to=s,l=0;for(let c=1,_=t.length;c<_;c++){i=t[c];if(!0===i._isMid&&c<_)e=n,o=l,h=o+e,l=h,s=e,n=0;else if(i._isSum)e=r,o=0,h=e,s=e;else{if(null==i.y)continue;e=i.y,o=a+s,h=o+e,n+=e,r+=e,s=e}i.yGroup=i.yValue=e,i.from=o,i.to=h,i.y=Math.max(o,h),i.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}Vo.type="waterfall",Vo.defaults=ti(fr.defaults,{tooltipDetail:"<b>${y}</b>"});class Co extends Ir{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,i,s,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,i,s,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,i,s,r){const n=this._log,o=this._pow,a=this._snap;s>=i?s=i:r<=i&&(r=i);const h=r-s;if(0===h||t<=0)return isNaN(s)?[]:[s];let l=[],d=f(1,c(t/e))+1;if(r-s>=.5){if(0===h)return isNaN(s)?[]:[s];let t=h/(d-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/d),s=isNaN(i)?this._normalizeMin(s,t):i-_((i-s)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-s)>u._roundThreshold,g=.5;let f=s,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{s=o(s);const t=(r=o(r))-s;let e=t/(d-1);const i=o(c(n(e))),a=this._getStepMultiples(i);if(e/=i,a&&a.length>0){let t=a[0];for(let i=0;i<a.length-1;i++)if(e>a[i]&&e<a[i+1]){t=e<=a[i]+(a[i+1]-a[i])/2?a[i]:a[i+1];break}e=t}e*=i,(e<=0||!isFinite(e))&&(e=t/d);const h=1e-10*e;let _=c(s/e)*e;for(_<s&&(_+=e),l.push(n(_));_<=r+h;)_+=e,_>0&&l.push(n(_))}return l}}Co.defaults=ti(Ir.defaults,{arrangeDecimals:!0});class Ao extends jr{_isLog(){return!0}_createLabel(){return new zr(this)}_createTickModel(){return new Co(this)}_doApply(t){super._doApply(t);const e=this._logBase=f(2,this.num("logBase",10));this._roundThreshold=this.num("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 i=>{const s=c(i);return i===s?i:s+e((i-s)*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)}contains(t){return t>0&&super.contains(this._log(t))}trimRange(t,e){const i=t>0?this._log(t):NaN,s=e>0?this._log(e):NaN,[r,n]=super.trimRange(i,s);return[this._pow(r),this._pow(n)]}_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,ft(this._pow(e)))}_interpolateMinorValue(t,e,i,s){if(t<=0||e<=0)return NaN;const r=this._log(t),n=this._log(e);return isFinite(r)&&isFinite(n)?ft(this._pow(r+(n-r)*i/(s+1))):NaN}_canInterpolateMinorSegment(t,e){return super._canInterpolateMinorSegment(t,e)&&t>0&&e>0}_calcUnitLen(t,e,i,s){if((t=t.filter(t=>t>0)).length<2)return super._calcUnitLen(t,e,i,s);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=g(n,r(t[e])-r(t[e-1]));if(!isFinite(n)||n<=0)return super._calcUnitLen(t,e,i,s);const o=s-i,a=n/o;return{len:A(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)}}Ao.type="log",Ao.defaults=ti(jr.defaults,{logBase:10,roundThrrehold:500});class Po extends si{isChartScope(){return"chart"===this.prop("scope")}getHoverEffect(){return"auto"===this.prop("hoverEffect")?this.prop("hoverImageUrl")?"image":"background":this.prop("hoverEffect")}click(){const t=this.prop("onClick");if(t){t({chart:this.chart.wrapper,button:this})}}}Po.defaults=ti(si.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class ko extends ri{load(t){const e=this.chart,i=this._items=[];s(t)?t.forEach((t,s)=>{i.push(this.$_loadItem(e,t))}):t&&i.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map(t=>t.options)}$_loadItem(t,e){const i=new Po(t);return i.init(),i._load(e),i}}const Lo="$ctrl";class To extends si{isFloating(){return this.prop("floating")||"middle"===this.prop("verticalAlign")&&"center"===this.prop("align")}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}To.defaults=ti(si.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class No extends si{getHintDistance(t){const e=this.prop("hintDistance");return isNaN(e)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:e}getScope(t,e){return"auto"!==P(this.prop("scope"),"auto")?this.prop("scope"):this.chart.general.prop("seriesHovering")?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}No.defaults=ti(si.defaults,{scope:"auto"});class Mo extends si{_doInit(t){this._pointHovering=this._addChild("pointHovering",new No(this.chart))}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this.prop("xStart"))&&void 0!==e?e:t.getXStart()}}var Eo;Mo.defaults=ti(si.defaults,{paletteMode:"normal",interactive:!0,animatable:!0,hoverable:!0,clickable:!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"}(Eo||(Eo={}));class Bo extends ht{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new _t,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Qe,(this._general=new Mo(this)).init(),(this._title=new kr(this)).init(),(this._subtitle=new Lr(this)).init(),(this._legend=new cs(this)).init(),(this._credits=new To(this)).init(),(this._tooltip=new Tr(this)).init(),this._buttons=new ko(this),Bo.split_class&&(this._split=new Bo.split_class(this)).init(),(this._body=new as(this)).init(),(this._navigator=new Pr(this)).init(),(this._exporter=new hs(this)).init(),this._series=new rr(this),this._xAxes=new Ei(this,!0),this._yAxes=new Ei(this,!1),this._gauges=new Fi(this),this._annotations=new ci(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Bo.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Lo]).win()}get options(){return this._op}get exporter(){return this._exporter}get chartOptions(){return this._general}get general(){return this._general}get credits(){return this._credits}_createChart(t){return new Bo(t)}_generalInteractive(){return!1!==this._general.prop("interactive")}animatable(){return this._generalInteractive()&&!1!==this._general.prop("animatable")}loadAnimatable(){return this._loadAnimatable}hoverable(){return this._generalInteractive()&&!1!==this._general.prop("hoverable")}clickable(){return this._generalInteractive()&&!1!==this._general.prop("clickable")}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,i){class s{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter(t=>t.needAxes())}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,i){return yr.collectTooltipText({tooltipHeader:this.axis.prop("tooltipHeader"),tooltipRow:this.axis.prop("tooltipRow"),tooltipListRow:this.axis.prop("tooltipListRow"),tooltipFooter:this.axis.prop("tooltipFooter")},this.series,t,e,i)}getTooltipParam(t,e,i){return yr.inflateTooltipParam(this.series,t,e,i)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._general.pointHovering.getScope(e,i)),t){case"axis":return new s(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 Ri?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._general.prop("timeOffset")}get startOfWeek(){return this._general.prop("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(i=>i.col===t&&(!e||i.checkVisible())):this._xAxes._internalItems().filter(t=>!e||t.checkVisible())}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter(i=>i.row===t&&(!e||i.checkVisible())):this._yAxes._internalItems().filter(t=>!e||t.checkVisible())}_getXAxesAtPane(t,e,i){return this._splitted?this._xAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._xAxes._internalItems().filter(t=>!i||t.checkVisible())}_getYAxesAtPane(t,e,i){return this._splitted?this._yAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._yAxes._internalItems().filter(t=>!i||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 i=this._xAxes.items(),s=this._yAxes.items();let r;if(this.isInverted())switch(t){case Eo.LEFT:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Eo.RIGHT:r=i.filter(t=>t._isOpposite);break;case Eo.BOTTOM:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Eo.TOP:r=s.filter(t=>t._isOpposite)}else switch(t){case Eo.LEFT:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Eo.RIGHT:r=s.filter(t=>t._isOpposite);break;case Eo.BOTTOM:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Eo.TOP:r=i.filter(t=>t._isOpposite)}return r?e?r.filter(t=>t.checkVisible()):r:[]}_setProperties(t,e=!0){const i=this._op;for(const e in Bo.defaults)t.hasOwnProperty(e)&&(i[e]=t[e]);i.type=i.type||"bar",i.gaugeType=i.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&ii(n={},r.base),i(r[s])&&(n||(n={}),ii(n,r[s])),n?ii(n,t):t}_load(t){var e,s;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(P(t.asset,t.assets)),r.options=r.chart=r.general=this._general._load(k(t.general,t.chart,t.options)),i(t.general)?this._credits._load(t.general.credits):i(t.chart)?this._credits._load(t.chart.credits):i(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(P(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(P(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(k(t.xAxis,t.xAxes,{})),this._yAxes.load(k(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(s=this._split)||void 0===s||s._load(t.split),this._annotations.load(P(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(P(t.exporting,t.exportOptions)),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const i=this[e];(i instanceof si||i instanceof ri||i instanceof Qe)&&i.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,i=this._yAxes,s=this._split;return[e,i].forEach(t=>{t.count<1&&!this._gaugeOnly&&t.load({})}),this._inverted=!this._polar&&this.inverted,this._splitted=s&&s.visible,this._assets.prepareRender(),e.disconnect(),i.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),i.prepare(),e.collectValues(),i.collectValues(),e.collectReferentValues(),i.collectReferentValues(),i.collectRanges(),e.collectRanges(),e.prepareRender(),i.prepareRender(),this._splitted&&this._split.prepareRender(e,i),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,i,s){this._xAxes._buildTicks(i?e:t,s),this._yAxes._buildTicks(i?t:e,s),this.$_calcAxesPoints(t,e,i,s)}$_calcAxesPoints(t,e,i,s){let r=i?e:t;this._xAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)}),r=i?t:e,this._yAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)})}axesLayouted(t,e,i){this.$_calcAxesPoints(t,e,i,101)}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t,e);return i&&(this._dataChanged(),this._modelChanged(i)),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._dataChanged(),this._modelChanged(null),i}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const i=document.querySelector(".rct-root");if(i){const s="data-palette",r=i.getAttribute(s);i.setAttribute(s,t);const n=getComputedStyle(i);this._palColors[t]=e=[];for(let t=1;t<=ir;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());i.setAttribute(s,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=l({},s))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach(s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])}),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return ii(ii({},i),t)}else s(e)&&e.forEach(e=>{let i=this._templates[e];return i?ii(ii({},i),t):i});return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Ys[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Ws[t.toLowerCase()]}_getAxisType(t){return n(t)&&pi[t.toLowerCase()]}_getGaugeType(t){return n(t)&&Oi[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&Di[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&hi[t.toLowerCase()]}getAxesGap(){return this._general.num("axisGap")}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}Bo.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Mi.register(Is,Wr,Ao,Qr),sr.register(wn,Vn,tn,rn,kn,Tn,In,Hn,jn,Un,qn,Kn,eo,ro,yn,bn,ao,lo,_o,yo,wo,Vo),yr.register(An,on,Fn,Wn,Cn,bo),yr.registerSeries(An,on,Wn,Cn,bo),li.register(Or,Dr,Rr);class Oo{constructor(t,e){this._modelCallback=e,this._obj=new Bo(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[Lo]=null===(t=this[Lo])||void 0===t?void 0:t.dispose(),this._obj=null,this.$_disposed=!0)}get options(){return this._obj.options}get general(){return this._obj._general}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,s){var r;if(i(t)){const i="load chart";st.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new Bo(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,st.log("chart-items:",Je),st.LOGGING&&console.timeEnd(i),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,i){this._obj.setParam(t,e,i)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[Lo].refresh()}}class Do{constructor(t,e){this._obj=new ct(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,i){this._obj.setValue(t,e,i)}getValues(t,e=0,i=-1){return this._obj.getValues(t,e,i)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Ro extends U{constructor(t,e,i){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i}_doDispose(){var t;null===(t=this._orphans)||void 0===t||t.clear(),this.freeAll(),this._owner=null,this._creator=null,super._doDispose()}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,i=0){let s=this._pool.pop();return s||(s=new this._creator(t,this._styleName)),s}prepare(t,e,i){const s=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(s);o.push(e),null==i||i(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 i=this._views.indexOf(t);i>=0&&this._views.splice(i,1)}}freeAll(t,e=0){for(let i=(t=t||this._views).length-1;i>=0;i--)this.free(t[i],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 i=e.length-1;i>=t;i--)this.free(e[i],0)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===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 i=null===(e=this._orphans)||void 0===e?void 0:e.get(t);i&&(this.free(i),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}}class $o{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new $o(t,t,t,t):new $o(t,t,e,e):new $o(t,e,i,s)}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,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new $o(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=A(t.paddingLeft,0),this.right=A(t.paddingRight,0),this.top=A(t.paddingTop,0),this.bottom=A(t.paddingBottom,0),this}applyMargin(t){return this.left=A(t.marginLeft,0),this.right=A(t.marginRight,0),this.top=A(t.marginTop,0),this.bottom=A(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}}}$o.Empty=Object.freeze(new $o),$o.Temp=new $o;class Io extends we{constructor(t,e=ut){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Io.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Io.IGNORE_ATTRS={width:"",height:""};class Fo extends we{constructor(t,e=ut){super(t,e,"g"),we.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,i,s,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,i,s,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),we.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,i,s,r){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class zo extends Fo{constructor(t,e,i){super(t,e),this._margins=new $o,this._paddings=new $o,this.add(this._background=new gs(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s,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,i,s,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 Ho extends Io{measure(t,e,i,s,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,i,s,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 Go extends Fo{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,i){this._inverted=t,this._animatable=e,this._loadAnimatable=i}}class jo extends we{constructor(t,e,i){super(t,i,"image"),this._bounds=W,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&&!it||(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,i){this.url=t,this.resize(e,i)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,i=this._bounds.height;e>0&&!i?i=e/t.width*t.height:0==i||e||(e=i/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:i}}return this._bounds}resize(t,e,i){const s=this._proxy;return t||(t=NaN),e||(e=NaN),s&&(N(t)||N(e))&&(t>0&&N(e)?e=t/s.width*s.height:e>0&&N(t)?t=e/s.height*s.width:(t=s.width,e=s.height)),super.resize(t,e,i)}}class Wo extends Io{constructor(e,i=ut){super(e),this.add(this._text=new Oe(e,i)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.prop("effect");return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),s&&this._text.internalSetStyleOrClass(s),"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.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Oe(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()),i&&i!==this._failedIconUrl?(this._icon||this.add(this._icon=new jo(t,!1)),this._icon.setImage(i,+this._model.prop("iconWidth"),+this._model.prop("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){const e=this._model;if(null==e?void 0:e.prop("autoContrast")){const i=this._back&&this._back.parent?this._back.dom:t;i&&this._text.setContrast(i,e.prop("darkStyle")||"rct-label-dark",e.prop("lightStyle")||"rct-label-light")}if(this._outline&&this._outline.parent){const t=ie.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const i=this._text,s=this._outline,r=this._icon;let n=0;const o=i.getBBox(),a=o.width,h=o.height;let l=a,c=h,_=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();n=this._model.num("iconGap");const e=this._model.num("iconWidth"),i=this._model.num("iconHeight");switch(_=t.width||e||i,d=t.height||i||e,this._model.getIconPos()){case"left":case"right":l+=n+_,c=Math.max(d,h);break;default:c+=n+d,l=Math.max(_,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(t.paddingRight)||0),c+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(c-d)/2),u+=_+n,l-=_+n;break;case"right":r.trans(u+l-_,(c-d)/2),l-=_+n;break;case"top":r.trans((l-_)/2,p),p+=d+n;break;case"bottom":r.trans((l-_)/2,p+h+n)}switch(e){case"center":u+=l/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}return i.trans(u,p),s&&(s.anchor=i.anchor,s.setAttr("y",i.getAttr("y")),s.trans(i.tx,i.ty)),this._iconBox=r?{x:r.tx,y:r.ty,width:_,height:d}:null,this}getLayoutBox(){const t=this.getBBox(),e=this._iconBox;if(!e)return t;const i=Math.min(t.x,e.x),s=Math.min(t.y,e.y);return{x:i,y:s,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-s}}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new Oe(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 Yo extends zo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new Oe(t)),this._richText=new je}rotatedWidth(){const t=this.model.getRotation()*w,e=this.getBBox();return m(u(t)*e.height)+m(d(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*w,e=this.getBBox();return m(d(t)*e.height)+m(u(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,r){this._angle=e.getRotation();const n=e.prop("writingMode");n&&this._textView.setStyle("writingMode",n),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===n,this._richText.setFormat(e.prop("text")),!isNaN(e.num("lineHeight"))&&this._richText&&(this._richText.lineHeight=e.num("lineHeight")),this._richText.build(this._textView,i,s,null,null);const o=Y(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=o.width;o.width=o.height,o.height=t}return o}_doLayout(e){const i=this._textView,s=i.getStyle("writing-mode"),r=s===wt||s===vt;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":i.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}i.trans(o,n)}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 Xo extends zo{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new Oe(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new je}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null),Y(this._textView.getBBox())}_doLayout(e){const i=this._textView;let s=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":i.anchor=t.TextAnchor.END,r+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE}i.trans(r,s)}}class Uo extends Fo{constructor(t,e=Jo.TICK_CLASS){super(t,e),this.add(this._lineView=new cn(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Zo extends Wo{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1,this.groupLevel=-1,this._backPad=null,this._backPadDom=null}setLabel(t,e,i,s,r,n){s?(t.prepareRich(s),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(i)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),this._text.text="")}applyBackgroundCallback(t,e){const i=t.prop("backgroundStyleCallback");if("background"===t.prop("effect")&&i){const s=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(i(s))}}rotatedWidth(){const t=(this.rotation||0)*w,e=this.getBBox();return m(u(t)*e.height)+m(d(t)*e.width)}rotatedHeight(){const t=this.rotation*w,e=this.getBBox();return m(d(t)*e.height)+m(u(t)*e.width)}invalidateBackPad(){this._backPad=null,this._backPadDom=null}resizeBackBySpan(t,e,i=!0){const s=this._back;if(!s)return;const r=this.getBBox();let n=this._backPad;if(!n||this._backPadDom!==s.dom){const t=getComputedStyle(s.dom);n=this._backPad={l:parseFloat(t.paddingLeft)||0,t:parseFloat(t.paddingTop)||0,r:parseFloat(t.paddingRight)||0,b:parseFloat(t.paddingBottom)||0},this._backPadDom=s.dom}const{l:o,t:a,r:h,b:l}=n;s.transX(0),s.transY(0),i?s.setBounds((t-r.width)/-2-e-o,-a,t-1+o+h,r.height+a+l):s.setBounds(-o,(t-r.height)/-2-e-a,r.width+o+h,t-1+a+l)}resizeBackByWeight(t,e,i,s,r,n,o,a,h,l=0){const c=this._back;if(c)if(t._isHorz){const t=this.getBBox(),e=a;c.transY(-this.ty),c.transX((e-t.width)/-2-h),c.resize(e-1,r)}else{const t=this.getBBox(),r=a,_=e?n-o+l:i?n:l-o;c.transX(_-this.tx),c.transY((r-t.height)/-2-h),e?c.resize(s-l-2*(n+o),r-1):c.resize(s-n-l+o,r-1)}}}class qo extends we{constructor(t){super(t,void 0),this.add(this._back=new Pe(t,"rct-crosshair-flag")),this.add(this._text=new Oe(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const i=t.flag;this._text.text=(i.prop("prefix")||"")+e+(i.prop("suffix")||"");const s=this._text.getBBox(),r=new ye,n=f(i.num("minWidth"),s.width+8);r.rect(0,0,n,s.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.prop("textStyles"))}}class Ko extends Fo{static isThumb(t){return t.classList.contains(Ko.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,Ko.TRACK_CLASS)),this.add(this._thumbView=new gs(t,Ko.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,i=t.end-t.start;this._len=f(0,e),this._page=g(i,e),this._pos=g(t.min+e-i,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,i=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.prop("reversed"),(t=f(0,g(t,i)))*(e.max-e.min-(e.end-e.start))/i+e.min}_doMeasure(t,e,i,s,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:s}:{width:i,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,i=e.axis._zoom,s=this._szThumb=A(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-i.min,h=e.getGap(),l=h+e.getGapFar();let c=this.width,_=this.height;if(this._vertical){c-=l,this._trackView.setBounds(h,0,c,_),_-=s;const t=(n||o===r?_:_*o/r)+s;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-_*a/r-t,c-2,t)}else{_-=h+e.getGapFar(),this._trackView.setBounds(0,h,c,_),c-=s;const t=(n||o===r?c:c*o/r)+s;this._reversed,this._thumbView.setBounds(n?0:c*a/r,h+1,t,_-2)}}}Ko.CLASS_NAME="rct-axis-scrollbar",Ko.TRACK_CLASS="rct-axis-scrollbar-track",Ko.THUMB_CLASS="rct-axis-scrollbar-thumb";const Qo=/\${label}.*?/g;class Jo extends Fo{constructor(t){super(t,Jo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._minorMarkViews=[],this._categoryTreeLevelSizes=[],this._categoryTreeLevelOffsets=[],this._categoryTreeExtraSize=0,this.add(this._lineView=new cn(t,Jo.LINE_CLASS)),this.add(this._titleView=new Yo(t)),this.add(this._markContainer=new we(t,"rct-axis-ticks")),this.add(this._minorMarkContainer=new we(t,"rct-axis-minor-ticks")),this.add(this._labelContainer=new we(t,"rct-axis-labels")),this.add(this._unitView=new Xo(t)),this._labelViews=new Ro(this._labelContainer,Zo,"rct-axis-label")}$_checkScrollView(t,e,i,s,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Ko(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,s,r,1)[i];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?f(0,s.tick._getGap()):f(0,s.tick._getLength())+f(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsHorz(s,e,!0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).height,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"height",e,i),o}checkWidth(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?f(0,s.tick._getGap()):f(0,s.tick._getLength())+f(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsVert(s,i,!0,0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).width,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"width",e,i),o}prepareGuides(t,e,i,s,r){[s,r].forEach((s,r)=>{const n=this.model.guides.filter(t=>t.prop("front")==(1===r)&&t.canConstainedTo(e,i));s.setAll(t,n,!1)})}showCrosshair(t,e){const i=this.model;let s,r=this._crosshairView;r||this.add(r=this._crosshairView=new qo(this.doc)),r.setVis(!0),r.setText(i.crosshair,e);const n=r.getBBox();i._isHorz?r.trans(t-n.width/2,i.tick._getLength()):(s="opposite"===i._runPos?g(0,this.width-n.width):f(0,this.width-i.tick._getLength()-n.width),r.trans(s,t-n.height/2))}setMargins(t,e,i,s){}hideCrosshair(){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,i=this.model;if((!e||e===i)&&t){const t=this._prevMin,e=this._prevMax,s=this._prevMin=i.axisMin(),r=this._prevMax=i.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&s!==t){if(i._isX&&i._zooming)return{axis:i,from:this._prevMin,to:r};i.chart.animatable()&&i.prop("animatable")&&i.checkExtents(t,e)}}this._prevModel=i}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,i,s,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,c=this._titleView,_=this._unitView;let d=0,u=0;return this._reversed=e.prop("reversed"),(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new cn(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.tick._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach(n=>n.measure(t,e.tick,i,s,r)),e instanceof jr?(this._minorMarkLen=e.minorTick._getLength(),this.$_prepareMinorTickMarks(t,e)&&this._minorMarkViews.forEach(n=>n.measure(t,e.minorTick,i,s,r))):this._minorMarkContainer.setVis(!1),this.$_prepareLabels(e,h?i:s)&&(u=h?this.$_measureLabelsHorz(e,i):this.$_measureLabelsVert(e,s,!1,r),e.label._inside&&(u=0)),this._labelSize=u,_.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).width)),d+=u,this._simpleMode?(c.setVis(!1),_.setVis(!1)):(c.visible&&(d+=h?c.mh:c.mw,d+=e.title.num("gap")),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?i:d,height:h?d:s}}_doLayout(){const t=this.model,e=t._isHorz,i=t._isOpposite,s=t._isBetween,r=t.label._inside,n=t.tick._inside,o=t._ticks,a=t._markPoints,h=this._labelViews,l=this._unitView,c=this._markLen,_=this._tickGap,d=this.width,u=this.height;this._lineView.visible&&(e?this._lineView.setHLine(i?u:0,0,d):this._lineView.setVLine(i?0:d,0,u),this._lineView2&&(e?this._lineView2.setHLine(u,0,d):this._lineView2.setVLine(0,0,u))),this._markContainer.visible&&this.$_layoutTickMarkViews(this._markViews,a,c,t,e,i,n,d,u),t instanceof jr&&this._minorMarkContainer.visible&&this.$_layoutTickMarkViews(this._minorMarkViews,t._minorMarkPoints,this._minorMarkLen,t,e,i,n,d,u);const p=(r===n?c:0)+_,g=t instanceof Is?t:null;if(t._ani&&(this._labelContainer.visible?this._labelSize=e?this.$_measureLabelsHorz(t,d):this.$_measureLabelsVert(t,u,!1,0):(null==g?void 0:g.hasCategoryTree())&&(this._labelSize=this.$_measureCategoryTree(g,e,!1,e?d:u))),this._labelContainer.visible&&h.count>0?(h.count>o.length?h.prepare(o.length):h.count<o.length&&st.warn("labelViews.count < ticks.length",h.count,o.length),e?(this.$_layoutLabelsHorz(h,o,r,s,i,d,u,p),this.$_layoutCategoryTreeHorz(t,r,i,d,u,p)):(this.$_layoutLabelsVert(h,o,r,s,i,d,u,p),this.$_layoutCategoryTreeVert(t,r,i,d,u,p))):e?this.$_layoutCategoryTreeHorz(t,r,i,d,u,p):this.$_layoutCategoryTreeVert(t,r,i,d,u,p),l.visible&&(e?this.$_layoutUnitHorz(l,h,i,d,u,p):this.$_layoutUnitVert(l,h,i,d,u,p)),!this._simpleMode){const s=t.title,o=this._titleView,a=this._scrollView,h=this._labelSize,l=r?n?0:c+_:p+h;let g=0,f=0;if(o.visible){const r=+s.prop("offset")||0,n=s.getGap();if(o.resizeByMeasured().layout(e),e){if(f+=i?0:l+n,t.prop("reversed"))switch(s.prop("align")){case"start":g=d-o.width/2-r;break;case"end":g=o.width/2+r;break;default:g=d/2-r}else switch(s.prop("align")){case"start":g=o.width/2+r;break;case"end":g=d-o.width/2-r;break;default:g=d/2+r}o.trans(g,f),f+=o.height}else{const t=0===o._angle?o.width:o.height;if(g=i?l+n+t/2:d-l-n-t/2,this._reversed)if(0===o._angle)switch(s.prop("align")){case"start":f=0+r;break;case"end":f=u-o.height-r;break;default:f=(u-o.height)/2+r}else switch(s.prop("align")){case"start":f=o.width/2-o.height/2+r;break;case"end":f=u-o.width/2-o.height/2-r;break;default:f=(u-o.height)/2+r}else if(0===o._angle)switch(s.prop("align")){case"start":f=u-o.height-r;break;case"end":f=0+r;break;default:f=(u-o.height)/2-r}else switch(s.prop("align")){case"start":f=u-o.width/2-o.height/2-r;break;case"end":f=o.width/2-o.height/2+r;break;default:f=(u-o.height)/2-r}o.trans(g,f)}}else f+=i?0:l;(null==a?void 0:a.visible)&&(e?(a.trans(0,f).resize(this.width,a.mh),a.setScroll(t._zoom,this._reversed)):(a.trans(0,0).resize(a.mw,this.height),a.setScroll(t._zoom,this._reversed)),a.layout())}}$_syncTickMarkViews(t,e,i,s,r=Jo.TICK_CLASS){for(;i.length<s;){const s=new Uo(t,r);e.add(s),i.push(s)}for(;i.length>s;)i.pop().remove()}$_prepareTickMarkViews(t,e,i,s,r,n=Jo.TICK_CLASS){return!!(e.visible=s)&&(this.$_syncTickMarkViews(t,e,i,r,n),!0)}$_layoutTickMarkViews(t,e,i,s,r,n,o,a,h){r?t.forEach((t,r)=>{t.resize(1,i),t.layout().trans(s.prev(e[r]),n?o?h:h-i:o?-i:0)}):t.forEach((t,r)=>{t.resize(i,1),t.layout().trans(n?o?-i:0:o?a:a-i,h-s.prev(e[r]))})}$_prepareTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._markContainer,this._markViews,e.tick.visible,e._markPoints.length)}$_prepareMinorTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._minorMarkContainer,this._minorMarkViews,e.minorTick.visible,e._minorMarkPoints.length,Jo.MINOR_TICK_CLASS)}_prepareLabel(t,e,i,s,r){if(!r&&t.value===e.value)return;const n=i.getLabelText(e,s),o=e.label,a=i.getLabelStyle(e,s);if(t.value=e.value,null!=n){o&&n.match(Qo)?t.setLabel(i,a,e,n.replace(Qo,o),1e3,1e3):(i.prepareRich(n),i._paramTick=e,t.setModel(this.doc,i,i.getIconUrl(i.getIcon(e)),a),i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,a,e,o,1e3,1e3);t.applyBackgroundCallback(i,e),t.layout("center")}$_resolveCategoryTreeRotation(t,e,i,s,r){const n=t.getLevelRotation(e.level);if("auto"!==n)return n;if(!i)return 0;const o=t.getCategoryTreeSpan(e.start,e.end,s);return isNaN(o.size)||o.size<=0?0:r._text.getBBox().width>o.size?-90:0}$_prepareCategoryTreeLabel(t,e,i,s,r,n,o,a){const h=s.getLevelStyle(i.level);if(!(!n&&t.index===r&&t.groupLevel===i.level&&t.value===i.start&&t.col===i.end&&t.categoryTreeLabel===i.label&&this.$_equalSVGStyleOrClass(t.categoryTreeStyle,h))){t.index=r,t.groupLevel=i.level,t.value=i.start,t.col=i.end,t.categoryTreeLabel=i.label,t.categoryTreeStyle=h,t.invalidateBackPad(),e.prepareRich(i.label),t.setModel(this.doc,e,null,h),e.buildSvg(t._text,t._outline,NaN,NaN,e,e._domain);const n=s._ticks[i.start];n&&t.applyBackgroundCallback(e,n),t.setContrast(null).layout(s.getLevelAlign(i.level))}t.rotation=this.$_resolveCategoryTreeRotation(s,i,o,a,t)}$_isCategoryTreeSpanVisible(t){return!isNaN(t.center)&&!isNaN(t.size)}$_equalSVGStyleOrClass(t,e){if(t===e)return!0;if(null==t||null==e)return t==e;if(n(t)||n(e))return t===e;if(!i(t)||!i(e))return!1;const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!1;for(const i of s)if(t[i]!==e[i])return!1;return!0}$_applyLabelRotationVert(t,e,i,s,r){const n=e.x+e.width/2,o=e.y+e.height/2;return t.setRotation(n,o,i),{x:r-n,y:s-o}}$_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,i,s,r,n,o,a){const h=t.label,l=f(0,g(s-1,h.prop("startStep")||0)),c=t._ticks,_=c.length,u=(s=f(1,s))*(r=g(f(1,r),c.length)),p=n||0,y=m(p)*w,b=y<35*w;let x,v=!1,S=0;for(let n=0;n<r;n++){let r=n*s+l;for(;r<_;r+=u){let s=0;for(let e=r;e<r+u&&e<_;e++)s+=t.getLabelLength(i,c[e].value);if(r+u<_){x=e.pull(S++),x.rotation=p,x.row=n,x.index=r,this._prepareLabel(x,c[r],h,_,a),x.setVis(!0);const t=s;if(0===p&&x.getBBox().width>=t){v=!0;break}if(b&&x.getBBox().width*d(y)>=t){v=!0;break}if(0!==p&&x.getBBox().height>=t){v=!0;break}}}if(v)return!0;{const t=r-u;0<=t&&t<_&&(x=e.pull(S++),x.row=n,x.rotation=p,x.index=t,this._prepareLabel(x,c[t],h,_,a),x.setVis(!0))}}!o&&e.freeFrom(S)}$_applyStep(t,e,i){const s=t.label,r=f(0,g(i-1,s.prop("startStep")||0));e.forEach(t=>t.index=-1);for(let t=r;t<e.length;t+=i)e[t].index=t;return e.forEach(t=>t.setVis(t.index>=0)),e.filter(t=>t.visible)}$_measureLabelsHorz(t,e,i=!1){const s=t.prop("reversed"),r=t.label,n=t instanceof Is?t:null;if(null==n?void 0:n.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(n,!0,i,e);let o=+r.prop("step")|0,a=+r.prop("rows")|0;const h=a;let l,c=+r.prop("rotation")%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i),d=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===r.prop("autoArrange"))this._labelViews.prepare(t._ticks.length,(e,s,n)=>{e.rotation=c,e.row=0,e.index=s,this._prepareLabel(e,t._ticks[s],r,n,i),e.setVis(!0)}),d=this.$_applyStep(t,d,o||1);else{switch(o=a=0,r.prop("autoArrange")){case"rows":a=this.$_getRows(d);break;case"step":o=this.$_getStep(d)}if(o>1){const s=t._ticks.length;for(;o<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,i);)o++}else if(a>1){const s=h>1?h:f(1,+r.prop("maxRows")|0);a=g(h>1?h:a,s);let n=!1;for(;t._ticks.length>a;){if(d.forEach((t,e)=>{t.row=e%a,t.index=e}),!this.$_checkOverlappedHorz2(t,this._labelViews,e,1,a,0,!1,i)){n=!0;break}if(a>=s)break;a++}if(n)this._labelRowPts=[];else{a=1,o=2;const s=t._ticks.length;for(;o<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,i);)o++}}else if((isNaN(c)||Math.abs(Math.tan(c*w))<1)&&(c=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i)){o=2;const s=t._ticks.length;for(;o<=s;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,i)&&d.forEach((t,e)=>{t.rotation=c});break}o++}}}else;if(d.length>0){if(a>1){const t=!isNaN(c)&&0!=c,e=this._labelRowPts;for(let t=0;t<a;t++)e.push(0);d.forEach(i=>{e[i.row]=f(e[i.row],t?i.rotatedHeight():i.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(c)||0==c){l=d[0].getBBox().height;for(let t=1;t<d.length;t++)l=f(l,d[t].getBBox().height);if(d.length>1){const e=t._ticks;let i=s?r.prop("lastOverflow"):r.prop("firstOverflow");if("hidden"===i){const t=d[0],i=t.rotatedWidth();let s=e[t.index].pos-i/2,r=0;for(let t=1;t<d.length;t++)r=f(r,d[t].getBBox().height);(s+i>d[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(l=r,t.hidden=!0):t.hidden=!1}if(i=s?r.prop("firstOverflow"):r.prop("lastOverflow"),"hidden"===i){const t=d[d.length-1],i=t.rotatedWidth(),s=d[d.length-2],r=e[t.index-1].pos+s.getBBox().width/2;let n=e[t.index].pos-i/2,o=0;for(let t=0;t<d.length-1;t++)o=f(o,d[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>o?(l=o,t.hidden=!0):t.hidden=!1}}}else{l=d[0].rotatedHeight();for(let t=1;t<d.length;t++)l=f(l,d[t].rotatedHeight())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),l}return 0}$_checkOverlappedVert2(t,e,i,s,r,n){const o=t.label,a=t._ticks,h=a.length,l=f(1,s);let c,_=o.prop("startStep")||0,d=0;for(;_<h;_+=l){let s=0;for(let e=_;e<_+l&&e<h;e++)s+=t.getLabelLength(i,a[e].value);if(_+l<h&&(c=e.pull(d++),c.rotation=r,c.index=_,this._prepareLabel(c,a[_],o,h,n),c.setVis(!0),c._text.getBBox().height>=s))return!0}const u=_-l;0<=u&&u<h&&(c=e.pull(d++),c.rotation=r,c.index=u,this._prepareLabel(c,a[u],o,h,n),c.setVis(!0)),e.freeFrom(d)}$_measureLabelsVert(t,e,i=!1,s=0){if(s>1&&t instanceof jr)return this._prevWidth;const r=t instanceof Is?t:null;if(null==r?void 0:r.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(r,!1,i,e);const n=t.label,o=+n.prop("rotation")%360;let a=f(1,+n.prop("step")|0);const h=this.$_checkOverlappedVert2(t,this._labelViews,e,a,o,i);let l=this._labelViews._internalItems();if(h)if("none"===n.prop("autoArrange"))this._labelViews.prepare(t._ticks.length,(e,s,r)=>{e.rotation=o,e.index=s,this._prepareLabel(e,t._ticks[s],n,r,i),e.setVis(!0)}),l=this.$_applyStep(t,l,a||1);else{const s=t._ticks.length;for(;a<=s&&this.$_checkOverlappedVert2(t,this._labelViews,e,++a,o,i););}else;if(this._labelViews.freeHiddens(),l=this._labelViews._internalItems(),l.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",i=this._labelContainer.textAlign()||e;let s;if(isNaN(o)||0===o){l[0].setContrast(null).layout(i),s=l[0].getBBox().width;for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(i),s=f(s,l[t].getBBox().width)}else{l[0].setContrast(null).layout(i),s=l[0].rotatedWidth();for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(i),s=f(s,l[t].rotatedWidth())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),this._prevWidth=s}return 0}$_ensureCategoryTreeViews(){this._categoryTreeBandContainer||(this.add(this._categoryTreeBandContainer=new we(this.doc,"rct-axis-tree-bands")),this._categoryTreeBandViews=new Ro(this._categoryTreeBandContainer,gs,"rct-axis-tree-band")),this._categoryTreeLabelContainer||(this.add(this._categoryTreeLabelContainer=new we(this.doc,"rct-axis-tree-labels")),this._categoryTreeLabelViews=new Ro(this._categoryTreeLabelContainer,Zo,"rct-axis-tree-label")),this._categoryTreeDividerContainer||(this.add(this._categoryTreeDividerContainer=new we(this.doc,"rct-axis-tree-dividers")),this._categoryTreeDividerViews=new Ro(this._categoryTreeDividerContainer,cn,"rct-axis-tree-divider"))}$_hideCategoryTreeViews(){var t,e,i;null===(t=this._categoryTreeLabelContainer)||void 0===t||t.setVis(!1),null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null===(i=this._categoryTreeDividerContainer)||void 0===i||i.setVis(!1)}$_measureCategoryTree(t,e,i,s){this.$_ensureCategoryTreeViews();const r=t.getCategoryTreeGroups(),n=t.getCategoryTreeDepth(),o=t.label,a=t._ani?this._categoryTreeLevelSizes:null,h=this._categoryTreeLevelSizes=[],l=this._categoryTreeLevelOffsets=[],c=Jo.HIERARCHY_ROW_GAP;let _=0;this._categoryTreeLabelContainer.setStyleOrClass(o._style),this._categoryTreeLabelContainer.setVis(r.length>0),this._categoryTreeLabelViews.prepare(r.length,(n,l)=>{const c=r[l],_=t.isLevelVisible(c.level);if(this.$_prepareCategoryTreeLabel(n,o,c,t,l,i,e,s),n.setVis(_),_){const t=e?n.rotatedHeight():n.rotatedWidth();let i=f(h[c.level]||0,t);null!=(null==a?void 0:a[c.level])&&(i=f(i,a[c.level])),h[c.level]=i}});for(let e=0;e<n;e++)l[e]=_,t.isLevelVisible(e)&&(_+=(h[e]||0)+c);return this._categoryTreeExtraSize=_,_}$_syncCategoryTreeMeasure(t,e,i){t._ani&&this.$_measureCategoryTree(t,e,!1,i)}$_layoutCategoryTreeHorz(t,e,i,s,r,n){const o=t instanceof Is?t:null;if(!(null==o?void 0:o.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const a=o._isHorz?s:r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(o,!0,a);const h=o.getCategoryTreeGroups(),l=o.label,c=this._categoryTreeLabelViews,_=this._categoryTreeLevelOffsets,d=n,u=this._categoryTreeExtraSize;this.$_layoutCategoryTreeBandsHorz(o,a,e,i,r,d,u);const p=l.prop("fillToCategory"),g="background"===l.prop("effect");c.forEach((t,s)=>{const n=h[s];if(!o.isLevelVisible(n.level))return void t.setVis(!1);const l=o.getCategoryTreeSpan(n.start,n.end,a);if(!this.$_isCategoryTreeSpanVisible(l))return void t.setVis(!1);const c=o.getLevelAlign(n.level);t.setContrast(null).layout(c);const u=t.rotation,f=t.getBBox(),m=Math.abs(u)>15;let y,b,x=0;p&&!m&&(x="left"===c?(l.size-f.width)/-2:"right"===c?(l.size-f.width)/2:0);const w=this._categoryTreeLevelSizes[n.level]||(m?t.rotatedHeight():f.height);let v;v=e?i?r+d+_[n.level]+w/2:-d-_[n.level]-w/2:i?r-d-_[n.level]-w/2:d+_[n.level]+w/2;const S=o.getLabelX(a,l.center),V=f.x+f.width/2,C=f.y+f.height/2;t.setRotation(V,C,u),b=S-V+x,y=v-C,t.trans(b,y),t.setVis(!0),g&&t.resizeBackBySpan(l.size,x,!0)}),this.$_layoutCategoryTreeDividers(o,a,!0,e,i,s,r,n,0,u,0)}$_getBandY(t,e,i,s,r){const n=s+r,o=t?e?i:-n:e?i-n:0,a=t?e?i+n:0:e?i:n;return{yMin:g(o,a),yMax:f(o,a)}}$_getLevelBoundaryY(t,e,i,s,r,n){const o=this._categoryTreeLevelOffsets,a=t>=o.length?i:o[t];return s?r?n+e+a:-e-a:r?n-e-a:e+a}$_getLevelBoundaryX(t,e,i,s,r,n,o,a){const h=this._categoryTreeLevelOffsets,l=t>=h.length?i:h[t];return s?r?-e-l:n+e+l:r?o+a+l:n-e-l}$_getLevelColumnCenterX(t,e,i,s,r,n,o,a,h){const{x0:l,x1:c}=this.$_getLevelRowXRange(t,e,i,s,r,n,o,a,h);return(l+c)/2}$_getLevelRowYRange(t,e,i,s,r,n,o){const{yMin:a,yMax:h}=this.$_getBandY(i,s,r,n,o),l=0===t?a:this.$_getLevelBoundaryY(t,n,o,i,s,r),c=t===e-1?h:this.$_getLevelBoundaryY(t+1,n,o,i,s,r);return{y0:g(l,c),y1:f(l,c)}}$_getLevelRowXRange(t,e,i,s,r,n,o,a,h){const l=this.$_getLevelBoundaryX(t,n,o,i,s,r,a,h),c=this.$_getLevelBoundaryX(t+1,n,o,i,s,r,a,h);return{x0:g(l,c),x1:f(l,c)}}$_countCategoryTreeDividerLines(t,e=!0){const i=t.getCategoryTreeDepth();let s=0;e&&t.isDividerTopCap()&&(s+=1);for(let e=0;e<i;e++)t.isDividerEdge(e)&&(s+=2),t.isDividerBetween(e)&&(s+=t.getDividerEnds(e).length),t.isDividerBelow(e)&&(s+=1);return s}$_prepareCategoryTreeBands(t){var e,i;if(!t.isBandVisible())return null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null;const s=t.getBandGroups();return s.length?(this._categoryTreeBandContainer.setVis(!0),s):(null===(i=this._categoryTreeBandContainer)||void 0===i||i.setVis(!1),null)}$_getCategoryTreeLabelXBounds(t,e,i,s,r,n,o){const a=s+r,h=t?e?-n-a:i:e?0:o-r,l=t?e?0:i+a+n:e?o+a+n:i;return{xMin:g(h,l),xMax:f(h,l)}}$_getCategoryTreeEdgeYBounds(t,e){const i=t.getDividerLinePositions(e),s=t.getLabelY(e,i[0]),r=t.getLabelY(e,i[i.length-1]);return{yMin:g(s,r),yMax:f(s,r)}}$_applyCategoryTreeDividerLine(t,e,i){const s=e.getDividerStyle(i);null!=s?(t.setStyleOrClass(s),t.setVis(!0)):t.setVis(!1)}$_layoutCategoryTreeBandsHorz(t,e,i,s,r,n,o){const a=this.$_prepareCategoryTreeBands(t);if(!a)return;const{yMin:h,yMax:l}=this.$_getBandY(i,s,r,n,o),c=m(l-h);this._categoryTreeBandViews.prepare(a.length,(i,s)=>{const r=a[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelX(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:o,y:g(h,l),width:n.size,height:c},i.setVis(!0)})}$_layoutCategoryTreeBandsVert(t,e,i,s,r,n,o,a,h){const l=this.$_prepareCategoryTreeBands(t);if(!l)return;const{xMin:c,xMax:_}=this.$_getCategoryTreeLabelXBounds(i,s,r,n,o,a,h),d=m(_-c);this._categoryTreeBandViews.prepare(l.length,(i,s)=>{const r=l[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelY(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:c,y:o,width:d,height:n.size},i.setVis(!0)})}$_layoutCategoryTreeDividers(t,e,i,s,r,n,o,a,h,l,c){var _,d,u;if(!t.isDividerVisible())return void(null===(_=this._categoryTreeDividerContainer)||void 0===_||_.setVis(!1));const p=t.getDividerLinePositions(e);if(p.length<2)return void(null===(d=this._categoryTreeDividerContainer)||void 0===d||d.setVis(!1));const m=this.$_countCategoryTreeDividerLines(t,i);if(m<=0)return void(null===(u=this._categoryTreeDividerContainer)||void 0===u||u.setVis(!1));this._categoryTreeDividerContainer.setVis(!0),this._categoryTreeDividerViews.prepare(m);const y=t.getCategoryTreeDepth();let b=0;if(i){const i=a,{yMin:n}=this.$_getBandY(s,r,o,i,l),h=t.getLabelX(e,p[0]),c=t.getLabelX(e,p[p.length-1]),_=g(h,c),d=f(h,c);if(t.isDividerTopCap()){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t),e.setHLine(n,_,d)}for(let n=0;n<y;n++){const{y0:a,y1:h}=this.$_getLevelRowYRange(n,y,s,r,o,i,l);if(t.isDividerEdge(n)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,i);this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,h)}),t.isDividerBetween(n)&&t.getDividerEnds(n).forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,h)}),t.isDividerBelow(n)){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t,n),e.setHLine(h,_,d)}}}else{const{yMin:i,yMax:o}=this.$_getCategoryTreeEdgeYBounds(t,e);for(let _=0;_<y;_++){const{x0:d,x1:u}=this.$_getLevelRowXRange(_,y,s,r,n,a,l,c,h);if(t.isDividerEdge(_)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,i);this.$_applyCategoryTreeDividerLine(s,t,_),s.setHLine(r,d,u)}),t.isDividerBetween(_)&&t.getDividerEnds(_).forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,_),s.setHLine(r,d,u)}),t.isDividerBelow(_)){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t,_),e.setVLine(u,i,o)}}}}$_layoutCategoryTreeVert(t,e,i,s,r,n){var o,a;const h=t instanceof Is?t:null;if(!(null==h?void 0:h.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const l=r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(h,!1,l);const c=h.getCategoryTreeGroups(),_=h.label,d=this._categoryTreeLabelViews,u=this._categoryTreeExtraSize,p=this._titleView,g=p.visible?p.rotatedWidth()+(null!==(a=null===(o=p.model)||void 0===o?void 0:o.prop("gap"))&&void 0!==a?a:0):0,f=t.tick._getGap();this.$_layoutCategoryTreeBandsVert(h,l,e,i,s,n,f,u,g);const m=_.prop("fillToCategory"),y=m?_.prop("verticalAlign"):"middle",b="background"===_.prop("effect");d.forEach((t,r)=>{const o=c[r];if(!h.isLevelVisible(o.level))return void t.setVis(!1);const a=h.getCategoryTreeSpan(o.start,o.end,l);if(!this.$_isCategoryTreeSpanVisible(a))return void t.setVis(!1);const _=t.rotation,d=h.getLevelAlign(o.level);t.setContrast(null).layout(d);const p=t.getBBox(),x=Math.abs(_)>15,w=x?t.rotatedWidth():p.width,v=x?t.rotatedHeight():p.height;let S,V,C=0;m&&(C="top"===y?(a.size-v)/-2:"bottom"===y?(a.size-v)/2:0);const A=h.getLabelY(l,a.center)+C,P=this.$_getLevelColumnCenterX(o.level,h.getCategoryTreeDepth(),e,i,s,n,u,g,f);x?({x:S,y:V}=this.$_applyLabelRotationVert(t,p,_,A,P)):(S=P-w/2,V=A-v/2,isNaN(_)||t.setRotation(p.width/2,p.height/2,_)),t.trans(S,V),t.setVis(!0),b&&t.resizeBackBySpan(a.size,C,!1)}),this.$_layoutCategoryTreeDividers(h,l,!1,e,i,s,r,n,f,u,g)}$_layoutLabelsHorz(t,e,i,s,r,n,o,a){const h=this.model,l=h instanceof Is,c=l&&h.label.prop("fillToCategory"),_=h.label,d=this._reversed,p=this._labelContainer.textAlign()||"center",g=this._labelRowPts,f=t.get(0).rotation,m=f*w,y=+h.label.prop("rows")|0,b=f<-15&&f>=-90||f>15&&f<=90,x=t.count,v=l?h:null;let S,V,C;if(t.freeHiddens(),t.forEach((t,l)=>{const _=e[t.index];if(t.setVis(!!_)&&(t.setContrast(null).layout(p),S=t.getBBox(),V=v?v.getLabelX(n,_.pos):h.prev(_.pos),C=i?r?o+a+g[t.row]:-a-S.height-g[t.row]:r?o-a-S.height-g[t.row]:a+g[t.row],f<-15&&f>=-90?i?r?(C+=u(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=u(m)*S.height/2,t.setRotation(0,S.height/2,f)):r?(V-=S.width,C-=u(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=u(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):f>15&&f<=90?i?r?(V+=S.width,C-=u(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=u(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):r?(C+=u(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=u(m)*S.height/2,t.setRotation(0,S.height/2,f)):(V-=S.width/2,t.setRotation(S.width/2,0,r?-f:f)),t.trans(V,C),c&&v)){const e=v.getUnitLen(n,_.value),i=v.label.prop("align")||"center",h="left"===i?(e-S.width)/-2:"right"===i?(e-S.width)/2:0;t.transX(t.tx+h),t.resizeBackByWeight(v,s,r,n,o,a,0,e,h)}}),!c&&!b&&y<2&&x>1){let e=t.get(d?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=_.num("overflowGap");let r=!0;const n=e.rotatedWidth(),o=d?_.prop("lastOverflow"):_.prop("firstOverflow");let a,h=e.tx;h+n>=i.tx?"pull"===o?h=i?i.tx-n-s:0:r="hidden"!==o:(a=e.elementToSvg(0,0).x)<0&&("pull"===o?h=Math.min(i.tx-s,a+4):r="hidden"!==o),r?e.transX(h):e.setVis(!1)}(0,e,t.get(d?x-2:1)),e=t.get(d?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=_.num("overflowGap"),r=i.tx+i.rotatedWidth();let o=!0,a=e.tx;const h=e.rotatedWidth(),l=d?_.prop("firstOverflow"):_.prop("lastOverflow");let c,u;a<=r?"pull"===l?a=Math.max(r+s,n-h):o="hidden"!==l:(c=e.elementToSvg(e.getBBox().width,0).x)>(u=t.control.getBounds().width)&&("pull"===l?a=Math.max(r+s,a-(c-u+4)):o="hidden"!==l),o?e.transX(a):e.setVis(!1)}(this,e,t.get(d?1:x-2))}}$_layoutLabelsVert(t,e,i,s,r,n,o,a){var h,l;const c=this.model,_=c instanceof Is,d=_&&c.label.prop("fillToCategory"),u=r?i?"right":"left":s?"center":i?"left":"right",p=d?c.label.prop("verticalAlign"):"middle",g=d?c.label.prop("align"):u,f=this._titleView,m=f.visible?f.rotatedWidth()+(null!==(l=null===(h=f.model)||void 0===h?void 0:h.prop("gap"))&&void 0!==l?l:0):0,y=this._labelSize,b=c.tick._getGap();const x=this._reversed,w=_?c:null;let v=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;const S=t.get(0).rotation,V=S<-15&&S>=-90||S>15&&S<=90;t.forEach((t,h)=>{const l=e[t.index];if(t.setVis(!!l)){t.setContrast(null).layout(g);const e=t.getBBox(),h=V?t.rotatedHeight():e.height,_=V?t.rotatedWidth():e.width,u=function(t,e){if(i)if(r)switch(t){case"center":return(y-e)/2-y-b-a;case"left":return-y-b-a;default:return-e-b-a}else switch(t){case"right":return n+a+b+y-e;case"center":return!f.visible&&s?(n-e)/2:n+a+b+(y-e)/2;default:return n+a+b}else if(r)switch(t){case"center":return a+(n-m-e-a+b)/2;case"right":return n-e-m+b;default:return a}else switch(t){case"left":return m-b;case"center":return!f.visible&&s?(n-e)/2:m+(n-m-e-a-b)/2;default:return n-a-e}}(g,_)+(_-e.width)/2,C=(w?w.getLabelY(o,l.pos):o-c.prev(l.pos))-e.height/2;if(0===S||isNaN(S)||t.setRotation(e.width/2,e.height/2,S),t.trans(u,C),d&&w){const i=w.getUnitLen(o,l.value),h="top"===p?(i-e.height)/-2:"bottom"===p?(i-e.height)/2:0;t.shiftY(h),t.resizeBackByWeight(w,s,r,n,o,a,b,i,h,m)}else!x&&t.ty+h>v+1||x&&t.ty<v-1?t.setVis(!1):v=x?t.ty+h:t.ty}})}$_layoutUnitHorz(t,e,i,s,r,n){const o=this.model,a=o.prop("reversed"),h="start"!==o.unitLabel.prop("position"),l=t.getBBox(),c=e.first,_=e.last,d=o.unitLabel.num("gap");let u,p;a?h?(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)):(u=c.getBBox(),p=Math.max(c.tx+u.width+d,s-l.width)):h?(u=_.getBBox(),p=Math.max(_.tx+u.width+d,s-l.width)):(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)),t.resizeByMeasured().layout().trans(p,n)}$_layoutUnitVert(t,e,i,s,r,n){const o=this.model,a=o.prop("reversed"),h="start"!==o.unitLabel.prop("position"),l=t.getBBox(),c=e.first,_=e.last,d=o.unitLabel.num("gap");let u,p=i?n:s-l.width-n;a?h?(_.getBBox(),u=Math.max(_.ty+l.height+d,r)):u=Math.min(c.ty-l.height-d,0):h?u=Math.min(_.ty-l.height-d,0):(c.getBBox(),u=Math.max(c.ty+l.height+d,r)),t.resizeByMeasured().layout().trans(p,u)}}Jo.AXIS_CLASS="rct-axis",Jo.LINE_CLASS="rct-axis-line",Jo.TICK_CLASS="rct-axis-tick",Jo.HIERARCHY_ROW_GAP=2,Jo.MINOR_TICK_CLASS="rct-axis-minor-tick";class ta extends we{constructor(t,e,i){super(t,ta.STYLE),this.add(this._back=new gs(t,ta.BACK_STYLE)),this.add(this._textView=new Oe(t)),i&&this.dom.classList.add(i),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),i=(new $o).applyPadding(e),s=this._textView.getBBox();this._back.rect={x:0,y:0,width:s.width+i.left+i.right,height:s.height+i.top+i.bottom,rx:A(parseFloat(e.rx),0),ry:A(parseFloat(e.ry),0)},this._textView.trans(s.width/2+i.left,i.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}ta.STYLE="rct-button",ta.BACK_STYLE="rct-button-background";class ea extends we{constructor(t,e){super(t,e,"circle")}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class ia extends Pe{setArc(t,e,i,s,r,n){this.setPath(ps.arc(t,e,i,i,s,close?s+r:s-r,n))}}class sa extends ia{setPolyline(t){this.setPath(ps.polygon(...t))}}const ra={};class na extends zo{static register(...t){t.forEach(t=>{ra[t[0].type]=t[1]})}constructor(t,e){super(t,na.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new we(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,i){this.measure(this.doc,this.model,e,i,0),this._layoutView(this.chart().isInverted(),t,0,0,e,i)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,i,s,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),i,s,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this.model.prop("align")){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this.model.prop("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,i){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,i)}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.prop("backgroundStyle"))}_doLayout(t){const e=this.model.prop("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)}}na.CLASS_NAME="rct-annotation";const oa={};class aa extends Go{static register(...t){t.forEach(t=>{oa[t[0].type]=t[1]})}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new gs(t,aa.PANE_CLASS)),this.add(this._contentContainer=new Se(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return aa.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const i=this.model;let s=i.getLeft(t),r=i.getTop(e);return isNaN(s)&&(s=i.getRight(t)-this.width,isNaN(s)&&(s=(t-this.width)/2)),isNaN(r)&&(r=i.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:s,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){return e.getSize(i,s)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const i=l(se.getPadding(this.dom));t-=i.left+i.right,e-=i.top+i.bottom,this._renderGauge(t,e),this._contentContainer.trans(i.left,i.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof ca)return t;t=t.parent}}}aa.GAUGE_CLASS="rct-gauge",aa.PANE_CLASS="rct-gauge-pane";class ha extends pe{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class la extends Wo{}class ca extends aa{_defaultCalss(){return ca.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,i){super._setChartOptions(t,e,i),this._gaugeViews.forEach(s=>s._setChartOptions(t,e,i))}_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,i){i.forEach((i,s)=>{i.prepareGauge(t,e.getVisible(s))})}}ca.GAUGE_GROUP_CLASS="rct-gauge-group";const _a=function(t){const e=t.x+t.width/2,i=t.y+t.height/2,s=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(s)-r*Math.sin(s)),i+(t*Math.sin(s)+r*Math.cos(s))])},da=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i],r=t[(i+1)%t.length],n=[r[0]-s[0],r[1]-s[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},ua=function(t,e){const i=t.map(([t,i])=>t*e[0]+i*e[1]);return[Math.min(...i),Math.max(...i)]},pa=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ga=function(t,e){const i=_a(t),s=_a(e),r=da(i),n=da(s);for(const t of[...r,...n]){const e=ua(i,t),r=ua(s,t);if(!pa(e,r))return!1}return!0},fa=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 ma{static reveal(t,e){new xa(t,e)}static grow(t,e){new va(t,e)}static spread(t,e){new Sa(t,e)}static fadeIn(t){new ya(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);st.isAnimation(i)&&(i.addEventListener("finish",()=>{t._animationFinished(i)}),t._animationStarted(i))}}class ya extends ma{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:pe.DURATION,fill:"none"})}}class ba extends ma{static clipRect(t,e){const i=e.view||t;let s;if(t.model.needClip(!1))s=i.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)s=i.clipRect(0,0,t.width,t.height);else{const e=t.control;s=t.model.chart.isInverted()?i.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):i.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return s}constructor(t,e){super(t,e)}_createAnimation(t,e){const i=ba.clipRect(t,e);let s;switch(e&&e.from){case"top":s=this.$_top(i,e);break;case"bottom":s=this.$_bottom(i,e);break;case"right":s=this.$_right(i,e);break;default:s=this.$_left(i,e)}return null==s||s.addEventListener("finish",()=>{i.dom.remove()}),s}$_aniOptions(t){return{duration:pe.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 xa extends pe{constructor(t,e){super(),this._series=t,this._cr=ba.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 we}_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 wa extends pe{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof we}_stop(t){super._stop(t),this._series=null}}class va extends wa{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Sa extends wa{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Va extends Wo{constructor(t){super(t,"rct-series-trendline-label")}}class Ca extends Se{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new Pe(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new Pe(t,"rct-series-trendline-variable")),this.add(this._line=new Pe(t)),this.add(this._label=new Va(t))}layout(t,e,i,s,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.prop("reversed"),a=e.owner._yAxisObj.prop("reversed"),h=this.$_getPoints(e,i);if(h.length<2)return this._line.setVis(!1),this._fixedArea.setVis(!1),this._variableArea.setVis(!1),this._label.setVis(!1),void(this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)));this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(i,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new Pe(t,"rct-series-trendline-marker")),this.add(this._endMarker=new Pe(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,i,h,s,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,i,h,s,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,e.label.getIconUrl(),e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(i,e,n,o,a,h,s,r))}$_getPoints(t,e){const i=t.owner,s=i.chart.isInverted(),r=i._xAxisObj,n=i._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map(t=>{const i=e.start+r.getPos(a,t.x),s=es(e,n,t.y);return{x:e.cx+s*d(i),y:e.cy+s*u(i),a:i}}):t._points.map(t=>{let e,i;return s?(i=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),i=o-n.getPos(o,t.y)),{x:e,y:i}}),h}$_getLine(t,e){const i=new ye;return i.move(e[0].x,e[0].y),i.lines(...e),i.end()}$_getVariable(t,e,i,s,r,n,o){const a=new ye,h=r[0],l=r[r.length-1];if(s);else if(t)if(i){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(i){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,i,s,r,n,o){const a=new ye,h=r[0],l=r[r.length-1];return s||(t?i?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):i?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 i=t.marker.getRadius();if(this._startMarker.setVis(i>0)&&this._endMarker.setVis(i>0)){const s=ps.getDrawer(t.marker.prop("shape"));this._startMarker.setPath(s(i)),this._endMarker.setPath(s(i)),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,i,s,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,c=this._label,_=h.getText();if(!_)return void c.setVis(!1);h.prepareRich(_),h.buildSvg(c._text,c._outline,NaN,NaN,h,e.getLabelDomain());const d=h.prop("position"),u=t?function(t){const e=Math.floor((n.length-1)*t),i=(n.length-1)*t-e;let s;if(e>=n.length-1)s=n[n.length-1].a;else{const t=n[e],r=n[e+1];s=t.a+(r.a-t.a)*i}return s}(d):0,p=t?h.getAlignPolar(u):h.getAlign(i,s,r,d),g=t?h.getVerticalAlignPolar(u):h.getVerticalAlign(i,s,r),f=h.getOffsetX(p)+("middle"===g?l:0),m=h.getOffsetY(g)+("center"===p?l:0);c.setContrast(null).layout(p);const y=Math.floor((n.length-1)*d),b=(n.length-1)*d-y;let x,w;if(y>=n.length-1)x=n[n.length-1].x,w=n[n.length-1].y;else{const t=n[y],e=n[y+1];x=t.x+(e.x-t.x)*b,w=t.y+(e.y-t.y)*b}const v=c.getBBox();switch(p){case"left":x-=v.width+f;break;case"center":x-=v.width/2+f;break;case"right":x+=f}switch(g){case"top":w-=v.height+m;break;case"middle":w-=v.height/2+m;break;case"bottom":w+=m}t||(x<0&&(x=0),w<0&&(w=0),x+v.width>o&&(x=o-v.width),w+v.height>a&&(w=a-v.height)),c.trans(x,w)}}class Aa extends pe{constructor(t,e,i,s){super(),this.duration=i?200:100,this._sv=t,this._focused=i,this._marker=e,i||(this._marker.setBoolData(Ra.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(s)}_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(Ra.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Pa extends Wo{constructor(t){super(t,"rct-point-label")}}class ka extends Se{constructor(t){super(t,"rct-point-labels"),this._labels=[new Ro(this,Pa),new Ro(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=f(e,t.getBBox().width)),e}prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.prop("text"));e.point=s,e.setModel(t,n,n.getIconUrl(s.icon),r.getPointLabelStyle(s)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):e.setText(n.getText(n.getValue(s,i)))}prepare(t,e){const i=e.model,s=i.pointLabel;if(i.isLabelsVisible()){this.setVis(!0);const r=i.pointLabelCount(),n=this._labels,o=i._getLabeledPoints(),a=this._maps,h=s._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,i,s),a[h][r.pid]=l)}}),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const i=t[e].inflateBBox(-1,-1),s=t[e-1].inflateBBox(-1,-1);if(fa(i,s))return t}}dedupe(t,e,i){let s=0,r=t[s];if(i===Ss)for(let i=1;i<t.length;i++){const n=t[i],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(ga(h,l)?(r.point.yValue<t[i].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1),r=n,s=i):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1)),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ga(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,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(s,1)))}}else for(let i=1;i<t.length;i++){const n=t[i],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(ga(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ga(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1))}}}arrangeVertical(t,e,i,s,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 c=Number.MAX_SAFE_INTEGER,_=0;for(let t=0;t<a;t++){const i=e[t].inflateBBox(0,-1),s=Math.abs(l-(i.y+i.height/2));s<c&&(c=s,_=t)}const d=(t,i)=>{0!==i&&e[t].shiftY(i)},u=(t,i)=>{const s=e[t].inflateBBox(0,-1),r=e[i].inflateBBox(0,-1);return s.y+s.height-r.y};for(let t=0;t<_;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>=_&&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,i)=>{for(let s=t;s<i;s++){const t=e[s].tbottom-e[s+1].ty;t>0&&d(s+1,t)}},i=(t,i)=>{for(let s=t;s>i;s--){const t=e[s].ty-e[s-1].tbottom;t<0&&d(s-1,t)}},s=e[0],r=e[a-1],n=e[_];let o=s.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const i=e[t+1].ty-e[t].tbottom;t<_?o+=i:h+=i}if(s.ty<0)if(o>=0){s.transY(0),t(0,_-1),n.ty<e[_-1].tbottom&&i(_,0),o=0;for(let t=0;t<_;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)s.transY(0),t(0,a-1),o=0;else{for(let t=_;t>0;t--){const i=e[t].ty-e[t-1].tbottom;d(t-1,i)}o=s.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),i(a-1,_+1),n.tbottom<e[_+1].ty&&t(_,a-1),h=0;for(let t=_;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),i(a-1,0),h=0;else{if(o>=0){s.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=_;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(s.ty<0&&h>0){const t=Math.min(s.ty+h,0);s.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===Vs&&e.forEach((t,e)=>{const s=t.ty+t.getBBox().height;(t.ty<0||s>p)&&(i.get(t.point).setVis(!1),t.setVis(!1))}),1}}class La extends Io{constructor(t){super(t),this.add(this._line=new Pe(t))}setLine(t){this._line.setPath(t)}}class Ta extends Io{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Ro(this,La)}prepare(t){const e=this._lines,i=t._visPoints,s=t.pointLabel,r=this._map={};s.visible?e.prepare(i.length).forEach((t,e)=>{const s=i[e];t.visible=s.visible,r[s.pid]=t}):e.prepare(0)}get(t){return this._map[t.pid]}}class Na 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 Ma extends Wo{constructor(t){super(t,"rct-stack-label")}}class Ea extends Se{constructor(t){super(t,"rct-stack-labels"),this._labels=new Ro(this,Ma),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 Ba={},Oa="rct-point-hover",Da="rct-point-unhover";class Ra extends Go{static register(...t){t.forEach(t=>{Ba[t[0].type]=t[1]})}static isPointDom(t){for(;se.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 Na(t,"rct-series-points")),this._labelContainer=new ka(t),this._stackLabelContainer=new Ea(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,i,s){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.general.prop("paletteMode")===xt,this.setData("index",e._seriesIndex%ir),this.setData("pointcolors",this._colorByPoint?this._getPointColors():ut),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.prop("reversed"),this._prepareSeries(t,e,i,s)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.prop("hoverStyle"))}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach(t=>{t!==e&&t.removeClass(Oa).addClass(Da)})):this._getPointPool().forEach(t=>{t.containsClass(Da)&&t.removeClass(Da).addClass(Oa)})}_clearHoverClasses(t){t instanceof we&&t.removeClass(Oa).removeClass(Da)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.prop("hoverEffect"),i=this._hoverAnis,s=this._hoverPts,r=[],n=[];!1!==this.model.prop("interactive")&&e&&(s.forEach(e=>{if(e instanceof we&&(!t||t.indexOf(e)<0)){const t=i.find(t=>t._marker===e);t&&t.cancel(),e.setBoolData(Ra.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Ua&&r.push(new Aa(this,e,!1,()=>{e.endHover(this,!1)}))}}),t&&t.forEach(t=>{if(t&&!t.point.isNull){const e=i.find(e=>e._marker===t);e&&e.cancel(),t instanceof we&&(t.setBoolData(Ra.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Ua?r.push(new Aa(this,t,!0,()=>{t.endHover(this,!0)})):this instanceof Ka&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}})),i&&i.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,i,s){if(!this.model.pointLabel.prop("autoRotation"))return;const{width:r,height:n}=t.getBBox(),o=e/i*((null!=s?s:i?i*v:360)||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&ue(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,i,s,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof nr&&e.trendline.visible?(this._trendView||this.add(this._trendView=new Ca(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:i,height:s}}_doLayout(){const t=this.width,e=this.height,i=this.model,s=i.pointLabel,r=this._trendView;this._labelOverlap={model:s,inverted:this._inverted,width:t,height:e,fit:s._overflowFit,outline:s.prop("overlapOutline"),contrast:s.prop("overlapContrast")},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||i._needAnimate),i._needAnimate=!1,r&&r.setVis(r.visible&&(!i.trendline.prop("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 i=e.stackLabel;if(!i||!i.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const s=e._stackTotals,r=e._stackPoints;s&&0!==s.size&&r&&0!==r.size?this._doLayoutStackLabel(i,s,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,i){var s;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),c=t.getOffset(),_=t.prop("align"),p=this._labelContainer,g=p&&p.visible,f=o._body.getPolar(h),y=this._inverted,b=this.width,x=this.height,v=a.prop("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 C=0;const P=f?h.getTotalAngle():0,k=y?b:x,L=y?x:b,T=y?0:x;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[x,S]of e){const e=V.get(C++),N=t.getCallbackArgs(o,b.x,b.positiveTotal,b.negativeTotal);if(e.setVis(t.isStackLabelVisible(N))){const o=t.getStackLabelText(N,x),b=t.getStackLabelStyle(N);e.xValue=n,e.setModel(r,t,null,b),e.setText(o),e.layout(_);const V=y?0:t.getRotation(),{width:C,height:M}=e.getBBox(),E=V*w,B=0!==V?M*m(d(E))+C*m(u(E)):M,O=0!==V?C*m(d(E))+M*m(u(E)):C;let D,R;const $=i.get(n),I=$&&null!==(s=$.find(t=>t.yGroup===x))&&void 0!==s?s:null;if(f){const t=A(null==I?void 0:I.xPos,f.cx+f.rd*d(f.start+h.getPos(P,n))),i=A(null==I?void 0:I.yPos,f.cy+f.rd*u(f.start+h.getPos(P,n))),s=Math.atan2(i-f.cy,t-f.cx),r=es(f,a,x)+(S!==v?-1:1)*(M/2+l);let o=0;"left"===_?o=-(C/2+c):"right"===_&&(o=C/2+c),D=f.cx+r*d(s)+-u(s)*o,R=f.cy+r*u(s)+d(s)*o,e.trans(D-C/2,R-M/2),0!==V&&e.setRotation(C/2,M/2,V)}else{const i=a.getPos(k,x),s=g&&I?p.get(I,0):null,r=s&&s.visible?s.getBBoxEx():null,o=$?$[$.length-1]:null,d=o?this.getPointView(o):null,u=(null==d?void 0:d.wPoint)||0;if(y){const s=S!==v?-1:1;if(D=T+i+s*(l+O/2)-C/2,r)if(s>0){const t=D+C/2-O/2,e=r.x+r.width-t;e>0&&(D+=e)}else{const t=D+C/2+O/2-r.x;t>0&&(D-=t)}const o=A(null==I?void 0:I.yPos,L-h.getPos(L,n)),a=v?"left"===_?"right":"right"===_?"left":_:_;R="left"===a?o-u/2-B/2-M/2-c:"right"===a?o+u/2+B/2-M/2+c:o-M/2+c,R+=M*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,D,C,k);if(null===d){e.setVis(!1);continue}D=d}else{const s=S!==v?1:-1;if(R=T-i+s*(l+B/2)-M/2,r)if(s<0){const t=R+M/2+B/2-r.y;t>0&&(R-=t)}else{const t=R+M/2-B/2,e=r.y+r.height-t;e>0&&(R+=e)}const o=A(null==I?void 0:I.xPos,h.getPos(L,n));D="left"===_?o-u/2-O/2-C/2-c:"right"===_?o+u/2+O/2-C/2+c:o-C/2+c;const a=this._applyOverflowFit(t._overflowFit,R,M,k);if(null===a){e.setVis(!1);continue}R=a}e.trans(D,R),0!==V&&e.setRotation(C/2,M/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const i=this._randomPalette?Math.floor(st.randomLike(e.index)*ir):e.index%ir;t.setData("index",this._model._paletteColors[i].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return A(this._growRate,1)}_getPosRate(){return A(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,i,s){const r=this.model;r instanceof nr&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),i,s)}_layoutLabel(t,e,i,s){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=i&&o>=0&&o<=s))return;h.layout(e.textAlign);const c=e.below=e.reversed?a<=0:a<0,_=h.getBBox();let d=!0;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const i=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===i?o-=e.wPoint/2+_.height-_.height*t._vertAdjust+p:"right"===i?o+=e.wPoint/2+_.height*t._vertAdjust+p:o-=_.height/2-_.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+_.width+p:"right"===u?n+=e.wPoint/2+p:n-=_.width/2;const g=n,f=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+_.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-_.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,c?n+=l:n-=_.width+l):(n-=e.base,o+=e.side,c?o-=_.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=c?a+_.width+l:a-l):(n-=e.base,o+=e.side,o+=c?a+l:a-_.height-l);break;case"far":r?n=c?l:i-_.width-l:c?(n-=e.base,o=s-_.height-l):o=l,d=!1;break;default:r?c?n-=_.width+l:n+=l:c?(n-=e.base,o+=e.side,o+=l):o-=_.height+l,d=!1}this._checkLabelOverlap(h,_,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,_,n,o)}_applyOverflowFit(t,e,i,s){if(isFinite(t)||t===1/0){if(e+i>=s)return t===1/0?null:s+t-i;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,i,s,r,n,o,a,h,l){const c=this._labelOverlap;let _=!1;if(!h){const s=c.fit;if(isFinite(s)||s===1/0){const h=c.inverted?o:a,l=c.inverted?e.width:e.height,d=c.inverted?c.width:c.height,u=c.inverted?r:n,p=h+l>=d,g=this._applyOverflowFit(s,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(_=p?g<i+u:g+l>i-u,c.inverted?o=g:a=g),_&&c.outline&&t.setOutline(c.model)}}return t.setContrast((h||_&&c.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,i,s,r,n){if(n){const i=t;t=e,e=i}const o="x"===i,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.prop("reversed"),l=a.getPos(o?t:e,f(a.axisMin(),s.fromValue)),c=a.getPos(o?t:e,g(a.axisMax(),s.toValue));n?o?h?r.setBounds(c,-e,m(c-l),e):r.setBounds(l,-e,m(c-l),e):r.setBounds(0,-f(l,c),t,m(c-l)):o?h?r.setBounds(c,0,m(c-l),e):r.setBounds(l,0,m(c-l),e):r.setBounds(0,e-f(l,c),t,m(c-l))}_setFill(t,e){i(e)&&e[St]?t.internalSetStyle(St,e[St]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,i,s){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,i,s),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=e.height,h=A(e.fit,0),l=this.model._yAxisObj.prop("reversed"),c=this.model.chart.isInverted(),_=n.prop("position");let d=this._getRotatedLabelDisplacement(o,i);if(!c&&_!==bs)if(l?_!==ys&&_!==ms||(d*=-1):_===ms&&(d*=-1),r-=d,l){const t=r+(-2*d+i.height)/2+i.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+i.height)/2<0&&(r=d-h)}t.trans(s,r)}_getRotatedLabelDisplacement(t,e){const i=t*Math.PI/180,s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),n=e.width,o=e.height;return n/2*s+o/2*r-o/2}}Ra.POINT_CLASS="rct-point",Ra.DATA_FOCUS="focus",Ra.DATA_UNFOCUS="unfocus",Ra.DATA_UNHOVER="unhover",Ra.LEGEND_MARKER="rct-legend-item-marker";class $a extends Pe{constructor(t){super(t,Ra.POINT_CLASS)}savePrevs(){}}class Ia extends $a{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class Fa extends we{constructor(t){super(t,Ra.POINT_CLASS)}savePrevs(){}}class za extends Fa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Ha=class extends Ia{layout(t,e,i,s,r,n,o){this.x=t,this.y=e,this.setPath(ps.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,i,s))}shrink(t,e,i,s){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,i,s,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,i,s,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class Ga extends za{constructor(t){super(t),this.add(this._topView=new Pe(t)),this.add(this._frontView=new Pe(t)),this.add(this._sideView=new Pe(t))}layout(t,e,i,s,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const c=h<0?e:e-h;if(it&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(ps.rectangle(t-r,e+n,a,-h)),this._topView.setPath(ps.polygon(t,c,t+a,c,t+a-r,c+n,t-r,c+n)),this._topView.setStyle("fill",ie.interpolate(o?ie.BLACK:ie.WHITE,l,.2)),this._sideView.setPath(ps.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",ie.interpolate(o?ie.WHITE:ie.BLACK,l,.2))}}class ja extends Io{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Wa extends Ra{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,i,s){this._preparePoints(t,e,this._visPoints,!!s)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&ma.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach(t=>t.savePrevs())}getPointsAt(t,e){return[]}}class Ya extends Wa{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Ta(t))}depthEnabled(){return!0}_prepareSeries(t,e,i,s){s?(this._depthAngle=s.prop("angle")*w,this._base=d(this._depthAngle)*e.depth,this._side=u(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,i,s),this._pointOff=e.prop("pointOffset")||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var i;const s=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=s.pointLabel,h=this._labelViews(),c=this._labelLineContainer,_=s._xAxisObj,p=s._yAxisObj,g=this._yReversed,m=this._depthExt,y=s._group?s._groupDistance:s.distance,b=m?y*(r?u(this._depthAngle):d(this._depthAngle)):0,x=m?y*(r?d(this._depthAngle):u(this._depthAngle)):0,w=2*_.unitPad(),v=A(s.prop("minPointWidth"),0),S=this._yLen=r?t:e,V=r?e:t,C=t=>p.getPos(S,t),P=t=>_.getPos(V,t),k=r?0:e,L=p.valueMin(),T=C(L),N=this._baseVal=s.getBaseValue(p),M=!isNaN(N),E=this._yBase=A(C(f(L,A(N,T))),T),B=this._pointOff,O=h&&l(this._labelInfo,{inverted:r,reversed:g,labelPos:s.getLabelPos(a),labelOff:s.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:x,side:this._side,base:this._base});h&&c.setVis(s.pointLabel.line.visible)&&(c.internalClearStyleAndClass(),c.internalSetStyleOrClass(s.pointLabel.line._style),c.prepare(s),O.pb=new ye),this._prepareLayoutPoints(t,e),null===(i=this._getPointPool().getOrphans())||void 0===i||i.forEach(t=>{this._shrinkPoint(t)}),this._getPointPool().forEach((i,l)=>{const c=i.point;if(i.setVis(!c.isNull)){const d=_.getUnitLen(V,c.xValue)*(1-w);let u=s.getPointWidth(d,v),p=C(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=N>c.yGroup,e=c.yGroup<0,i=c.yValue<0,s=t&&e&&!i||t&&!e&&!i||!t&&e&&i||!t&&!e&&i,r=c.yGroup-c.yValue*(s?-1:1);g=C(r)}const f=(p-g)*n;let m=P(c.xValue)-d/2,y=k-p;isNaN(o+i.wSave)||(u=i.wSave+(u-i.wSave)*o),m+=s.getPointPos(d)+u/2,isNaN(o+i.xSave)||(m=i.xSave+(m-i.xSave)*o),c.xPos=m+=u*B,c.yPos=y,this._layoutPoint(i,l,m-b,k-E*(1-n)-g*n+x,u,f),r&&(y=V-P(c.xValue)+d/2,m=k,c.yPos=y-=s.getPointPos(d)+u/2+u*B,c.xPos=m+=M?C(c.yGroup)*n:C(c.yGroup*n)),O&&(O.labelView=h.get(c,0))&&(O.pointView=i,O.x=m,O.y=y,O.wPoint=u,O.hPoint=f,this._layoutLabel(a,O,t,e))}})}_layoutLabel(t,e,i,s){if(super._layoutLabel(t,e,i,s),e.pb){const t=this._labelLineContainer.get(e.pointView.point),i=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?i.tx+i.getBBox().width:i.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?i.ty:i.ty+i.getBBox().height),t.setLine(e.pb.end())}}}class Xa extends Wa{_getHighValue(t){return t.yValue}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._pointOff=+e.prop("pointOffset")||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const i=this.model,s=i.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=i.pointLabel,a=this._labelViews(),h=i._xAxisObj,c=i._yAxisObj,_=2*h.unitPad(),d=A(i.prop("minPointWidth"),0),u=s?t:e,p=s?e:t,g=s?0:e,f=this._pointOff,m=a&&l(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(o),labelOff:i.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach((l,y)=>{const b=l.point;if(l.setVis(!b.isNull)){const x=h.getUnitLen(p,b.xValue)*(1-_);let w=i.getPointWidth(x,d);const v=(c.getPos(u,this._getHighValue(b))-c.getPos(u,this._getLowValue(b)))*r;let S=h.getPos(p,b.xValue)-x/2,V=g-c.getPos(u,this._getHighValue(b))*r;isNaN(n+l.wSave)||(w=l.wSave+(w-l.wSave)*n),S+=i.getPointPos(x)+w/2,isNaN(n+l.xSave)||(S=l.xSave+(S-l.xSave)*n),b.xPos=S+=w*f,b.yPos=V,this._layoutPoint(l,y,S,V,w,v),s&&(V=p-h.getPos(p,b.xValue)+x/2,S=g,b.yPos=V-=i.getPointPos(x)+w/2+w*f,b.xPos=S+=c.getPos(u,this._getHighValue(b))*r),a&&(m.pointView=l,m.hPoint=v,m.x=S,m.y=V,(m.labelView=a.get(b,0))&&(m.hPoint=v,this._layoutLabel(o,m,t,e)),(m.labelView=a.get(b,1))&&(s?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}})}}class Ua extends $a{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-i)**2)-t}}class Za extends Ra{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.prop("position");let l=this._getRotatedLabelDisplacement(o,i);if(!a&&h!==bs){(r-=l)-(2*l+i.height)/2<0&&(r=l),t.trans(s,r)}}_layoutLabelView(t,e,i,s,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*s*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-s-o.height-i),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class qa extends pe{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 Ka extends Ra{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 i;this._zombie&&(this._zombie=null,null===(i=this._zombieAni)||void 0===i||i.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new qa(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,i){return gs.create(t,"rct-legend-item-marker",0,0,i,i,i/2)}_preparePoint(t,e,i,s){this._clearHoverClasses(s),i.legendMarker()||i.setLegendMarker(this._createPointLegendMarker(t,i,this.chart()._legend.getMarkerSize())),this._setPointStyle(s,e,i);const r=getComputedStyle(s.dom);i._calcedColor=r.fill,i._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Qa extends na{constructor(t){super(t,Qa.CLASS_NAME),this.addToTransform(this._imageView=new jo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,i,s,r){const n=this._size=e.getSize(i,s);this._deflatePaddings(n),this.$_setImage(this.model.getImageUrl());const o=this._imageView.getBBox();return this._inflaePaddings(o),Y(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)}}Qa.CLASS_NAME="rct-image-annotation";class Ja extends na{constructor(t){super(t,Ja.CLASS_NAME),this.addToTransform(this._shapeView=new Pe(t))}_doMeasure(t,e,i,s,r){const n=e.getSize(i,s),o=e.chart.getAxisOf(e,!0),a=e.chart.getAxisOf(e,!1),h=null==o?void 0:o.getPos(i,e.prop("x1")),l=null==o?void 0:o.getPos(i,e.prop("x2")),c=null==a?void 0:a.getPos(s,e.prop("y1")),_=null==a?void 0:a.getPos(s,e.prop("y2")),d=e.getShape();if(this.$_resetHeadView(),e.hasCustomPath())this._shapeView.setPath(e.prop("path"));else{let i=0,r=0;switch(d){case Mr:!Number.isNaN(l)&&Number.isNaN(h)&&(i=l),Number.isNaN(_)||(r=Number.isNaN(c)?s-_:n.height/2),this._shapeView.setPath(ps.line(i,r,i+n.width,r));break;case Nr:Number.isNaN(l)||(i=Number.isNaN(h)?l:n.width/2),!Number.isNaN(_)&&Number.isNaN(c)&&(r=s-_),this._shapeView.setPath(ps.line(i,r,i,r+n.height));break;case Er:{const t=this.$_lineEndpoints(h,l,c,_,s,n);this._shapeView.setPath(ps.line(t.xStart,t.yStart,t.xEnd,t.yEnd));break}case Br:{const i=this.$_lineEndpoints(h,l,c,_,s,n),r=ps.arrowParts(i.xStart,i.yStart,i.xEnd,i.yEnd,e.getHeadSize()),o=this.$_headView(t);this._shapeView.setPath(r.body),o.setPath(r.head),o.setVis(r.head.length>0);break}default:ps.setShape(this._shapeView,e.getShape(),n.width/2,n.height/2)}}return this._deflatePaddings(n),n}_doLayout(t){var e;this._shapeView.trans(this._paddings.left,this._paddings.top),null===(e=this._headView)||void 0===e||e.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_headView(t){return this._headView||this.addToTransform(this._headView=new Pe(t)),this._headView}$_resetHeadView(){this._headView&&(this._headView.setVis(!1),this._headView.setPath([]))}$_lineEndpoints(t,e,i,s,r,n){let o=0,a=0;return Number.isNaN(e)||(o=Number.isNaN(t)?e:t>e?n.width:0),Number.isNaN(s)||(a=Number.isNaN(i)?r-s:i<s?n.height:0),{xStart:o,yStart:a,xEnd:t>e?o-n.width:o+n.width,yEnd:i<s?a-n.height:a+n.height}}}Ja.CLASS_NAME="rct-shape-annotation";class th extends na{constructor(e){super(e,th.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new Oe(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new je}_doMeasure(t,e,i,s,r){const n=e.getSize(i,s);this._hasExplicitWidth=!isNaN(n.width);const o=this._textView,a=e.prop("writingMode");a&&this._textView.setStyle("writingMode",a),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(n),this._richText._isVertical="vertical"===a,this._richText.setFormat(e.prop("text")),!isNaN(e.num("lineHeight"))&&this._richText&&(this._richText.lineHeight=e.num("lineHeight")),this._richText.build(o,i,s,null,e._domain);const h=Y(this._textView.getBBox());return{width:A(n.width,h.width),height:A(n.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);const e=this._paddings,i=this.width-e.left-e.right,s=this.height-e.top-e.bottom,r=this._textView.getBBox();this._hasExplicitWidth&&r.width>i+.5?(this.isClip(this._textClip)||(this._textClip=this.control.clipBounds(),this._textView.setClip(this._textClip)),this._textClip.setBounds(e.left,e.top,i,s)):this._textView.setClip(null),super._doLayout(t)}remove(){var t;return this._textClip&&(null===(t=this.control)||void 0===t||t.removeDef(this._textClip.dom)),super.remove()}}th.CLASS_NAME="rct-text-annotation";class eh extends Ro{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 i=e.get(t);i||(i=this.find(e=>e.point===t),i&&this.addOrphan(t,i))})}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class ih extends Ua{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;ps.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,i){const s=this.point,r=(+t.model.marker.prop("hoverScale")||1.8)-1;let n=this._radius;e?isNaN(i)||(n=this._radius=this._saveRadius*(1+i*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(i)?r:r*i)),ps.setShape(this,t.model.getShape(s),n,n),this.index>0?this.trans(s.px2-n,s.py2-n):this.trans(s.xPos-n,s.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,i){const s=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((s-e)**2+(r-i)**2)-t}distance2(t,e,i,s){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:s?Math.abs(n-i):Math.abs(r-e)}}class sh extends Na{}class rh extends Ra{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new sh(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Pe(t,"rct-line-series-line")),this._markers=new eh(this._pointContainer,ih),this.add(this._tester=new Pe(t)),this._tester.setFill("#ff000010"),this._arrowViews=new Ro(this._pointContainer,Pe,"rct-line-series-arrow rct-series-point")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),i=t._marker;if(i._line.setStyle("strokeWidth",e.strokeWidth),i._shape){const t=getComputedStyle(this.dom);i._marker.setStyles({fill:t.fill,stroke:t.stroke}),i._marker.internalSetStyles(this.model.marker._style),i._line.setStyle("strokeDasharray","")}else i._line.setStyle("strokeDasharray",e.strokeDasharray)}_computeNeedBelow(t){return this._based&&!!t.prop("belowStyle")}_prepareSeries(t,e,i){e instanceof yn&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._computeNeedBelow(e),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&&ma.grow(this):t&&ma.reveal(this,{from:function(t){const e=t.model._xAxisObj.prop("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),this.$_layoutArrows()}getPointsAt(t,e){return[]}getNearest(t,e){const i=this.model.marker.prop("radius"),s=this._markers._internalItems();if(s&&s.length>0){const 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)}}}getNearest2(t,e,i){const s=this.model.marker.prop("radius"),r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce((r,n)=>r.distance2(s,t,e,i)<n.distance2(s,t,e,i)?r:n);return{pv:n,dist:n.distance2(s,t,e,i)}}}getHintDistance(){return this.model.marker.prop("hintDistance")}canHover(t,e,i){return t<=this.model.marker.prop("radius")+i}_markersPerPoint(){return 1}_prepareBelow(t){var e,i;const s=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new Pe(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=s.clipPath(),this._innerClip=s.clipPath(),this._outerLineClip=s.clipPath(),this._innerLineClip=s.clipPath()):this.isClip(this._upperClip)||(this._upperClip=s.clipBounds(),this._lowerClip=s.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===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const i=this._rangeClips;let s=this._rangeLines;if(e){for(s||(s=this._rangeLines=new Ro(this._lineContainer,Pe)),s.prepare(e.length);i.length<e.length;){const t=new Ae(this.doc);this.control.addClip(t),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach(t=>t.remove()),i.length=0)}$_resetClips(t,e,i,s){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:e,rd:s,rdInner:r,min:o,max:a,cyclic:h}=this._polar;if(null==o||null==a)return;const l=ft(f(0,g((b-m(o-a))/2,.2))),c=n?1:this._getGrowRate(),_=s-r,d=r+(f(i,r)-r)*c,u=r+_*c,p=u>0?d/u:0;this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(ps.donut(t,e,u,d)),this._outerLineClip.setPath(this._outerClip.getPath())):r>0?(this._outerClip.setPath(ps.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(ps.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(ps.circle(t,e,d)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(ps.sector(t,e,u,u,p,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():ps.sector(t,e,u,u,p,o-l,a+l,!0))):r>0?(this._outerClip.setPath(ps.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(ps.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(ps.sector(t,e,d,d,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():ps.sector(t,e,d,d,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(s?r?o.setBounds(0,-i,e,t):o.setBounds(0,-t,e,t-i):r?o.setBounds(0,0+i,t,e-i):o.setBounds(0,0,t,i)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-i):o.setBounds(0,-i,e,i):r?o.setBounds(0,0,t,i):o.setBounds(0,0+i,t,e-i))}$_prepareMarkers(t,e){var i;const s=t instanceof yn&&this._needBelow,r=s?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(i=this._markers)||void 0===i||i.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const i=this._markersPerPoint(),o=s&&t.prop("belowStyle"),a=e.length;this._markers.prepare(a*i,(i,h)=>{const l=e[h%a];l.isNull||(i.point=l,n[1]=s&&l.yValue<r?o:null,this._setPointStyle(i,t,l,n)),i.point=l,i.index=h<a?0:1})}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,i=t.point;t._shape=e.getShape(i),t._radius=e.getRadius(i)}_layoutMarker(t,e,i,s){const r=t._radius;e&&t.internalSetStyleOrClass(e),ps.setShape(t,t._shape,r,r),t.setPos(i,s),t.trans(i-=r,s-=r)}_layoutMarkers(t,e,i){const s=this.model,r=s.marker,n=r._style,o=this._inverted,a=s.needClip(!1),h=this._getGrowRate(),l=r.visible,c=r.prop("firstVisible"),_=r.prop("lastVisible"),p=r.prop("maxVisible"),m=r.prop("minVisible"),y=s.pointLabel,b=y.prop("align"),x=y.getAlignOffset(),w=y.getOffset(),v=y.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),C=s._xAxisObj,A=s._yAxisObj,P=this._polar=s.chart._body.getPolar(C),k=!!P,{cx:L,cy:T,rd:N,rdInner:M,start:E,total:B}=P||{},O=o?e:i,D=P?B:o?i:e,R=o?0:i,$=t.length,I=this._yReversed,F=A instanceof Wr?s.getBaseValue(A):NaN,z=F>A.axisMin(),H=k?z?es(P,A,F):M:z?A.getPos(O,F):0;this._pointContainer.visible&&this._shrinkPoints(s),t.forEach((t,y)=>{let G,j,W,Y;P?(W=E+C.getPos(D,t.xValue),P.min=null==P.min?W:g(P.min,W),P.max=null==P.max?W:f(P.max,W),Y=I?isNaN(t.yGroup)?z?H:N:z?H+(es(P,A,t.yGroup)-H)*h:is(P,A,t.yGroup,h):isNaN(t.yGroup)?z?H:M:z?H+(es(P,A,t.yGroup)-H)*h:is(P,A,t.yGroup,h),G=t.px=L+Y*d(W),j=t.py=T+Y*u(W),t.angle=W):(G=t.px=C.getPos(D,t.xValue),j=t.py=R-A.getPos(O,t.yGroup),o&&(G=A.getPos(O,t.yGroup),j=i-C.getPos(D,t.xValue))),t.xPos=G,t.yPos=j;const X=G,U=j,Z=this._markers.get(y),q=V&&V.get(t,0);if(Z&&Z.setVis(!t.isNull&&(k||!a||G>=0&&G<=e&&j>=0&&j<=i))){this._prepareMakrer(Z),this._layoutMarker(Z,n,G,j);const e=r.getMarkerStyle(t);e&&Z.internalSetStyleOrClass(e),s._maxY,t.yGroup,s._minY,t.yGroup;const i=0==y&&null!=c?c:y==$-1&&null!=_?_:s._maxY==t.yGroup&&null!=p?p:s._minY==t.yGroup&&null!=m?m:l;if(Z.setStyle("opacity",i?"1":"0"),q){q.setContrast(null).layout(S);const e=q.getBBox(),i=Z._radius;if(q.visible=!0,P){switch(v){case"inside":I?t.yValue<F?Y-=w:Y+=w:t.yValue<F?Y+=w:Y-=w;break;case"foot":I?t.yValue<F?Y-=e.height/2+w:Y+=e.height/2+w:t.yValue<F?Y+=e.height/2+w:Y-=e.height/2+w;break;default:I?t.yValue<F?Y+=e.height/2+w:Y-=e.height/2+w:t.yValue<F?Y-=e.height/2+w:Y+=e.height/2+w}G=L+Y*d(W),j=T+Y*u(W)-e.height/2,this.applyAutoRotation(q,W,B)}else switch(v){case"inside":j-=e.height/2+w;break;case"foot":j+=w+(l?i:0);break;default:j-=e.height+w+(l?i:0)}switch(b){case"left":G-=e.width+(l?i:0)+x;break;case"right":G+=(l?i:0)+x;break;default:G-=e.width/2+x}this._checkLabelOverlap(q,e,X,U,i,i,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 i=this.width,s=this.height,r=this._inverted,n=e instanceof yn&&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),se.setImportantStyle(t.dom.style,St,"none"),t.setClip(this._rangeClips[n]),this._clipRange(i,s,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),se.setImportantStyle(t.dom.style,St,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);if(t){const e=!isNaN(l)&&l>h.axisMin()?es(t,h,l):t.rdInner;this.$_resetClips(i,s/2,e,!0)}else r?this.$_resetClips(i,s,isNaN(l)?0:h.getPos(i,l),!0):this.$_resetClips(i,s,isNaN(l)?s:s-h.getPos(s,l),!1);a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.prop("belowStyle")),se.setImportantStyle(a.dom.style,St,"none"))}}_buildLine(t,e,i,s){const r=this.model;"spline"===e?this._drawCurve(t,i,s):r instanceof yn&&"step"===e?this._drawStep(t,i,s,i?r.backDir():r.prop("stepDir")):this.$_drawLine(t,i,s)}_buildLines(t,e){const i=this.model,s=i.getLineType(),r=new ye;return"spline"===s?this._drawCurves(t,e,r):i instanceof yn&&"step"===s?this._drawSteps(e,r,i.prop("stepDir")):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,i){if(t.length>1){const s=this._model instanceof yn&&this._model.prop("connectNullPoints");i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&s||i.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach(t=>this.$_drawLine(t,!1,e))}_drawStep(t,e,i,s){if(t.length>1){i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(s){case"backward":i.line(t[e-1].px,t[e].py),i.line(t[e].px,t[e].py);break;case"center":i.line((t[e].px+t[e-1].px)/2,t[e-1].py),i.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&i.line(t[e].px,t[e].py);break;default:i.line(t[e].px,t[e-1].py),i.line(t[e].px,t[e].py)}}}_drawSteps(t,e,i){t.forEach(t=>this._drawStep(t,!1,e,i))}_drawCurve(t,e,i){t.length>1&&(i.moveOrLine(e,t[0].px,t[0].py),i.spline(t,0,t.length-1))}_drawCurves(t,e,i){if(t){const{cx:s,cy:r,rdInner:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof Wr?a.getBaseValue(h):NaN,c=l>h.axisMin()?es(t,h,l):this._yReversed?0:n,_=e[0],p=_.length;let g,f;o?(i.move(_[0].px,_[0].py),i.closedSpline(_,!0)):(g=s+c*d(_[0].angle),f=r+c*u(_[0].angle),i.move(g,f),i.line(_[0].xPos,_[0].yPos),i.closedSpline(_,!1),g=s+c*d(_[p-1].angle),f=r+c*u(_[p-1].angle),i.line(g,f))}else e.forEach(t=>this._drawCurve(t,!1,i))}_buildAreas(t,e,i){const s=new ye;i=i||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,s),this._buildLine(o,i,!0,s)}return s.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.prop("hoverStyle"))}_doLayout(){super._doLayout(),this.$_layoutArrows()}$_layoutArrows(){const t=this.model;if(!(t instanceof yn))return void this._arrowViews.prepare(0);const e=t.arrow,i=this._visPoints,s=e.buildArrowSlots(i);if(0===s.length)return void this._arrowViews.prepare(0);const r=this._getGrowRate(),n=e.getShape(),o=e.getRadius()*r,a=t.needClip(!1),h=this.width,l=this.height,c=!!this._polar;this._arrowViews.prepare(s.length,(t,r)=>{const _=s[r],d=i[_.index],u=d.px,p=d.py,g=e.calcArrowAngle(i,_.index,_.at),f=!d.isNull&&(c||!a||u>=0&&u<=h&&p>=0&&p<=l);if(t.setVis(f)){ps.setShape(t,n,o,o);const i=e.getArrowStyle(d);this.$_applyArrowStyle(t,e,i),t.trans(u-o,p-o),t.setRotation(o,o,g)}})}$_applyArrowStyle(t,e,i){t.internalClearStyleAndClass(),i&&t.internalSetStyleOrClass(i);const s=e.getArrowStyleOverrides(i);s&&t.internalSetStyles(s),n(i)&&this.$_isolateClassArrowStrokeDasharray(t,pn.STYLE_ISOLATION.strokeDasharray)}$_isolateClassArrowStrokeDasharray(t,e){const i=getComputedStyle(t.dom).strokeDasharray,s=getComputedStyle(this.dom).strokeDasharray;i&&"none"!==i?s&&"none"!==s&&i===s&&t.internalSetStyle("strokeDasharray",e):t.internalSetStyle("strokeDasharray",e)}}class nh extends rh{constructor(t){super(t,nh.CLASS),this._flagView=new Wo(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,i=e.flag,s=this._flagView,r=this.parent.parent;let n;if(s.setVis(i.visible&&!!(n=i.label()))){s.setText(n),s.setModel(this.doc,i,i.getIconUrl(),null),s.setContrast(null).layout("left");const o=i.prop("offset"),a=s.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let c;c=("step"==e.prop("lineType")&&"forward"==e.prop("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 _={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[c],{width:d,height:u}=a,p=d/2,g=u/2,{width:f,height:m}=r,y=f/2,b=m/2,x=l>u+o,w=m>l+u+o,v=h>d+o,S=f>h+d+o,V={top:x,right:S,bottom:w,left:v};c=null!==(t=_.find(t=>V[t]))&&void 0!==t?t:c;const C=h>p&&f-h>p?h-p:h>y?f-d:0,A=l>g&&m>l+g?l-g:l>b?m-u:0;switch(c){case"top":h=C,l=x?l-u-o:0;break;case"bottom":h=C,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}s.trans(h,l)}}}nh.CLASS="rct-line-series";class oh extends rh{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new sh(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Pe(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Pe(t,"rct-areanrange-series-line")),se.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,i){super._layoutMarkers(t,e,i);const s=this.model,r=s.marker,n=r._style,o=r.visible,a=this._inverted,h=s._xAxisObj,l=s._yAxisObj,c=a?e:i,_=a?0:i,p=this._labelViews(),g=this._labelContainer._textAlign,f=this._polar=s.chart._body.getPolar(h),m=s.pointLabel,y=m.prop("position"),b=m.prop("align"),x=m.getAlignOffset(),w=m.getOffset(),v=this._getGrowRate();for(let e=0,i=t.length;e<i;e++){const i=t[e];i.yLow=_-l.getPos(c,i.lowValue)}const S=this._markers;for(let s=0,h=t.length;s<h;s++){const _=t[s],m=S.get(h+s),V=p&&p.get(_,1);let C,P,k,L;this._prepareMakrer(m),f?(k=A(_.angle,0),L=is(f,l,_.lowValue,v),C=_.px2=f.cx+L*d(k),P=_.py2=f.cy+L*u(k)):a?(C=_.px2=l.getPos(c,_.lowValue),P=_.py2=S.get(s).ty+m._radius):(C=_.px2=_.xPos,P=_.py2=_.yLow);const T=C,N=P;if(m&&m.setVis(!_.isNull&&C>=0&&C<=e&&P>=0&&P<=i)){this._layoutMarker(m,n,C,P);const t=r.getMarkerStyle(_);if(t&&m.internalSetStyleOrClass(t),m.setStyle("opacity",o||0==s&&!0===r.prop("firstVisible")||s===h-1&&!0===r.prop("lastVisible")?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=m._radius;if(f){let e=L;switch(y){case"inside":e-=w;break;case"foot":e-=t.height/2+w;break;default:e+=t.height+w}C=f.cx+e*d(k),P=f.cy+e*u(k)-t.height/2,this.applyAutoRotation(V,k,f.total)}else switch(y){case"inside":P-=t.height/2+w;break;case"foot":P+=w+(o?e:0);break;default:P-=t.height+w+(o?e:0)}switch(b){case"left":C-=t.width+(o?e:0)+x;break;case"right":C+=(o?e:0)+x;break;default:C-=t.width/2+x}this._checkLabelOverlap(V,t,T,N,e,e,C,P,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,i=this.model;if(!this._areaContainer.setVis(i._lines.length>0))return;const s=this._buildAreas(i._lines,i.getLineType());e.setPath(s),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),i._runColor&&e.setFill(i._runColor),this._setFill(e,i._style),i.prop("areaStyle")&&e.internalSetStyleOrClass(i.prop("areaStyle"))}}class ah extends rh{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new sh(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Pe(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}_computeNeedBelow(t){return this._based&&!(!t.prop("belowStyle")&&!t.prop("belowAreaStyle"))}_prepareBelow(t){const e=this._area;let i=this._lowArea;if(super._prepareBelow(t))return i||this._areaContainer.add(i=this._lowArea=new Pe(this.doc,"rct-area-series-area")),t?this._yReversed&&this._needBelow?(e.setClip(this._innerClip),i.setClip(this._outerClip)):(e.setClip(this._outerClip),i.setClip(this._innerClip)):(e.setClip(this._upperClip),i.setClip(this._lowerClip)),!0;null==i||i.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const i=this.doc,s=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new Ro(this._areaContainer,Pe,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<g(e.length,s.length);t++)this.isClip(s[t])||(s[t]=this.control.addClip(new Ae(i)));for(;s.length<e.length;)s.push(this.control.addClip(new Ae(i)));for(;s.length>e.length;)s.pop().remove()}else r&&(r.freeAll(),s.forEach(t=>t.remove()),s.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,i){super._layoutMarkers(t,e,i);const s=this._inverted,r=this.model._yAxisObj,n=s?e:i,o=s?0:i,a=this._polar;for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.isNull)i.yLow=NaN;else if(a&&!isNaN(i.angle)){const t=es(a,r,i.yGroup-i.yValue),e=i.angle;i.yLow=a.cy+t*u(e)}else i.yLow=o-r.getPos(n,i.yGroup-i.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;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,s=this.height,r=e.chart.isInverted(),n=this._needBelow?this._lowArea:void 0,o=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach((t,n)=>{const a=e._runRanges[n];t.setBoolData("simple",this._simpleMode),t.setPath(o),t.internalClearStyleAndClass(),t.setFill(a.color),this._setFill(t,a.style),a.areaStyle&&t.internalSetStyleOrClass(a.areaStyle),t.setClip(this._rangeAreaClips[n]),this._clipRange(i,s,e._runRangeValue,a,this._rangeAreaClips[n],r)}):(t.setPath(o),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(St,e._runColor),this._setFill(t,e.prop("style")),e.prop("areaStyle")&&t.internalSetStyleOrClass(e.prop("areaStyle"))),n&&(n.setBoolData("simple",this._simpleMode),n.setPath(o),n.internalClearStyleAndClass(),e._runColor&&n.internalSetStyle(St,e._runColor),e.prop("areaStyle")&&n.internalSetStyleOrClass(e.prop("areaStyle")),this._setFill(n,e.prop("belowStyle")),e.prop("belowAreaStyle")&&n.internalSetStyleOrClass(e.prop("belowAreaStyle")))}setCircular(t){this._circular=t}$_layoutPolar(t,e,i){const s=this.model,r=s._group,n=s._xAxisObj,o=s._yAxisObj,a=this._yReversed,h=o instanceof Wr?s.getBaseValue(o):NaN,l=this._polar,{cx:c,cy:_,rd:p,rdInner:m,cyclic:y}=l,x=new ye,w=i.length;if(!r||"stack"!==r.prop("layout")&&"fill"!==r.prop("layout")){const r=h>o.axisMin(),v=r?es(l,o,h):a?0:m,S=s.chart._body.prop("circular");let V,C,A,P,k=!1,L=!1;if("spline"===s.prop("lineType"))this._drawCurves(this._polar,s.buildLines(i),x);else{y?x.move(i[0].xPos,i[0].yPos):(V=c+v*d(i[0].angle),C=_+v*u(i[0].angle),x.move(V,C),x.line(i[0].xPos,i[0].yPos));for(let t=1;t<w;t++)x.line(i[t].xPos,i[t].yPos);y||(V=c+v*d(i[w-1].angle),C=_+v*u(i[w-1].angle),x.line(V,C))}const T=i.map(t=>t.angle),N=this._polar.min=g(...T),M=this._polar.max=f(...T),E=(new ye).push(x.end());if(r)y?x.circle(c,_,v):a&&x.push(...ps.arc(c,_,v,v,N,M,!0)),A=x.end(),k=!0,y?E.circle(c,_,v):E.push(...ps.arc(c,_,v,v,N,M,!0)),P=E.end(),L=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),i=n._ticks;x.push("Z"),y?S?x.circle(c,_,p):x.polygon(...i.map(i=>({x:c+d(t+i.pos/p*e/b)*p,y:_+u(t+i.pos/p*e/b)*p}))):S?x.push(...ps.sector(c,_,p,p,0,N,M,!0)):x.polygon({x:c,y:_},...i.map(i=>({x:c+d(t+i.pos/p*e/b)*p,y:_+u(t+i.pos/p*e/b)*p}),{x:c,y:_})),m>0&&x.circle(c,_,m),A=x.end(!0),k=!0}else A=x.end();t.setPath(A),t.setAttr("fill-rule",k?"evenodd":""),e&&(e.setPath(P||""),e.setAttr("fill-rule",L?"evenodd":""))}else{const e=t=>{if(isNaN(t.angle))return{x:t.xPos,y:t.yLow};const e=es(l,o,t.yGroup-t.yValue);return{x:c+e*d(t.angle),y:_+e*u(t.angle)}},s=e(i[0]);x.move(A(s.x,c),A(s.y,_)),x.line(A(i[0].xPos,c),A(i[0].yPos,_));for(let t=1;t<i.length;t++)x.line(A(i[t].xPos,c),A(i[t].yPos,_));const r=e(i[i.length-1]);x.line(A(r.x,c),A(r.y,_));for(let t=i.length-1;t>=0;t--){const s=e(i[t]);x.line(A(s.x,c),A(s.y,_))}t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),se.setImportantStyle(t.dom.style,Vt,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(s._runColor),e.addStyleOrClass(s._style),e.internalSetStyleOrClass(s.prop("belowStyle")),s.prop("belowAreaStyle")&&e.internalSetStyleOrClass(s.prop("belowAreaStyle")),se.setImportantStyle(e.dom.style,Vt,"none")),s._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new ke(this.doc)));const t=m>0?m/p:0,e=ps.sector(c,_,p,p,t,l.start,l.start+l.total,!0);this._arcClip.setPath(e),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class hh extends Xa{constructor(t){super(t,"rct-barrange-series"),this._bars=new eh(this._pointContainer,Ha)}_getPointPool(){return this._bars}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*A(t.point.width,1),t.hPoint=n,t.layout(i,s+n,this._rd,this._rd,0,0,this._inverted)}}class lh extends Nn{constructor(t){super(t,Ra.POINT_CLASS)}savePrevs(){}}class ch extends Ya{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,i,s){this._polar=i,super._prepareSeries(t,e,i,s)}_preparePoints(t,e,i,s){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,s)}_setPointStyle(t,e,i){super._setPointStyle(t,e,i),i.yValue<e.getBaseValue(e._yAxisObj)&&e.prop("belowStyle")&&t.addStyleOrClass(e.prop("belowStyle"))}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,i,s){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(s!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=s))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_parepareSectors(t,e,i){this._sectors||(this._sectors=new eh(this._pointContainer,lh)),this._sectors.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),i=t.pointLabel,s=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.prop("reversed"),h=2*n.unitPad(),l=r.getPolar(n),{cx:c,cy:_,rd:p,rdInner:f}=l,m=o instanceof Wr?t.getBaseValue(o):NaN,y=m>o.axisMin(),b=es(l,o,m),x=this._pointOff,w=n.getTotalAngle();let v,S,V,C,A;s&&(v=this._labelInfo,S=t.getLabelPos(i),V=t.getLabelOff(i.getOffset()),C=this._labelContainer._textAlign),this._sectors.forEach((i,r)=>{const P=i.point;if(i.setVis(!P.isNull)){const r=is(l,o,P.yGroup,e),k=n.getUnitLen(w,P.xValue)*(1-h),L=t.getPointWidth(k,0);let T,N,M=l.start+n.getPos(w,P.xValue)-k/2;M+=L*x,M+=t.getPointPos(k)+L/2;const E=es(l,o,P.yGroup);if(a?y?(T=b+(E-b)*e,N=b):(T=p,N=r):y?(T=b+(E-b)*e,N=b):(T=r,N=f),i.setSector({cx:c,cy:_,rx:T,ry:T,innerRadius:T>0?N/T:0,start:M-L/2,angle:L,clockwise:!0}),M=i.start+i.angle/2,P.xPos=c+i.rx*d(M),P.yPos=_+i.ry*u(M),s&&(A=v.labelView=s.get(P,0))){A.layout(C);const{width:t,height:e}=A.getBBox(),s=i.ry,r=N;let n,o;n=a?y?P.yValue<m?"outside"===S?s+e/2+V:"head"===S?s-e/2-V:"foot"===S?b+e/2+V:s-(s-b)/2+V:"outside"===S?s-e/2-V:"head"===S?g(b,s+e/2+V):"foot"===S?b-e/2-V:b-(b-s)/2-V:"outside"===S?r-e/2-V:"head"===S?g(s,r+e/2+V):"foot"===S?s-e/2-V:s-(s-r)/2-V:y?P.yValue<m?"outside"===S?s-e/2-V:"head"===S?s+e/2+V:"foot"===S?b-e/2-V:b-(b-s)/2-V:"outside"===S?s+e/2+V:"head"===S?s-e/2-V:"foot"===S?b+e/2+V:s-(s-b)/2+V:"outside"===S?s+e/2+V:"head"===S?s-e/2-V:.7*s+V,o=_+n*u(M),n=c+n*d(M),"outside"!==S&&A.setContrast(i.dom),this.applyAutoRotation(A,M,l.total),A.trans(n-t/2,o-e/2)}}})}}class _h extends ch{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new eh(t,Ga):new eh(t,Ha)}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._rdTop=+e.prop("topRadius")||0,this._rdBottom=+e.prop("bottomRadius")||0}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*A(t.point.width,1),t.hPoint=n,t.layout(i,s,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof Ha){const e=this.model._xAxisObj;t.shrink(e.prop("reversed"),e._vlen,this._rdTop,this._rdBottom)}}}class dh extends ah{constructor(t){super(t,"rct-bellcurve-series")}}class uh extends ja{constructor(t){super(t,Ra.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const i=this.point,s=i.yValue-i.minValue,r=t/2;const n=0+e-e*(i.lowValue-i.minValue)/s,o=0+e-e*(i.highValue-i.minValue)/s,a=e*(i.highValue-i.lowValue)/s;i.color&&this._box.setFill(i.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*(i.midValue-i.minValue)/s,0,t)}_doInitChildren(t){this.add(this._stemUp=new cn(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new cn(t,"rct-boxplot-point-stem")),this.add(this._box=new gs(t,"rct-boxplot-point-box")),this.add(this._mid=new cn(t,"rct-boxplot-point-mid")),this.add(this._min=new cn(t,"rct-boxplot-point-min")),this.add(this._max=new cn(t,"rct-boxplot-point-max"))}}class ph extends Xa{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new eh(this._pointContainer,uh)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,i){this._boxes.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class gh extends Ua{}class fh extends Za{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new Se(t,"rct-bubble-pie"))}_createMarkers(t){return new eh(t,gh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ma.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,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_preparePie(t,e,i){const s=e.pie,r=s&&s.visible&&s.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;i.forEach(t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)}),this._pieSectors||(this._pieSectors=new Ro(this._pieContainer,Nn,Ra.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();s.getLegendSources().forEach(e=>{e.legendMarker()||e.setLegendMarker(gs.create(t,Ra.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 i;const s=this.model,r=this._inverted,n=s.needClip(!1),o=this._getGrowRate(),a=+s.prop("rotation")||0,h=s.pointLabel,l=h.prop("position"),c=h.getOffset(),_=this._labelContainer._textAlign,p=this._labelViews(),g=s._xAxisObj,f=s._yAxisObj,m=this._polar=s.chart._body.getPolar(g),y=r?t:e,b=r?e:t,x=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(x),S=r?0:e,V=ps.getDrawer(s.prop("shape")),C=s.pie,P=C&&C.visible&&C.fields.length>0;let k,L=0;null===(i=this._markers.getOrphans())||void 0===i||i.forEach(t=>{t.setPath(V(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))}),this._markers.forEach((i,h)=>{var x,T;const N=i.point,M=p&&(k=p.get(N,0));if(i.setVis(!N.isNull&&!isNaN(N.zValue))){const h=i._radius=s.getRadius(N.zValue,w,v),p=h*o*A(N._vr,1);let T,E;if(m){const t=m.start+g.getPos(b,N.xValue),e=es(m,f,N.yValue);T=m.cx+e*d(t),E=m.cy+e*u(t)}else T=g.getPos(b,N.xValue),E=S-f.getPos(y,N.yValue),r&&(T=f.getPos(y,N.yValue),E=e-g.getPos(b,N.xValue));N.xPos=T,N.yPos=E;const B=!n||T>=0&&T<=t&&E>=0&&E<=e;if(P&&N.pieSlices)if(i.setVis(!1),B)C.resolveSliceColors(N.pieSlices),L=this.$_renderPieSectors(N,N.pieSlices,L,T,E,p,C.getInnerRadius(p),C.clockwise);else for(let t=0;t<N.pieSlices.length;t++)null===(x=this._pieSectors.get(L++))||void 0===x||x.setVis(!1);else i.setVis(B)&&i.setPath(V(p)).trans(T,E).rotate(a);B&&M?(k.setContrast(P&&N.pieSlices?null:i.dom),k.layout(_),this._layoutLabelView(k,l,c,h,T,E)):M&&M.setVis(!1)}else{if(P&&N.pieSlices)for(let t=0;t<N.pieSlices.length;t++)null===(T=this._pieSectors.get(L++))||void 0===T||T.setVis(!1);M&&M.setVis(!1)}})}$_renderPieSectors(t,e,i,s,r,n,o,a){let h=i;for(const i of e){const e=this._pieSectors.get(h++);if(e){const h={cx:s,cy:r,rx:n,ry:n,innerRadius:o,start:i.startAngle,angle:m(i.angle),clockwise:a};if(e.setSector(h),e.setFill(i.color),e.setVis(!0),this._sectorMap){const a=i.startAngle+i.angle/2,h=(n+o)/2,l=s+h*d(a),c=r+h*u(a),_={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:c}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:i,pv:_})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;const i=this._markers._internalItems();if(i&&i.length>0){const s=i.reduce((i,s)=>i.distance(i._radius,t,e)<s.distance(s._radius,t,e)?i:s);return{pv:s,dist:s.distance(s._radius,t,e)}}}canHover(t,e,i){return t<=e._radius+i}}let mh=class extends ja{constructor(t){super(t,Ra.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue;const r=0+e-e*(0===s?1:(g(i.openValue,i.closeValue)-i.lowValue)/s),n=0+e-e*(0===s?1:(f(i.openValue,i.closeValue)-i.lowValue)/s),o=g(n,r),a=f(1,m(r-n)),h=i.close<i.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 cn(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new cn(t,"rct-candlestick-point-wick")),this.add(this._body=new gs(t))}};class yh extends Xa{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new eh(this._pointContainer,mh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._sticks.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}}class bh extends $a{layout(t,e,i){const s=new ye;s.circle(t,e,i),this.setPath(s.end())}}class xh extends ch{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new eh(t,bh)}_layoutPoint(t,e,i,s,r,n){t.layout(i,s-n/2,n/2-1)}}let wh=class extends ja{constructor(t){super(t,Ra.POINT_CLASS),this.add(this._line=new cn(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Pe(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Pe(t,"rct-dumbbell-point-marker"))}layout(t,e,i,s){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=i/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let c=t.getMarkerStyle(o);c&&r.internalSetStyleOrClass(c),c=e.getMarkerStyle(o),c&&n.internalSetStyleOrClass(c),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,s),ps.setShape(r,o.shape,a,a),ps.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,s-a)}};class vh extends Xa{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new eh(this._pointContainer,wh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),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 Sh=class extends Io{constructor(t){super(t,Ra.POINT_CLASS),this._segments=new Ro(this,Pe),this._decimal=0,this.add(this._back=new Pe(t)),this._back.setTransparent(!0)}prepareSegments(t,e,i,s){this._decimal=i,this._segments.prepare(Math.round(e)).forEach((t,e)=>{})}layout(t,e,i){const s=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=s/2,r<0&&(t=t.map(t=>-t)),this._back.setPath(ps.rectangle(e,i,s,-r)),this._segments.forEach((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(ps.rectangle(e,i-t[2*a],s,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(ps.rectangle(e,i-t[2*a],s,n(-1,t[2*a]-t[2*a+1])))})}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class Vh extends Ya{constructor(t){super(t,"rct-equalizer-series"),this._bars=new eh(this._pointContainer,Sh)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(e,i)}_shrinkPoint(t){}_layoutPoints(t,e){const i=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,i),super._layoutPoints(t,e)}_layoutPoint(t,e,i,s,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(i=t.xSave+(i-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,i,s)}$_parepareBars(t,e){this._bars.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_buildSegments(t,e){const i=t._yAxisObj.axisMax(),s=t.prop("segmented"),r=t.num("segmentGap"),n=this._pts=[];let o,a,h=0;const l=t._yAxisObj,c=l.axisMin(),_=t.getBaseValue(l)||0,d=l.getPos(l.prop("reversed")?0:e,_);for(a=t.prop("maxCount")>0?t.prop("maxCount"):Math.round(e/(t.getSegmentSize(e)+r/2)),o=(e-r*(a-1))/a;n.length<2*a;)n.push(h,h+o),h+=o+r;n[n.length-1]=e;const u=n.length/2;this._bars.forEach(r=>{const a=r.point;if(r.setVis(!a.isNull)){const h=a.yValue>=_?(e-d)/e*(a.yValue-_)/(i-_):d/e*(_-a.yValue)/(_-c);let l=-1,p=0;for(let t=0;t<u-1;t++)if(h>=n[2*t]/e&&h<n[2*(t+1)]/e){l=t+1,p=!s&&h<n[2*t+1]/e?h*e-n[2*t]:o;break}l<0&&(l=u,p=o),0===h&&(l=0),r.prepareSegments(u,l,p,t.prop("backStyle"))}})}}let Ch=class extends ja{constructor(t){super(t,Ra.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new cn(t)),this.add(this._whiskerUp=new cn(t)),this.add(this._whiskerDown=new cn(t)),this.add(this._back=new gs(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const i=t/2;this.x=this.tx+i,this._stem.setVLine(i,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Ah extends Xa{constructor(t){super(t,"rct-errorbar-series"),this._bars=new eh(this._pointContainer,Ch)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class Ph extends $a{}class kh extends Ka{constructor(t){super(t,"rct-funnel-series"),this._segments=new eh(this._pointContainer,Ph),this.add(this._lineContainer=new Ta(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&&ma.reveal(this,{from:this.model.prop("reversed")?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,i){this._segments.prepare(i.length,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcRates(t){const e=this._zombie,i=this._zombieRate,s=t.length;let r=0,n=0;if(t.forEach(t=>{r+=t.yValue*(t===e?i:t._isDeleted()?t._vr:1)}),s>1||s>0&&!e)if(1==s&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===s&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<s-1;o++){const s=t[o],a=ft(s.yValue*(s===e?i:s._isDeleted()?s._vr:1)/r)||0;s.yRate=100*a,s.yPos=n,s.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==s){const e=t[0],s=ft(i);n=1-s,e.yRate=100*s,e.yPos=n,e.height=s,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const i=function(t){return d?b+(V-b)*(w-t)/(w-C):b+(V-b)*(t-x)/(C-x)},s=this.model,r=this._labelViews(),n=s.pointLabel,o="inside"===s.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getWidgetAlign(),c=null==r?void 0:r.textAlign(),_=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=s.prop("reversed"),u=n.prop("opposite"),p=s.getSize(t,e),g=s.getNeckSize(p.width,p.height),f=new ye,y=s.getCenter(t,e),b=y.x-p.width/2,x=y.y-p.height/2,w=x+p.height,v=b+p.width/2,S=p.height-g.height,V=b+(p.width-g.width)/2,C=d?w-S:x+S,A=[],P=new ye,k=(null==r?void 0:r.getWidth(0))||0;let L,T;this._lineContainer.setStyleOrClass(n.connector.prop("style")),this._segments.forEach(s=>{const n=s.point;if(s.setVis(!n.isNull)){const y=n.yPos*p.height,b=(n.yPos+n.height)*p.height,N=d?w-y:x+y,M=d?w-b:x+b,E=b<S;let B,O,D,R;if(T=null==_?void 0:_.get(n),y>=S?(B=V,O=B+g.width,f.move(B,N).lines(O,N,O,M,B,M),s.ny=s.nx1=NaN):E?(B=i(N),O=B+2*(v-B),D=i(M),R=D+2*(v-D),f.move(B,N).lines(O,N,R,M,D,M),s.ny=NaN,s.nx1=D-B,s.nx2=R-B):(B=i(N),O=B+2*(v-B),D=V,R=D+g.width,f.move(B,N).lines(O,N,R,C,R,M,D,M,D,C),s.nx1=D-B,s.nx2=R-B,s.ny=m(C-N),s.nx3=D,s.nx4=R),s.setPath(f.close(!0)),n.xPos=v,n.yPos=N+(M-N)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==T||T.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),i=E?(O-B+(R-D))/2:g.width;switch(!t&&L.layout(c||"center"),l){case-1:L.trans(n.xPos-i/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+i/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,s,L,c,u,T,P,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,s,L,c,u,T,P,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,n,s,L,c,u,T,P,v,a,h);L.setContrast(o&&s.dom),A.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else T&&T.setVis(!1)}});const N=n.prop("convergent"),M=n.prop("dedupeMode"),E=n.prop("overflow");r&&(o||0===l?"preserveOrder"!==M&&"largestFirst"!==M||r.dedupe(A,_,M):(null==r?void 0:r.arrangeVertical(this,A,_,e,N,M,E))&&this._segments.forEach(i=>{const s=i.point;s.isNull||(L=r.get(s,0),T=null==_?void 0:_.get(s),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,s,i,L,c,u,T,P,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,s,i,L,c,u,T,P,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,s,i,L,c,u,T,P,v,a,h)))}))}$_calcX(t,e,i,s){const r=e.getBBox(),n=s?-1:1,o=r.height;let a=i+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=s?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,i,s,r,n,o,a,h,l,c,_){const d=s.isDomAnimating(),u=t?s.getBBoxEx():s.getBBox(),p=e.yPos;!t&&!d&&s.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,i,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-_,e).end()):o.setLine(a.reset(0,0).line(f+_-g,e).end()),o.trans(g,p)}t||(n?f-=c+_+u.width:f+=_+c,s.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,i,s,r,n,o,a,h,l,c,_,d,u){const p=s.isDomAnimating(),g=t?s.getBBoxEx():s.getBBox(),f=e.yPos;!t&&!p&&s.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,i,h,n);let y;if(y=n?c+l+_:d-c-_-l,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(y-m-c,e).end()):o.setLine(a.reset(0,0).line(y+c-m,e).end()),o.trans(m,f)}t||(n?y-=l+c+g.width:y+=c+l,s.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,i,s,r,n,o,a,h,l,c){const _=s.isDomAnimating(),d=t?s.getBBoxEx():s.getBBox(),u=e.yPos;!t&&!_&&s.layout(r||(n?"right":"left"));let p=this.$_calcX(e,i,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-c,e).end()):o.setLine(a.reset(0,0).line(c,e).end()),o.trans(p,u)}t||(n?p-=c+l+d.width:p+=c+l,s.trans(p,u-d.height/2))}}let Lh=class extends Ia{layout(t,e){this.setPath(ps.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Th extends Wa{constructor(t){super(t,"rct-histogram-series"),this._bars=new eh(this._pointContainer,Lh)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){t.wPoint=r,t.hPoint=n,t.layout(i,s)}_layoutPoints(t,e){const i=this.model,s=this._inverted,r=this._getGrowRate(),n=i.pointLabel,o=this._labelViews(),a=i._xAxisObj,h=i._yAxisObj,c=s?t:e,_=s?e:t,d=h.getPos(c,i.getBaseValue(h)),u=s?0:e,p=o&&l(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(n),labelOff:i.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach((i,l)=>{const g=i.point,f=a.getPos(_,g.min),m=a.getPos(_,g.max),y=h.getPos(c,g.yValue),b=m-f+(m>f?-1:1),x=y-d;let w=f+(m-f)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(i,l,w,v+x,b,x*r),p&&(p.labelView=o.get(g,0))&&(s&&(v=_-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(c,g.yGroup)),p.pointView=i,p.x=w,p.y=v,p.wPoint=b,p.hPoint=x,this._layoutLabel(n,p,t,e))})}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutBars(t,e){const i=this.model._xAxisObj,s=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach((o,a)=>{const h=o.point,l=i.getPos(t,h.min),c=i.getPos(t,h.max),_=l+(c-l)/2,d=s.getPos(e,o.point.yValue)*n,u=f(1,c-l-1);h.xPos=_,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(_,r)})}}class Nh extends Io{constructor(t){super(t,Ra.POINT_CLASS),this.add(this._line=new cn(t,"rct-lollipop-point-bar")),this.add(this._marker=new Pe(t,"rct-lollipop-point-marker"))}layout(t){var e;const i=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),ps.setShape(this._marker,this.point.shape,i,i),this._marker.trans(-i,-i)}savePrevs(){this.xSave=this.tx}}class Mh extends Ya{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_shrinkPoint(t){}_layoutPoint(t,e,i,s,r,n){t.trans(i,s-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,i){const s=e.marker,r=s._style;s.prop("styleCallback"),this._bars||(this._bars=new eh(this._pointContainer,Nh)),this._bars.prepare(i.length,(t,n)=>{const o=t.point=i[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=s.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)})}}class Eh extends ja{constructor(t){super(t,Ra.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue,r=-t/2;const n=0+e-e*(g(i.openValue,i.closeValue)-i.lowValue)/s,o=0+e-e*(f(i.openValue,i.closeValue)-i.lowValue)/s,a=i.close<i.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 cn(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new cn(t,"rct-ohlc-point-tick")),this.add(this._bar=new cn(t)),this.add(this._back=new gs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class Bh extends Xa{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new eh(this._pointContainer,Eh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this.$_prepareSticks(e,i)}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}$_prepareSticks(t,e){this._sticks.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}}class Oh extends rh{constructor(t){super(t,"rct-pareto-series")}}class Dh extends Pe{setOff(t){return this.off=m(t),this}}class Rh extends Nn{constructor(t){super(t,Ra.POINT_CLASS)}render(t,e,i){this._assignShape(i,!1)}}class $h extends we{constructor(t){super(t,Ra.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Nn(t))}setSides(t,e,i,s,r){const n=this.point,o=ft(y),a=ft(((t?n.startAngle:n.startAngle+n.angle)+y/2+b)%b),h=ft(a+(t?n.angle:-n.angle)-1e-4+b)%b,l=o-(a+m(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=i.setOff(o-h),a<=y/2&&!(h>=a&&h<y/2)||h>=3*y/2&&!(a<h&&a>3*y/2)?(this._outArcView=s.setOff(g(e.off,i.off)),this._inArcView=r.setOff(1/0)):a>=3*y/2&&h<=y/2?(this._outArcView=s.setOff(1/0),this._inArcView=r.setOff(l)):a>=y/2&&h<=3*y/2?(this._outArcView=s.setOff(g(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=s.setOff(l),a>=0&&a<=y&&this._outArcView.setOff(g(this._outArcView.off,this._side1View.off)),h>=y&&h<b&&this._outArcView.setOff(g(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,i){const s=ps.isCircled(i.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=i.innerRadius>0,o=i.depth,a=this._outPath,h=this._inPath,l=i.clockwise?i.angle:-i.angle;it&&(r=this.control.getIEColor(r)),this._outArcView.setPath(ps.arc3d(i.cx,i.cy,i.rx,i.ry,o,i.start,i.start+l,i.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(ps.arc3dInner(i.cx,i.cy,i.rx*i.innerRadius,i.ry*i.innerRadius,o,i.start,i.start+l,i.clockwise,h)),this._side1View.setVis(!s),this._side2View.setVis(!s),this._side1View.visible&&(n?(this._side1View.setPath(ps.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(ps.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(ps.polygon(i.cx,i.cy,a.x1,a.y1,a.x1,a.y1+o,i.cx,i.cy+o)),this._side2View.setPath(ps.polygon(i.cx,i.cy,a.x2,a.y2,a.x2,a.y2+o,i.cx,i.cy+o)))),this._sectorView._assignShape(i,!1),this._side1View.setStyle("fill",ie.interpolate("#000",r,.2)),this._side2View.setStyle("fill",ie.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",ie.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",ie.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Ra.DATA_FOCUS,t),this._side2View.setBoolData(Ra.DATA_FOCUS,t),this._inArcView.setBoolData(Ra.DATA_FOCUS,t),this._outArcView.setBoolData(Ra.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,i,s){return this._side1View.transEx(t,e,i,s),this._side2View.transEx(t,e,i,s),this._inArcView.transEx(t,e,i,s),this._outArcView.transEx(t,e,i,s),super.transEx(t,e,i,s)}}class Ih extends Ka{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new ye,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 ea(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Wo(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new Se(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Ta(e))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const i=e.innerText,s=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.prop("ratio"):1,this.setBoolData("deep",s),this.$_prepareSectors(t,e,this._visPoints,s),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&i.visible)&&(this._textView.setModel(t,i,i.getIconUrl(),null),i.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 i=this.model,s=i._group,r=Math.floor(s.getPolarSize(t,e)/2),n=s.getInnerRadius(r)*r,o=r-n;this._rx=n+(i._groupPos+i._groupSize)*o,this._rxInner=(n+i._groupPos*o)/this._rx}_runShowEffect(t){t&&ma.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.prop("autoSlice"),!1))})}_doPointClicked(t){if((t instanceof Rh||t instanceof $h)&&this.model.prop("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 $h&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,i,s){const r=i.length;let n=this._sides;s!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(s?(this._sectors=new eh(this._pointContainer,$h,null),n=this._sides=new Ro(this._sideContainer,Dh,"rct-pie-series-side")):this._sectors=new eh(this._pointContainer,Rh,null)),this._deep=s,n&&n.prepare(4*r,(t,e)=>t.index=e),this._sectors.prepare(r,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcAngles(t){const e=this._zombie,i=this._zombieRate,s=t.length,r=this._model.prop("clockwise")?1:-1,n=t.filter(t=>(t.visible||t===e)&&!t.isNull).map(t=>t.yValue*(t===e?i:t._isDeleted()?t._vr:1)).reduce((t,e)=>t+e,0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%b;if(s>1||s>0&&!e)t.forEach(t=>{1===s&&t._isDeleted()||1===s&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=ft(t.yValue*(t===e?i:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)});else if(1==s){const e=t[0];e.startAngle=a,e.angle=r*i*o,e.yRate=100}}$_layoutSectors(t,e,i){const s=this.model,r=s.prop("clockwise"),n=this._getGrowRate(),o=s.getCenter(e,i),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,c=this._rxInner,_=this._depth,p=this._ratio,g=this._sides,f=s.pointLabel,y=f.connector.prop("curved"),b=this._labelViews(),x="inside"===s.getLabelPos(f),w=A(f.prop("radius"),.7),v=this._pb,S=f.getDistance(x,l,c),V=f.getWidgetAlign();let C=null==b?void 0:b.textAlign();const P=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,k=this._slicedOff=s.getSliceOffset(l)*n,L=[],T=[],N=[],M=(null==b?void 0:b.getWidth(0))||0,E=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(f.connector.prop("style")),!b||C||V||(C="center"),this._textView.visible){this._textView.layout("center"),this._textView.setContrast(null);const t=this._textView.getLayoutBox();this._textView.trans(a-t.x-t.width/2,h-t.y-t.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(O=null==P?void 0:P.get(f),f.isNull)t.setVis(!1),b&&(B=b.get(f,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=E>1&&f.sliced,g=f.startAngle,A=g+f.angle/2;let P=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(P+=d(A)*k,D+=u(A)*k),t.trans(P,D).setVis(!0),f.xPos=a+d(A)*(k+l*w),f.yPos=h+u(A)*(k+l*w),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:c,start:g,angle:m(f.angle),clockwise:r,depth:_}),b&&(B=b.get(f,0))){const r=s.getLabelOff2(f);let n;x?(null==O||O.setVis(!1),this.$_layoutLabelInside(f,B,C,r,S,o?k:0)):(n=-1===V?this.$_layoutLabelAligned(!1,f,B,C,O,v,y,r,S,o?k:0):1==V?this.$_layoutLabelEnded(!1,f,B,C,O,v,y,r,S,o?k:0,M,e,i):this.$_layoutLabelOutside(!1,f,B,C,O,v,y,r,S,o?k:0),n?L.push(B):T.push(B),this._layoutLabelRotation(B)),B.setContrast(x&&t.dom).setVis(!0),N.push(B)}else null==O||O.setVis(!1)}}),g&&g.sortDom((t,e)=>{let i=e.off-t.off;return 0===i&&(i=t.index-e.index),i});const D=f.prop("convergent"),R=f.prop("dedupeMode"),$=f.prop("overflow");b&&(x||0===V?"preserveOrder"!==R&&"largestFirst"!==R||b.dedupe(N,P,R):b.arrangeVertical(this,L,P,i,D,R,$)+b.arrangeVertical(this,T,P,i,D,R,$)>0&&this._sectors.forEach(t=>{const r=t.point;if(!r.isNull){const t=E>1&&r.sliced,n=s.getLabelOff2(r);B=b.get(r,0),O=null==P?void 0:P.get(r),(null==B?void 0:B.visible)&&(-1===V?this.$_layoutLabelAligned(!0,r,B,C,O,v,y,n,S,t?k:0):1==V?this.$_layoutLabelEnded(!0,r,B,C,O,v,y,n,S,t?k:0,M,e,i):this.$_layoutLabelOutside(!0,r,B,C,O,v,y,n,S,t?k:0))}}))}$_layoutLabelAligned(t,e,i,s,r,n,o,a,h,l){const c=i.isDomAnimating(),_=e.startAngle+e.angle/2,p=this._cx,g=this._cy,f=this._rx,m=this._ry,y=f+l,b=m+l,x=p+d(_)*y,w=g+u(_)*b,v=x<p;!t&&!c&&i.layout(s||(v?"right":"left"));const S=i.getBBox(),V=w-S.height/2;let C,A,P,k=g+u(_)*m;if(v?(C=p+d(Math.PI)*f-h,A=C-S.width-a,P=p+d(Math.PI)*y-h,S.width):(C=p+d(0)*f+h,A=C+a,P=p+d(0)*y+h),r&&r.setVis(y>0)){const e=t?i.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(x-C),e,x-C,0).end()):r.setLine(n.reset(0,e).line(x-C,0).end()),r.setPos(C,k),!c&&r.trans(C,w)}return t||(i.setPos(A,k-S.height/2),!c&&i.trans(A,k-S.height/2)),v}$_layoutLabelEnded(t,e,i,s,r,n,o,a,h,l,c,_,p){const g=i.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,y=this._cy,b=this._rx,x=this._ry,w=b+l,v=x+l;let S=m+d(f)*w,V=y+u(f)*v;const C=S<m;!t&&!g&&i.layout(s||(C?"right":"left"));const A=i.getBBox(),P=V-A.height/2;let k,L,T,N=y+u(f)*x;if(C?(k=h+c+a,T=h+c-A.width,L=k):(k=_-h-c-a,T=_-h-c,L=k),r&&r.setVis(w>0)){const e=t?i.ty-P: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(k,N),!g&&r.trans(L,V)}return t||(i.setPos(T,N-A.height/2),!g&&i.trans(T,N-A.height/2)),C}$_layoutLabelOutside(t,e,i,s,r,n,o,a,h,l){const c=i.isDomAnimating();!t&&!c&&i.layout(s);const _=i.getBBox(),p=e.startAngle+e.angle/2,g=this._cx,f=this._cy,m=this._rx+.5*h,y=this._ry+.5*h,b=d(p)*l,x=u(p)*l,w=g+d(p)*this._rx,v=f+u(p)*this._ry,S=g+d(p)*m;let V=f+u(p)*y;const C=S<g;let A,P;return C?(A=S-.2*h,P=A):(A=S+.2*h,P=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),!c&&r.trans(w+b,v+x)),t||(C?P-=_.width+a:P+=a,V-=_.height/2,i.setPos(P,V),!c&&i.trans(P+b,V+x)),C}$_layoutLabelInside(t,e,i,s,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.prop("autoRotation"),c=h.prop("rotationMode"),_=a.prop("clockwise");!o&&e.layout(i||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,i=g(a.prop("totalAngle")||360,360);if("angle"===c){let s=p/t*i+90,r=(s+a.prop("startAngle"))%360;r+=_?0:360,s+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,s)}else this.applyAutoRotation(e,p,t,i)}else this._layoutLabelRotation(e);const f=h.prop("align")===ws?.3:h.prop("align")===xs?.5:.7,m=u>0?u+(this._rx-u)/2:l?"angle"===c?this._rx*f+s:.8*this._rx+s:.7*this._rx+s,y=this._deep?m*this._ratio:m,b=Math.cos(p),x=Math.sin(p);let w=this._cx+b*m,v=this._cy+x*y;e.move(w-d.width/2,v-d.height/2),w=this._cx+b*(n+m),v=this._cy+x*(n+y),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,i){if(e&&this._sectors.count<2)return;const s=this.model,r=this._labelViews(),n=s.pointLabel.getWidgetAlign(),o=this._slicedOff,a=s.prop("autoSlice")?s.prop("sliceDuration"):0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(d(l)*o,u(l)*o,a):t.transEx(0,0,a),!r)return;const c=s.pointLabel,_=this._lineContainer,p=c.connector.prop("curved"),g="inside"===s.getLabelPos(c),f=r.get(h,0),m=s.pointLabel.getDistance(g,this._rx,this._rxInner);if(f){const t=!g&&_.get(h);if(i){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,f,e,c.getOffset(),m,o):0===n&&this.$_layoutLabelOutside(!1,h,f,e,t,this._pb,p,c.getOffset(),m,o)}if(e){let e=f.tx,i=f.ty,s=t.tx,r=t.ty;(g||0===n)&&(f.trans(f.x,f.y).transEx2(e,i,a),t&&t.trans(t.x,t.y).transEx(s,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 Fh extends Ua{setHoverRate(t,e,i){const s=this.point,r=ps.getDrawer(t.model.getShape(s)),n=(+t.model.prop("hoverScale")||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(i)?1:i)*n):o=t._radius*(1+n-(isNaN(i)?n:n*i)),this.setPath(r(o)),this.trans(s.xPos,s.yPos)}endHover(t,e){delete this._hoverRadius}}class zh extends Za{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new eh(t,Fh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ma.grow(this)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const i=this.model,s=this._inverted,r=i.needClip(!1),n=i._xAxisObj,o=i._yAxisObj,a=this._polar=i.chart._body.getPolar(n),h=this._getGrowRate(),l=this._radius=Math.max(0,i.num("radius"))*h,c=i.num("rotation"),_=i.num("jitterX"),p=i.num("jitterY"),g=i.pointLabel,f=g.prop("position"),m=g.getOffset(),y=this._labelViews(),b=s?t:e,x=a?a.total:s?e:t,w=s?0:e;let v;this._markers.forEach((g,S)=>{const V=g.point,C=y&&(v=y.get(V,0));if(g.setVis(!V.isNull)){const y=ps.getDrawer(i.getShape(V)),S=st.jitter(V.xValue,_),A=st.jitter(V.yGroup,p);let P,k;if(a){const t=a.start+n.getPos(x,S),e=is(a,o,A,h);P=a.cx+e*d(t),k=a.cy+e*u(t)}else P=n.getPos(x,S),k=w-o.getPos(b,A),s&&(P=o.getPos(b,A),k=e-n.getPos(x,S));if(V.xPos=P,V.yPos=k,g.setVis(!!a||!r||P>=0&&P<=t&&k>=0&&k<=e)){const t=g._hoverRadius||l;g.setPath(y(t)),g.trans(P,k).rotate(c),C&&this._layoutLabelView(v,f,m,t,P,k)}else C&&C.setVis(!1)}else C&&C.setVis(!1)})}getNearest(t,e){const i=this._markers._internalItems();if(i&&i.length>0){const s=this.model.prop("radius"),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)}}}canHover(t,e,i){return t<=this.model.prop("radius")+i}}class Hh extends Xa{constructor(t){super(t,"rct-waterfall-series"),this._bars=new eh(this._pointContainer,Ha),this.add(this._lineContainer=new Se(t,"rct-waterfall-series-lines")),this._lines=new Ro(this._lineContainer,cn)}_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,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,s+=n,t.layout(i,s,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?s:s-n:a<0?s-n:s,t.setHLine(h,this._xPrev+this._wPrev/2,i-r/2)}this._xPrev=i,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,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i._isSum&&e.prop("sumColor")?this._setPointColor(t,e.prop("sumColor")):i.y<0&&e.prop("negativeColor")?this._setPointColor(t,e.prop("negativeColor")):i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];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(i.length-1,(t,e)=>{t.visible=!i[e].isNull&&!i[e+1].isNull})}}function Gh(t,e){return new(ra[e._type()])(t)}function jh(t,e){return new(Ba[e._viewType()])(t)}Ra.register([wn,ah],[Vn,oh],[rn,_h],[tn,hh],[kn,dh],[Tn,ph],[In,fh],[Hn,yh],[jn,xh],[Un,vh],[qn,Vh],[Kn,Ah],[eo,kh],[ro,Th],[yn,nh],[ao,Mh],[lo,Bh],[_o,Oh],[yo,Ih],[wo,zh],[Vo,Hh]),na.register([Rr,th],[Or,Qa],[Dr,Ja]);class Wh extends Fo{constructor(t){super(t,"rct-axis-grid"),this._lines=new Ro(this,cn),this.add(this._minorLineContainer=new we(t,"rct-axis-minor-grid")),this._minorLines=new Ro(this._minorLineContainer,cn)}_prepareStyleOrClass(t){}_doMeasure(t,e,i,s,r){return{width:i,height:s}}_doLayout(){const t=this.model,e=t.axis,i=e.prop("reversed"),s=this.width,r=this.height,n=e._isHorz?s:r;if(t instanceof $r&&e instanceof jr){const o=t.minorGrid,a=t.visible&&!e.isEmpty()?t.getMinorPositions(e,n):[],h=this._minorLines.prepare(a.length,t=>{t.internalClearStyleAndClass(),t.setClass("rct-axis-minor-grid-line"),t.internalSetStyleOrClass(o._style)});this._minorLineContainer.setVis(a.length>0),this.$_layoutGridLines(h,a,e,i,s,r,()=>!!a.length)}else this._minorLines.prepare(0),this._minorLineContainer.setVis(!1);const o=e.isEmpty()?[]:t.getPositions(e,n),a=this._lines.prepare(o.length,e=>{e.internalClearStyleAndClass(),e.setClass("rct-axis-grid-line"),e.internalSetStyleOrClass(t._style)}),h=a.count-1;a.forEach((t,i)=>{t.setBoolData("first",0===i),t.setBoolData("last",o[i]===(e._isHorz?s:r))});const l=P(t.prop("firstVisible"),t.visible),c=P(t.prop("lastVisible"),t.visible);this.$_layoutGridLines(a,o,e,i,s,r,e=>0===e?l:e===h?c:t.visible)}$_layoutGridLines(t,e,i,s,r,n,o){const a=t.count-1;if(i._isHorz){const h=A(i._prevRate,1);t.forEach((t,l)=>{t.setVis(o(l,a))&&t.setVLine(i.prev(e[l])+(s?r*(1-h):0),0,n)})}else{const h=s?A(i._prevRate,1):1;t.forEach((t,s)=>{t.setVis(o(s,a))&&t.setHLine(n*h-i.prev(e[s]),0,r)})}}}class Yh extends we{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Pe(t)),this._mask.setStroke("none"),this.add(this._upLine=new Pe(t)),this._upLine.setFill("none"),this.add(this._downLine=new Pe(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,i){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const s=this._model._sect.len,r=new ye;if(i){let t=0,i=0,n=s/2,o=s;for(r.move(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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,i=0,n=s/2,o=s;for(r.move(e,n);e<t;)e+=20,r.line(e,i),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,i),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 Xh extends we{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Wo(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.prop("text"))){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const i=e.label.getText();e.label.prepareRich(i)}}layout(t,e,i){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")),i?this._doLayoutPolar(t,e,i):this._doLayout(t,e)}_getContrastTarget(){return null}}class Uh extends Xh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?sa:cn)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.prop("value")))&&i(e._style)&&this._line.setStyles(e._style)}_doLayout(t,e){const i=this.model,s=i.prop("value"),r=i.label,n=this._line,o=this._labelView.setVis(r.visible)?this._labelView:null,a=this._labelView.getBBox(),h=r.num("offsetX"),l=r.num("offsetY");let c,_;if(this.vertical()){const d=i.axis.getPos(t,s),u=n.setVis(!isNaN(d));if(null==o||o.setVis(u),u&&(n.setVLine(d,0,e),o)){switch(r.prop("align")){case"center":c=d-a.width/2+h;break;case"right":c=d+h;break;default:c=d-a.width-h}switch(r.prop("verticalAlign")){case"bottom":_="outside"!==r.prop("position")?e-a.height-l:e+l;break;case"middle":_=(e-a.height)/2-l;break;default:_="outside"!==r.prop("position")?l:-1*(a.height+l)}}}else{const d=e-i.axis.getPos(e,s),u=n.setVis(!isNaN(d));if(null==o||o.setVis(u),u&&(n.setHLine(d,0,t),o)){switch(r.prop("align")){case"center":c=(t-a.width)/2-h;break;case"right":c="outside"!==r.prop("position")?t-a.width-h:t+h;break;default:c="outside"!==r.prop("position")?h:-1*(a.width+h)}switch(r.prop("verticalAlign")){case"bottom":_=d+l;break;case"middle":_=d-a.height/2-l;break;default:_=d-a.height-l}}}(null==o?void 0:o.visible)&&o.trans(c,_)}_doLayoutPolar(t,e,i){const s=this.model,r=this._line,n=this._labelView.setVis(s.axis.contains(s.prop("value"))&&s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=ts(i,s.axis),h=i.rdInner+s.axis.getPos(a,s.prop("value"));r.setArc(i.cx,i.cy,h,o,s.axis.getTotalAngle(),!1),r.setStyle(St,"none"),n&&n.trans(i.cx+h*d(i.start),i.cy+h*u(i.start))}}class Zh extends Xh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Nn:fs)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.prop("position"))?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:i,endValue:s}={startValue:e.prop("startValue"),endValue:e.prop("endValue")},r=!h(i)&&!h(s);this._range=r?e.axis.trimRange(g(i,s),f(i,s)):[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 i=this.model,s=i.label,r=this._box,[n,o]=this._range,a=this._labelView.setVis(s.visible)?this._labelView:null,h=this._labelView.getBBox(),l=s.num("offsetX"),c=s.num("offsetY");if(this.vertical()){const _=i.axis.getPos(t,n),d=i.axis.getPos(t,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(d!==_);if(null==a||a.setVis(u),u){let i,n;switch(s.prop("align")){case"center":i=_+(d-_-h.width)/2+l;break;case"right":i=d-h.width-l;break;default:i=_+l}switch(s.prop("verticalAlign")){case"bottom":n="outside"!==s.prop("position")?e-h.height-c:e+c;break;case"middle":n=(e-h.height)/2-c;break;default:n="outside"!==s.prop("position")?c:-1*(h.height+c)}r.setBox(_,0,d,e),a&&a.trans(f(0,g(t,i)),n)}}else{const _=e-i.axis.getPos(e,n),d=e-i.axis.getPos(e,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(_!==d);if(null==a||a.setVis(u),u){let e,i;switch(s.prop("align")){case"center":e=(t-h.width)/2-l;break;case"right":e="outside"!==s.prop("position")?t-h.width-l:t+l;break;default:e="outside"!==s.prop("position")?l:-1*(h.width+l)}switch(s.prop("verticalAlign")){case"bottom":i=_-h.height-c;break;case"middle":i=d+(_-d-h.height)/2-c;break;default:i=d+c}a&&a.trans(e,i),r.setBox(0,d,t,_)}}}_doLayoutPolar(t,e,i){const s=this.model,r=this._box,n=this._labelView.setVis(s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=ts(i,s.axis),h=i.rdInner+s.axis.getPos(a,this._range[0]),l=i.rdInner+s.axis.getPos(a,this._range[1]);if(r.setSector({cx:i.cx,cy:i.cy,rx:l,ry:l,innerRadius:h/l,start:o,angle:b,clockwise:!0}),n){const t=h+(l-h)/2;n.trans(i.cx+t*d(i.start),i.cy+t*u(i.start))}}}class qh extends Se{constructor(){super(...arguments),this._views=new Ro(this,Pe)}prepare(){this._rows=[]}addAll(t,e){const i=this._rows;e.forEach(t=>{i.push(...t.grid.rows.getRows())})}layout(t,e){const i=this._rows;this._views.prepare(i.length),this._views.forEach((s,r)=>{const n=i[r],o=n.axis,a=Math.max(o.valueMin(),n.from),h=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const i=f(0,g(t,o.getPos(t,a))),r=f(0,g(t,o.getPos(t,h)));s.setPath(ps.rectangle(i,0,r-i,e))}else{const i=f(0,g(e,o.getPos(e,a))),r=f(0,g(e,o.getPos(e,h)));s.setPath(ps.rectangle(0,e-i,t,i-r))}s.internalClearStyleAndClass(),s.setFill("none"),s.setFill(n.color),n.style&&s.internalSetStyleOrClass(n.style)})}}class Kh 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 Zh?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,i){e.forEach(e=>{let s;e instanceof Vi?s=this._rangePool.pop()||new Zh(t,i):e instanceof Si&&(s=this._linePool.pop()||new Uh(t,i)),this.add(s),s.prepare(t,e)})}add(t){return this._views.push(t),super.add(t)}}class Qh extends Pe{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,i,s,r,n=!1){const o=this.model.axis,a=o._isHorz,h=new ye;if(this._bar){const l=o._isHorz?s:r;let _;if(t?_=t.point.xValue:(this.model.prop("showAlways")||n)&&(_=o.prop("reversed")?o.xValueAt(a?s-e:i):o.xValueAt(a?e:r-i)),o instanceof Is&&(_=c(_)),!isNaN(_)){const t=o.getPos(l,_);let e=o.getUnitLen(l,_);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,s,e)}}else(t||this.model.prop("showAlways")||n)&&(a?h.vline(e,0,r):h.hline(i,0,s));this.setPath(h.end())}}class Jh extends ta{constructor(t){super(t,"Reset Zoom",Jh.CLASS_NAME),this.setVis(!1)}}Jh.CLASS_NAME="rct-reset-zoom";class tl 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 Wo(t,"rct-empty-view-label"))}layout(t,e,i){this.setStyleOrClass(t._style),"background"===t.prop("effect")&&this._backView.setStyleOrClass(t.prop("backgroundStyle")),this._backView.resize(e,i);const s=this._labelView;t.buildSvg(s._text,s._outline,e,i,null,null),s.layout("center");const r=s.getBBox();s.trans((e-r.width)/2,(i-r.height)/2)}}class el extends Se{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Ro(this,cn)}layout(t,e,i,s,r,n){const o=e.model,a=o.axis,{side:h,base:l}=s,c=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(c.length,(e,s)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),i?e.setLine(0,n-c[s],r,n-h-c[s]):e.setLine(c[s]+l,0,c[s],n)})}}class il extends Se{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new Pe(t)),this.add(this._gridContainer=new Se(t,"rct-body-depth-grids")),this.add(this._lineView=new cn(t,"rct-body-depth-side-line")),this.add(this._endView=new cn(t,"rct-body-depth-side-line"))}layout(t,e,i,s,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,i,s,n,o),this.$_renderGrids(t,e,r,i,s,n,o)}$_renderBack(t,e,i,s,r,n){const{side:o,base:a}=s,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)),i?(t.setPath(ps.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(ps.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,i,s,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())i.has(t)||(h.delete(t),e.remove());for(const[l,c]of i.entries())if(l._isX===this.isX){let i=h.get(l);i||(i=new el(t),h.set(l,i),a.add(i)),i.layout(e,c,s,r,n,o)}}}class sl extends Se{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new il(t,!0)),this.add(this._ySideView=new il(t,!1)),this.add(this._orgLineView=new cn(t,"rct-body-depth-org-line"))}render(t,e,i,s,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,c=this._ySideView;l.setVis(i.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,i.xSide,e,r,s)),c.setVis(i.ySide.visible)&&(e?c.setBounds(0,o-h,n,h):c.setBounds(0,0,a,o),c.layout(t,i.ySide,!e,r,s)),this._orgLineView.setVis(i.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class rl extends Fo{constructor(t,e){super(t,rl.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 Pe(t,"rct-body-background")),this.add(this._depthLayer=new sl(t)),this.add(this._image=new jo(t,!0,"rct-body-image")),this.add(this._emptyView=new tl(t)),this.add(this._gridRowContainer=new qh(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 Kh(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 Kh(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 Jh(t)),this._crosshairViews=new Ro(this._feedbackContainer,Qh)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,i){const s=e.chart,r=e.depth.visible;this._animatable=xe._animatable&&s.animatable(),this._polar=i,this._prepareSeries(t,e,s._getSeries().getVisibleSeries(),r),s._getGauges()&&this._prepareGauges(t,s,s._getGauges().getVisibles()),this._prepareAnnotations(t,s._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,i){return this._depthExt=t._body._getDepth(e,i)}pointerMoved(t,e){const i=this.width,s=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<i&&t.y>=0&&t.y<s;let l,c;if(Ra.isPointDom(e))for(let t=a-1;t>=0;t--)if(c=o[t].pointByDom(e),c){l=o[t];break}const _=null==e?void 0:e.classList,d=(null==_?void 0:_.value)&&(_.contains("rct-contextmenu-item")||_.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach(e=>{e.setVis(u)&&e.layout(c,t.x,t.y,i,s)}),c)this.$_setFocused(l,c,t);else if(a>0){const e=this.chart().general.pointHovering.getHintDistance(null==l?void 0:l.model);let i,s,c=!n;for(const t of o)if(!(t.model instanceof fn)){c=!1;break}if(l=null,c)if(a>1){const n=[];o.forEach(o=>{i=A(o.getHintDistance(),e),s=o.getNearest2(t.x,t.y,r),n.push({hint:i,sv:o,pv:s})});const a=n.reduce((e,i)=>{if(!e.pv||!i.pv)return e||i;const s=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=s*s+r*r,o=i.pv.pv.point.xPos-t.x,a=i.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:i});l=a.sv,s=a.pv,i=a.hint}else l=o[0],i=A(l.getHintDistance(),e),s=l.getNearest2(t.x,t.y,r);else o.forEach(r=>{if(r.getHintDistance&&(i=A(r.getHintDistance(),e),i>0)){const e=r.getNearest(t.x,t.y);(!s||e.dist<s.dist)&&(l=r,s=e)}});h&&s&&l.canHover(s.dist,s.pv,i)?this.$_setFocused(l,s.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,i){const s=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=n&&!1!==n.prop("interactive"),a=this.chart().general.pointHovering,h=this._focused,l=this._siblings,c=this._siblingSeries;let _,d,u;if(o&&e&&a.visible)switch(a.getScope(n,e.point)){case"axis":u=n._xAxisObj.getSeries();case"group":u||(u=n._group.getVisibleSeries());const r=u.map(t=>{if(t instanceof wr){let e,s=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof In){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:s,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,s,r);o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2)-a}else o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2);o<s&&(s=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)});_=u.map(t=>s.getSeriesView(t)),d=[],r.forEach((t,e)=>{d.push(_[e].getPointView(t))});break;default:_=[t],d=[e]}let p=[];if(_&&_.forEach((t,e)=>{p.push(...t.getSiblings(d[e]))}),p=p.length>1?p.sort((t,e)=>t.hash-e.hash):p.length>0?p:null,z.equalArrays(l,p)||(_&&_.forEach((t,e)=>{t.focusPoints(t.getSiblings(d[e]))}),c&&c.forEach(t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)}),this._siblingSeries=_,this._siblings=p),e!==h){let i=this._focusedSeries;this._focused=e,t!==i&&(i&&this.$_focusSeries(i,!1),this._focusedSeries=t,o&&this.$_focusSeries(t,!0),o&&r.general.prop("seriesHovering")&&this.$_hoverSeries(t))}this._focused&&o&&(this._focused!==h||!s.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?i.x>0&&i.x<this.width&&i.y>0&&i.y<this.height?s.showTooltip(n,e,[],this,i):s.hideTooltip():!this._focused&&s.tooltipVisible()&&s.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(Ra.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Ra.DATA_UNHOVER,t&&e!==t)})}hoverPoint(t){const e=this.chart().seriesByPoint(t),i=this.getSeries(e);i?(i.hoverPoint(t),this._hoverPointSeries.push(i)):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.hideCrosshairs(),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)}getConnectedAxes(){const t=new Set;return this._seriesViews.forEach(e=>{const i=e.model._xAxisObj,s=e.model._yAxisObj;i&&t.add(i),s&&t.add(s)}),Array.from(t)}showAxisCrosshair(t,e,i){const s=this.width,r=this.height;this._crosshairViews.forEach(n=>{n.model.axis===t?n.setVis(!0)&&n.layout(null,e,i,s,r,!0):n.setVis(!1)})}hideCrosshairs(){this._crosshairViews.forEach(t=>t.setVis(!1))}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,i,s){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-s:t),l=o.valueAt(a,n?a-e:i);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 Ua&&e.endHover(t,!1),e.setBoolData(Ra.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,i,s,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:i,l=a?a.hBody:s;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,i)=>{e.measure(t,this._series[i],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,i)=>{e.measure(t,this._gauges[i],h,l,r)}),this._annotationViews.forEach((e,i)=>{e.measure(t,this._annotations[i],h,l,r)}),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:i,height:s}}_clipSeries(t,e,i){const s=i?this._seriesClip:this._seriesClip2;t&&t.setClip(s),e&&e.setClip(s)}_renderBackground(t,e,i){t.setPath(ps.rectangle(0,0,e,i))}_setImage(t,e,i,s){if(e.setVis(t.visible&&!!t.prop("url")))return e.setImage(t.prop("url"),i,s),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const i=this._depthExt,s=this.width,r=this.height;let n=i?i.wBody:s,o=i?i.hBody:r,a=i?i.base:0;if(this._inverted){const t=i?i.side:0;this._seriesClip.setBounds(-t,-n,r,s),this._seriesClip2.setBounds(-t,0,s,r)}else this._seriesClip.setBounds(-a,0,s,r),this._seriesClip2.setBounds(-a,0,s,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&&i&&i.depth>0),this._seriesViews.forEach(t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(i),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,i,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,i=e.axis;t.setStyleOrClass(e._style),i._isHorz?i.prop("reversed")?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):i.prop("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,i){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,i))}$_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(oa[e._type()])(t)}$_prepareGrids(t,e){const i=e._needAxes(),s=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())i&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())i&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof jr)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));if(i){const i=new Set,l=[],c=t=>{t&&!i.has(t)&&(i.add(t),l.push(t))};e._getXAxesAtPane(a,h,!0).forEach(c),e._getYAxesAtPane(a,h,!0).forEach(c),this.getConnectedAxes().forEach(t=>{t.checkVisible()&&c(t)}),l.forEach(e=>{const i=e.grid;if(!r.has(e)&&(i.visible||i.prop("firstVisible")||i.prop("lastVisible"))){const i=new Wh(t);r.set(e,i),s.add(i)}if(e instanceof jr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const i=new cn(t,"rct-axis-baseline");o.set(e,i),n.add(i),i.tag=e}})}}_prepareSeries(t,e,i,s){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=s?e.depth:null;for(const t of o.keys())i.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=i,a.forEach(t=>{i.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())}),a.length=0,i.forEach(e=>{const i=o.get(e)||jh(t,e);i._setChartOptions(n,this._animatable,r.loadAnimatable()),i.parent||(this._seriesContainer.add(i),this._labelContainer.add(i._labelContainer)),o.set(e,i),a.push(i),i.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,i){const s=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())i.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=i,o.forEach(t=>t.remove()),o.length=0,i.forEach(i=>{const a=n.get(i)||this.$_createGaugeView(t,i);s.add(a),n.set(i,a),o.push(a),a.prepareGauge(t,i),a._setChartOptions(r,this._animatable,e.loadAnimatable())})}_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Gh(t,e);(e.prop("front")?s:i).add(o),r.set(e,o),n.push(o)})}$_prepareAxisBreaks(t,e){const i=this._axisBreakContainer,s=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 jr&&o.push(...t._getBreaks())}));s.length<o.length;){const e=new Yh(t);i.add(e),s.push(e)}for(;s.length>o.length;)s.pop().remove();s.forEach((t,e)=>t.setModel(o[e]))}$_prepareCrosshairs(t){const e=this._crosshairViews,i=this.getCol(),s=this.getRow(),r=[],n=new Set,o=t=>{const e=null==t?void 0:t.crosshair;e&&e.visible&&!n.has(e)&&(n.add(e),r.push(e))};t._needAxes()&&(this.getConnectedAxes().forEach(o),t._getXAxesAtPane(i,s,!0).forEach(o),t._getYAxesAtPane(i,s,!0).forEach(o)),e.prepare(r.length,(t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)})}_layoutAnnotations(t,e,i,s){this._annotationViews.length>0&&this._annotationViews.forEach(r=>{r._layoutView(t,e,0,0,i,s),!this._polar&&r.model.needClip()&&r.resetClip(this.control,i,s)})}}rl.BODY_CLASS="rct-body";class nl extends we{constructor(t){super(t,ol.HANDLE_STYLE),this.add(this._back=new gs(t)),this.add(this._shape=new Pe(t)),this._shape.setFill("white")}layout(t,e,i){if(t!==this._w||e!==this._h||i!==this._vertical){const s=2*Pr.HANDLE_RADIUS,r=new ye;this._back.rect={x:-s/2,y:-s/2,width:s,height:s,rx:s/2};const n=s/3;r.polygon(-n-1,0,-1,-n,-1,n),r.polygon(n+1,0,1,-n,1,n),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=i}}}class ol extends Fo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(ol.HANDLE_STYLE)}static isMask(t){return t.classList.contains(ol.MASK_STYLE)}constructor(t){super(t,ol.CLASS_NAME),this.add(this._back=new gs(t,ol.BACK_STYLE)),this.add(this._container=new Se(t,null)),this.add(this._mask=new gs(t,ol.MASK_STYLE)),this.add(this._trackView=new gs(t,ol.TRACK_CLASS)),this.add(this._thumbView=new gs(t,ol.THUMB_CLASS)),this.add(this._startHandle=new nl(t)),this.add(this._endHandle=new nl(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,i,s,r){const n=e._naviChart;let o,a,h=i,l=s;return e._vertical?(h=e.getSize(),o=e.getThickness(),a=s):(l=e.getSize(),o=i,a=e.getThickness()),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:h,height:l}}_doLayout(t){const e=this.model,i=e.axis()._zoom,s=e.mask,r=e.handle,n=this.width,o=this.height;if(this._back.resize(n,o),e._vertical);else{const t=i?(i.start-i.min)*n/i.total():0,e=i?(i.end-i.min)*n/i.total():n;this._mask.setVis(s.prop("visible"))&&(this._mask.setBounds(t,0,e-t,o),this._mask.setStyleOrClass(s._style));const a=Pr.HANDLE_TRACK_HEIGHT,h=Pr.HANDLE_TRACK_OFFSET;if(this._trackView.setBounds(-2,o,n+4,a),this._trackView.setRadius(4),this._thumbView.setBounds(t,o,e-t,a),this._startHandle.setVis(r.prop("visible")),this._endHandle.setVis(r.prop("visible")),this._startHandle.visible&&this._endHandle){const i=2*Pr.HANDLE_RADIUS;this._startHandle.layout(i,i,!1),this._startHandle.trans(t,o+h),this._endHandle.layout(i,i,!1),this._endHandle.trans(e,o+h),this._startHandle.setStyleOrClass(r._style),this._endHandle.setStyleOrClass(r._style)}}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,n,o,1),this._seriesView.resize(n,o),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,n,o,1),this._xAxisView.resize(n,o),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const i=e.firstSeries;let s=this._seriesView;s&&s.model!==i&&(s.remove(),s=this._seriesView=null),s||(this._container.add(s=this._seriesView=jh(t,i)),s._simpleMode=!0),s&&s.prepareSeries(t,i,!1,null)}$_prepareXAxisView(t,e){const i=e.xAxis;let s=this._xAxisView;s&&s.model!==i&&(s.remove(),s=this._xAxisView=null),s||(this._container.add(s=this._xAxisView=new Jo(t)),s._simpleMode=!0)}$_prepareYAxisView(t,e){const i=e.yAxis;let s=this._yAxisView;s&&s.model!==i&&(s.remove(),s=this._yAxisView=null),s||(this._container.add(s=this._yAxisView=new Jo(t)),s._simpleMode=!0)}}ol.CLASS_NAME="rct-navigator",ol.BACK_STYLE="rct-navigator-back",ol.MASK_STYLE="rct-navigator-mask",ol.HANDLE_STYLE="rct-navigator-handle",ol.HANDLE_BACK_STYLE="rct-navigator-handle-back",ol.TRACK_CLASS="rct-navigator-track",ol.THUMB_CLASS="rct-navigator-thumb";class al extends Ne{constructor(t){super(),this.chart=t}}class hl extends al{constructor(t,e,i){super(t),this._body=e,this._vertical=i}_doStart(t,e,i,s,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=f(0,e-(o.x-n.x)),this._yStart=f(0,i-(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 i=this.chart.getBounds(),s=this._body.getBounds();this._vertical?(e=f(0,g(s.height,e-(s.y-i.y))),this._body.setZoom(0,g(f(0,this._yStart),e),this._body.width,f(g(this._yStart,s.height),e))):(t=f(0,g(s.width,t-(s.x-i.x))),this._body.setZoom(f(0,g(this._xStart,t)),0,f(g(this._xStart,s.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,i,s,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=f(0,g(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,g(this._yStart,r),this._body.width,m(this._yStart-r))):(s=f(0,g(o.width,s-(o.x-n.x))),this._feedback.setBounds(g(this._xStart,s),0,m(this._xStart-s),this._body.height)),!0}}class ll extends al{constructor(t,e){super(t),this._view=e}_doStart(t,e,i,s,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?i-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,i,s,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(s,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(s,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class cl extends al{constructor(t,e,i){super(t),this._view=e,(this._isStart=e._startHandle.contains(i))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,i,s,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?i-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,i,s,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(s,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,c=n.model.prop("minSize"),_=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(_,NaN,c):o.zoom(l,NaN,c):a>0&&a<n.width?o.zoom(NaN,_,c):a>=n.width&&o.zoom(NaN,o._zoom.max,c),!0}}class _l extends al{constructor(t,e,i){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,i,s,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?i-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,i,s,r){const n=this._view,o=n.svgToElement(s,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=f(0,g(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class dl{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const i=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,i.x,i.y),this._prevX=this._clickX=i.x,this._prevY=this._clickY=i.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),i=t.target,{x:s,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const i=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(i?this.$_doDrag(t,n,s,r):(!this._dragTracker&&(m(this._clickX-s)>3||m(this._clickY-r)>3)||this._dragTracker&&!i)&&this.$_startMove(t,n,s,r))}else this.$_stopDragTracker(t,i,s,r,!0);this._prevX=s,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(i)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;if(!this._chart.model.clickable())return;const i=this._chart.model,s=this._chart.chartView(),r=this._clickElement,n=s.getButton(r);let o,a,h,l,c;const _=this._chart.chart.exporter;if(_.isContextMenuVisible()&&_.toggleContextMenu(),n)!0!==n.click()&&s.buttonClicked(n);else if(a=s.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:i.wrapper,source:a.legend.getSources(a)})){const t=z.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach(t=>{if(t instanceof Ms){const e=t,r=i.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=s.findSeriesView(r);t instanceof Ka&&t.togglePointVisible(e)}}else t.visible=e}),s.bodyView().hoverSeries(e?a.source:null)}}else(h=s.seriesByDom(r))?h.clicked(r):(c=s.htmlButtonByDom(r))?c.click():(l=s.annotationByDom(r))?l.clicked():(o=s.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,i=this._clickElement;!e.visible||e.dblClick(i)}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,i){const s=this._chart.chartView(),r=s.bodyOf(t);return Ko.isThumb(t)?new ll(this._chart,s.getScrollView(t)):ol.isHandle(t)?new cl(this._chart,s._navigatorView,t):ol.isMask(t)&&r&&r.model.isZoomed()?new _l(this._chart,s._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new hl(this._chart,r,s._inverted):void 0}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(t,e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){this.$_startDrag(e,this._prevX,this._prevY,i,s)&&(i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,i,s,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,s-e,r-i)),this._dragTracker){if(this._dragTracker.start(t,e,i,s,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,i,s),this._dragTracker=null)}}class ul extends Se{constructor(t){super(t,ul.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,i){if(this.setVis(i&&i.length>0)){const s=this._itemViews,r=this._separators;for(;s.length<i.length;){const i=new Oe(e,"rct-history-item");i.anchor=t.TextAnchor.START,s.push(i)}for(;s.length>i.length;)s.pop().remove();for(;r.length<i.length-1;){const i=new Oe(e);i.anchor=t.TextAnchor.START,i.text=">",r.push(i)}for(;r.length>i.length-1;)r.pop().remove();this.$_layout(i)}}$_layout(t){const e=this._itemViews,i=this._separators,s=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+s,i[o].transX(n),n+=i[o].width+s)}}ul.TITLE_CLASS="rct-history";class pl extends Fo{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new gs(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Oe(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.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,i,s,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.prop("markerVisible"))?this._marker.getBBox():W,l=Y(this._label.getBBox());return this._gap=e.legend.num("markerGap"),{width:h.width+this._gap+l.width,height:f(h.height,l.height)}}_doLayout(t){const e=this._rMarker,i=A(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.getBBox().height)/2)}}class gl extends zo{constructor(t){super(t,gl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Ro(this,pl)}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.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){const n=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=A(e.prop("itemsPerLine"),Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?e.num("gap"):0,o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this.$_prepareItems(t,n),this.$_measure(t,e,o,this._ipr,i,s)}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("useTextColor"),s=this._sizes,r=t.prop("itemsAlign"),n=t.num("lineGap"),o=t.num("itemGap"),a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,_=a.top+h.top;let d,u=c,p=_;this._itemViews.forEach(t=>{const e=t.model.source,s=e.legendColor(),r=e.legendStroke();t._marker.setColor(s),r&&t._marker.setStroke(r),i&&e.visible?t._label.setFill(s):t._label.setFill("")}),e.forEach((t,e)=>{l?(t.forEach(t=>{t.mw=s[e],t.resizeByMeasured().layout(this._wMarkers[e])}),p=_,"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+=s[e]+n):(t.forEach(t=>{t.resizeByMeasured().layout(NaN)}),u=c,"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+=s[e]+n)})}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.items(),a=this._itemViews,h=e.num("itemGap"),l=e.num("lineGap"),c=e.getMarkerSize(),_=a.count,d=this._rowViews=[],u=this._sizes=[];let p,g,m,y;a.forEach((e,i)=>{e.setMarker(o[i].source.legendMarker(t,c)),e.measure(t,o[i],r,n,1)});let b=0,x=0;if(i){for(;b<_;)y=a.get(b),x%s===0?(d.push(m=[y]),g=y.mh,x++,b++):(g+=h+y.mh,g<=n?(m.push(y),x++,b++):x=0);this._wMarkers=[],p=g=0,d.forEach((t,e)=>{let i=0,s=0,r=0;t.forEach(t=>{s+=t.mh,i=f(i,t.mw),r=f(r,t._rMarker.width),t._col=e}),s+=h*(t.length-1),g=f(g,s),p+=i,u.push(i),this._wMarkers.push(r)}),p+=l*(d.length-1)}else{for(;b<_;)y=a.get(b),x%s===0?(d.push(m=[y]),p=y.mw,x++,b++):(p+=h+y.mw,p<=r?(m.push(y),x++,b++):x=0);p=g=0,d.forEach(t=>{let e=0,i=0;t.forEach(t=>{e+=t.mw,i=f(i,t.mh)}),e+=h*(t.length-1),p=f(p,e),g+=i,u.push(i)}),g+=l*(d.length-1)}return{width:p,height:g}}}gl.LEGEND_CLASS="rct-legend";class fl extends we{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new ea(t))}layout(){}}class ml extends we{constructor(t,e,i,s){super(t,e),this.add(this._markContainer=new Se(t,"rct-polar-axis-markers")),this._markViews=new Ro(this._markContainer,fl),this.add(this._gridContainer=new we(t,"rct-polar-axis-grids")),this._labelViews=new Ro(this._labelContainer=i,Zo,s?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,i,s){this._model=e,this._circular=i,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,i,s)}layout(t,e,i,s){const r=this._model._ticks;return this._doLayout(this._model,e,i,s,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,i,s){const r=i.getLabelText(e,s),n=e.label,o=i.getLabelStyle(e,s);if(t.value=e.value,null!=r){n&&r.match(Qo)?t.setLabel(i,o,e,r.replace(Qo,n),1e3,1e3):(i.prepareRich(r),i._paramTick=e,i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const i=e.label;if(i.visible&&e.checkVisible()){const t=e._ticks;i.chart._body.getPolar(e),i.prop("rotation");const s=t.length;this._labelContainer.setStyleOrClass(i._style),this._labelViews.prepare(s,(e,s,r)=>{e.setVis(!0),this._prepareLabel(e,t[s],i,r)})}else this._labelViews.forEach(t=>t.setVis(!1))}prepareGuides(t,e,i){let s=this._model.guides.filter(t=>!t.prop("front"));e.setAll(t,s,!0),s=this._model.guides.filter(t=>t.prop("front")),i.setAll(t,s,!0)}}class yl extends ml{constructor(t,e,i){super(t,"rct-polar-xaxis",i,!0),this._gridLines=new Ro(this._gridContainer,cn,yl.GRID_CLASS),e.insertFirst(this._startView=new cn(t,yl.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new cn(t,yl.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new sa(t,yl.LINE_CLASS))}_doPrepare(t,e,i){const s=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(s.visible)&&(n.setStyleOrClass(s._style),n.setFill("none")),this._startView.setVis(i&&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,i,s,r,n){const o=t.getStartAngle(),a=t.getTotalAngle(),h=t.chart._body.getPolar(t).rdInner;if(r.forEach(t=>t.pos=t.pos/s*a/b),this._gridContainer.visible&&this._gridLines.forEach((n,a)=>{const l=r[a].pos,c=e+d(o+l)*s,_=i+u(o+l)*s,p=e+d(o+l)*h,g=i+u(o+l)*h;n.setFill("none"),n.setLine(p,g,c,_),n.setStyleOrClass(t.grid.prop("style"))}),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=s+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",c=[],_=t.label.prop("rotation")||0,p="auto"===_;this._labelViews.forEach((t,s)=>{if(t.setVis(s%a===0)){t.layout(l);const n=r[s],a=t.getBBox(),g=t.angle=o+n.pos,f=(g*v%360+360)%360,m=f>90&&f<270;if(p){const s=e-a.width/2+d(g)*(h+a.width/2),r=i-a.height/2+u(g)*(h+a.width/2);t.trans(s,r),t.setRotation(a.width/2,a.height/2,m?g*v+180:g*v)}else{const s=e+d(g)*(h+a.width/2)-a.width/2,r=i+u(g)*(h+a.height/2)-a.height/2;t.trans(s,r),t.setRotation(a.width/2,a.height/2,_)}c.push(t)}});let g=0,f=c[g];for(let t=1;t<c.length;t++){const e=c[t],i=f.inflateBBox(-1,-1),s=e.inflateBBox(-1,-1),r=Object.assign(i,{rotation:f.rotation}),n=Object.assign(s,{rotation:e.rotation});if(ga(r,n)?(e.setVis(!1),c.splice(t,1),--t):(f=e,g=t),t===c.length-1&&c.length>1){if(st.diffAngle(f.angle,c[0].angle)<b/6){const t=Object.assign(c[0].inflateBBox(-1,-1),{rotation:c[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});ga(t,e)&&(f.setVis(!1),c.splice(g,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,i,s,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+d(o)*s,i+u(o)*s),r.map(t=>{const r=t.pos;h.push(e+d(o+r)*s,i+u(o+r)*s)}),n&&r[r.length-1].pos<a&&h.push(e+d(o+a)*s,i+u(o+a)*s),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e+d(o)*h,i+u(o)*h,e+d(o)*s,i+u(o)*s),this._endView.setLine(e+d(o+a)*h,i+u(o+a)*h,e+d(o+a)*s,i+u(o+a)*s))}}yl.LINE_CLASS="rct-polar-xaxis-line",yl.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",yl.GRID_CLASS="rct-polar-xaxis-grid-line";class bl extends ml{constructor(t,e,i){super(t,"rct-polar-yaxis",i,!1),this._gridViews=new Ro(this._gridContainer,sa,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new cn(t,"rct-polar-yaxis-line")),e.add(this._baseView=new sa(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,i,s){const r=t.line,n=t instanceof jr&&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,i,s,r,n){const o=t.chart._body.getPolar(t),a=o.rdInner,h=ts(o,t);function l(t,s){if(t.setFill("none"),c)t.setArc(e,i,s,g,f,!0);else{const r=[];p&&_[0].pos>0&&r.push(e+d(g)*s,i+u(g)*s),_.forEach(t=>{const n=t.pos;r.push(e+d(g+n)*s,i+u(g+n)*s)}),p&&_[_.length-1].pos<f&&r.push(e+d(g+f)*s,i+u(g+f)*s),t.setPolyline(r)}}const c=this._circular,_=n._ticks,p=n.isArced(),g=n.getStartAngle(),f=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach((e,i)=>{l(e,a+r[i].pos),e.setStyleOrClass(t.grid.prop("style"))}),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",s="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(p){const t=n.getStartAngle();this._labelViews.forEach((n,h)=>{const l=n.getBBox(),c=a+r[h].pos;n.setContrast(null).trans(e+d(t)*c-l.width*s+o,i+u(t)*c-l.height/2)})}else this._labelViews.forEach((t,n)=>{const h=t.getBBox();t.setContrast(null).trans(e-h.width*s+o,i-(a+r[n].pos)-h.height/2)})}this._lineView.visible&&(p?this._lineView.setLine(e+a*d(g),i+a*u(g),e+s*d(g),i+s*u(g)):this._lineView.setVLine(e,i-a,i-s)),this._baseView.visible&&l(this._baseView,a+t.getPos(h,t.getBaseValue()))}}class xl extends rl{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,i,s,r){const n=e.chart,o=super._doMeasure(t,e,i,s,r);return this._circular=this.model.prop("circular"),this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,i){const{cx:s,cy:r,rd:n,rdInner:o}=this.model.getPolar(null);t.setPath(o>0?ps.donut(s,r,n,o):ps.circle(s,r,n))}_setImage(t,e,i,s){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,i=this.model.setPolar(t,e),{cx:s,cy:r,rd:n,rdInner:o}=i.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(i.image,this._image,t,e),this._layoutInnerText(i,s,r,o),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(s,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(i.chart.yAxis,s,r,n),this._yAxisViews.forEach(t=>{t.layout(i.chart.xAxis,s,r,n)}),[this._guideContainer,this._frontGuideContainer].forEach(t=>{t._views.forEach(t=>t.visible&&t.layout(this.width,this.height,i.getPolar(t.model.axis)))}),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(i,t,e)}_prepareInnerText(e){this._innerTextView||(this.add(this._innerTextView=new Wo(e,"rct-polar-body-inner")),this._innerTextView._text.anchor=t.TextAnchor.MIDDLE)}_layoutInnerText(t,e,i,s){var r;const n=t.innerText;if(!(null===(r=this._innerTextView)||void 0===r?void 0:r.setVis(t.hasInner()&&n.visible)))return;this._innerTextView.setModel(this.doc,n,n.getIconUrl(),null),n.buildSvg(this._innerTextView._text,this._innerTextView._outline,2*s,2*s,t,null),this._innerTextView.layout("center"),this._innerTextView.setContrast(null);const o=this._innerTextView.getBBox();this._innerTextView.trans(e-o.x-o.width/2,i-o.y-o.height/2)}_prepareAxes(t,e,i,s,r){if(this._prepareInnerText(t),!this._xAxisContainer){const e=this._image,i=this._axisBreakContainer;this.insertAfter(this._xAxisLabelContainer=new Se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),i),this.insertAfter(this._yAxisLabelContainer=new Se(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),i),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<i.length;){const e=new bl(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>i.length;)n.pop().remove();n.forEach((e,n)=>{e.setVis(!0),e.prepare(t,i[n],s,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)}),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new yl(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,s,r))}}class wl extends zo{constructor(t,e){super(t,e?wl.SUBTITLE_CLASS:wl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Oe(t)),this._richText=new je}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null),Y(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}wl.TITLE_CLASS="rct-title",wl.SUBTITLE_CLASS="rct-subtitle";class vl extends we{constructor(e){super(e,"rct-tooltip-row"),this._hasMarker=!0,this.add(this._marker=new Pe(e,"rct-tooltip-row-marker")),this.add(this._textView=new Oe(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new Oe(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,i,s,r){var n;const o=e.getMarkerSize(),a=o+e.getMarkerGap(),h=e.hasListMarker();if(this._hasMarker=h,h){const t=ps.getDrawer(e.prop("listMarkerShape")||"circle");this._marker.setVis(!0),this._marker.setPath(t(o/2)),this._marker.setFill((null===(n=s.legendColor)||void 0===n?void 0:n.call(s))||"")}else this._marker.setVis(!1);r[0]?(i.setFormat(r[0]),i.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a)):this._textView.text="",r[1]?(i.setFormat(r[1]),i.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+this._textView.getBBox().width+A(e.prop("listGap"),4))):this._detailView.text=""}alignDetail(t){if(this._detailView.transX(t-this._detailView.getBBox().width),this._hasMarker){const t=this._marker.getBBox();this._marker.trans(t.width/2,this.r.height/2)}}}class Sl extends we{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new Oe(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new Se(e,"")),this.add(this._footerView=new Oe(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new Ro(this._rowLayer,vl)}layout(t,e,i,s){const r=this._headerView,n=this._footerView,o=A(e.prop("listRowGap"),4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!s.header)&&(i.setFormat(s.header),i.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(s.items.length).forEach((r,n)=>{r.trans(0,h),r.layout(t,e,i,s.items[n],s.rows[n]),h+=r.getBBox().height+o,l=r._width=f(l,(r.r=r.getBBox()).width)}),n.setVis(!!s.footer)&&(i.setFormat(s.footer),i.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach(t=>{t.alignDetail(l)})}}class Vl extends we{constructor(e){super(e,Vl.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Pe(e,"rct-tooltip-back")),this.add(this._top=new Pe(e,"rct-tooltip-top")),this.add(this._textView=new Oe(e,"rct-tooltip-text")),this.add(this._listView=new Sl(e)),this._back.setAttr("filter","url(#"+xe.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new je,this.close(!0,!1)}show(t,e,i,r,n,o,a){const h=i.point,l=this._model=t.chart._tooltip,c=l.setTarget(t,h,r&&r.map(t=>t.point));if(!c)return;const _=c.isGroupTooltip();let d,u=this._list;if(_){u.header=u.footer="",u.items=[],u.rows=[];const e=c.getTooltipText(t,h,u);if(0===u.rows.length){if(d=s(e)?e.join(" "):e,!d||!d.trim())return;u.rows=u.items.map(()=>[d,""])}}else{const e=l.prop("text")||c.getTooltipText(t,h,null);if(d=s(e)?e.join(" "):e,!d||!d.trim())return}this.setStyleOrClass(l._style);const p=e.contentWidth(),m=e.contentHeight(),y=this._listView,b=this._textView,x=l.getHeaderHeight(),w=l.getTailSize(),v=t.chart.isInverted(),S=t._yAxisObj;let V,C,A,P=S.prop("reversed");t instanceof gr&&t.getBaseValue(S)>i.point.yValue&&(P=!P),_?(y.setVis(!0),b.setVis(!1),y.layout(e.doc(),l,this._richText,this._list),V=y.getBBox()):(y.setVis(!1),b.setVis(!0),this._richText.setFormat(d),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),V=b.getBBox()),C=f(l.num("minWidth"),V.width+16),A=f(l.num("minHeight"),V.height+12)+x;let k=t.getTooltipHeaderColor(h);null===k&&(k=t._calcedColor,t instanceof _r?(t.prop("legendByPoint")||t._colorByPoint())&&(k=h._calcedColor):t._colorByPoint()&&(k=getComputedStyle(i.dom).fill)),this._top.setFill(k);const L=this.isVisible()?300:0,T=l.num("offset")+w,N=a.getFocusPointView().getBounds(),M=e.dom().getBoundingClientRect();let E,B,O=!1;const D=l.isFollowPointer(t);if(v&&!t.isWidget)E=o-A/2-f(0,g(o-A/2,m-A)),O=D?P?C+T>n:n+C+T>p:P?C+T>N.x-M.x+N.width:N.x-M.x-T>p-C,O&&(P=!P),B=P?"left":"right",this.$_drawTooltip(0,0,C,A,B,E),P?n-=C+T:n+=T,o-=A/2;else{E=n-C/2-f(0,g(n-C/2,p-C));const t=D?o-e.getRootDistance().y:N.y-M.y-e._padding.top,i=D?m-o:M.bottom-N.bottom;if(t>=A+T||i>=A+T){(P?i>=A+T:t>=A+T)?B=P?"bottom":"top":(B=P?"top":"bottom",P=!P),this.$_drawTooltip(0,0,C,A,B,E),n-=C/2,P?o+=T:o-=A+T}else{E=o-A/2-f(0,g(o-A/2,m-A));const t=N.x-M.x;B=p-t>=C+T||t<C+T?"right":"left",this.$_drawTooltip(0,0,C,A,B,E),"right"===B?n+=T:n-=C+T,o-=A/2}}return n=f(0,g(n,p-C)),o=f(0,g(o,m-A)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,n-20),f(0,o-20)),this.transEx(n,o,L/2,!1)):this.transEx(n,o,L,!1),0===L&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:C,h:A}}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.prop("hideDelay"):Tr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){ue(this.dom,"opacity",void 0,0,200,()=>{this.setStyle("visibility","hidden")})}$_drawTooltip(t,e,i,s,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let c=["M",t+h,e,"L",t+i-h,e,"Q",t+i,e,t+i,e+h,"L",t+i,e+s-h,"Q",t+i,e+s,t+i-h,e+s,"L",t+h,e+s,"Q",t,e+s,t,e+s-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":c=c.concat(["M",t+i/2-a/2+n,e+s,"L",t+i/2+n,e+s+a,"L",t+i/2+a/2+n,e+s]);break;case"bottom":c=c.concat(["M",t+i/2-a/2+n,e,"L",t+i/2+n,e-a,"L",t+i/2+a/2+n,e]);break;case"left":c=c.concat(["M",t+i,e+s/2-a/2+n,"L",t+i+a,e+s/2+n,"L",t+i,e+s/2+a/2+n]);break;case"right":c=c.concat(["M",t,e+s/2-a/2+n,"L",t-a,e+s/2+n,"L",t,e+s/2+a/2+n])}const _="bottom"===r,d=_?["M",t,e+s-l,"l",i,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-i,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",i-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-i,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(i-p.width)/2,e+=(s-p.height+(_?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(c)}}Vl.CLASS_NAME="rct-tooltip";class Cl extends ve{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Vl(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,i,s,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,i,s,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 Al extends U{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDispose(){this._dom.remove(),this._dom=null,super._doDispose()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,i=se.isHoverAt(e),s=this._model=t;return se.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(s.num("width"))?s.prop("autoWidth")?e.style.width="max-content":e.style.width="":e.style.width=Ct(s.prop("width")),isNaN(s.num("height"))?e.style.height="":e.style.height=Ct(s.prop("height")),"custom"===s.prop("hintMode")?(s.prop("hint")?e.dataset.hint=s.prop("hint"):delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=s.prop("hint")||""),s.prop("imageUrl")?se.setStyles(this._img,{display:"",width:T(s.prop("imageWidth")),height:T(s.prop("imageHeight"))}):se.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(it?this._hovered:i),this._span.textContent=s.prop("text")||"",this}layout(t){const e=this._dom,i=e.style,s=this._model,r=s.prop("align"),n=s.prop("verticalAlign");i.left=T("left"===r?t.x+(s.prop("offsetX")||0):"right"===r?t.x+t.width-e.offsetWidth-(s.prop("offsetX")||0):t.x+(t.width-e.offsetWidth)/2+(s.prop("offsetX")||0)),i.top=T("top"===n?t.y+(s.prop("offsetY")||0):"bottom"===n?t.y+t.height-e.offsetHeight-(s.prop("offsetY")||0):t.y+(t.height-e.offsetHeight)/2+(s.prop("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"),i=t.createElement("div");return e.className="rct-html-button",se.setStyles(e,{position:"absolute",textAlign:"center"}),se.setStyles(i,{display:it?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(i),this._img=t.createElement("span"),this._img.className="rct-html-button-image",se.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),i.appendChild(this._img),this._span=t.createElement("span"),se.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),it&&se.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),i.appendChild(this._span),e}$_setImage(t){const e=this._model;e.prop("imageUrl")?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.prop("hoverImageUrl")||e.prop("imageUrl")})`:this._img.style.backgroundImage=`url(${e.prop("imageUrl")})`:this._img.style.backgroundImage=""}}class Pl extends Ho{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new wl(t,!1)),this.add(this.subtitleView=new wl(t,!0))}_doMeasure(t,e,i,s,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,c=0,_=0,d=this.titleView,u=i,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,i,s,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,i,s,r),_=this._hSub=a.height,c=this._wSub=a.width,g=o.num("titleGap")):d.setModel(o),o.prop("position")){case"leftSide":case"left":case"rightSide":case"right":p=f(l,_),u=h+g+c;break;default:p=l+g+_,u=f(u,h+c)}return p>0&&(p+=this.titleView.visible?n.getGap():o.getGap()),{width:u,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.visible?this._wTitle>t.wPlot||"chart"===s.prop("alignBase")?t.wChart:t.wPlot:0,o=r&&r.visible?this._wSub>t.wPlot||"chart"===r.prop("alignBase")?t.wChart:t.wPlot:0;let a=this._wTitle>t.wPlot||s&&"chart"===s.prop("alignBase")?0:t.xPlot,h=this._wSub>t.wPlot||r&&"chart"===r.prop("alignBase")?0:t.xPlot;if(n>0&&o>0){const t=(t,e,i)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},l=()=>{const e=f(this._hTitle,this._hSub);u=f(u,u+t(s,e,this._hTitle)),g=f(g,g+t(r,e,this._hSub))},c=(t,e,i)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},_=()=>{if(p=f(p,p+c(s,n,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":m=p;break;case"right":m=p+this._wTitle-this._wSub;break;default:m=p+(this._wTitle-this._wSub)/2}else m=f(m,m+c(r,o,this._wSub))},d=r.num("titleGap");let u=0,p=a,g=0,m=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"leftSide":case"left":p=m+this._wSub+d,l();break;case"rightSide":m=p+this._wTitle+d,l();break;case"right":switch(m=p+this._wTitle+d,r.prop("align")){case"center":m=f(m,m+(o-this._wTitle-this._wSub)/2);break;case"right":m=f(m,h+o-this._wSub)}l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}break;case"right":switch(r.prop("position")){case"leftSide":p+=n-this._wTitle,m=p-d-this._wSub,l();break;case"left":switch(p+=n-this._wTitle,r.prop("align")){case"center":m+=(n-this._wTitle-this._wSub)/2;break;case"right":m=p-d-this._wSub}l();break;case"rightSide":case"right":m+=o-this._wSub,p=m-d-this._wTitle,l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}break;default:switch(r.prop("position")){case"leftSide":p+=(n-this._wTitle)/2,m=p-this._wSub-d,l();break;case"left":switch(p+=(n-this._wTitle)/2,r.prop("align")){case"left":break;case"center":m+=(p-m-this._wSub)/2;break;case"right":m=p-this._wSub-d}l();break;case"rightSide":p+=(n-this._wTitle)/2,m=p+this._wTitle+d,l();break;case"right":switch(p+=(n-this._wTitle)/2,r.prop("align")){case"left":m=p+this._wTitle+d;break;case"center":m+=p+this._wTitle+d,m+=(o-m-this._wSub)/2;break;case"right":m+=o-d-this._wSub}l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}}const y=A(s.prop("offset"),0),b=A(r.prop("offset"),0);0!==y&&(p+="right"===s.prop("align")?-y:y,"leftSide"!==r.prop("position")&&"rightSide"!==r.prop("position")||(m+="right"===s.prop("align")?-y:y)),0!==b&&"leftSide"!==r.prop("position")&&"rightSide"!==r.prop("position")&&(m+="right"===r.prop("align")?-b:b),e.resizeByMeasured().layout().trans(p,u),i.resizeByMeasured().layout().trans(m,g)}else if(n>0||o>0){const t=n?s:r,l=n?e:i,c=n||o,_=n?this._wTitle:this._wSub;let d=n?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":d+=c-_;break;default:d+=(c-_)/2}const u=A(t.prop("offset"),0);0!==u&&(d+="right"===t.prop("align")?-u:u),l.trans(d,0)}}}class kl extends Ho{_doInitChildren(t){this.add(this._legendView=new gl(t))}_doMeasure(t,e,i,s,r){const n=e._legend,o=this._legendView.measure(t,n,i,s,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 i=this.width,s=this.height,r=0,n=0;switch(this._pos){case"left":i-=e;break;case"right":i-=e,r+=e;break;case"top":s-=e;break;default:n+=e,s-=e}t.trans(r,n).resize(i,s),t.layout()}}class Ll extends Ho{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,i,s,r,n){const o=this.views;let a;for(o.length;o.length<s.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>s.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach((t,e)=>{t.prepare(s[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,i){this.views.forEach((s,r)=>{s.prepareGuides(t,NaN,NaN,e,i)})}checkHeights(t,e,i){return this.views.length>0?this.$_checkHeights(this.views,t,e,i):0}$_checkHeights(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkHeight(e,i,s)}),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,i){return this.views.length>0?this.$_checkWidths(this.views,t,e,i):0}$_checkWidths(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkWidth(e,i,s)}),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const i of this.views)if(null===(e=i._scrollView)||void 0===e?void 0:e.contains(t))return i._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map(t=>t.model))}clean(){this.views.forEach(t=>t.clean())}_doMeasure(t,e,i,s,r){this._inverted;let n=0,o=0;return[this.views].forEach(e=>{if(e){const a=(this.isX,i),h=(this.isX,s);let l=0,c=0;e.forEach(e=>{if(e.visible){const i=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=i.width,c+=i.height}}),this.isHorz?c+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),o=f(o,c)}}),{width:n,height:o}}_doLayout(t){const e=this.control,i=e.loaded,s=[];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(i);e&&s.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===Eo.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Eo.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}}),this.isHorz?o+=r+t:a+=n+t}});const h=s.length>0&&e.chart.body.prop("zoomCallback");h&&Promise.resolve().then(()=>{s.forEach(({axis:t,from:e,to:i})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof Is?Math.floor(e):e,to:t instanceof Is?Math.floor(i):i})})})}}class Tl extends Fo{constructor(e){super(e,"rct-credits"),this.add(this._textView=new Oe(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}_doMeasure(t,e,i,s,r){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.getBBox()}}class Nl 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 rl(t,this));for(const e in Eo){const i=new Ll(t,Eo[e]);this._plotContainer.add(i),this._axisSectionMap[Eo[e]]=i}Nl.pane_class&&this.add(this._paneContainer=new Nl.pane_class(t,this)),this.add(this._titleSectionView=new Pl(t)),this.add(this._legendSectionView=new kl(t)),this.add(this._frontAnnotationContainer=new Se(t,"rct-front-annotations")),this.add(this._creditView=new Tl(t)),this.add(this._navigatorView=new ol(t)),this.add(this._historyView=new ul(t))}_doDispose(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.dispose(),super._doDispose()}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,i,s,r){var n,o,a;const h=this._model=e,l=h.isPolar(),c=h._credits,_=h._legend,d=h._navigator;let u,p=i,g=s;if(e._width=i,e._height=s,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(c.visible)&&(u=this._creditView.measure(t,c,p,g,r),c.isFloating()||("middle"!==c.prop("verticalAlign")?g-=u.height+c.num("offsetY")+c.num("gap"):"center"!==c.prop("align")&&(p-=u.width+c.num("offsetX")+c.num("gap")))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(_.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),_._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],i,s,r)})}layout(){var t;const e=this.width,i=this.height;let s=e,r=i;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,c=l.num("gap"),_=l.prop("align"),d=l.prop("verticalAlign"),u=l.num("offsetX"),p=l.num("offsetY"),g=this._bodyView._depthExt;let f=0,m=0,y=0,b=0,x=0,w=0,v=0,S=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==d?(f=p,r-="top"===d?y=h.height+f+c:b=h.height+f+c):(m=u,s-="left"===_?x=h.width+m+c:w=h.width+m+c)));const V=this._titleSectionView;let C=0;const A=S+y;V.visible&&(V.resizeByMeasured(),r-=C=V.height),v=x,S=i-b;const P=this._navigatorView;let k=0;P.visible&&(P.model._vertical||(P.resize(P.mw,P.model.getThickness()),r-=k=P.mh));const L=this._legendSectionView;let T,N,M=0,E=0;if(L.visible)switch(L.resizeByMeasured().layout(),M=L.height,E=L.width,a._location){case"top":T=C+y,r-=M;break;case"bottom":r-=M,T=S-M,S-=M;break;case"right":s-=E,N=e-E;break;case"left":s-=E,v+=E,N=0}P.visible&&(S-=k,P.layout().transY(S+P.model.getGap()));let B,O=0,D=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(v,A+C).resize(s,r),this._paneContainer.layout(),O=r,D=s,B=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Eo.LEFT,Eo.RIGHT].forEach(i=>{(e=t[i])&&e.visible&&(s-=e.mw)}),[Eo.TOP,Eo.BOTTOM].forEach(i=>{(e=t[i])&&e.visible&&(r-=e.mh)}),(e=t[Eo.LEFT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0),v+=e.mw),(e=t[Eo.RIGHT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0)),(e=t[Eo.BOTTOM])&&e.visible&&(e.resize(s-(g?g.base:0),e.mh),o||e.transX(v),e.layout(0),S-=e.mh),(e=t[Eo.TOP])&&e.visible&&(e.resize(s-(g?g.base:0),e.mh),o||e.transX(v),e.layout(0))),P.visible&&P.layout().transX(v);const i={x:v,y:S};this._plotWidth=s,this._plotHeight=r,o||((e=t[Eo.LEFT])&&e.visible&&e.trans(i.x-e.mw,i.y-e.height),(e=t[Eo.RIGHT])&&e.visible&&e.trans(i.x+s,i.y-e.height),(e=t[Eo.BOTTOM])&&e.visible&&e.trans(i.x,i.y),(e=t[Eo.TOP])&&e.visible&&e.trans(i.x,i.y-r-e.height));const n=this._currBody;O=this._plotHeight-0,D=this._plotWidth-0,v=i.x,S=i.y-this._plotHeight,n.resize(D,O),n.trans(v,S),n.layout(),B=n.getRect(),n._seriesViews.forEach(t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}})}if(D+=0,V.visible&&V.layout({xPlot:v,wPlot:D,wChart:e}).trans(0,A),L.visible){const t=a.prop("align"),n=a.prop("verticalAlign");if("body"===a._location){let e=a.num("offsetX");switch(t){case"right":v+=D-E-e;break;case"center":v+=(D-E)/2+e;break;default:v+=e}switch(e=a.num("offsetY"),n){case"bottom":S+=O-M-e;break;case"middle":S+=(O-M)/2+e;break;default:S+=e}}else if(isNaN(T)){const t=a.num("offsetY");if(v=N,"chart"===a.prop("alignBase")){switch(n){case"top":S=t;break;case"bottom":S=i-M-t;break;default:S=(i-M)/2+t}S+M>i&&(S=(i-M)/2)}else switch(n){case"top":S+=t;break;case"bottom":S=S+r-M-t;break;default:S=S+(r-M)/2+t}S+M>i&&(S=(i-M)/2),S<0&&(S=0)}else{const i=a.num("offsetX");if(S=T,"chart"===a.prop("alignBase"))switch(t){case"left":v=i;break;case"right":v=e-E-i;break;default:v=(e-E)/2+i}else switch(t){case"left":v+=i;break;case"right":v=v+s-E-i;break;default:v+=(s-E)/2+i}v+E>e&&(v=(e-E)/2),v<0&&(v=0)}L.trans(v,S)}if(h.visible){let t,s;switch(h.layout(),d){case"top":s=f;break;case"middle":s=(i-h.height)/2+f;break;default:if(b>0){if(s=i-b+c,L.visible){const t=L.y+M+c;t>s&&(s=t)}}else s=i-h.height-f}switch(_){case"left":if(t=m,x>0&&L.visible&&"left"===a._location){const e=L.x+E+c;e>t&&(t=e)}break;case"center":t=(e-h.width)/2+m;break;default:if(w>0){if(t=e-w+c,L.visible&&"right"===a._location){const e=L.x-c-h.width;e<t&&(t=e)}}else t=e-h.width-m}h.trans(t,s)}this.$_layoutHtmlButtons(e,i),this.$_layoutAnnotations(this._inverted,e,i,B),this.hideTooltip()}showTooltip(t,e,i,s,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:c}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},_=s.getTooltipPos(),d=h?r.x+_.x:l+_.x,u=h?r.y+_.y:c+_.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new Cl(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,i,d,u,s)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new Vl(this.doc)),this._tooltipView.show(t,o,e,i,d,u,s))}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,i;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(i=this._tooltipView)||void 0===i||i.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 i=this._annotationViews.find(e=>e.dom.contains(t));return i||((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,i){var s,r,n,o,a;if(!(null===(s=this._model)||void 0===s?void 0:s.hoverable()))return;const h=i,l=this._model&&this.bodyOf(i),c=null==h?void 0:h.classList,_=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list"));let d=this._hoverItem;if(this._hoverItem=null,(null===(r=this._model)||void 0===r?void 0:r.isSplitted())&&this._paneContainer.bodies.forEach(t=>{t!==l&&t.clearHover()}),l){const s=l.controlToElement(t,e),r=l.pointerMoved(s,i);if(!this._hoverItem&&this._legendSectionView._legendView.contains(h)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(h);if(t){const e=t.legend;z.makeArray(e.getSources(t),!0).forEach(t=>{e.prop("seriesHovering")&&t instanceof sr?l.hoverSeries(t):e.prop("pointHovering")&&t instanceof Ms&&l.hoverPoint(t)})}}if(d instanceof ls&&!(this._hoverItem instanceof ls)&&(l.hoverPoint(null),l.hoverSeries(null)),this.$_handleAnnotationHover(i),!r)return this.$_hideCrosshairs(),void l.removeFocus();if(null===(n=this._model)||void 0===n?void 0:n.isSplitted())this.$_updateSplitCrosshair(l,s,_);else for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>{this.$_axisFlagAndMoved(t,l,s,_)})}else(null===(o=this._model)||void 0===o?void 0:o.isSplitted())?this._paneContainer.bodies.forEach(t=>t.removeFocus()):null===(a=this._currBody)||void 0===a||a.removeFocus(),this.$_hideCrosshairs(),this.$_handleAnnotationHover(i)}pointerLeaved(t,e,i){var s,r;this.$_clearAnnotationHover(),this.$_hideCrosshairs(),(null===(s=this._model)||void 0===s?void 0:s.isSplitted())?this._paneContainer.bodies.forEach(t=>t.removeFocus()):null===(r=this._currBody)||void 0===r||r.removeFocus()}$_hideCrosshairs(){var t,e;if(null===(t=this._model)||void 0===t?void 0:t.isSplitted())this.$_clearSplitCrosshair();else{for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>t.hideCrosshair());null===(e=this._currBody)||void 0===e||e.hideCrosshairs()}}$_axisFlagAndMoved(t,e,i,s){const r=t.model,n=r.crosshair,o=r._isHorz?e.width:e.height,a=r._isHorz?i.x:i.y,h=n.visible&&!s&&n.flag.visible&&!n.isBar()&&n.getFlag(o,a);if(h){if(t.showCrosshair(a,h),n.prop("onChange")){const t=[],s=this._model.inverted;e._seriesViews.forEach(e=>{let n,o=Number.MAX_SAFE_INTEGER;e.model._visPoints.forEach(t=>{const e=t.xPos,a=t instanceof vn&&!s?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=r._isX?Math.abs(i.x-e):Math.abs(i.y-a);h<o&&(o=h,n=t)}),t.push(n)}),n.moved(a,h,t)}}else t.hideCrosshair()}$_updateSplitCrosshair(t,e,i){const s=this._paneContainer,r=t.getConnectedAxes(),n=r.find(t=>t._isX&&t.crosshair.visible);s.bodies.forEach(i=>{i!==t&&(n&&i.isConnected(n)?i.showAxisCrosshair(n,e.x,-1):i.hideCrosshairs())}),r.forEach(r=>{if(!r.crosshair.visible)return;const n=s.axisViewOf(r);n&&this.$_axisFlagAndMoved(n,t,e,i)})}$_clearSplitCrosshair(){const t=this._paneContainer;null==t||t.bodies.forEach(t=>t.hideCrosshairs());const e=this._model;e&&[e._getXAxes(),e._getYAxes()].forEach(e=>e.forEach(e=>{const i=null==t?void 0:t.axisViewOf(e);null==i||i.hideCrosshair()}))}getAxis(t){for(const e in this._axisSectionMap){const i=this._axisSectionMap[e].views.find(e=>e.model===t);if(i)return i}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Eo){const i=this._axisSectionMap[Eo[e]].getScrollView(t);if(i)return i}}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 i,s;e?(this._polarView||(this._polarView=new xl(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(i=this._bodyView)||void 0===i||i.setVis(!1),this._polarView.setVis(!0)):(null===(s=this._polarView)||void 0===s||s.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(),i=[];e._internalItems().forEach((e,s)=>{let r=this._htmlButtons[s];r||(r=new Al(t),this.control.appendDom(r.dom),this._htmlButtons[s]=r),i.push(r)});for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].dispose();this._htmlButtons=i}$_layoutHtmlButtons(t,e){const i=this.control._padding,s=this._htmlButtons;if(s.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:i.left,y:i.top,width:t,height:e},o=this._model._getButtons()._internalItems();s.forEach((t,e)=>{const i=o[e];t.setVisible(i.visible)&&t.setModel(i).layout(i.isChartScope()?n:r)})}}$_prepareAxes(t,e){const i=this._currBody._gridRowContainer,s=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const i in o){const a=o[i];n?a.prepare(t,this,e,e.getAxes(i,!0),s,r):a.visible=!1}i.prepare()}$_prepareAxisGuides(t,e){const i=this._currBody._guideContainer,s=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,i,s)}}$_measurePlot(t,e,i,s,r){const n=this._axisSectionMap,o=i,a=s;let h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,c,this._inverted,r),i-=n[Eo.LEFT].checkWidths(t,i,s),i-=n[Eo.RIGHT].checkWidths(t,i,s),s-=n[Eo.BOTTOM].checkHeights(t,i,s),s-=n[Eo.TOP].checkHeights(t,i,s),h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r);for(const i in n){const s=n[i];s.visible&&s.measure(t,e,l,c,r)}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===Eo.LEFT||t===Eo.RIGHT?i-=e.mw:t!==Eo.BOTTOM&&t!==Eo.TOP||(s-=e.mh))}r++,h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const i in n){const s=n[i];s.visible&&(s.measure(t,e,l,c,r),s.prepareGridRows(t,this._bodyView._gridRowContainer))}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===Eo.LEFT||t===Eo.RIGHT?i-=e.mw:t!==Eo.BOTTOM&&t!==Eo.TOP||(s-=e.mh))}h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.axesLayouted(l,c,this._inverted),this._bodyView.measure(t,e._body,i,s,r)}$_measurePolar(t,e,i,s,r){const n=e._body,o=n.getRadius(i,s),a=n.getInnerRadiusPx(o),h=2*Math.PI*o,l=o-a;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(h,l,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(h,l,!1),this._polarView.measure(t,e._body,i,s,r)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Gh(t,e);(e.prop("front")?s:i).add(o),r.set(e,o),n.push(o)})}$_layoutAnnotations(t,e,i,s){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach(s=>{if("container"===s.model.prop("scope"))n=-r.left,o=-r.top,a=e+r.left+r.right,h=i+r.top+r.bottom;else n=o=0,a=e,h=i;s._layoutView(t,this,n,o,a,h)})}$_handleAnnotationHover(t){var e,i;if(!t)return;const s=this.htmlButtonByDom(t);if(s!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=s,void(null===(i=this._hoverButton)||void 0===i||i.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 Ml;!function(t){t.EXPORT="$$realchart_export"}(Ml||(Ml={}));class El extends xe{static $_conf(t,e){!function(t,e){const i=ce(e);if(!t||!i)return;let s=le.get(t);s||le.set(t,s=new Set),s.add(i)}(t,e)}constructor(t,e){super(t,e),this._contextMenuDismissHandler=null,this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new Oo(null,(t,e)=>{this.$_changeModel(t,e)})}_createChartView(t){return new Nl(t)}_createPointerHandler(){return new dl(this)}_doDispose(){this.$_unbindContextMenuDismiss(),this.setPointerHandler(null),this._chart=null,super._doDispose()}onModelChanged(t,e,i){e instanceof li&&i===si.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,i){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof Oo&&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 i;null===(i=this._chartView.getAxis(t))||void 0===i||i.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Ml.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e),this.$_bindContextMenuDismiss()}}_canOverflowRender(){return!1}_doRender(t){var e;const i=this.model,s=i._general,r=this._chartView;if(this.clearTemporaryDefs(),i&&(this.setData("theme",s.prop("theme"),!0),this.setData("palette",s.prop("palette")),this.setResizeDelay(s.prop("resizeDelay")),i._prepareRender(),this._loadModules()),this.loaded||r.clean(),t.width>0&&t.height>0&&r.setVis(!1!==s.prop("visible"))&&(r.measure(this.doc(),i,t.width,t.height,1),r.setRect(t),r.layout(),i&&i.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,s,r){if(this.model){const s=this.model._general._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}$_bindContextMenuDismiss(){if(this._contextMenuDismissHandler)return;const t=this.doc();this._contextMenuDismissHandler=t=>{var e,i;const s=null===(e=this.chart)||void 0===e?void 0:e.exporter;if(!(null==s?void 0:s.isCompose())||!s.isContextMenuVisible())return;const r=t.target;(null===(i=null==r?void 0:r.closest)||void 0===i?void 0:i.call(r,".rct-contextmenu-button"))||s.toggleContextMenu()},t.addEventListener("pointerdown",this._contextMenuDismissHandler,!0)}$_unbindContextMenuDismiss(){this._contextMenuDismissHandler&&(this.doc().removeEventListener("pointerdown",this._contextMenuDismissHandler,!0),this._contextMenuDismissHandler=null)}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e._exporter.options)}}}class Bl{static getVersion(){return ne.version}static setLicenseKey(t){ne.code=t}static setLocale(t,e){e&&at(t,e),(t=>{t&&(ot=rt[nt=t.substring(0,2)]),ot||(ot=rt[nt="ko"])})(t)}static registerLocale(t,e){at(t,e)}static setDebugging(t){we.DEBUGGING=t}static setLogging(t){st.LOGGING=t}static setAnimatable(t){xe._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new El(t,e);return o.chart.load(i(s)?s:{},r,n),o.chart[Lo]=o,o.chart}static createData(t,e){return new Do(t||{},e)}}class Ol{static empty(){return new Ol}static create(t=0,e=0){return new Ol(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class Dl{static empty(){return new Dl}static create(t=0,e=0){return new Dl(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const Rl=Bl.getVersion,$l=Bl.setDebugging,Il=Bl.setLogging,Fl=Bl.setAnimatable,zl=Bl.configure,Hl=Bl.createChart,Gl=Bl.createData,jl=Bl.setLicenseKey;t.Annotation=li,t.AnnotationView=na,t.ArcElement=ia,t.AreaRangeSeries=Vn,t.AreaRangeSeriesView=oh,t.AreaSeries=wn,t.AreaSeriesGroup=An,t.AreaSeriesView=ah,t.AssetCollection=Qe,t.Axis=Mi,t.AxisBaseLine=Gr,t.AxisCollection=Ei,t.AxisGrid=xi,t.AxisItem=gi,t.AxisLabel=ki,t.AxisLine=fi,t.AxisScrollBar=Li,t.AxisScrollView=Ko,t.AxisSectorLine=Ni,t.AxisTick=Ci,t.AxisTitle=mi,t.AxisView=Jo,t.BarRangeSeries=tn,t.BarRangeSeriesView=hh,t.BarSeries=rn,t.BarSeriesBase=sn,t.BarSeriesGroup=on,t.BarSeriesGroupBase=nn,t.BarSeriesPoint=en,t.BarSeriesView=_h,t.BarSeriesViewBase=ch,t.BasedSeries=gr,t.BasedSeriesView=Ya,t.BellCurveSeries=kn,t.BellCurveSeriesView=dh,t.Body=as,t.BodyDepth=os,t.BodyView=rl,t.BoxPlotSeries=Tn,t.BoxPlotSeriesView=ph,t.BoxPointElementEx=za,t.BubblePie=$n,t.BubbleSeries=In,t.BubbleSeriesView=fh,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Fn,t.CandlestickSeries=Hn,t.CandlestickSeriesView=yh,t.CategoryAxis=Is,t.CategoryAxisGrid=$s,t.CategoryAxisLabel=Rs,t.CategoryAxisTick=Ds,t.Chart=Oo,t.ChartControl=El,t.ChartData=Do,t.ChartDataCollection=_t,t.ChartElement=Fo,t.ChartItem=si,t.ChartObject=Bo,t.ChartPointerHandler=dl,t.ChartText=ni,t.ChartView=Nl,t.CircelBarPointLabel=Gn,t.CircleBarSeries=jn,t.CircleBarSeriesGroup=Wn,t.CircleBarSeriesView=xh,t.CircleElement=ea,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=qi,t.CircularGaugeGroup=Ki,t.CircularGaugeLabel=Ui,t.ClockGaugeType="clock",t.ClusterableSeries=ur,t.ClusterableSeriesGroup=xr,t.Color=ie,t.ConnectableSeries=nr,t.ConstraintSeriesGroup=br,t.ContentView=Go,t.ContinuousAxis=jr,t.Credits=To,t.Crosshair=ui,t.DataPoint=Ms,t.DataPointCollection=Es,t.DataPointLabel=Zs,t.Dom=se,t.DumbbellSeries=Un,t.DumbbellSeriesView=vh,t.ElementPool=Ro,t.EqualizerSeries=qn,t.EqualizerSeriesView=Vh,t.ErrorBarSeries=Kn,t.ErrorBarSeriesView=Ah,t.Exporter=hs,t.FunnelSeries=eo,t.FunnelSeriesView=kh,t.Gauge=$i,t.GaugeBase=Ri,t.GaugeGroup=Ii,t.GaugeGroupView=ca,t.GaugeItem=class extends si{constructor(t){super(t.chart)}},t.GaugeLabel=Xi,t.GaugeRangeBand=Yi,t.GaugeRangeLabel=Wi,t.GaugeScale=ji,t.GaugeView=aa,t.HeatmapSeriesType="heatmap",t.HistogramSeries=ro,t.HistogramSeriesView=Th,t.IconedText=oi,t.ImageAnnotation=Or,t.ImageAnnotationView=Qa,t.ImageElement=jo,t.LayerElement=Se,t.Legend=cs,t.LegendItem=ls,t.LegendItemView=pl,t.LegendView=gl,t.LineElement=cn,t.LinePointLabel=gn,t.LineSeries=yn,t.LineSeriesBase=fn,t.LineSeriesBaseView=rh,t.LineSeriesGroup=Cn,t.LineSeriesPoint=dn,t.LineSeriesView=nh,t.LinearAxis=Wr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=Ao,t.LollipopSeries=ao,t.LollipopSeriesView=Mh,t.LowRangedSeries=mr,t.MarkerSeries=wr,t.MarkerSeriesPointView=Ua,t.MarkerSeriesView=Za,t.NavigatorMask=Sr,t.NavigiatorHandle=vr,t.ORG_ANGLE=x,t.OhlcSeries=lo,t.OhlcSeriesView=Bh,t.OthersGroup=cr,t.PI_2=b,t.PaneContainer=class extends Se{},t.ParetoSeries=_o,t.ParetoSeriesView=Oh,t.PathBuilder=ye,t.PathElement=Pe,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=yo,t.PieSeriesGroup=bo,t.PieSeriesLabel=fo,t.PieSeriesText=go,t.PieSeriesView=Ih,t.Point=Ol,t.PointElement=$a,t.PointHovering=No,t.PointLabelLineContainer=Ta,t.PointLabelLineView=La,t.PointLabelView=Pa,t.PointViewPool=eh,t.RAD_DEG=v,t.RObject=U,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=dr,t.RangedSeries=fr,t.RcAnimation=pe,t.RcControl=xe,t.RcElement=we,t.RcObject=U,t.RectElement=gs,t.SVGNS=Lt,t.ScaleView=class extends Fo{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 Ro(this._tickContainer,cn),this.add(this._labelContainer=new Se(t,"rct-gauge-scale-tick-labels")),this._labels=new Ro(this._labelContainer,la)}},t.ScatterSeries=wo,t.ScatterSeriesView=zh,t.SectionView=Ho,t.SectorElement=Nn,t.Series=sr,t.SeriesAnimation=ma,t.SeriesGroup=yr,t.SeriesMarker=or,t.SeriesNavigator=Pr,t.SeriesView=Ra,t.ShapeAnnotation=Dr,t.ShapeAnnotationView=Ja,t.Size=Dl,t.SplineSeries=bn,t.StackLabel=qs,t.Subtitle=Lr,t.SvgShapes=ps,t.TextAnnotation=Rr,t.TextAnnotationView=th,t.TextElement=Oe,t.TimeAxis=Qr,t.Title=kr,t.Tooltip=Tr,t.TreemapSeriesType="treemap",t.TrendLineArea=Fs,t.TrendLineLabel=zs,t.Trendline=Gs,t.Utils=st,t.ValueGauge=zi,t.ValueGaugeView=class extends aa{constructor(){super(...arguments),this.valueOf=(t,e,i)=>{const s=t.getParam(e);return o(s)?$t.getFormatter(i||t.label.numberFormat).toStr(s):s},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.prop("animatable")&&t.prop("value")!==t._prevValue&&(this._ani=new ha(this).start(()=>{t._runValue=NaN,t._prevValue=t.prop("value")}))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=Vo,t.WaterfallSeriesView=Hh,t.Widget=Bi,t.WidgetSeries=_r,t.WidgetSeriesConnector=hr,t.WidgetSeriesLabel=lr,t.WidgetSeriesPoint=ar,t.WidgetSeriesView=Ka,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Bs,t.absv=m,t.assignObj=l,t.buildValueRanges=yt,t.calcPercent=R,t.configure=zl,t.copyObj=function(t){if(t&&"object"==typeof t&&!s(t))return l({},t)},t.cos=d,t.createChart=Hl,t.createData=Gl,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=ti,t.fixnum=ft,t.getVersion=Rl,t.incv=L,t.isArray=s,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=it,t.isNumber=o,t.isObject=i,t.isString=n,t.maxv=f,t.minv=g,t.parsePercentSize=At,t.pickNum=A,t.pickProp=P,t.pickProp3=k,t.pixel=T,t.rectToSize=Y,t.setAnimatable=Fl,t.setDebugging=$l,t.setLicenseKey=jl,t.setLogging=Il,t.sin=u,t.toStr=function(t){return null==t?null:String(t)}});
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,function(t){"use strict";const e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=function(t){return null==t||isNaN(t)},l=Object.assign,c=Math.floor,_=Math.ceil,d=Math.cos,u=Math.sin,p=Math.log10,g=Math.min,f=Math.max,m=Math.abs,y=Math.PI,b=2*y,x=-y/2,v=y/180,w=180/y;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const S="undefined"!=typeof navigator?navigator.userAgent:"",V=S?navigator.appVersion:"";S.match(/Trident.*rv\:11\./),V?.indexOf("MSIE 10"),V?.indexOf("MSIE 9");const C="undefined"!=typeof window&&window.devicePixelRatio||1,P=function(t,e){const i="number"==typeof t?t:parseFloat(t);return isNaN(i)?"number"==typeof e?e:parseFloat(e):i},A=function(t,e){return void 0!==t?t:e},k=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},L=(t,e,i)=>t+(e-t)*i;function T(t){return t+"px"}function M(t){return null==t||Number.isNaN(t)||""===t}function N(t){return null==t||Number.isNaN(t)||""===t}function E(t){return t<10?"0"+t:String(t)}function B(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function O(t,e){const i={};return i[t]=e,i}const D=(t,e)=>t.replace("%1",e),$=(t,e)=>{throw new Error(D(t,e))};function R(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}class I extends Error{}const F=(new Date).getTime(),z=class t{static setLogging(t){this.LOGGING=t}static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static warn(...t){this.LOGGING&&console.warn(...t)}static warnIf(t,...e){this.LOGGING&&t&&console.warn(...e)}static now(){return+new Date}static parseDate(t,e){const i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(g(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}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,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(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 getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getEnumValues(t){return Object.keys(t).map(e=>t[e])}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-F}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=s(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return f(e,g(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=f(e,t)),isNaN(i)||(t=g(i,t)),t}static makeIntArray(t,e){const i=new Array(f(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}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,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],i=t[0];for(let s=1;s<t.length;s++)e=g(e,t[s]),i=f(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||s(t))?e.split(".").reduce((t,e)=>t?t[e]:void 0,t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let n=0;n<s;n++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};z.LOGGING=!1,z.week_days=["일","월","화","수","목","금","토"],z.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],z.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]];let H=z;const G=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],j=["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"],Y=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(H.startsWith(e,"rgb(")&&H.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(H.startsWith(e,"rgba(")&&H.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(H.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return n(e)?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,n=.5){const o=new t(null);return r<n?(o.r=Math.ceil(e.r+(i.r-e.r)*(r/n)),o.g=Math.ceil(e.g+(i.g-e.g)*(r/n)),o.b=Math.ceil(e.b+(i.b-e.b)*(r/n)),o.a=(i.a+e.a)/2):(o.r=Math.ceil(i.r+(s.r-i.r)*((r-n)/(1-n))),o.g=Math.ceil(i.g+(s.g-i.g)*((r-n)/(1-n))),o.b=Math.ceil(i.b+(s.b-i.b)*((r-n)/(1-n))),o.a=(s.a+i.a)/2),o}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(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}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 i;e>6?(i=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)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};Y.TRANSPARENT=new Y("rgba(0,0,0,0)"),Y.WHITE=new Y("rgb(255,255,255)"),Y.BLACK=new Y("rgb(0,0,0)"),Y.COLORS=function(){const t={};for(let e=0;e<G.length;e++)t[G[e]]=j[e];return t}();const W=Object.freeze({x:0,y:0,width:0,height:0});function X(t){return{width:t.width,height:t.height}}let U=0;class Z{constructor(){this._hash=++U,this._disposed=!1,this._disposing=!1}dispose(){return this._disposed||this._disposing||(this._disposing=!0,this._doDispose(),this._disposed=!0),null}_doDispose(){}get hash(){return this._hash}get shash(){return this._hash.toString()}get disposing(){return this._disposing}get orphaned(){return this._disposed}_throwError(t){throw new Error(t)}}class q extends Error{}const K=function(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(s(t)&&s(r)){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!K(t[e],r[e]))return!1;return!0}if(i(t)&&i(r)){const i=Object.keys(t),s=Object.keys(r);if(i.length!==s.length)return!1;for(const s of i){if(!e.call(r,s))return!1;if(!K(t[s],r[s]))return!1}return!0}return!1},Q=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)){let e=r[t];s(e)?n[t]=e.slice(0):e instanceof Date?n[t]=new Date(e):i(e)?n[t]=Q(n[t],e):n[t]=e}return n},J=class t extends Z{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}preset(t,e=!0){return this._preset=t._op,e&&this._children&&this._children.forEach((e,i)=>{const s=t._children?.get(i);s&&e.preset(s,!0)}),this}_doDispose(){this._externals=void 0,this._preset=void 0,this._children&&(this._children.forEach(t=>t.dispose()),this._children=void 0)}prop(t){const e=this._op[t];if(void 0!==e)return e;if(this._preset){const e=this._preset[t];if(void 0!==e)return e}return this.constructor.defaults[t]}str(t){const e=this._op[t];if(void 0!==e)return String(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return String(e)}return String(this.constructor.defaults[t])}num(t){let e=parseFloat(this._op[t]);return isNaN(e)?this._preset&&(e=parseFloat(this._preset[t]),!isNaN(e))?e:parseFloat(this.constructor.defaults[t]):e}bool(t){let e=this._op[t];if(void 0!==e)return Boolean(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return Boolean(e)}return e=this.constructor.defaults[t],Boolean(e)}propAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.prop(t):e.rest?e.child.propAt(e.rest):void 0}strAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.str(t):e.rest?e.child.strAt(e.rest):void 0}numAt(t){const e=this._resolvePath(t);return-1===e?NaN:0===e?this.num(t):e.rest?e.child.numAt(e.rest):NaN}boolAt(t){const e=this._resolvePath(t);return-1!==e&&(0===e?this.bool(t):!!e.rest&&e.child.boolAt(e.rest))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){let t=e[r];void 0===t&&this._preset&&(t=this._preset[r]),s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);if(e)return e.saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this.$_load(t),this._optionChanged(),this}saveOption(t){if(this._children&&this._children.has(t))return this._findChild(t).saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}saveOptions(t,e=!1,r=!1,n=!1){const o={};let a,h,l;return s(t)?a=t:i(t)&&([a,h,l]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,e,r,h,n,l),o}saveTo(t,e,r=!1,n=!1,o=!1){let a,h,l;return s(e)?a=e:i(e)&&([a,h,l]=this.$_splitProps(e)),this._doSave(t,a,this.constructor.defaults,r,n,h,o,l),t}updateOptions(e,i=!0){const s=this._op,r=this._externals??t.EMPTY_MAP;let n,o;if(void 0!==e&&!this._doSetSimple(s,e)){const t={};let i;for(const s in e)r.has(s)?(this._doUpdateProp(s,e[s]),(o??=[]).push(s)):(i=this._findChild(s))?(i=this.$_recreateChild(s,i,e[s]),(n??=[]).push(s)):e[s]!==this.prop(s)&&(this.$_validateOptions(s,e[s]),t[s]=e[s],(o??=[]).push(s));Q(s,t)}return this._doApply(s),n?.forEach(t=>this._findChild(t).updateOptions(e[t])),i&&this._optionChanged(o),this}invertOptions(t){if(!i(t))return{};const s={},r={};let n=!1;for(const i in t){if(!e.call(t,i))continue;const o=this._findChild(i);o?s[i]=o.invertOptions(t[i]):(r[i]=t[i],n=!0)}return n&&this.saveTo(s,r,!0,!1,!0),s}updateOption(t,e,r=!0,n=!1){if(this._doUpdateProp(t,e))return this._doApply(this._op),r&&this._optionChanged(t),this;let o=this._findChild(t);if(o)o=this.$_recreateChild(t,o,e),o.updateOptions(e);else{const o=this._op;(n||e!==this.prop(t))&&(this.$_validateOptions(t,e),s(e)?e=e.slice(0):e instanceof Date?e=new Date(e):i(e)&&(e=Q({},e)),o[t]=e,this._doApply(o),r&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r=!a(s)||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(t,i=!0){const s=this._op,r=this._findChild(t);return r?r.clearOptions(!0):this._externals?.has(t)?(this._doUpdateProp(t,void 0),this._externals.delete(t),this._doApply(s),i&&this._optionChanged(t)):e.call(s,t)&&(delete s[t],this._doApply(s),i&&this._optionChanged(t)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);if(-1===r)return this;if(0===r)return this.updateOption(t,e,i,s);if(r.rest)return r.child.updateAt(r.rest,e,i,s);return this.$_recreateChild(t,r.child,e).updateOptions(e,i),this}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}deleteAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.deleteAt(i.rest,e):(i.child.clearOptions(!0,e),this)}_clearExternalOptions(){this._externals=void 0}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach(t=>t&&e(t)),i._clearExternalOptions(),i._doApply(i._op)}(this),e&&this._optionChanged(),this}_cleanExternalOptions(){}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))K(s[t],i._propBaseline(t,r))&&delete s[t];t&&i._children&&i._children.forEach(t=>e(t)),i._cleanExternalOptions()}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e&&e._init(),e}_attachRef(t,e){(this._children??=new Map).set(t,e)}_findChild(t){return this._children?.get(t)}_resolveChild(t){return this._findChild(t)}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._resolveChild(i);return r?{child:r,rest:s}:e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_includeTags(t,...e){return!t||(s(t)?e.some(e=>t.includes(String(e))):e.includes(t))}$_recreateChild(t,e,i){const s=this._doRecreateChild(t,e,i);return s?((this._children??=new Map).set(t,s),s._init(),s):e}_doRecreateChild(t,e,i){}_doLoad(t,r){for(const n in r)if(e.call(r,n)){let e,o=r[n];this._doLoadProp(n,o)?(this._externals??=new Map).set(n,o):void 0!==(e=this._findChild(n))?(e=this.$_recreateChild(n,e,o),e.$_load(o)):s(o)?t[n]=o.slice(0):o instanceof Date?t[n]=new Date(o):i(o)?t[n]=Object.assign({},o):t[n]=o}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doUpdateProp(t,e){return this._doLoadProp(t,e)}_doSaveProp(t,e,i){return!1}_doApply(t){}_propBaseline(t,e){return e[t]}_doSave(i,r,n,o,a,h,l=!1,c){const _=this._op,d=this._children??t.EMPTY_MAP,u=this._externals??t.EMPTY_MAP,p=r&&r.length>0,g=l&&p,f=p?r:Object.keys(_);for(const t of f)if(!d.has(t)&&!u.has(t)){const r=e.call(_,t);if(!r&&!a&&!g)continue;const o=this._propBaseline(t,n),h=r?_[t]:o;(a||g||!K(h,o))&&(s(h)?i[t]=h.slice():void 0!==h?i[t]=h:g&&(i[t]=void 0))}if(u.size>0)if(p){if(c)for(const t in c)u.has(t)&&this._doSaveProp(i,t,c[t])}else u.forEach((t,e)=>this._doSaveProp(i,e,u.get(e)));d.forEach((t,s)=>{const n=null!=h&&e.call(h,s),c=p&&r.indexOf(s)>=0;if(p&&!n&&!c)return;const _=n||c;if(o||_){const e=n?h[s]:void 0,r=l&&_,o=t.saveOptions(e,!0,a,r);(r||a||Object.keys(o).length>0)&&(i[s]=o)}})}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof q?e:new q(`Invalid value for option "${t}": ${e.message}`)}}$_splitProps(t){const e=[];let i,s;for(const r of Object.keys(t))this._children?.has(r)?((i??={})[r]=t[r],e.push(r)):this._externals?.has(r)?(s??={})[r]=t[r]:e.push(r);return[e,i,s]}_doValidateOptions(t,e){}};J.defaults={},J.EMPTY_MAP=new Map;let tt=J;(class t extends tt{constructor(t=!1){super(),this._items=[],t&&this.keyProp&&(this._map=new Map)}get keyProp(){}get addMissingOnUpdate(){return t.UPDATE_MODE.addMissing}get removeMissingOnUpdate(){return t.UPDATE_MODE.removeMissing}get reorderOnUpdate(){return t.UPDATE_MODE.reorder}get count(){return this._items.length}get isEmpty(){return 0===this._items.length}get isSingle(){return 1===this._items.length}get items(){return this._items.slice()}get first(){return this._items[0]}get last(){const t=this._items;return t.length?t[t.length-1]:void 0}_internalItems(){return this._items}get(t){return this._items[t]}getOf(t){return this._map?this._map.get(t):this.keyProp?this.findProp(this.keyProp,t):void 0}itemAt(t){return this._items[t]}indexOf(t){return this._items.indexOf(t)}indexOfProp(t,e){for(let i=0;i<this._items.length;i++)if(this._items[i].prop(t)===e)return i;return-1}findIndex(t){return this._items.findIndex((e,i)=>t(e,i,this))}contains(t){return-1!==this._items.indexOf(t)}forEach(t){this._items.forEach((e,i)=>t(e,i,this))}some(t){return this._items.some((e,i)=>t(e,i,this))}someProp(t,e){return this._items.some(i=>i.prop(t)===e)}find(t){return this._items.find((e,i)=>t(e,i,this))}findProp(t,e){return this._items.find(i=>i.prop(t)===e)}filter(t){return this._items.filter((e,i)=>t(e,i,this))}filterProp(t,e){return this._items.filter(i=>i.prop(t)===e)}map(t){return this._items.map((e,i)=>t(e,i,this))}addSource(t,e=!0){return this.insertSource(t,this._items.length,e)}insertSource(t,e,i=!0){const s=this.$_newItem(t);if(s){const t=Math.max(0,Math.min(e,this._items.length));this.$_insertItem(s,t,i)}return s}add(t,e=!0){return this.insert(t,this._items.length,e),!0}insert(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this.$_insertItem(t,s,i),!0}addAll(t,e=!0){return this.insertAll(t,this._items.length,e)}insertAll(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this._items.splice(s,0,...t),t.forEach((t,e)=>this.$_inserted(t,s+e)),this._doItemsChanged(this._items),i&&this._optionChanged(),t.length}remove(t,e=!0){if(n(t)){const e=this.keyProp;if(!e)return;t=this.findProp(e,t)}const i=this._items.indexOf(t);if(-1!==i)return this.removeAt(i,e)}removeAll(t,e=!0){const i=this.keyProp;let s=0;for(const e of t){let t;t=n(e)?this.indexOfProp(i,e):this._items.indexOf(e),-1!==t&&(this.removeAt(t,!1),s++)}return s>0&&(this._doItemsChanged(this._items),e&&this._optionChanged()),s}removeAt(t,e=!0){const i=this._items;if(t<0||t>=i.length)return;const s=i.splice(t,1)[0];return this.$_removed(s,t),this._doItemsChanged(this._items),e&&this._optionChanged(),s}clear(t=!0){return!!this.$_clearItems()&&(t&&this._optionChanged(),!0)}moveTo(t,e,i=!0){const s=this._items,r=s.indexOf(t);if(-1===r)return!1;const n=Math.max(0,Math.min(e,s.length-1));return n!==r&&(s.splice(r,1),s.splice(n,0,t),this._doItemMoved(t,r,n),this._doItemsChanged(this._items),i&&this._optionChanged(),!0)}replace(t,e,i=!1,s=!0){const r=this._items.indexOf(t);if(r>=0)this._items[r]=e,this.$_removed(t,r),this.$_inserted(e,r);else{if(!i)return!1;this._items.push(e),this.$_inserted(e,this._items.length-1)}return this._doItemsChanged(this._items),s&&this._optionChanged(),!0}_doItemInserted(t,e){}_doItemRemoved(t,e){}_doCleared(){}_doItemMoved(t,e,i){}_doItemsChanged(t){}$_insertItem(t,e,i){this._items.splice(e,0,t),this.$_inserted(t,e),this._doItemsChanged(this._items),i&&this._optionChanged()}saveOptions(t,e=!0,r=!1,n=!1){const o=this.keyProp;if(i(t)&&s(t.items)&&(t=t.items),s(t)){if(o){const s=[];for(const a of t){const t=this.$_findByKey(o,i(a)?a[o]:void 0);t&&s.push(this.$_saveItem(t,a,e,r,n,o))}return s}return this._items.map((i,s)=>i.saveOptions(t[s],e,r,n))}const a=i(t)?t:void 0;return this._items.map(t=>this.$_saveItem(t,a,e,r,n,o))}$_saveItem(t,e,s,r,n,o){const a=t.saveOptions(e,s,r,n);return o&&i(a)&&void 0===a[o]&&(a[o]=t.getOption(o)),a}saveTo(t,e,i=!0,s=!1,r=!1){return this.saveOptions(e,i,s,r)}updateOptions(t,e=!0){const{items:i,updateMode:r}=this.$_split(t);"*"===r?.remove&&this.$_clearItems(),i&&this.$_reconcile(this._normalizeOptions(i),{addMissing:r?.addMissing??this.addMissingOnUpdate,removeMissing:r?.removeMissing??this.removeMissingOnUpdate,reorder:r?.reorder??this.reorderOnUpdate});const n=r?.remove;return s(n)&&n.length&&this.$_removeKeys(n),this._doItemsChanged(this._items),e&&this._optionChanged(),this}invertOptions(t){const{items:e,updateMode:r}=this.$_split(t),n=this.keyProp,o=r?.addMissing??this.addMissingOnUpdate,a=r?.removeMissing??this.removeMissingOnUpdate,h=r?.reorder??this.reorderOnUpdate,l=s(r?.remove)?r.remove:[],c=a||h||"*"===r?.remove||l.length>0;if(!n||c)return{items:this.saveOptions(),updateMode:{addMissing:!0,removeMissing:!0,reorder:!0,remove:"*"}};const _=[],d=[];for(const t of e??[]){const e=i(t)?t[n]:void 0;if(void 0===e)continue;const s=this.$_findByKey(n,e);s?_.push(this.$_saveItem(s,t,!0,!1,!0,n)):o&&d.push(e)}const u={};return d.length&&(u.remove=d),{items:_,updateMode:u}}_normalizeOptions(t){return t}_doLoad(t,e){this.$_replaceItems(this._normalizeOptions(e))}clearOptions(t=!1,e=!0){return this.$_clearItems(),super.clearOptions(t,e)}_resolveChild(t){const e=this._items,i=+t;return Number.isInteger(i)&&i>=0&&i<e.length?e[i]:super._resolveChild(t)}_doDispose(){this.$_clearItems(),super._doDispose()}$_newItem(t){const e=this._createItem(t);return e&&e.initAndLoad(t),e}$_inserted(t,e){if(this._map){const e=t.prop(this.keyProp);M(e)||this._map.set(e,t)}this._doItemInserted(t,e)}$_removed(t,e){if(this._map){const e=t.prop(this.keyProp);M(e)||this._map.delete(e)}this._doItemRemoved(t,e)}$_split(t){if(s(t))return{items:t,updateMode:void 0};if(i(t)){const e=t;return{items:s(e.items)?e.items:void 0,updateMode:i(e.updateMode)?e.updateMode:void 0}}return{items:void 0,updateMode:void 0}}$_replaceItems(t){if(this.$_clearItems(),t){const e=this._items;for(const i of t){const t=this.$_newItem(i);t&&(e.push(t),this.$_inserted(t,e.length-1))}this._doItemsChanged(e)}}$_reconcile(t,e){const{addMissing:s,removeMissing:r,reorder:n}=e,o=this._items,a=this.keyProp;if(a){if(r){const e=new Set;for(const s of t){const t=i(s)?s[a]:void 0;void 0!==t&&e.add(t)}for(let t=o.length-1;t>=0;t--)if(!e.has(o[t].getOption(a))){const e=o.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}for(const e of t){const t=this.$_findByKey(a,i(e)?e[a]:void 0);if(t)t.updateOptions(e,!1);else if(s){const t=this.$_newItem(e);t&&(o.push(t),this.$_inserted(t,o.length-1))}}n&&this.$_reorderByKey(t,a)}else{const e=t.length;if(r)for(;o.length>e;)o.splice(o.length-1,1)[0].dispose();for(let i=0;i<e;i++)if(i<o.length)o[i].updateOptions(t[i],!1);else if(s){const e=this.$_newItem(t[i]);e&&o.push(e)}}}$_reorderByKey(t,e){const s=new Set,r=[];for(const n of t){const t=this.$_findByKey(e,i(n)?n[e]:void 0);t&&!s.has(t)&&(s.add(t),r.push(t))}for(const t of this._items)s.has(t)||r.push(t);this._items=r,this._doItemsChanged(this._items)}$_findByKey(t,e){if(void 0!==e)for(const i of this._items)if(i.getOption(t)===e)return i}$_removeKeys(t){const e=this.keyProp,i=this._items;if(e){const s=new Set(t);for(let t=i.length-1;t>=0;t--)if(s.has(i[t].getOption(e))){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}else{const e=Array.from(new Set(t.filter(t=>Number.isInteger(t)&&t>=0&&t<i.length))).sort((t,e)=>e-t);for(const t of e){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}}$_clearItems(){const t=this._items;if(t.length){for(let e=t.length-1;e>=0;e--){const i=t.pop();i.dispose(),this.$_removed(i,e)}return this._doCleared(),this._doItemsChanged(t),!0}return!1}}).UPDATE_MODE={addMissing:!0,removeMissing:!1,reorder:!1};const et=class t extends Z{constructor(t){super(),this._cssWidth=0,this._cssHeight=0,this._dpr=1,this._canvas=t.createElement("canvas");const e=this._canvas.getContext("2d");if(!e)throw new Error("CanvasRenderer: 2d context not available.");this._ctx=e}static registerShape(e,i){t.SHAPES.set(e,i)}static unregisterShape(e){return t.SHAPES.delete(e)}static shapeNames(){return Array.from(t.SHAPES.keys())}static _builtinShapes(){const t=new Map;return t.set("circle",(t,e,i,s)=>{t.arc(e,i,s/2,0,2*Math.PI)}),t.set("square",(t,e,i,s)=>{const r=s/2;t.rect(e-r,i-r,s,s)}),t.set("diamond",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i),t.lineTo(e,i+r),t.lineTo(e-r,i),t.closePath()}),t.set("triangle",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i+r),t.lineTo(e-r,i+r),t.closePath()}),t.set("triangle-down",(t,e,i,s)=>{const r=s/2;t.moveTo(e,i+r),t.lineTo(e+r,i-r),t.lineTo(e-r,i-r),t.closePath()}),t.set("star",(t,e,i,s)=>{const r=s/2,n=.4*r,o=Math.PI/5;let a=-Math.PI/2;t.moveTo(e+r*Math.cos(a),i+r*Math.sin(a));for(let s=1;s<10;s++){a+=o;const h=1&s?n:r;t.lineTo(e+h*Math.cos(a),i+h*Math.sin(a))}t.closePath()}),t.set("plus",(t,e,i,s)=>{const r=s/2,n=s/6;t.moveTo(e-n,i-r),t.lineTo(e+n,i-r),t.lineTo(e+n,i-n),t.lineTo(e+r,i-n),t.lineTo(e+r,i+n),t.lineTo(e+n,i+n),t.lineTo(e+n,i+r),t.lineTo(e-n,i+r),t.lineTo(e-n,i+n),t.lineTo(e-r,i+n),t.lineTo(e-r,i-n),t.lineTo(e-n,i-n),t.closePath()}),t.set("cross",(t,e,i,s)=>{const r=s/2,n=s/6,o=Math.SQRT1_2,a=[[-n,-r],[n,-r],[n,-n],[r,-n],[r,n],[n,n],[n,r],[-n,r],[-n,n],[-r,n],[-r,-n],[-n,-n]];for(let s=0;s<a.length;s++){const r=a[s][0]*o-a[s][1]*o,n=a[s][0]*o+a[s][1]*o;0===s?t.moveTo(e+r,i+n):t.lineTo(e+r,i+n)}t.closePath()}),t.set("wye",(t,e,i,s)=>{const r=s/2,n=s/6/2,o=[];for(let t=0;t<3;t++){const e=-Math.PI/2+t*Math.PI*2/3,i=Math.cos(e),s=Math.sin(e),a=[i*r,s*r],h=[i*n-s*n,s*n+i*n],l=[i*n+s*n,s*n-i*n];o.push(h,a,l)}t.moveTo(e+o[0][0],i+o[0][1]);for(let s=1;s<o.length;s++)t.lineTo(e+o[s][0],i+o[s][1]);t.closePath()}),t}static _applyLine(t,e){t.strokeStyle=e?.color??"#000",t.lineWidth=e?.width??1,t.lineCap=e?.cap??"butt",t.lineJoin=e?.join??"miter",t.globalAlpha=e?.alpha??1,e?.dash?t.setLineDash(e.dash):t.setLineDash([])}static _applyFill(t,e){t.fillStyle=e?.color??"#000",t.globalAlpha=e?.alpha??1}static _applyText(t,e){t.fillStyle=e?.color??"#000",t.font=e?.font??"12px sans-serif",t.textAlign=e?.align??"start",t.textBaseline=e?.baseline??"alphabetic",t.globalAlpha=e?.alpha??1}static _roundRectPath(t,e,i,s,r,n){const o=Math.min(s,r)/2;let a,h,l,c;Array.isArray(n)?(a=Math.min(o,Math.max(0,n[0]??0)),h=Math.min(o,Math.max(0,n[1]??a)),l=Math.min(o,Math.max(0,n[2]??a)),c=Math.min(o,Math.max(0,n[3]??h))):a=h=l=c=Math.min(o,Math.max(0,n));const _=t;a!==h||h!==l||l!==c||"function"!=typeof _.roundRect?(t.moveTo(e+a,i),t.lineTo(e+s-h,i),h>0&&t.arcTo(e+s,i,e+s,i+h,h),t.lineTo(e+s,i+r-l),l>0&&t.arcTo(e+s,i+r,e+s-l,i+r,l),t.lineTo(e+c,i+r),c>0&&t.arcTo(e,i+r,e,i+r-c,c),t.lineTo(e,i+a),a>0&&t.arcTo(e,i,e+a,i,a),t.closePath()):_.roundRect(e,i,s,r,a)}static _splinePath(t,e,i,s=!1){const r=e.length;if(r<2)return;if(s||t.moveTo(e[0][0],e[0][1]),2===r)return void t.lineTo(e[1][0],e[1][1]);const n=i/6;for(let i=0;i<r-1;i++){const s=e[i-1]??e[i],r=e[i],o=e[i+1],a=e[i+2]??o,h=r[0]+(o[0]-s[0])*n,l=r[1]+(o[1]-s[1])*n,c=o[0]-(a[0]-r[0])*n,_=o[1]-(a[1]-r[1])*n;t.bezierCurveTo(h,l,c,_,o[0],o[1])}}_doDispose(){}get canvas(){return this._canvas}get context(){return this._ctx}get width(){return this._cssWidth}get height(){return this._cssHeight}get pixelRatio(){return this._dpr}attatch(t){return t.appendChild(this._canvas),this}detach(){const t=this._canvas.parentElement;return t&&t.removeChild(this._canvas),this}prepare(t,e,i=!0){const s=this._canvas.parentElement,r=Math.max(0,Math.floor(P(t,s&&s.clientWidth))),n=Math.max(0,Math.floor(P(e,s&&s.clientHeight)));return this._cssWidth===r&&this._cssHeight===n&&this._dpr===C||(this._canvas.width=Math.round(r*C),this._canvas.height=Math.round(n*C),this._canvas.style.width=r+"px",this._canvas.style.height=n+"px",this._cssWidth=r,this._cssHeight=n,this._dpr=C),this._ctx.setTransform(C,0,0,C,0,0),i&&this._ctx.clearRect(0,0,r,n),this}clear(){return this._ctx.clearRect(0,0,this._cssWidth,this._cssHeight),this}save(){return this._ctx.save(),this}restore(){return this._ctx.restore(),this}translate(t,e){return this._ctx.translate(t,e),this}rotate(t){return this._ctx.rotate(t),this}scale(t,e=t){return this._ctx.scale(t,e),this}clip(t,e,i,s){const r=this._ctx;return r.beginPath(),r.rect(t,e,i,s),r.clip(),this}resolveStroke(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map((t,e)=>({offset:e/n,color:t}));return{color:this.createLinearGradient(e,i,s,r,o)}}resolveFill(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map((t,e)=>({offset:e/n,color:t}));return{color:this.createLinearGradient(e,i,s,r,o)}}line(e,i,s,r,n){const o=this._ctx;return o.save(),t._applyLine(o,n),o.beginPath(),o.moveTo(e,i),o.lineTo(s,r),o.stroke(),o.restore(),this}hline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(i)+.5:i;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(e,o),n.lineTo(e+s,o),n.stroke(),n.restore(),this}vline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(e)+.5:e;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(o,i),n.lineTo(o,i+s),n.stroke(),n.restore(),this}polyline(e,i){if(e&&e.length>1){const s=this._ctx;s.save(),t._applyLine(s,i),s.beginPath(),s.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)s.lineTo(e[t][0],e[t][1]);s.stroke(),s.restore()}return this}spline(e,i,s=1){if(e&&e.length>1){const r=this._ctx;r.save(),t._applyLine(r,i),r.beginPath(),t._splinePath(r,e,s),r.stroke(),r.restore()}return this}polygon(e,i,s){if(e&&e.length>2){const r=this._ctx;r.save(),r.beginPath(),r.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)r.lineTo(e[t][0],e[t][1]);r.closePath(),i&&(t._applyFill(r,i),r.fill()),s&&(t._applyLine(r,s),r.stroke()),r.restore()}return this}rect(e,i,s,r,n,o){const a=this._ctx;if(a.save(),n&&(t._applyFill(a,n),a.fillRect(e,i,s,r)),o){const n=1===(o.width??1)?.5:0;t._applyLine(a,o),a.strokeRect(Math.floor(e)+n,Math.floor(i)+n,s,r)}return a.restore(),this}roundRect(e,i,s,r,n,o,a){if(s>0&&r>0){const h=this._ctx;h.save(),h.beginPath(),t._roundRectPath(h,e,i,s,r,n),o&&(t._applyFill(h,o),h.fill()),a&&(t._applyLine(h,a),h.stroke()),h.restore()}return this}circle(e,i,s,r,n){if(s>0){const o=this._ctx;o.save(),o.beginPath(),o.arc(e,i,s,0,2*Math.PI),r&&(t._applyFill(o,r),o.fill()),n&&(t._applyLine(o,n),o.stroke()),o.restore()}return this}arc(e,i,s,r,n,o,a=!1){if(s>0){const h=this._ctx;h.save(),t._applyLine(h,o),h.beginPath(),h.arc(e,i,s,r,n,a),h.stroke(),h.restore()}return this}pie(e,i,s,r,n,o,a,h=!1){if(s>0){const l=this._ctx;l.save(),l.beginPath(),l.moveTo(e,i),l.arc(e,i,s,r,n,h),l.closePath(),o&&(t._applyFill(l,o),l.fill()),a&&(t._applyLine(l,a),l.stroke()),l.restore()}return this}ring(e,i,s,r,n,o,a,h){if(r>0&&s>=0&&s<r){const l=this._ctx;l.save(),l.beginPath(),l.arc(e,i,r,n,o,!1),l.arc(e,i,s,o,n,!0),l.closePath(),a&&(t._applyFill(l,a),l.fill()),h&&(t._applyLine(l,h),l.stroke()),l.restore()}return this}shape(e,i,s,r,n,o){if(r>0){const a=t.SHAPES.get(e);if(!a){const e=this._ctx;e.save(),e.beginPath(),a(e,i,s,r),n&&(t._applyFill(e,n),e.fill()),o&&(t._applyLine(e,o),e.stroke()),e.restore()}}return this}bar(e,i,s,r,n,o){const a=this._ctx,h=Math.round(e),l=Math.round(i),c=Math.max(1,Math.round(s)),_=Math.max(1,Math.round(r));if(a.save(),n&&(t._applyFill(a,n),a.fillRect(h,l,c,_)),o){const e=o.width??1,i=1===e?.5:0,s=1===e?1:0;t._applyLine(a,o),a.strokeRect(h+i,l+i,c-s,_-s)}return a.restore(),this}area(e,i,s,r){if(e&&e.length>1){const n=this._ctx;n.save(),n.beginPath(),n.moveTo(e[0][0],i);for(let t=0;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);if(n.lineTo(e[e.length-1][0],i),n.closePath(),s&&(t._applyFill(n,s),n.fill()),r){n.beginPath(),n.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);t._applyLine(n,r),n.stroke()}n.restore()}return this}splineArea(e,i,s,r,n=1){if(e&&e.length>1){const o=this._ctx;o.save(),o.beginPath(),o.moveTo(e[0][0],i),o.lineTo(e[0][0],e[0][1]),t._splinePath(o,e,n,!0),o.lineTo(e[e.length-1][0],i),o.closePath(),s&&(t._applyFill(o,s),o.fill()),r&&(o.beginPath(),t._splinePath(o,e,n),t._applyLine(o,r),o.stroke()),o.restore()}return this}text(e,i,s,r){if(null!=e&&""!==e){const n=this._ctx;n.save(),t._applyText(n,r),n.fillText(e,i,s),n.restore()}return this}measureText(t,e){const i=this._ctx;i.save(),e&&(i.font=e);const s=i.measureText(t);return i.restore(),s}drawImage(t,e,i,s,r,n,o,a,h){const l=this._ctx;return void 0!==n&&void 0!==o&&void 0!==a&&void 0!==h&&void 0!==s&&void 0!==r?l.drawImage(t,n,o,a,h,e,i,s,r):void 0!==s&&void 0!==r?l.drawImage(t,e,i,s,r):l.drawImage(t,e,i),this}createLinearGradient(t,e,i,s,r){const n=this._ctx.createLinearGradient(t,e,i,s);for(const t of r)n.addColorStop(t.offset,t.color);return n}createRadialGradient(t,e,i,s,r,n,o){const a=this._ctx.createRadialGradient(t,e,i,s,r,n);for(const t of o)a.addColorStop(t.offset,t.color);return a}verticalGradient(t,e,i){return this.createLinearGradient(0,t,0,e,i)}horizontalGradient(t,e,i){return this.createLinearGradient(t,0,e,0,i)}blit(t,e,i,s,r){return this._cssWidth>0&&this._cssHeight>0&&t.drawImage(this._canvas,0,0,this._canvas.width,this._canvas.height,e,i,s??this._cssWidth,r??this._cssHeight),this}};et.SHAPES=et._builtinShapes();const it=(new Date).getTime(),st="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class rt{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&rt.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(g(i,rt.month_days[rt.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,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!s(t))return l({},t)}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}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 i=parseFloat(t);return isFinite(i)?i:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(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()-it}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=f(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}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 i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static parseTuples(t){if(s(t)){const e=[];let i=-1/0;return t.forEach((r,n)=>{s(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>i&&(e.push([+r[0],+r[1]]),i=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=s(t)?[]:{};for(let i of Object.keys(t))e[i]=this.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(t,e){const i=+new Date;e(),rt.log(t,+new Date-i+"ms")}static clamp(t,e,i){return f(e,g(i,t))}static makeIntArray(t,e){const i=new Array(f(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length;e;){const i=Math.floor(Math.random()*e),s=t[--e];t[e]=t[i],t[i]=s}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,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%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 i=m(t-e);return g(i,b-i)}}rt.LOGGING=!1,rt.week_days=["일","월","화","수","목","금","토"],rt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],rt.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]],rt.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const nt={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 ot="ko",at=nt[ot]||nt[ot="ko"];const ht=(t,e)=>{t&&i(e)&&(at=nt[t.substring(0,2)]=Object.assign(nt.ko,nt.en,e))};class lt extends Z{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 i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}const ct=function(t){return t&&"object"==typeof t};class _t extends lt{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),s(e)&&e.forEach(t=>this._rows.push(this.$_readRow(t)))}$_buildOptions(t){const e=t.fields;let i;i=s(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(s(t))for(let i=0;i<this._fields.length;i++)e[this._fields[i]]=t[i];else ct(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,i){this._checkRow(t);const s=this._rows[t],r=s[e];i!==r&&(s[e]=i,this._rows[t]=s,this._fireEvent("onDataValueChanged",t,e,i,r),this._changed())}getValues(t,e=0,i=-1){const s=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(i)||i<0||i>s.length)&&(i=s.length);for(let n=e;n<i;n++)r.push(s[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)&&$(at.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class dt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const i=t[e];let r;s(i)?r=new _t({},i):ct(i)&&s(i.values)&&(r=new _t(i.options,i.values)),this._map[e]=r}}}const ut="%".charCodeAt(0),pt=void 0,gt={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"},ft=function(t){const e=gt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return gt[t]=e,e}return e};function mt(t){return parseFloat(t.toPrecision(12))}function yt(t){return Math.floor(1e6*t)/1e6}const bt=function(t,e,r,o=!0,a=!0,h=!1,c){let _,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),s(t))_=[],t.forEach(t=>{if(i(t)&&n(t.color)){const i={fromValue:P(t.fromValue,d?d.toValue:e),toValue:P(t.toValue,r),color:t.color,style:t.style?l({},t.style):pt};i.fromValue<i.toValue&&(_.push(i),d=i)}}),_=_.sort((t,e)=>t.fromValue-e.fromValue).filter(t=>t.toValue>=e&&t.fromValue<r),a&&_.forEach(t=>{t.fromValue=f(t.fromValue,e),t.toValue=g(t.toValue,r)});else if(i(t)&&s(t.colors)&&t.colors.length>0){const i=t.colors,n=s(t.styles)?t.styles:null;if(_=[],s(t.steps)&&t.steps.length>0){const o=s(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++)_.push({fromValue:o[t],toValue:o[t+1],color:i[g(t,i.length-1)],style:n?n[g(t,n.length-1)]:pt})}else{let s=P(t.fromValue,e);const o=P(t.toValue,r),a=(o-s)/i.length;let h=0;for(;s<o;)_.push({fromValue:s,toValue:s+=a,color:i[g(h,i.length-1)],style:n?n[g(h,n.length-1)]:pt}),h++}}if(h&&_&&_.length>0){let t=0,i=e;for(;t<_.length;)_[t].fromValue>i&&_.splice(t,0,{fromValue:i,toValue:_[t].fromValue,color:c}),i=_[t].toValue,t++;_[t-1].toValue<r&&_.push({fromValue:_[t-1].toValue,toValue:r,color:c})}return _},xt="shuffle",vt="random",wt="vertical-lr",St="vertical-rl",Vt="fill",Ct="stroke";function Pt(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function At(t,e,i){let s,r=!1;if(null==t){if(e)return null;s=i||0,r=!0}else if("string"==typeof t){const i=t.trim();if(0===i.length?s=NaN:i.charCodeAt(i.length-1)===ut?s=1===i.length?NaN:parseFloat(i):(s=parseFloat(i),r=!0),isNaN(s)){if(e)return null;Lt(at.invalidSizeValue,t)}}else if(s=+t,isNaN(s)){if(e)return null;s=i||0,r=!0}else r=!0;return{size:s,fixed:r}}function kt(t,e){return At(t,!0)||At(e,!1)}const Lt=(t,e)=>{throw new Error(D(t,e))},Tt="http://www.w3.org/2000/svg",Mt=function(t){return"function"==typeof t?t:null},Nt=function(t){return"string"==typeof t&&t.length>0},Et=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):s):s},Bt="0".charCodeAt(0),Ot="#".charCodeAt(0),Dt=",".charCodeAt(0),$t="s".charCodeAt(0),Rt="a".charCodeAt(0);class It{static getFormatter(t){let e=It.Formatters[t];return e||(It.Formatters[t]=e=new It(t)),e}static get Default(){return It.getFormatter(It.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 i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===Bt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Ot;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Bt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Dt){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===$t){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===Rt){i.signDisplay="never";break}}return i.minimumIntegerDigits=f(1,i.minimumIntegerDigits),i}}}It.DEFAULT_FORMAT="",It.Formatters={};const Ft=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],zt=[".","/","-",":"],Ht="Z".charCodeAt(0),Gt="z".charCodeAt(0),jt="A".charCodeAt(0),Yt="a".charCodeAt(0),Wt="y".charCodeAt(0),Xt="M".charCodeAt(0),Ut="m".charCodeAt(0),Zt="W".charCodeAt(0),qt="w".charCodeAt(0),Kt="d".charCodeAt(0),Qt="H".charCodeAt(0),Jt="h".charCodeAt(0),te="S".charCodeAt(0),ee="s".charCodeAt(0);class ie{static getFormatter(t){let e=ie.Formatters[t];return e||(ie.Formatters[t]=e=new ie(t)),e}static get Default(){return ie.getFormatter(at.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||at.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case Wt:s+=a>2?t.getFullYear():E(t.getFullYear()%100);break;case Xt:s+=a>1?E(t.getMonth()+1):t.getMonth()+1;break;case Kt:s+=a>1?E(t.getDate()):t.getDate();break;case Zt:s+=a>1?E(H.weekOfYear(t,e)+1):H.weekOfMonth(t,e,!0)+1;break;case qt:s+=a>1?H.long_week_days[t.getDay()]:H.week_days[t.getDay()];break;case Qt:s+=a>1?E(t.getHours()):t.getHours();break;case Jt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?E(e):e}else s+=a>1?E(t.getHours()):t.getHours();break;case Ut:s+=a>1?E(t.getMinutes()):t.getMinutes();break;case ee:s+=a>1?E(t.getSeconds()):t.getSeconds();break;case Yt:case jt:t.getHours()<12?s+=at.am:s+=at.pm;break;case te:let i=t.getMilliseconds();s+=3==a?B(i):2==a?E(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(zt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),Ft.indexOf(n)<0){let e=n.charCodeAt(0);(e>=jt&&e<=Ht||e>=Yt&&e<=Gt)&&$(at.invalidDateFormat,t)}e.push(n)}if(r<s&&H.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&H.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||at.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ie.Formatters={};class se{static isBright(t){return new se(t).isBright()}static getContrast(t,e,i){return new se(t).getContrast(e,i)}static interpolate(t,e,i){const s=new se(t),r=new se(e),n=1-i,o=Math.round(s.r*i+r.r*n),a=Math.round(s.g*i+r.g*n),h=Math.round(s.b*i+r.b*n),l=s.a*i+r.a*(1-i);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return st?new se(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(H.startsWith(t,"rgb(")&&H.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):H.startsWith(t,"rgba(")&&H.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):H.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 se(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 i;e>6?(i=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)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}se.BLACK="#000",se.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class re{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 i in e)t.setAttribute(i,e[i])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,i){t.setProperty(e,i,"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,i=""){return t.style.display=e?i:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let i=null;"string"==typeof e?i=e:re.isSVGClipPathElement(e)&&(i=e.id||null),i?t.setAttribute("clip-path",`url(#${i})`):t.removeAttribute("clip-path")}static createClipRect(t,e){const i=t.createElementNS(Tt,"clipPath");return i.id=e,i.append(t.createElementNS(Tt,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,i,s,r){return t.setAttribute("x",e),t.setAttribute("y",i),t.setAttribute("width",s),t.setAttribute("height",r),t}static isSVGElement(t){return re.isElement(t)&&t.namespaceURI===Tt}static isSVGClipPathElement(t){return re.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,i){i?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var ne;re.instanceOf=function(t,e){return re.isElement(t)&&t.tagName===e.toUpperCase()},re.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(ne||(ne={}));const oe={name:"RealChart",version:"1.5.0",license:"enterprise",code:null};class ae{static decode(t){const e=ae.CHARS,i=ae.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}ae.PAD="=",ae.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class he{static union(t,e){const i=e.s3[255&t];t>>=8;const s=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^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=he.xor,s=he.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=he.xor,s=he.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map(function(t){return 255&t.charCodeAt(0)});const i=he.kb,s=he._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map(function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*he.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)}),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=he._decryptBlock;let s=he._init(e),r=[],n=ae.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*he.POW24|n[a+1]*he.POW16|n[a+2]*he.POW8|n[a+3],h.right=n[a+4]*he.POW24|n[a+5]*he.POW16|n[a+6]*he.POW8|n[a+7],i(h,s);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)}}he.POW2=Math.pow(2,2),he.POW3=Math.pow(2,3),he.POW4=Math.pow(2,4),he.POW8=Math.pow(2,8),he.POW16=Math.pow(2,16),he.POW24=Math.pow(2,24),he.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 le{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 i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}}return!1}static decrypt(t){const e={},i=he.decrypt(t,"dkdl"+this._getLDKey(he.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}const ce=new Map;function _e(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const de=function(t){const e=location.hostname;let i;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(i=oe.code||window.realChartLic,!i)throw new Error(s)}catch(t){throw new Error(s)}const r=le.decrypt(i);if(!function(t,e){if("RealChart"===t)return!0;const i=_e(e),s=ce.get(t);return!!s&&s.has(i)}(r.name,t)||"RealChart"!==oe.name)throw new Error(s);try{const t=r.server.toLowerCase(),i=location.pathname.toLowerCase();if(oe.license!=ne.Developer&&!le.includedDomains(t,e.toLowerCase(),i))throw new Error(s);const n=r.lic.toLowerCase();if(!Object.values(ne).includes(n))throw new Error(s);if(oe.license=r.lic,n==ne.Evaluation||n==ne.Limited){const t=r.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)}return!0},ue={linear:t=>t,inOutSine:t=>-(d(y*t)-1)/2},pe=function(t,e,i,s,r,n){const o=O(e,null!=i?i:"initial"),a=O(e,s),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class ge{constructor(){this.delay=0,this.duration=ge.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,i=t-this._started-this.delay;let s=g(1,f(0,mt(i/this.duration)));this._easing&&(s=this._easing(s)),this._rate=s,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(s,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{i>=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,i=null){this._started&&this._stop(!0),this.duration=P(t,ge.DURATION),this.delay=e||0,this._easing=ue[i],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}}ge.DURATION=700,ge.SHORT_DURATION=300;class fe extends ge{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var i,s;null===(s=(i=this.props).endHandler)||void 0===s||s.call(i,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 me=function(t){return new fe(t).start()},ye=function(t){return isNaN(t)?0:t};class be{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=>{o(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)}),this}move(t,e){return o(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return o(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return o(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,i){return t?this._path.push("L",e,i):this._path.push("M",e,i),this}vline(t,e,i){return this._path.push("M",t,e,"L",t,i),this}hline(t,e,i){return this._path.push("M",e,t,"L",i,t),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}quad(t,e,i,s){return o(t)?this._path.push("Q",t,e,i,s):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0,"Z"),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",ye(t[e]),ye(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",ye(t[e].x),ye(t[e].y));return this}polygon(...t){return o(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,i){return 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`),this}donut(t,e,i,s){return this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 1 ${2*i} 0 a ${i} ${i} 0 1 1 ${2*-i} 0 Z`),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 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const i={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),i}}getPoints(t,e,i=!0){const s=[];for(;t<this._path.length&&s.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)s.push({x:this._path[t+1],y:this._path[t+2]}),i&&this._path.splice(t,3);return s}spline(t,e,i){let s=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void this.line(t[s+1].px,t[s+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[s+1].px-t[s].px,y:t[s+1].py-t[s].py};let l={x:0,y:0},c=Math.sqrt(h.x*h.x+h.y*h.y);if(0===c)return void this.line(t[i].px,t[i].py);h.x/=c,h.y/=c;let _=t[s+1].px-t[s].px,d=t[s].px,u=t[s].py;for(++s;s!=i;s++){a.x=-h.x,a.y=-h.y,h.x=t[s+1].px-t[s].px,h.y=t[s+1].py-t[s].py,c=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=c,h.y/=c,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*_*r,n.y=-l.y*_*r;const i=d+o.x,p=u+o.y,g=t[s].px+n.x,f=t[s].py+n.y;this.curve(i,p,g,f,t[s].px,t[s].py),_=t[s+1].px-t[s].px,o.x=l.x*_*r,o.y=l.y*_*r,d=t[s].px,u=t[s].py}this.curve(d+o.x,u+o.y,t[s].px,t[s].py,t[s].px,t[s].py)}closedSpline(t,e){const i=t.length;if(i<3)return void this.line(t[1].px,t[1].py);const s=.17,r=e?e=>t[(e+i)%i]:e=>e<0?t[0]:e>=i?t[i-1]:t[e];for(let t=0,n=i-(e?0:1);t<n;t++){const e=r(t-1),i=r(t),n=r(t+1),o=r(t+2),a=i.px+(n.px-e.px)*s,h=i.py+(n.py-e.py)*s,l=n.px-(o.px-i.px)*s,c=n.py-(o.py-i.py)*s;this.curve(a,h,l,c,n.px,n.py)}}}const xe="pan-y",ve={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)","touch-action":xe};class we extends Z{constructor(t,e,i){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=>{var e;this.isTouchScrollBlocked()&&t.cancelable&&((null===(e=this._pointerHandler)||void 0===e?void 0:e.shouldPreventTouchMove)&&!this._pointerHandler.shouldPreventTouchMove(t)||t.preventDefault())},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._pointerHandler&&this._pointerHandler.handleCancel(this.toOffset(t))},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},de(e),!t&&re.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,i||we.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this.setTouchAction(),this._unresigterEventHandlers(this._dom),re.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,i){N(e)?(this._root.dom.removeAttribute("data-"+t),i&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),i&&this._dom.setAttribute("data-"+t,e))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){re.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let i=e.length-1;i>=0;i--)e[i].hasAttribute(t)&&e[i].remove()}clearAssetDefs(){this.$_clearDefs(Se.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(Tt,"clipPath")).forEach(t=>t.remove())}clearTemporaryDefs(){this.$_clearDefs(Se.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){var e,i;this._pointerHandler!==t&&(null===(i=null===(e=this._pointerHandler)||void 0===e?void 0:e.dispose)||void 0===i||i.call(e)),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,i=NaN,s=NaN,r=0){return this.addClip(new ke(this.doc(),t,e,i,s,r,r))}clipCircle(){return this.addClip(new Me(this.doc()))}clipDonut(){return this.addClip(new Ne(this.doc()))}clipPath(){return this.addClip(new Te(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(re.isElement(e)&&e.id===t){t=e;break}re.isElement(t)&&t.parentNode===this._defs&&this._defs.removeChild(t)}containerToElement(t,e,i){const s=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+s.x,y:i-r.y+s.y}}svgToElement(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+s.left,y:i-r.top+s.top}}elementToSvg(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-s.left,y:i+r.top-s.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,Se.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){!0===s?t.addEventListener(e,i,{passive:!0}):!1===s?t.addEventListener(e,i,{passive:!1}):t.addEventListener(e,i)}_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,!1),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,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.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(t,e,i){if(this._inited)return;const s=t.defaultView;e instanceof s.HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof s.HTMLDivElement||$(at.invalidOuterDiv,e),t=this._container.ownerDocument;const r=this._dom=t.createElement("div");l(r.style,ve),r.className=i,this._container.appendChild(r);const n=this._svg=t.createElementNS(Tt,"svg");n.classList.add("rct-svg"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=t.createElement("desc");o.textContent="Created by RealChart v"+oe.version,n.appendChild(o);const a=this._defs=t.createElementNS(Tt,"defs");this._initDefs(t,a),n.appendChild(a),r.appendChild(n),this._root=new Pe(this),n.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),r.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),r.appendChild(this._tester),st&&(this._canvas=t.createElement("canvas"))}_initDefs(t,e){let i=t.createElementNS(Tt,"filter");i.setAttribute("id",we.SHADOW_FILTER);const s=t.createElementNS(Tt,"feGaussianBlur");s.setAttribute("stdDeviation","1.5"),s.setAttribute("in","SourceAlpha"),i.appendChild(s);const r=t.createElementNS(Tt,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),i.appendChild(r);const n=t.createElementNS(Tt,"feFlood");n.setAttribute("flood-color","#000"),i.appendChild(n);const o=t.createElementNS(Tt,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),i.appendChild(o);const a=t.createElementNS(Tt,"feMerge"),h=t.createElementNS(Tt,"feMergeNode"),l=t.createElementNS(Tt,"feMergeNode");l.setAttribute("in","SourceGraphic"),a.appendChild(h),a.appendChild(l),i.appendChild(a),e.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{rt.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._svg.clientWidth,s=this._svg.clientHeight,r=this._canvas;!r||r.width===i&&r.height==s||(r.width=i,r.height=s,r.style.width=T(i),r.style.height=T(s)),l(this._htmlRoot.style,{left:T(e.left-t.left),top:T(e.top-t.top)});const n=this._container.firstElementChild;if(n.removeAttribute("style"),l(n.style,ve),i>0&&s>0){this._doRenderBackground(n,this._root,i,s);const t=this._padding=re.getPadding(this._root.dom);this._doRender({x:t.left,y:t.top,width:i-t.left-t.right,height:s-t.top-t.bottom})}}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),rt.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,i,s){}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const s=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout(()=>{s&&this.invalidateLayout(),this._resizeTimer=null},i):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){try{this._dom.setPointerCapture(t.pointerId)}catch{}}releasePointerCapture(t){try{this._dom.releasePointerCapture(t.pointerId)}catch{}}setTouchAction(t){this._dom&&(this._dom.style.touchAction=t||xe),this._container&&(t?(void 0===this._containerTouchAction&&(this._containerTouchAction=this._container.style.touchAction),this._container.style.touchAction=t):void 0!==this._containerTouchAction&&(this._container.style.touchAction=this._containerTouchAction,this._containerTouchAction=void 0))}isTouchScrollBlocked(){var t;return"none"===((null===(t=this._dom)||void 0===t?void 0:t.style.touchAction)||xe)}}we.CLASS_NAME="rct-control",we.SHADOW_FILTER="rr-chart-shadow-filter",we._animatable=!0;class Se extends Z{constructor(t,e,i=pt){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(Tt,i||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDispose(){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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,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(t,e){const i=t.createElementNS(Tt,e);return this._dom.appendChild(i),i}insertElement(t,e,i){const s=t.createElementNS(Tt,e);return this._dom.insertBefore(s,i),s}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 N(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,i,s){return this.trans(t,e),this.resize(i,s),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 st&&(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 i=this._dom.getBBox();return st&&(i={x:i.x,y:i.y,width:i.width,height:i.height}),i.x+=this._tx,i.y+=this._ty,i.x-=t,i.width+=2*t,i.y-=e,i.height+=2*e,i}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 fe||!!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=rt.isValidNum(t)?t:this._tx,e=rt.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 i;this._updateTransform(),e&&(null===(i=this.control)||void 0===i||i.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,i=0,s=!0){if(t=rt.isValidNum(t)?t:this._tx,e=rt.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(i>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:i,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",()=>{this.$_cleanMove(r,s)}),r.addEventListener("cancel",()=>{this.$_cleanMove(r,s)})):this.$_cleanMove(r,s)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,i=0,s=!0){if(t=rt.isValidNum(t)?t:this._tx,e=rt.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(i>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:i,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)}),a.addEventListener("cancel",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)})):(this._dom.style.transformOrigin="",this.$_cleanMove(a,s))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&rt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&rt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}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(ft(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(ft(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const i=this.dom.style;for(let s of t)s in this._styles&&(i.removeProperty(ft(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(ft(i),this._styles[i]=t[i],"important")}}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this._dom.setAttribute(s,r),i[s]=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)):i(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):i(t)&&this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):i(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let i=!1;return e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}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,A(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=me({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(0,t.from*(1-e)),!0),endHandler:(t,i)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!i&&this.remove(),null==e||e(this)},from:P(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=me({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=f(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:P(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,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(Se.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 i=this.parent._dom,s=this._dom,r=t.length;if(e){const n=e.sort((e,i)=>t.indexOf(e)-t.indexOf(i))[e.length-1];this!==n&&(s.remove(),n===t[r-1]?i.appendChild(s):i.insertBefore(s,t[t.indexOf(n)+1].dom))}else r>1&&s!==i.lastElementChild&&(s.remove(),i.appendChild(s))}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 Se.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(rt.isValidNum(e)||rt.isValidNum(i))&&(e=e||0,i=i||0,s.push("translate("+e+","+i+")")),this._rotation&&s.push("rotate("+this._rotation+" "+rt.pick(this._originX,t.getAttribute("x"),0)+" "+rt.pick(this._originY,t.getAttribute("y")||0)+")"),rt.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")");const r=rt.getNumber(this._scaleX,1),n=rt.getNumber(this._scaleY,1);return 1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length?s.join(" "):""}}Se.DEBUGGING=!1,Se.TESTING=!1,Se.ASSET_KEY="_asset_",Se.CLIP_KEY="_clip_",Se.TEMP_KEY="_temp_";class Ve extends Z{constructor(t,e,i=!1){super(),this._control=e,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(Tt,"svg"),re.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"}_doDispose(){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,i,s){return re.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${i}px`,height:`${s}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 Ce extends Se{constructor(t,e){super(t,e,"g")}}class Pe extends Se{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Ae extends Se{constructor(t){super(t,pt,"clipPath");const e=this._id=rt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ke extends Ae{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Se(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,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.x=t,this._rect.y=e,this._rect.resize(i,s),this}resize(t,e,i){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 Le extends Se{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 Te extends Ae{constructor(t){super(t),this._path=new Le(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class Me extends Ae{constructor(t){super(t),this.add(this._circle=new Se(t,null,"circle"))}setCircle(t,e,i){this._circle.setAttrs({cx:t,cy:e,r:i})}}class Ne extends Ae{constructor(t){super(t),this.add(this._donut=new Le(t))}setDonut(t,e,i,s){this._donut.setPath((new be).donut(t,e,i,s).end())}}class Ee{constructor(){this.dragging=!1}start(t,e,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this.dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this.dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,i){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,i){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_doCompleted(t,e,i){}_doEnded(t,e){}}var Be,Oe,De;t.TextAnchor=void 0,(Be=t.TextAnchor||(t.TextAnchor={})).START="start",Be.MIDDLE="middle",Be.END="end",t.TextLayout=void 0,(Oe=t.TextLayout||(t.TextLayout={})).TOP="top",Oe.MIDDLE="middle",Oe.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(De||(De={}));class $e extends Se{constructor(e,i=void 0){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._overflow=De.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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(e){const i=this.getBBox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(s)}this.y=r}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=f(0,t),(e=g(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.setStyleOrClass(se.isBright(getComputedStyle(t).fill)?e:i),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let i=super.setStyle(t,e);return i&&this.layoutText(),i}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 Re="$_TH",Ie="$_TW";class Fe{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?It.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=i[r+2]||"";else if(H.isDate(n)){const t=i[3]?ie.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+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),pt),0===this._literals[2].length&&(this._literals[2]=pt)}else this._literals.push(r,n,pt,pt);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class ze extends Fe{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class He extends ze{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach(t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}}),super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-link")}}const Ge={t:class extends ze{tag(){return"</t>"}},b:class extends ze{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-bold")}},i:class extends ze{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-italic")}},a:He};class je{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new Fe).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in Ge){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new Ge[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const Ye=/<br.*?>|\r\n|\n/;class We{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,i,s,r){if(this._isVertical)return void this.buildVertical(t,e,i,s,r);const n=t.doc,o=P(this.lineHeight,1),a=this._lines,h=a.length,l=[],c=[];t.clearDom(),s=s||t;const _=t.getStyle("writing-mode"),d=this._vertical=_===wt||_===St;for(let e=0;e<h;e++){const i=a[e];let h=0,_=0,u=null;for(let e of i.words){const i=e.prepareSpan(t.appendElement(n,"tspan"),s,r),o=i.getBBox();if(i[Ie]=o.width,i[Re]=o.height,d?(h=f(h,i[Ie]),_+=i[Re]):(h+=i[Ie],_=f(_,i[Re])),u||(u=i),e instanceof He){const s=n.createElementNS(Tt,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}c.push(u),i[Re]=_*o,i[Ie]=h*o,l.push(0==e?i[Ie]/2:i[Ie])}if(h>0){let e=a[0];for(let i=1;i<c.length;i++)if(c[i]){let s=0,r=0;if(d?null!=c[i-1]&&(s=Math.floor(e[Ie]-t.getAscent(e[Ie]))+t.getAscent(a[i][Ie])):r=e[Re]-t.getAscent(e[Re])+t.getAscent(a[i][Re]),null==c[0]&&c[i]==c.find(t=>null!=t)){const r=t.insertElement(n,"tspan",c[i]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();s+=o.width,r[Ie]=o.width,r[Re]=e[Re]=o.height,c[0]=r}switch(_){case wt:c[i].setAttribute("dx",String(s)),c[i].setAttribute("y","0");break;case St:c[i].setAttribute("dx",String(-s)),c[i].setAttribute("y","0");break;default:c[i].setAttribute("x","0"),c[i].setAttribute("dy",String(r))}e=a[i]}if(d){const e=t.parent.dom.classList.contains("rct-annotation"),i=t.getBBox().width,[s]=c,r=s[Ie];if(e)s.setAttribute("dx",String(_===St?i-r/2:r/2));else switch(_){case wt:s.setAttribute("x",String((i-r)/-2));break;case St:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(a[0][Re])}}buildVertical(t,e,i,s,r){const n=t.doc,o=P(this.lineHeight,1),a=this._lines,h=a.length,l=[];let c=0;const _=[];t.clearDom(),s=s||t;for(let e=0;e<h;e++){const i=a[e];let h=0,d=0,u=null,p=!1;for(let e of i.words){const i=e.prepareSpan(t.appendElement(n,"tspan"),s,r);" "===i.textContent&&(p=!0,i.textContent=".");const o=i.getBBox();if(i[Ie]=o.width,i[Re]=o.height,p&&(i.textContent=" ",i[Re]*=.6,p=!1),h+=i[Ie],d=f(d,i[Re]),u||(u=i),e instanceof He){const s=n.createElementNS(Tt,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}_.push(u),i[Re]=d*o,i[Ie]=h*o,c=f(h,c),l.push(0==e?i[Ie]/2:i[Ie])}if(h>0){let e=a[0];_[0].setAttribute("x",String((c-_[0].getBBox().width)/2));for(let i=1;i<_.length;i++)_[i]&&(_[i].setAttribute("x",String((c-_[i].getBBox().width)/2)),_[i].setAttribute("dy",String(e[Re]-t.getAscent(e[Re])+t.getAscent(a[i][Re]))),e=a[i]);t.layoutText(a[0][Re])}}layout(e,i,s,r,n){const o=e.getBBox();let a=0,h=0;if(this._vertical)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(Ye);for(let t of i)e.push((new je).parse(t))}}}class Xe{constructor(t){this.source=t}hasDef(){return!0}}class Ue extends Xe{_setStops(t,e){e.setAttribute("id",this.source.id);const i=this.source.color,r=null==this.source.opacity?1:this.source.opacity,n=s(i)?[...i]:[i,"white"],o=s(r)?[...r]:Array(n.length).fill(r);1===n.length&&n.push("white"),n.forEach((i,s)=>{!function(t,e,i,s,r){const n=t.createElementNS(Tt,"stop");n.setAttribute("offset",String(i)),n.setAttribute("stop-color",s),n.setAttribute("stop-opacity",String(r)),e.appendChild(n)}(t,e,s/(n.length-1),i,null==o[s]?1:o[s])})}prepare(){}}class Ze extends Ue{getEelement(t,e){const i=t.createElementNS(Tt,"linearGradient");let{x1:s,x2:r,y1:n,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),e.dir){case"up":n=1;break;case"right":r=1;break;case"left":s=1;break;default:o=1}return i.setAttribute("x1",s),i.setAttribute("y1",n),i.setAttribute("x2",r),i.setAttribute("y2",o),i}}Ze.TYPE="lineargradient";class qe extends Ue{getEelement(t,e){const i=t.createElementNS(Tt,"radialGradient");return N(e.cx)||i.setAttribute("cx",e.cx),N(e.cy)||i.setAttribute("cy",e.cy),N(e.r)||i.setAttribute("r",e.r),this._setStops(t,i),i}}qe.TYPE="radialgradient";class Ke extends Xe{prepare(){}getEelement(t,e){const s=t.createElementNS(Tt,"pattern"),r=t.createElementNS(Tt,"path");let o,a,h,c,_=!1;if(s.setAttribute("id",e.id),s.setAttribute("patternUnits","userSpaceOnUse"),r.classList.add("rct-pattern"),+e.pattern>=0){const t=Ke.STOCK[+e.pattern%Ke.STOCK.length];o=t.path,a=t.style,_=!t.fill,h=t.width||20,c=t.height||20}else n(e.pattern)&&(o=e.pattern,h=e.width||e.height||20,c=e.height||e.width||20);s.setAttribute("width",String(h)),s.setAttribute("height",String(c)),r.setAttribute("d",o),a&&l(r.style,a),e.style&&l(r.style,e.style),_&&(r.style.fill="none");let d=e.backgroundStyle;if(n(d)||i(d)){const e=t.createElementNS(Tt,"rect");s.append(e),e.style.fill=n(d)?d:d.fill,e.setAttribute("width",String(h)),e.setAttribute("height",String(c))}return s.append(r),s}}Ke.TYPE="pattern",Ke.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 Qe extends Xe{prepare(){const t=this.source;this._colors=s(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&rt.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]}getAt(t){const e=this._colors;if(null==e?void 0:e.length)return this._index<0?e[Math.floor(rt.randomLike(t)*e.length)]:e[t%e.length]}hasDef(){return!1}getEelement(t,e){this._colors=s(e.colors)?e.colors:[]}}Qe.TYPE="colors";class Je extends Xe{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 i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}})}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||Je.SIZE,height:e.height||e.width||Je.SIZE})}}Je.TYPE="images",Je.SIZE=20;class ti{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(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(i(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(i=>{const s=i.getEelement(t,i.source);s.setAttribute(Se.ASSET_KEY,"1"),e.addDef(s)})}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(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ke.TYPE:s(t.colors)?e=Qe.TYPE:s(t.images)&&(e=Je.TYPE)),e)switch(e.toLowerCase()){case Ze.TYPE:return new Ze(t);case qe.TYPE:return new qe(t);case Ke.TYPE:return new Ke(t);case Qe.TYPE:return new Qe(t);case Je.TYPE:return new Je(t)}}}}let ei=0;const ii=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},si=["__proto__","constructor","prototype"],ri=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)&&!si.includes(t)){const e=r[t];s(e)?n[t]=e.slice(0):i(e)?e._obj instanceof _t?n[t]=e:rt.isDate(e)?n[t]=new Date(e):n[t]=ri(n[t],e):n[t]=e}return n};class ni extends tt{constructor(t){super(),this.chart=t,ei++}_addChild(t,e){return super._addChild(t,e)}_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.prop("visible")}num(t){const e=this._op[t];return Et(e,this.constructor.defaults[t],void 0)}_load(t){var e;const i=this._op,s=this.visible;return this._config=t,void 0===t||this._doSetSimple(i,t)||this._doLoad(i,t),this._doApply(i),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this)),i}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this._load(t),this}saveOptions(t,e=!0,i=!1,s=!1){return void 0===t&&arguments.length<=1?super.saveOptions(void 0,!0,i,s):"boolean"==typeof t?super.saveOptions(void 0,t,i,s):super.saveOptions(t,e,i,s)}updateOptions(t,e=!0){var s;const r=this.visible;if(i(t)){const e={},i=[];for(const s in t)this._findChild(s)?this._doUpdateProp(s,t[s])||i.push(s):e[s]=t[s];super.updateOptions(e,!1),i.forEach(e=>{this._findChild(e).updateOptions(t[e],!1)})}else super.updateOptions(t,!1);return this.visible!==r&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),e&&this._optionChanged(),this}updateOption(t,e,i=!0,s=!1){var r;const n=this.visible;let o=!1;if(this._doUpdateProp(t,e))this._doApply(this._op),o=!0;else{const i=this._findChild(t);i?(i.updateOptions(e,!1),o=!0):(s||e!==this.prop(t))&&(super.updateOption(t,e,!1,s),o=!0)}return this.visible!==n&&(null===(r=this.chart)||void 0===r||r._visibleChanged(this)),o&&i&&this._optionChanged(t),this}toggleOption(t,e=!0){var i;const s=this.visible;return super.toggleOption(t,!1),this.visible!==s&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),e&&this._optionChanged(t),this}removeOption(t,i=!0){var s;const r=this.visible,n=this._findChild(t);let o=!1;return n?(n.clearOptions(!0,!1),o=!0):e.call(this._op,t)&&(super.removeOption(t,!1),o=!0),this.visible!==r&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),o&&i&&this._optionChanged(t),this}clearOptions(t=!0,e=!0){var i;const s=this.visible;return super.clearOptions(t,!1),this.visible!==s&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),e&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,i,s=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==i&&""!==i||(i=void 0),void 0===i?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==i||(r||(r=this._style=this._op.style={}),r[t]=String(i),n=!0),n&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(t)){n||(n=this._style=this._op.style={});for(const e in t){let i=t[e];n[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_optionChanged(t){this._changed(t)}_doLoad(t,r){var n;if(null!=(null==r?void 0:r.template)){const t=null===(n=this.chart)||void 0===n?void 0:n.assignTemplates;t&&(r=t(r))}for(const n in r)if(e.call(r,n)){let e=r[n];const o=this._findChild(n);this._doLoadProp(n,e)?t[n]=e:o?o._load(e):s(e)?t[n]=e.slice(0):i(e)?e._obj instanceof _t?t[n]=e._obj:rt.isDate(e)?t[n]=new Date(e):t[n]=l({},e):t[n]=e}}_doSetSimple(t,e){return a(e)?(t.visible=e,!0):super._doSetSimple(t,e)}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=At(this[i]=s,!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}ni.REFRESHED="refreshed",ni.defaults=ii(tt.defaults,{visible:!0});class oi{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 ai extends ni{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){const e=rt.isValidNum(t)&&t>=0?t:P(this.constructor.defaults.outlineThickness,2);e!==this._outlineThickness&&(this._outlineThickness=e,this._outlineWidth=e+"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?It.getFormatter(t):null)}_setText(t){if(t!==this._text&&this.prepareRich(this._text=t),this._richTextImpl){const t=this.num("lineHeight");this._richTextImpl.lineHeight=rt.isValidNum(t)&&t>=0?t:NaN}return this}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,n){this._richTextImpl?(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n)):(t&&(t.clearDom(),t.text=""),e&&(e.clearDom(),e.text=""))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new We),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.num("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(this.prop("text"))}_getNumberText(t,e,i){if(rt.isValidNum(t)){const s=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(s&&(t=s.toNum(t)),n=rt.scaleNumber(t,r,i)),s?n?s.toStr(n.value)+n.symbol:s.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this._getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(r=o+r),a&&(r+=a),r}}ai.defaults=ii(ni.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class hi extends ai{getIconPos(){const t=this.prop("iconPosition"),e="default"===t?this.getDefaultIconPos():t;switch(e){case"left":case"right":case"top":case"bottom":return e;default:return this.getDefaultIconPos()}}_doPrepareRender(t){this._images=null;const e=this.prop("imageList");if(e){const i=t._assets.get(e);i instanceof Je&&(this._images=i)}this._root=this.prop("iconRoot")||""}getIconUrl(t){const e=this.prop("icon")||t;return n(e)?this.getUrl(e):null}getUrl(t){if(t){n(t)||(t=String(t));const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Je?i.getImage(r):s}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}hi.defaults=ii(ai.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class li extends ni{}const ci={};class _i extends ni{static register(...t){t.forEach(t=>{ci[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.prop("noClip")}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const i=this.chart.isInverted();let s,r;if(this.body){const n=+this.prop("x1"),o=+this.prop("x2"),a=+this.prop("y1"),h=+this.prop("y2");if(this._x=this._y=this._w=this._h=NaN,!isNaN(n)){const a=this.chart.getAxisOf(this,!0);i?this._y=e-a.getPos(e,n):this._x=a.getPos(t,n),isNaN(o)||(i?r=this._h=e-a.getPos(e,o)-this._y:s=this._w=a.getPos(t,o)-this._x)}if(!isNaN(a)){const n=this.chart.getAxisOf(this,!1);i?this._x=n.getPos(t,a):this._y=e-n.getPos(e,a),isNaN(h)||(i?s=this._w=n.getPos(t,h)-this._x:r=this._h=e-n.getPos(e,h)-this._y)}}return isNaN(s)?s=R(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=R(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:s,height:r}}getPosition(t,e,i,s,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this.prop("align")){case"center":h+=(s-n)/2+a.x;break;case"right":h+=s-a.x-n;break;default:this._anchorObj?h+=(s-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=i,this.prop("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(ni.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,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=this.prop("name")||`annotation ${this.index+1}`,this._row=isNaN(this.num("row"))?NaN:this.num("row")|0,this._col=isNaN(this.num("col"))?NaN:this.num("col")|0,(s=this.prop("offsetX"))!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(this.prop("offsetY")),this._setDims(t,"width","height")}_doPrepareRender(t){}}_i.defaults=ii(ni.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class di extends oi{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(i=>{const s=i.prop("row"),r=i.prop("col");return t===s&&e===r})}getAnnotation(t){const e=this._map[t];if(e instanceof _i)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={};s(t)?t.forEach((t,i)=>{n.push(this.$_loadItem(r,t,i,e?this.owner:void 0))}):i(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.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):pt})}$_loadItem(t,e,i,s){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,s);return a.init(),a.index=i,a._load(e),a}}class ui extends ge{constructor(t,e,i,s){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=i,this.start(s)}getPos(t,e){const i=this._axis,s=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=i._vlen;if(s<=0)return t;if(s>=r)o=s<=0?a:a+a*(s-r)/s*(1-n),t=t*o/a;else{o=a+a*(r-s)/r*(1-n),t=t*a/o}return t+this._offset*(o/s)*(1-n)*(e?-1:1)}_doUpdate(t,e){return this.$_calcRange(t),this._axis._changed(),!0}_stop(t){t||this._doUpdate(1,0),super._stop(t)}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const i=this._axis.axisMin(),s=this._axis.axisMax();this._axisLen=s-i,this._offset=i-e}}class pi extends ni{}pi.defaults=ii(ni.defaults,{minWidth:50});class gi extends ni{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=this._addChild("flag",new pi(this.axis.chart)),this._args={chart:void 0,axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this.prop("type")}getFlag(t,e){const i=this.axis.axisValueAt(t,e);if(i instanceof this.chart.win.Date)try{return ie.getFormatter(this.prop("timeFormat")).toStr(new Date(i),this.chart.startOfWeek)}catch{return ie.getFormatter(gi.defaults.timeFormat).toStr(new Date(i),this.chart.startOfWeek)}else try{return It.getFormatter(this.prop("numberFormat")).toStr(i)}catch{return It.getFormatter(gi.defaults.numberFormat).toStr(i)}}moved(t,e,i){const s=this.prop("onChange");s&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=i.slice(0),s(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t,e){return r(e)?(this._op.visible=!0,this._op.onChange=e,!0):super._doSetSimple(t,e)}}gi.defaults=ii(ni.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const fi={};class mi extends ni{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class yi extends mi{_isVisible(){const t=this.prop("visible");return null==t?this.axis._isX:t}_doSetSimple(t,e){return n(e)?(this._op.visible=!0,this._op.style={stroke:e},!0):super._doSetSimple(t,e)}}yi.defaults=ii(mi.defaults,{visible:void 0});class bi extends mi{getGap(){return this._gap}getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return st?"vertical"===e?0:"opposite"===this.axis.prop("position")?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.prop("position")?90:270}return this._rotation}getTextOrientation(){var t;return null!==(t=this.prop("textOrientation"))&&void 0!==t?t:bi.defaults.textOrientation}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;super._doApply(t),function(t){let i=+t;Number.isNaN(i)||90===i||270===i||-90===i||-270===i||(i=0),e._rotation=i}(this.prop("rotation"));const i=parseFloat(String(this.prop("gap")));this._gap=isNaN(i)?bi.defaults.gap:i}}bi.defaults=ii(mi.defaults,{align:"middle",offset:0,gap:5,textOrientation:"upright"});class xi extends mi{_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}xi.defaults=ii(mi.defaults,{position:"end",gap:2});class vi extends mi{getRows(){if(!1===this.prop("visible"))return[];const t=this.axis,e=this.prop("colors"),i=e?e.length:0,s=[],r=this._style;if(this.prop("belowColor")&&t.isBaseVisible()&&s.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this.prop("belowColor"),style:r}),i>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%i]&&s.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%i],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%i]&&s.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%i],style:r});n[n.length-1].value<t.valueMax()&&e[o%i]&&s.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%i],style:r})}return s}_doSetSimple(t,e){return n(e)?(this._op.colors=[e,null],!0):s(e)?(this._op.colors=e,!0):super._doSetSimple(t,e)}}class wi extends mi{_doInit(t){this._rows=this._addChild("rows",new vi(this.axis))}get rows(){return this._rows}_isVisible(){const t=this.prop("visible");return this.axis._isPolar?!1!==t:null==t?!this.axis._isX:t}}wi.defaults=ii(mi.defaults,{visible:void 0,depthVisible:void 0});class Si extends hi{getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}Si.defaults=ii(hi.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Vi extends mi{_doInit(t){this._label=this._addChild("label",new Si(this.axis.chart))}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const i=this._op;if(s(i.col)){for(const t of i.col)if(e==t)return!0;return!1}if(!isNaN(i.col)&&e!=i.col)return!1;if(s(i.row)){for(const e of i.row)if(t==e)return!0;return!1}return!(!isNaN(i.row)&&t!=i.row)}}Vi.defaults=ii(mi.defaults,{front:!1,zindex:0});class Ci extends Vi{}class Pi extends Vi{}class Ai extends mi{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}isShowLast(){return!1!==this.prop("showLast")}isShowFirst(){return!1!==this.prop("showFirst")}_doSetSimple(t,e){return rt.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._inside="inside"===this.prop("location");const e=this.num("length");this._length=isFinite(e)?e:Ai.defaults.length,this._gap=this.num("gap")}}Ai.defaults=ii(mi.defaults,{visible:!1,length:7,gap:3});class ki extends mi{_getLength(){return this._length}_getCount(){return this._count}_doSetSimple(t,e){return rt.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._length=this.num("length"),this._count=f(1,c(this.num("count")))}}ki.defaults=ii(mi.defaults,{visible:!1,count:4,length:4});class Li extends mi{}Li.defaults=ii(mi.defaults,{visible:!1});class Ti extends hi{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){const i=t.index,s=this.prop("textCallback");if(s){const e=s(this.axis.getTickLabelArgs(i,t.value));if(null!=e)return e}const r=this.prop("text"),n=this.prop("firstText"),o=this.prop("lastText");return 1==e?A(null!=o?o:n,r):0==i?A(n,r):i==e-1?A(o,r):r}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===this.prop("location")}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Ti.defaults=ii(hi.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Mi extends mi{getThickness(){return Math.max(0,this.num("thickness"))}getMinThumbSize(){return Math.max(0,this.num("minThumbSize"))}getGap(){return Math.max(0,this.num("gap"))}getGapFar(){return Math.max(0,this.num("gapFar"))}}Mi.defaults=ii(mi.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class Ni{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?rt.clamp(t,this.min,this.max):rt.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,i){if(t>e){const i=t;t=e,e=i}const s=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(s&&e>=t&&(isNaN(i)||o/r>=i)&&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 Ei extends yi{}class Bi extends ni{static register(...t){t.forEach(t=>{fi[t.type]=t,t.subtype&&(fi[t.subtype]=t)})}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._minorValues=[],this._minorMarkPoints=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){this._title=this._addChild("title",new bi(this)),this._unitLabel=this._addChild("unitLabel",new xi(this)),this._line=this._addChild("line",new yi(this)),this._sectorLine=this._addChild("sectorLine",new Ei(this)),this._tick=this._addChild("tick",this._createTickModel()),this._label=this._addChild("label",this._createLabel()),this._grid=this._addChild("grid",this._createGrid()),this._crosshair=this._addChild("crosshair",new gi(this)),this._scrollBar=this._addChild("scrollBar",new Mi(this))}_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(){const t=this.prop("visible");return!0===t||!1!==t&&!this._isEmpty}_isVisible(){return this.checkVisible()}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 x+v*this.num("startAngle")}getTotalAngle(){return v*this._totalAngle}isArced(){return this._totalAngle>0&&this._totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach(e=>{e.visible&&t.push(...e.getVisibleSeries())}),t}unitPad(){return 0}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.prop("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 i=e.needAxes()?[]:null;e.collectValues(this,i),i&&(e._yMin=g(...i),e._yMax=f(...i),t.push(...i))})}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.prop("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 i=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&i.length>0)if(t.isSplitted()){const t=[i[0].row];for(let e=1;e<i.length;e++)t.indexOf(i[e].row)<0&&t.push(i[e].row);t.forEach(t=>{let e=0,s=0;i.forEach(i=>{i.row==t&&i.isClusterable()&&(e+=P(i.groupWidth(),1))}),i.forEach(i=>{if(i.row==t&&i.isClusterable()){const t=P(i.groupWidth(),1)/e;i.setCluster(t,s),s+=t}})})}else{let t=0,e=0;i.forEach(e=>{e.isClusterable()&&(t+=P(e.groupWidth(),1))}),i.forEach(i=>{if(i.isClusterable()){const s=P(i.groupWidth(),1)/t;i.setCluster(s,e),e+=s}})}}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+rt.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),g(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Ni(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,i=NaN){const s=this._prepareZoom(),r=s.resize(t,e,i);return r&&(s.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.bool("reversed"),t*this._prevRate)}checkExtents(t,e){var i;null===(i=this._ani)||void 0===i||i.cancel(),this._min===t&&this._max===e||(this._ani=new ui(this,t,e,()=>{this._changed()}))}isAnimating(){return null!=this._ani}_posValue(){const t=this.prop("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 i=this,r=this.guides,n=function(t){var e;t!==i._guides&&(i._guides=t,e=s(t)?t:[t],r.length=0,e.forEach(t=>{let e;e="range"===t.type?new Pi(i):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new Ci(i):new Pi(i),e.init(),e._load(t),r.push(e)}))};super._doApply(t),this._name=this.prop("name")||`-axis-${this._index+1}`,this._row=P(Math.max(0,this.num("row")|0),0),this._col=P(Math.max(0,this.num("col")|0),0),this._totalAngle=f(0,g(360,this.num("totalAngle"))),e.call(this._op,"guide")?n(this.prop("guide")):e.call(this._op,"guides")&&n(this._op.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?mt(g(...t)||0):NaN,max:t.length>0?mt(f(...t)||0):NaN}}}Bi.defaults=ii(ni.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 Oi extends oi{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;s(t)?t.forEach((t,i)=>this._items.push(this.$_loadAxis(e,t,i))):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(i=>{(e<=2||i._isHorz)&&i._buildTicks(t,e)})}connect(t){const e=this.isX,i=this._items,s=t.options,r=e?s.xAxis:s.yAxis;let a;if(o(r)&&r>=0&&r<i.length?a=i.find(t=>t._index===r):n(r)&&(a=i.find(t=>t.prop("name")===r)),a||(a=i[0]),a&&this.chart.isValidAxis(a))return a._connect(t),this.isX?t.setCol(a.col):t.setRow(a.row),a}forEach(t){for(let e=0,i=this._items.length;e<i&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach(t=>t.resetZoom())}$_loadAxis(t,e,i){var r;let n=t._getAxisType(e.type);if(!n){let o;if(s(e.categories))o="category";else if(this.isX){const s=t._getSeries()._internalItems();if(s.length>0){o="category";for(const t of s)if(!t.canCategorized()){if(e.name&&t.prop("xAxis")===e.name){o=void 0;break}if(t.prop("xAxis")===i){o=void 0;break}if(N(t.prop("xAxis"))&&0===i){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=i,o.init(),o._load(e),o}}class Di extends ni{_doPrepareRender(t){}}const $i={},Ri={};class Ii extends Di{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:R(this._widthDim||this._sizeDim,t,t),height:R(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return R(this._leftDim,t)}getRight(t){return R(this._rightDim,t)}getTop(t){return R(this._topDim,t)}getBottom(t){return R(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=this.prop("name")||`Gauge ${this.index+1}`,this._row=P(this.num("row")|0,0),this._col=P(this.num("col")|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}Ii.defaults=ii(Di.defaults,{size:"100%"});class Fi extends Ii{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach(t=>{$i[t.type]=t})}static _loadGauge(t,e,i){let s=t._getGaugeType(e.type);s||(s=t._getGaugeType(i||t.gaugeType));const r=new s(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}Fi.defaults=ii(Ii.defaults,{duration:500});class zi extends Ii{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach(t=>{Ri[t.type]=t,Ri[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.prop("minValue"),max:this.prop("maxValue")}}_doApply(t){super._doApply(t),e.call(this._op,"children")&&this.$_loadGauges(this.chart,this.prop("children"))}saveOptions(t,e=!0,i=!1,s=!1){const r=super.saveOptions(t,e,i,s);return void 0!==r.children&&(r.children=this._gauges.map(t=>t.saveOptions())),r}_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();s(e)?e.forEach((e,i)=>this.$_add(Fi._loadGauge(t,e,r))):i(e)&&this.$_add(Fi._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)}}zi.defaults=ii(Ii.defaults,{minValue:0});class Hi extends oi{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(i=>{const s=i.row||0,r=i.col||0;return t===s&&e===r})}getGauge(t){const e=this._map[t];if(e instanceof Fi)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={};s(t)?t.forEach((t,i)=>{r.push(this.$_loadItem(e,t,i))}):i(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach(t=>{if(t.name&&(n[t.name]=t),t instanceof zi)for(let e=0;e<t.count();e++){const i=t.get(e);i.name&&(n[i.name]=i),this._gauges.push(i)}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,i){if(0===Object.keys($i).length&&0===Object.keys(Ri).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=s(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=i,n}}class Gi extends Fi{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),this._label=this._addChild("label",this._createLabel())}get label(){return this._label}getValue(){return f(this.prop("minValue"),g(this.prop("maxValue"),P(this._runValue,this.prop("value"))))}_setValueRate(t){this._runValue=this._prevValue+(this.prop("value")-this._prevValue)*t}updateValue(t){t!==this.prop("value")&&(this._op.value=t,this._changed())}getLabel(t,e){return t.prop("text")||(t.prop("prefix")||"")+"${value}"+(t.prop("suffix")||"")}getParam(t){switch(t){case"value":return this.label.prop("animatable")?P(this._runValue,this.prop("value")):this.prop("value");case"min":return this.prop("minValue");case"max":return this.prop("maxValue")}}calcedMinMax(){return{min:this.prop("minValue"),max:this.prop("maxValue")}}}Gi.defaults=ii(Fi.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class ji extends ni{constructor(t){super(t.chart),this.scale=t}}ji.defaults=ii(ni.defaults,{reversed:!1,length:7});class Yi extends hi{getText(t){return rt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class Wi extends ni{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._line=this._addChild("line",new ni(e)),this._tick=this._addChild("tick",new ji(this)),this._label=this._addChild("label",new Yi(e))}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,i=NaN){i=P(i,e);const{min:s,max:r}=this._adjustMinMax(g(e,i),f(e,i));return this._steps=this._buildSteps(t,s,r)}buildGroupSteps(t,e){const{min:i,max:s}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,i,s)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const i=this.gauge;return t=P(i.prop("minValue"),t),e=P(i.prop("maxValue"),e),this._min=g(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let i=e.prop("minValue"),s=e.prop("maxValue");return isNaN(i)&&(i=g(...t)),isNaN(s)&&(s=f(...t)),this._min=g(i,s),this._max=f(s,i),{min:this._min,max:this._max}}_buildSteps(t,e,i){let s;const r=this.prop("steps"),n=this.prop("stepCount"),o=this.prop("stepInterval"),a=this.prop("stepPixels");return s=Array.isArray(r)?r.slice(0):n>0?this._getStepsByCount(n,e,i):o>0?this._getStepsByInterval(o,e,i):a>0?this._getStepsByPixels(t,a,e,i):[e,i],this._min=s[0],this._max=s[s.length-1],s}_getStepsByCount(t,e,i){let s=(i-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(s))),n=[];s=this._step=Math.ceil(s/r)*r,n.push(mt(e));for(let e=1;e<t;e++)n.push(mt(n[e-1]+s));return n}_getStepsByInterval(t,e,i){const s=[];let r;for(s.push(r=e);r<i;)s.push(r+=t);return this._step=t,s}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,i,s){const r=[],n=s-i;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,c=0;if(o/=a,h)if(o>h[c]){for(;c<h.length-1;c++)if(o>h[c]&&o<h[c+1]){o=h[++c];break}}else o=h[c];for(o*=a,this._step=o,r.push(mt(l=i));;){if(l+=o,l>=s){r.push(mt(s));break}r.push(mt(l))}return r}}Wi.defaults=ii(ni.defaults,{position:"default",stepPixels:48,gap:8});class Xi extends ni{}Xi.defaults=ii(ni.defaults,{visible:!1});class Ui extends ni{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._rangeLabel=this._addChild("rangeLabel",new Xi(e)),this._tickLabel=this._addChild("tickLabel",new ni(e))}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?R(this._thicknessDim,t,0):"inside"===this.prop("position")?t:Ui.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("ranges"))!==e._ranges&&(e._ranges=i,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=bt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Ui.defaults=ii(ni.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Zi extends ai{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Zi.defaults=ii(ai.defaults,{animatable:!0});class qi extends Zi{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:R(this._offsetXDim,t,0),y:R(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}qi.defaults=ii(Zi.defaults,{offsetX:0,offsetY:0});class Ki{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Qi.DEF_CENTER),this.setCenterY(Qi.DEF_CENTER),this.setRadius(Qi.DEF_RADIUS),this.setInnerRadius(Qi.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=At(A(t,Qi.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=At(A(t,Qi.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=At(A(t,Qi.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=At(A(t,Qi.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=At(t,!0))}getCenter(t,e){return{x:R(this._centerXDim,t,t/2),y:R(this._centerYDim,e,e/2)}}getExtents(t){const e=R(this._radiusDim,t,t/2),i=g(e,this._innerDim?R(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?R(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=P(t%360,0),s=f(0,g(360,P(e,360)));this._startRad=x+v*i,this._handRad=v*i,this._sweepRad=v*s}}class Qi extends Gi{_doInit(t){super._doInit(t),this._props=new Ki}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 qi(this.chart)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(this.prop("centerX")),e.setCenterY(this.prop("centerY")),e.setRadius(this.prop("radius")),e.setInnerRadius(this.prop("innerRadius")),e.setValueRadius(this.prop("valueRadius"))}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new Ki)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.prop("startAngle"),e.prop("sweepAngle")):this._props.prepareAngles(this.prop("startAngle"),this.prop("sweepAngle"))}}Qi.DEF_CENTER="50%",Qi.DEF_RADIUS="40%",Qi.DEF_INNER="80%",Qi.defaults=ii(Gi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ji extends zi{_doInit(t){this._props=new Ki,this._label=this._addChild("label",new qi(this.chart))}get label(){return this._label}getProps(){return this._props}setChildExtents(t){const e=this._visibles.length;if(e>0){const i=this.num("itemGap");let s=t.radius;const r=(s-t.inner-i*(e-1))/e;this._visibles.forEach((t,e)=>{const n=t._childProps;n.setRadius(s),n.setInnerRadius(s-r),s-=r+i})}}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(this.prop("centerX")),e.setCenterY(this.prop("centerY")),e.setRadius(this.prop("radius")),e.setInnerRadius(this.prop("innerRadius")),e.setValueRadius(this.prop("valueRadius"))}}Ji.defaults=ii(zi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ts=class extends ni{constructor(t){super(t.chart),this.body=t}_isVisible(){var t,e,i,s;return!1!==this.prop("visible")&&!!(null===(e=null===(t=this.body)||void 0===t?void 0:t.isZoomed)||void 0===e?void 0:e.call(t))&&!!(null===(s=null===(i=this.body)||void 0===i?void 0:i.canZoom)||void 0===s?void 0:s.call(i))}};ts.defaults=ii(ni.defaults,{visible:void 0});class es extends ai{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this.prop("text")||this.chart._body.emptyView.prop("text")||es.DEF_TEXT}}function is(t,e){return e._vlen>0?e._vlen:f(0,P(t.rd,0)-P(t.rdInner,0))}function ss(t,e,i){const s=P(t.rdInner,0),r=is(t,e);return r<=0?s:s+e.getPos(r,i)}function rs(t,e,i,s){const r=P(t.rdInner,0),n=is(t,e);return n<=0?r:r+e.getPos(n,i)*s}es.DEF_TEXT="표시할 데이터가 없습니다.",es.defaults=ii(ni.defaults,{visible:void 0});class ns extends hi{getDefaultIconPos(){return"left"}}class os extends ni{}os.defaults=ii(ni.defaults,{visible:!1});class as extends ni{_doInit(t){this._line=this._addChild("line",new os(this.chart)),this._endLine=this._addChild("endLine",new os(this.chart)),this._gridLine=this._addChild("gridLine",new os(this.chart))}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}as.defaults=ii(ni.defaults,{});class hs extends ni{_doInit(t){this._xSide=this._addChild("xSide",new as(this.chart)),this._ySide=this._addChild("ySide",new as(this.chart)),this._orgLine=this._addChild("orgLine",new os(this.chart))}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this.bool("visible")&&this.num("length")>=0}_doSetSimple(t,e){return o(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._angle=g(60,f(30,this.num("angle")))}prop(t){return"angle"===t?this._angle:super.prop(t)}}hs.defaults=ii(ni.defaults,{visible:!1,length:32,angle:32});class ls extends ni{constructor(t){super(t),this._annotations=new di(this)}_doInit(t){this._depth=this._addChild("depth",new hs(this.chart)),this._image=this._addChild("image",new li(null)),this._emptyView=this._addChild("emptyView",new es(this.chart)),this._innerText=this._addChild("innerText",new ns(this.chart)),this._zoomButton=this._addChild("zoomButton",new ts(this))}anchorByName(t){var e;const i=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return i instanceof Ii&&this.contains(i)?i:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get innerText(){return this._innerText}hasInner(){return!!(this._innerRadiusDim&&this._innerRadiusDim.size>0)}get zoomButton(){return this._zoomButton}canZoom(){const t=this.prop("zoomType");return!this.chart.isEmpty(!0)&&("x"===t||"y"===t||"both"===t)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const i=this._depth.num("length"),s=this._depth.prop("angle"),r=_(d(s*v)*i),n=_(u(s*v)*i);return{depth:i,angle:s,base:r,side:n,wBody:t-r,hBody:e-n}}}getRadius(t,e){return R(this._radiusDim,g(t,e))}getInnerRadius(t){const e=this._innerRadiusDim;return e&&e.size>0?e.size/(e.fixed?t:100):0}getInnerRadiusPx(t){const e=this.getInnerRadius(t);return e>0?g(e*t,t):0}setPolar(t,e){return this._cx=R(this._centerXDim,t),this._cy=R(this._centerYDim,e),this._rd=R(this._radiusDim,g(t,e)),this._rdInner=this.getInnerRadiusPx(this._rd),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,rdInner:this._rdInner,cyclic:t&&!t.isArced()&&t.getTotalAngle()>0}: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 i=this,s=function(t){t!==i._anns&&(i._anns=t,i._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","innerRadius","centerX","centerY"),e.call(this._op,"annotation")?s(this.prop("annotation")):e.call(this._op,"annotations")&&s(this._op.annotations)}_doPrepareRender(t){this._annotations.prepareRender(),this._innerText._prepareRender()}}ls.defaults=ii(ni.defaults,{circular:!0,zoomType:"none",radius:"45%",innerRadius:0,centerX:"50%",centerY:"50%"});class cs extends ni{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,i){this._module&&this._module.exportToImage(t,e,i)}}cs.defaults=ii(ni.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class _s extends ni{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class ds extends Di{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.slice(0)}getLayout(){const t=this.prop("layout");if("auto"!==t||"body"===this._location)return t;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return R(this._maxWidthDim,t,t)}getMaxHeight(t){return R(this._maxHeightDim,t,t)}getMarkerSize(){return this.num("markerSize")}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map(t=>t.source):t.source}_isVisible(){const t=this.prop("visible");return!0===t&&this._visItems.length>0||!1!==t&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t),this._location=this.prop("location")||ds.defaults.location,this._items=this._getLegendSources().map(t=>new _s(this,t)),this.prop("reversed")&&(this._items=this._items.reverse());const e=this._itemMap={},i=this._visItems=[];this._items.forEach(t=>{const s=t.source.legendKey();if(rt.isNotEmpty(s)&&""!==s){const r=e[s];r?r.push(t):(e[s]=[t],i.push(t))}else i.push(t)})}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var us;ds.defaults=ii(Di.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 ps=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),gs=.001;class fs{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,i,s){return["M",t,e,"L",i,s]}static arrowParts(t,e,i,s,r){const n=i-t,o=s-e,a=Math.sqrt(n*n+o*o);if(a<.001)return{body:this.line(t,e,i,s),head:[]};const h=null!=r?f(1,g(r,.9*a)):g(.15*a,12),l=Math.atan2(o,n),c=y/6,_=i+h*d(l+Math.PI-c),p=s+h*u(l+Math.PI-c),m=i+h*d(l+Math.PI+c),b=s+h*u(l+Math.PI+c);return{body:["M",t,e,"L",(_+m)/2,(p+b)/2],head:["M",_,p,"L",i,s,"L",m,b,"Z"]}}static polygon(...t){let e=0;const i=["M",t[e],t[e+1]];for(;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i.push("Z"),i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){const o=s>0,a=o?0:1;return r>0?n>0?(r=g(m(s)/2,i/2,r),n=g(m(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=g(m(s)/2,i/2,r),["M",t,e,"v",s+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s-r,"Z"]):n>0?(n=g(m(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n:+n),"h",i,"v",-s+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=g(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static isCircled(t){return b-t<gs}static arc(t,e,i,s,r,n,o,a=!1){const h=g(b,m(n-r)),l=this.isCircled(h),c=h>y?1:0,_=o?1:0,p=d(r),f=u(r),x=d(n-=l?_?gs:-.001:0),v=u(n),w=[];return w.push("M",t+i*p,e+s*f,"A",i,s,0,c,_,t+i*x,e+s*v),l&&w.push("M",t,e),a&&w.push("Z"),w}static sector(t,e,i,s,r,n,o,a){const h=g(b,m(o-n)),l=this.isCircled(h),c=h>y?1:0,_=a?1:0,p=d(n),f=u(n),x=d(o-=l?_?gs:-.001:0),v=u(o),w=i*r,S=s*r,V=[];return V.push("M",t+i*p,e+s*f,"A",i,s,0,c,_,t+i*x,e+s*v),l?V.push("M",t+w*x,e+S*v):V.push("L",t+w*x,e+S*v),r>0&&V.push("A",w,S,0,c,1-_,t+w*p,e+S*f),V.push("Z"),V}static donut(t,e,i,s){return["M",t-i,e,"a",i,i,0,1,1,2*i,0,"a",i,i,0,1,1,2*-i,0,"Z","M",t-s,e,"a",s,s,0,1,0,2*s,0,"a",s,s,0,1,0,2*-s,0,"Z"]}static arc3d(t,e,i,s,r,n,o,a,h){function l(t,e,n,o){w.push("M",t,e,"A",i,s,0,_,c,n,o),w.push("L",n,o+r),w.push("A",i,s,0,_,1-c,t,e+r),w.push("Z")}const c=a?1:0;let _,p=g(b,m(o-n));const f=this.isCircled(p);let x=(n%b+b)%b,v=(o%b+b)%b;const w=[];let S,V,C,P;if(!f&&(c&&x<=y&&v>=0&&v<x||!c&&v<=y&&x>=0&&x<v))_=0,c?(S=t+i*d(n),V=e+s*u(n),C=t+i*d(y),P=e+s*u(y),l(S,V,C,P),h&&(h.x1=S,h.y1=V),S=t+i*d(0),V=e+s*u(0),C=t+i*d(o),P=e+s*u(o),l(S,V,C,P),h&&(h.x2=C,h.y2=P)):(S=t+i*d(n),V=e+s*u(n),C=t+i*d(0),P=e+s*u(0),l(S,V,C,P),h&&(h.x1=S,h.y1=V),S=t+i*d(y),V=e+s*u(y),C=t+i*d(o),P=e+s*u(o),l(S,V,C,P),h&&(h.x2=C,h.y2=P));else{S=t+i*d(n),V=e+s*u(n),C=t+i*d(o-=f?c?gs:-.001:0),P=e+s*u(o),c?(x=f||x<=b&&!(v>=x&&v<b)?0:x,v=f||v>y&&!(x<=v&&x>y)?y:v):(x=f||x>y&&!(v<=x&&v>y)?y:x,v=f||v<b&&!(x>=v&&x<b)?0:v);const r=t+i*d(x),a=e+s*u(x),p=t+i*d(v-=f?c?gs:-.001:0),g=e+s*u(v);_=m(v-x)>y?1:0,l(r,a,p,g),h&&(h.x1=S,h.y1=V,h.x2=C,h.y2=P)}return w}static arc3dInner(t,e,i,s,r,n,o,a,h){const l=g(b,m(o-n)),c=this.isCircled(l),_=a?1:0,p=t+i*d(n),f=e+s*u(n),x=t+i*d(o-=c?_?gs:-.001:0),v=e+s*u(o),w=l>y?1:0,S=[];return S.push("M",p,f,"A",i,s,0,w,_,x,v),S.push(c?"M":"L",x,v+r),S.push("A",i,s,0,w,1-_,p,f+r),h&&(h.x1=p,h.y1=f,h.x2=x,h.y2=v),S.push("Z"),S}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*u(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/4,_=2*Math.PI/5,p=_/2,g=[];g.push("M",n+a*d(r),o+h*u(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*u(r),"L",n+l*d(r+p),o+c*u(r+p)),r+=_;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=us[e](0,0,f(2*i,0),f(2*s,0));break;default:r=us.circle(i,s,f(g(i,s),0))}t.setPath(r)}}us=fs,fs._drawers=Object.assign({circle:t=>us.circle(0,0,t),none:t=>[]},us._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ms extends Se{static create(t,e,i,s,r,n,o=0){return new ms(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=pt,i=pt){super(t,e,"rect"),this.rect=i}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,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}resizeRect(t,e){const i=this.getStyle("border-radius");return this.resize(t,e),i&&this.dom.setAttribute("rx",i),this}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setBox(t,e,i,s){this.rect=s<0?{x:t,y:e+s,width:i,height:-s}:{x:t,y:e,width:i,height:s}}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 ys extends Le{constructor(t,e){super(t,e)}setBox(t,e,i,s){return this.setPath(fs.box(t,e,i,s)),this}}const bs="head",xs="far",vs="inside",ws="none",Ss="near",Vs="displayAll",Cs="largestFirst",Ps="hidden",As="line",ks="area",Ls="circlebar";let Ts=0;const Ms="_deleted",Ns="_drop",Es="_save";class Bs{static getSum(t){let e=0;for(const i of t)isNaN(i.y)||(e+=i.y);return e}constructor(t){this.pid=Ts++,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:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(s(e.drillDown)||i(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,i,s;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 s=null!==(i=this[e[0]])&&void 0!==i?i:r[e[0]];if(null!=s&&"object"==typeof s)for(let t=1;t<e.length;t++)s=s[e[t]];return s}return null!==(s=this[t])&&void 0!==s?s:r[t]}_setDeleted(){this._prev=this.copy(),this[Ms]=!0}_isDeleted(){return this[Ms]}_setDrop(t){this[Ns]=t}_getDrop(){return this[Ns]}_setSave(t){this[Es]=t}_getSave(){return this[Es]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=pt}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return l(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 i=t.options,s=+i.colorField,r=+i.iconField;e.length>1?(this.x=e[P(i.xField,0)],this.y=e[P(i.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var i,s,r,n;this.x=(i=t._xFielder(e),s=e.x,r=e.name,n=e.label,void 0!==i?i:void 0!==s?s:null!=r?r:n),this.y=k(t._yFielder(e),e.y,e.value),this.color=A(t._colorFielder(e),e.color),this.icon=A(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 Os{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 s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find(i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue)))}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach(t=>{const i=this._points.indexOf(t);i>=0&&(t._setDeleted(),e.push(t),this._points.splice(i,1))}),e}clean(){this._points=this._points.filter(t=>!t[Ms])}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,i=this._points.length;e<i&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,i=t._zoom;if(this._owner.needAxes()&&i){const i=t._range;let s=t.axisToData(i.min),r=t.axisToData(i.max);return t.continuous()?e.filter(t=>t.xValue>=s&&r>=t.xValue).slice(0):e.filter(t=>t.xValue>s-.5&&r+.5>t.xValue).slice(0)}return e}}class Ds extends Bs{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(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 i=t.options,s=e.length>2?1:0;s>0&&(this.x=e[P(i.xField,0)]),this.y=e[P(i.yField,0+s)],this.z=e[P(i.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=A(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=L(t.zValue,this.zValue,e)}}class $s extends Bs{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 l(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 i=t.options,s=e.length>2?1:0;this.low=e[P(i.lowField,0+s)],this.y=e[Et(i.highField,i.yField,1+s)],s>0&&(this.x=e[P(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=A(e[t.prop("lowField")],e.low),this.y=k(e[t.prop("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=L(t.lowValue,this.lowValue,e)}}class Rs extends Ai{getPosition(){const t=this.prop("position");return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Rs.defaults=ii(Ai.defaults,{step:1});class Is extends Ti{getTick(t,e){if(null!=e){const t=this.axis,i=e.levels;if((null==i?void 0:i.length)&&t.hasCategoryTree())return i[0];const r=this._getText(e,e,!1,!1),n=r.lastIndexOf(this.sep);return s(t.prop("categoryField"))&&n>0?r.substring(n+this.sep.length):r}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}Is.defaults=ii(Ti.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class Fs extends wi{getPositions(t,e){if(t.isNumericScale())return t._ticks.filter(t=>isFinite(t.pos)).map(t=>t.pos);const i=t._ani,s=t.prop("reversed"),r=[],n=t._pts;if(t._ticks.length>0){if(Math.max(1,t.tick.prop("step")||1)>1){const e=t.axisMin();for(const o of t._ticks){const t=o.value-e+1;t>0&&t<n.length&&r.push(i?i.getPos(n[t],s):n[t])}t._ticks[0].value!==e&&n.length>1&&r.unshift(i?i.getPos(n[1],s):n[1])}else for(let t=1,e=n.length-2;t<=e;t++)r.push(i?i.getPos(n[t],s):n[t])}return r}}class zs extends Bi{constructor(){super(...arguments),this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeOp=null,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],this._weights=new Map,this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1,this._numericScale=!1}get tick(){return this._tick}get label(){return this._label}xValueAt(t){const e=this._pts,i=e.length;if(i<3)return-1;let s=2,r=i-2;for(;s<=r;){const i=s+r>>>1;if(t<e[i-1])r=i-1;else{if(!(t>=e[i]))return this._catMin+i-2;s=i+1}}return-1}getCategorySeparator(){return this.prop("categorySeparator")||zs.defaults.categorySeparator}isCategoryTreeEnabled(){return null!=this._categoryTreeOp}hasCategoryTree(){return!this._isPolar&&this._categoryTreeDepth>1&&this._categoryTreeGroups.length>0&&this.isCategoryTreeEnabled()}$_resolveCategoryTreeOp(t){if(!0===t)return zs.categoryTreeDefaults;if(!i(t)||!1===t.visible)return null;const e={...zs.categoryTreeDefaults,...t};return i(t.divider)&&i(zs.categoryTreeDefaults.divider)&&(e.divider={...zs.categoryTreeDefaults.divider,...t.divider}),i(t.band)&&(e.band={visible:!0,...t.band}),e}$_normalizeDivider(t){const e=zs.categoryTreeDividerDefaults;return!1===t?{...e,visible:!1}:!0===t||null==t?{...e}:{...e,...t}}$_isDividerOn(t){var e;const s=this._categoryTreeOp,r=null===(e=null==s?void 0:s.levels)||void 0===e?void 0:e[t],n=null==r?void 0:r.divider;if(void 0!==n){if(!1===n)return!1;if(!0===n)return!0;if(i(n)&&void 0!==n.visible)return!1!==n.visible}return!1!==this.$_normalizeDivider(null==s?void 0:s.divider).visible}$_dividerProp(t,e){var s;const r=this._categoryTreeOp,n=null===(s=null==r?void 0:r.levels)||void 0===s?void 0:s[t];return i(null==n?void 0:n.divider)&&void 0!==n.divider[e]?!1!==n.divider[e]:!1===(null==r?void 0:r.divider)?this.$_isDividerOn(t):i(null==r?void 0:r.divider)&&void 0!==r.divider[e]?!1!==r.divider[e]:this.$_isDividerOn(t)}isLevelVisible(t){var e,i;const s=this._categoryTreeOp;return null==s||!1!==(null===(i=null===(e=s.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.visible)}getLevelRotation(t){var e,i,s;const r=this._categoryTreeOp,n=null===(s=null===(i=null===(e=null==r?void 0:r.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.label)||void 0===s?void 0:s.rotation,o=this.$_resolveLevelRotation(n);if(void 0!==o)return o;const a=this.$_resolveLevelRotation(this.label.prop("rotation"));return void 0!==a?a:"auto"}$_resolveLevelRotation(t){return"auto"===t?"auto":o(t)?+t%360:void 0}getLevelStyle(t){var e,i,s,r;return null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.style}getLevelAlign(t){var e,i,s,r;const n=null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.align;if(null!=n)return n;const o=this.label;return o.prop("fillToCategory")&&o.prop("align")||"center"}getCategoryTreeDepth(){return this._categoryTreeDepth}getCategoryTreeGroups(){return this._categoryTreeGroups}getDividerLevel(){return this._categoryTreeDividerLevel}getDividerEnds(t){return null==t?this._categoryTreeDividerEnds:this._categoryTreeLevelEnds[t]||[]}$_groupsAtLevel(t){return this._categoryTreeLevelGroups[t]||[]}isDividerBetween(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"between")}isDividerEdge(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"edge")}isDividerBelow(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"below")}isDividerTopCap(){const t=this._categoryTreeOp;if(!t||!this.hasCategoryTree())return!1;const e=t.divider;return!1!==e&&(!0===e||null==e||(!i(e)||!1!==e.visible&&!1!==e.edge))}isDividerVisible(){if(!this.hasCategoryTree())return!1;if(this.isDividerTopCap())return!0;for(let t=0;t<this._categoryTreeDepth;t++)if(this.$_dividerProp(t,"between")||this.$_dividerProp(t,"edge")||this.$_dividerProp(t,"below"))return!0;return!1}getBandLevel(){return this.getDividerLevel()}$_resolveDividerStyle(t){if(!1===t)return;if(!0===t)return"rct-axis-tree-divider";if(n(t))return t;if(i(t)&&Object.keys(t).length>0)return t;const e=this.line._style;return n(e)||i(e)&&Object.keys(e).length>0?e:"rct-axis-tree-divider"}$_dividerStyleOf(t){if(i(t))return t.style}getDividerStyle(t){var e,i;if(null!=t){if(!this.isDividerBetween(t)&&!this.isDividerEdge(t)&&!this.isDividerBelow(t))return;const i=this._categoryTreeOp,s=null===(e=null==i?void 0:i.levels)||void 0===e?void 0:e[t],r=this.$_dividerStyleOf(null==s?void 0:s.divider),n=this.$_dividerStyleOf(null==i?void 0:i.divider),o=void 0!==r?r:n;return this.$_resolveDividerStyle(o)}return this.$_resolveDividerStyle(this.$_dividerStyleOf(null===(i=this._categoryTreeOp)||void 0===i?void 0:i.divider))}$_isBandEnabled(){const t=this._categoryTreeOp;return null!=t&&(!1!==t.band&&(!0===t.band||!!i(t.band)&&!1!==t.band.visible))}isBandVisible(){return this.$_isBandEnabled()&&this.hasCategoryTree()&&this.getBandGroups().length>0}getBandGroups(){const t=this.getBandLevel();return t<0?[]:this.$_groupsAtLevel(t)}getBandColor(t){const e=this._bandColors;return e[(t%e.length+e.length)%e.length]}$_resolveBandColors(t){const e=i(null==t?void 0:t.band)?t.band.colors:null;return s(e)&&e.length>0?e:["var(--rct-axis-tree-band-0-fill)","var(--rct-axis-tree-band-1-fill)"]}getCategoryTreeSpan(t,e,i){return this.$_getSpanFromPts(t,e,i)}getDividerPos(t,e){return this.$_getDividerPosFromPts(t,e)}getDividerLinePositions(t){const e=this._categories.length;if(0===e)return[];const i=[this.$_getCategoryEdgePos(0,t,"left")];for(const e of this._categoryTreeDividerEnds)i.push(this.getDividerPos(e,t));return i.push(this.$_getCategoryEdgePos(e-1,t,"right")),i}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}getLabelY(t,e){return t*(this.prop("reversed")?P(this._prevRate,1):1)-this.prev(e)}getLabelX(t,e){const i=P(this._prevRate,1);return this.prev(e)+(this.prop("reversed")?t*(1-i):0)}_type(){return"category"}unitPad(){return this._catPad}isNumericScale(){return this._numericScale}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new Ni(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new Fs(this)}_createTickModel(){return new Rs(this)}_createLabel(){return new Is(this)}_doApply(t){super._doApply(t),this._categoryTreeOp=this.$_resolveCategoryTreeOp(this.prop("categoryTree")),this._bandColors=this.$_resolveBandColors(this._categoryTreeOp)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this.$_buildCategoryTree(),this._isEmpty?this._values=rt.makeIntArray(0,this._categories.length):super.collectValues(),this.$_resolveNumericScale()}getStartAngle(){let t=super.getStartAngle(),e=+this.prop("startOffset");return e>0&&(t-=g(e,1)*this.getWeight(0)*b/this._catLen),t}_doPrepareRender(){this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=Et(this.prop("minPadding"),this.prop("padding"),0),this._maxPad=Et(this.prop("maxPadding"),this.prop("padding"),0),this._catPad=Math.max(0,Math.min(.5,this.num("categoryPadding"))))}_adjustMinMax(t,e){return this.$_applyRangeOptions(t,e)}_doBuildTicks(t,e,i,s){if(this._numericScale)return this.$_doBuildNumericTicks(t,e);const r=this._label;let n=this._weights;const o=this._tick,a=o.prop("step")||1,h=[];this._zoom||(t=Math.floor(t),e=Math.ceil(e)),this._catMin=t,this._catMax=e;let l=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(l,a));let c=0;for(const t of n.values())c+=t;l=this._len=this._minPad+this._maxPad+l-n.size+c;const _=this._pts=[];if(l>0){let i=this._minPad;_.push(0);for(let s=t;s<=e;s++)_.push(i/l),i+=this.getWeight(s);_.push(i/l),_.push((i+this._maxPad)/l)}const d=this._catStart,u=this._catStep,p=o.isShowFirst();let g=1;!p&&a>1&&(g=1+a);let f=!1,m=!1;for(let i=g;i<_.length-2;i+=a){const s=t+(i-1),n=this._categories[s/u-d];this.getWeight(s)<=0||(s===t&&(f=!0),s===e&&(m=!0),h.push({index:i-1,pos:NaN,value:s,label:r.getTick(i-1,n?n.t:s)}))}if(p&&!f){const e=this._categories[t/u-d];h.unshift({index:0,pos:NaN,value:t,label:r.getTick(0,e?e.t:t)})}if(!0===o.prop("showLast")&&!m){const i=e-t,s=this._categories[e/u-d];h.push({index:i,pos:NaN,value:e,label:r.getTick(i,s?s.t:e)})}return!p&&h.length>0&&h[0].value===t&&h.shift(),!o.isShowLast()&&h.length>0&&h[h.length-1].value===e&&h.pop(),this._setMinMax(t,e),h}_calcPoints(t,e){if(this._numericScale)return this.$_scaleNumericPts(t),super._calcPoints(Math.max(0,t),e),void(this._isPolar||this.$_updateMarkPoints());const i=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<i.length;t++)i[t]=0;else for(let t=0;t<i.length;t++)i[t]/=this._vlen;for(let e=0;e<i.length;e++)i[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this.getTotalAngle();if(0===t)for(let t=0;t<i.length;t++)i[t]=0;else for(let s=0;s<i.length;s++)i[s]=i[s]/t*e}}else this.$_updateMarkPoints()}$_scaleNumericPts(t){const e=this._minPad+1+this._maxPad,i=Math.max(0,t),s=this._pts=[0,this._minPad/e,(this._minPad+1)/e,1];for(let t=0;t<s.length;t++)s[t]*=i}$_updateMarkPoints(){const t=this._tick,e=this._markPoints=this._markPoints||[];if(this._numericScale||"edge"!==t.getPosition()){const t=this._ticks;e.length=t.length;for(let i=0;i<t.length;i++)e[i]=t[i].pos}else{const t=this._pts,i=t.length-2;e.length=i;for(let s=0;s<i;s++)e[s]=t[s+1]}}getPos(t,e){if(this._numericScale)return this.$_getNumericPos(t,e);const i=this._pts,s=this.$_slotIndex(e);if(s<0||s+2>=i.length)return NaN;const r=i[s+1];let n=r+(i[s+2]-r)*(e-Math.floor(e+.5)+.5);return this.prop("reversed")&&(n=t-n),this._ani?this._ani.getPos(n,this.prop("reversed")):n}valueAt(t,e){if(this._numericScale)return this.$_numericValueAt(t,e);const i=this._pts;this.prop("reversed")&&(e=t-e);const s=i.length;if(s<3)return;let r=1,n=s-2,o=-1;for(;r<=n;){const t=r+n>>>1;e>=i[t]&&i[t+1]>=e?(o=t,n=t-1):e<i[t]?n=t-1:r=t+1}if(o>=0){const t=i[o],s=i[o+1];return this._catMin+o-(1-(e-t)/(s-t))}}getUnitLen(t,e){if(this._numericScale)return this.getLabelLength(t,e);const i=this.$_slotIndex(e),s=this._pts;if(i<0||i+2>=s.length)return NaN;let r;return r=this._ani?this._ani.getPos(s[i+2],this.prop("reversed"))-this._ani.getPos(s[i+1],this.prop("reversed")):s[i+2]-s[i+1],m(r)}getLabelLength(t,e){if(this._numericScale){const e=this._ticks.length;return e<2?NaN:Math.floor(t/e)}const i=this.$_slotIndex(e),s=this._pts;return i<0||i+2>=s.length?NaN:i>this._tstep?s[i+2]-s[i+2-this._tstep]:s[i+2+this._tstep-1]-s[i+1]}getValue(t){if(o(t))return t;const e=this._map[t];return void 0!==e?e:NaN}getXLabel(t){var e,i;const r=this._categories[t];if(!r)return t;const n=r.levels,o=this.prop("categoryField");return(null==n?void 0:n.length)&&s(o)&&o.length>1?this.hasCategoryTree()?n[0]:n[n.length-1]:null!==(i=null!==(e=r.t)&&void 0!==e?e:r.c)&&void 0!==i?i:t}_doCalculateRange(t){if(0===t.length)return this.$_hasExplicitCategories()&&this._categories.length>0?this.$_applyRangeOptions(0,this._categories.length-1):this.$_applyRangeOptions(0,0);let{min:e,max:i}=super._doCalculateRange(t);return this._isX||(e=g(0,e),i=f(0,i)),this.$_applyRangeOptions(e,i)}$_hasExplicitCategories(){const t=this.prop("categories");return s(t)&&t.length>0}$_hasDefinedTickRange(){const t=this._op;return o(t.minValue)&&!isNaN(t.minValue)&&o(t.maxValue)&&!isNaN(t.maxValue)}$_applyRangeOptions(t,e){const i=this._op,s=i.minValue,r=i.maxValue,n=o(s)&&!isNaN(s),a=o(r)&&!isNaN(r);return n&&a?this._numericScale?{min:g(s,t),max:f(r,e)}:{min:s,max:r}:(n&&s<t&&(t=s),a&&r>e&&(e=r),{min:t,max:e})}$_isValidCategoryIndex(t){return Number.isInteger(t)&&t>=0&&t<this._categories.length}$_needsNumericScaleForExplicitCategories(t){if(!this.$_hasExplicitCategories()||0===t.length)return!1;const e=this._categories.length;let i=0;for(const e of t)if(isFinite(e)){if(!Number.isInteger(e))return!0;i=f(i,m(e))}return i>f(2*e,zs.NUMERIC_SCALE_SPAN_THRESHOLD)}$_shouldUseNumericScale(t,e){const i=e-t+1,s=this._values;if(0===s.length||!isFinite(i)||i<=0)return!1;const r=new Set;for(const t of s)isFinite(t)&&r.add(t);const n=r.size;return 0!==n&&(i>zs.NUMERIC_SCALE_SPAN_THRESHOLD&&i>n*zs.NUMERIC_SCALE_SPAN_FACTOR)}$_resolveNumericScale(){if(this._numericScale=!1,this.$_hasDefinedTickRange()){const t=Math.floor(this.prop("minValue")),e=Math.ceil(this.prop("maxValue"));return void(this.$_shouldUseNumericScale(t,e)&&(this._numericScale=!0))}if(this.$_hasExplicitCategories())return void(this._numericScale=this.$_needsNumericScaleForExplicitCategories(this._values));if(this._categories.length>0||0===this._values.length)return;const t=super._doCalculateRange(this._values);let e=this._isX?t.min:g(0,t.min),i=this._isX?t.max:f(0,t.max);({min:e,max:i}=this.$_applyRangeOptions(e,i)),this.$_shouldUseNumericScale(Math.floor(e),Math.ceil(i))&&(this._numericScale=!0)}$_doBuildNumericTicks(t,e){const i=this._label;this._catMin=t,this._catMax=e,this._catLen=e-t;const s=this.$_buildNumericTickValues(t,e),r=[];for(let t=0;t<s.length;t++){const e=s[t],n=this.$_hasExplicitCategories()&&this.$_isValidCategoryIndex(e)?this.getXLabel(e):String(e);r.push({index:t,pos:NaN,value:e,label:i.getTick(t,n)})}return this._setMinMax(t,e),r}$_buildNumericTickValues(t,e){const i=e-t;if(!isFinite(i)||i<=0)return[t];let s=i/10;if(s<=0||!isFinite(s))return[t,e];const r=Math.pow(10,Math.floor(Math.log10(s))),n=s/r,o=(n<=1?1:n<=2?2:n<=5?5:10)*r,a=[];let h=Math.ceil(t/o)*o;for(h>t&&a.push(t);h<=e+1e-4*o;h+=o)a.push(parseFloat(h.toPrecision(12)));return(0===a.length||a[a.length-1]<e)&&a.push(e),a}$_getNumericPos(t,e){const i=this._catMin,s=this._catMax-i,r=this._pts;if(!isFinite(e)||s<=0||r.length<3)return s<=0?t/2:NaN;const n=r[1];let o=n+(r[r.length-2]-n)*((e-i)/s);this.prop("reversed")&&(o=t-o);const a=yt(o);return this._ani?this._ani.getPos(a,this.prop("reversed")):a}$_numericValueAt(t,e){const i=this._pts;if(i.length<3)return;this.prop("reversed")&&(e=t-e);const s=i[1],r=i[i.length-2],n=this._catMax-this._catMin;if(r===s||n<=0)return this._catMin;const o=(e-s)/(r-s);return this._catMin+o*n}$_slotIndex(t){if(!isFinite(t))return-1;const e=Math.floor(t-this._catMin+.5);return e<0||e>this._catMax-this._catMin?-1:e}$_getSpanFromPts(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=P(i,this._vlen),a=f(t,r),h=g(e,n);if(a>h||!s.length)return{center:NaN,size:0};let l=s[a-r+1],c=s[h-r+2];if(null==l||null==c)return{center:NaN,size:0};if(this.prop("reversed")){const t=o-c;c=o-l,l=t}return this._ani&&(l=this._ani.getPos(l,this.prop("reversed")),c=this._ani.getPos(c,this.prop("reversed"))),{center:(l+c)/2,size:Math.abs(c-l)}}$_getDividerPosFromPts(t,e){return this.$_getCategoryEdgePos(t,e,"right")}$_getCategoryEdgePos(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=P(e,this._vlen),a="left"===i?1:2;let h=s[f(g(t,n),r)-r+a];return null==h?NaN:(this.prop("reversed")&&(h=o-h),this._ani?this._ani.getPos(h,this.prop("reversed")):h)}$_parseCategoryLevels(t){const e=this.prop("categoryField");if(!s(e)||e.length<2||null==t)return;const i=this.getCategorySeparator(),r=t.split(i);return r.length===e.length?r:void 0}$_pushCategory(t,e,i){const s=this.$_parseCategoryLevels(t),r=this._categories;(null==s?void 0:s.length)&&(e=s[s.length-1]),r.push({c:t,t:e,i:i,levels:s})}$_buildCategoryTree(){var t,e,i,s;const r=this._categories;if(this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],!this.isCategoryTreeEnabled()||!r.length||this._isPolar)return;const n=null!==(e=null===(t=r[0].levels)||void 0===t?void 0:t.length)&&void 0!==e?e:0;if(n<2)return;if(!r.every(t=>{var e;return(null===(e=t.levels)||void 0===e?void 0:e.length)===n&&t.levels.every(t=>null!=t&&""!==t)}))return;this._categoryTreeDepth=n;for(let t=0;t<n;t++){const e=this._categoryTreeLevelGroups[t]=[];let n=0;for(;n<r.length;){const o=null===(i=r[n].levels)||void 0===i?void 0:i[t];let a=n+1;for(;a<r.length&&(null===(s=r[a].levels)||void 0===s?void 0:s[t])===o;)a++;const h={level:t,start:n,end:a-1,label:o};this._categoryTreeGroups.push(h),e.push(h),n=a}this._categoryTreeLevelEnds[t]=e.slice(0,-1).map(t=>t.end)}let o=-1,a=1/0;for(let t=0;t<n;t++){const e=this.$_groupsAtLevel(t);e.length>1&&e.some(t=>t.end>t.start)&&e.length<a&&(a=e.length,o=t)}o>=0&&(this._categoryTreeDividerLevel=o,this._categoryTreeDividerEnds=this.getDividerEnds(o))}$_collectCategories(t){var e,r;const o=this._op,a=o.categories,h=this._categories=[];let l=this._weights;if(l.clear(),s(a)&&a.length>0)this._len=0,a.forEach(t=>{const e=null==t?1:f(P(t.weight,1),0),s=t&&t.icon;let r,n;null==t?n=r=null:i(t)?(r=A(t.name,t.label),n=A(t.label,t.name)):n=r=String(t),this._len+=e,this.$_pushCategory(r,n,s),l.set(l.size,e)});else{const i=this.chart.seriesByName(o.categorySeries),a=this.chart.seriesByName(o.weightSeries)||i,h=o.weightField,c=null==a?void 0:a.data,_=o.weightByFrequency;i&&(t=[i]);const d=new Map;for(const e of t){const t=e.collectCategories(this);for(let e=0,i=t.length;e<i;e++){const i=t[e];d.has(i)||(d.set(i,d.size),this.$_pushCategory(i,i))}}if(h&&s(c)&&c.length>0){const t=a.getPoints();let i=null;for(let s=0,o=c.length;s<o;s++){const o=c[s],a=t.get(s);if(!a)continue;const u=a.x,p=f(null!==(e=o[h])&&void 0!==e?e:1,0);if(n(u)){const t=d.get(u);if(void 0===t){i=null;continue}if(!l.has(t)){l.set(t,p),i=u,this._len+=p;continue}_&&i===u&&(l.set(t,f((null!==(r=l.get(t))&&void 0!==r?r:0)+p,0)),this._len+=p)}else Number.isInteger(u)?(l.has(u)||(l.set(u,p),this._len+=p),i=null):i=null}}else if(s(t)&&t.length>0){const e=new Set;for(const i of t){const t=i.collectCategories(this),s=t.length;if(0===s)continue;let r=t[0],n=1;for(let i=1;i<s;i++){const s=t[i],o=d.get(r);s!==r?(void 0===o||e.has(r)||(e.add(r),l.set(o,_?n:1)),r=s,n=1):n++}if(!e.has(r)){e.add(r);const t=d.get(r);void 0!==t&&l.set(t,_?n:1)}}}}this._map={},h.forEach((t,e)=>{const i=t.v=e;null!=t.c&&(this._map[t.c]=i)})}}zs.type="category",zs.categoryTreeDividerDefaults={visible:!0,edge:!0,between:!0,below:!0},zs.categoryTreeDefaults={visible:!0,divider:{...zs.categoryTreeDividerDefaults},band:!1},zs.defaults=ii(Bi.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+",categoryTree:!1}),zs.NUMERIC_SCALE_SPAN_THRESHOLD=1e3,zs.NUMERIC_SCALE_SPAN_FACTOR=10;class Hs extends ni{}Hs.defaults=ii(ni.defaults,{visible:!1});class Gs extends hi{getAlign(t,e,i,s){let r=this._align;return"auto"===r&&(r=t?i?"left":"right":s<=0?e?"left":"right":s>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,i){let s=this._verticalAlign;return"auto"===s&&(s=t?"middle":i?"bottom":"top"),s}getAlignPolar(t){let e=this._align;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100||i>=260&&i<=280?"center":i>100&&i<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._verticalAlign;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100?"bottom":i>=260&&i<=280?"top":"middle"}return e}getOffsetX(t){const e=this.prop("offsetX");return isNaN(e)?"center"===t?0:Gs.OFFSET:e}getOffsetY(t){const e=this.prop("offsetY");return isNaN(e)?"middle"===t?0:Gs.OFFSET:e}getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),this._position=g(1,f(0,this.num("position")));const e=this.prop("align");this._align="left"===e||"center"===e||"right"===e?e:"auto";const i=this.prop("verticalAlign");this._verticalAlign="top"===i||"middle"===i||"bottom"===i?i:"auto"}prop(t){return"position"===t?this._position:"align"===t?this._align:"verticalAlign"===t?this._verticalAlign:super.prop(t)}}Gs.OFFSET=4,Gs.defaults=ii(hi.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class js extends ni{getRadius(){return f(0,this.num("radius"))}}js.defaults=ii(ni.defaults,{visible:!1,radius:4});class Ys extends ni{constructor(t){super(t.chart),this.owner=t,this._points=[],this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),this._variableArea=this._addChild("variableArea",new Hs(this.chart)),this._fixedArea=this._addChild("fixedArea",new Hs(this.chart)),this._label=this._addChild("label",new Gs(this.chart)),this._marker=this._addChild("marker",new js(this.chart))}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,i,s){return this._minX=t,this._maxX=e,this._minY=i,this._maxY=s,this}_doPrepareRender(t){this._label._prepareRender();const e=this.prop("type"),i=this.owner,s=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,this.num("resolution")||Ys.defaults.resolution)),r=this._minX>0?0:(this._maxX-this._minX)/s-this._minX,n=this._minY>0?0:(this._maxY-this._minY)/s-this._minY,o=i._visPoints.filter(t=>!t.isNull).map(t=>({x:t.xValue+r,y:t.yValue+n})).sort((t,e)=>t.x-e.x),a=(this["_"+e]||this._linear).call(this,this._formatter,o);if(this._points=[],a&&"function"==typeof a.evaluator){if(o.length>0){const t=o[0].x,i=o[o.length-1].x,s=this._forward>0?this._forward:0;let r=t-(this._backward>0?this._backward:0),n=i+s;if("logarithmic"===e||"power"===e){const t=Number.EPSILON||1e-12;r<=0&&(r=t)}const h=i-t,l=n-r,c=h>0?Math.ceil(this._res*l/h):this._res;for(let t=0;t<=c;t++){const e=r+(n-r)*t/c,i=a.evaluator(e);Number.isFinite(i)&&this._points.push({x:e,y:i})}}}else if(a&&Array.isArray(a.points)){const t=this.prop("maExtrapolation");if("movingAverage"===e&&"flat"===t||"linear"===t){const e=this._forward>0?this._forward:0,i=this._backward>0?this._backward:0,s=a.points;if(s.length>0){const r=s[0],n=s[s.length-1],o=n.x-r.x,a="flat"===t;if(i>0){const t=Math.max(2,Math.ceil(this._res*i/o)),e=i/t;if(a){const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}else if(s.length>=2){const i=s[0],n=s[1],o=(n.y-i.y)/(n.x-i.x);for(let s=t;s>0;s--){const t=r.x-e*s,n=i.y+o*(t-i.x);this._points.push({x:t,y:n})}}else{const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}}if(this._points.push(...s),e>0){const t=Math.max(2,Math.ceil(this._res*e/o)),i=e/t;if(a){const e=n.y;for(let s=1;s<=t;s++)this._points.push({x:n.x+i*s,y:e})}else if(s.length>=2){const e=s[s.length-1],r=s[s.length-2],o=(e.y-r.y)/(e.x-r.x);for(let s=1;s<=t;s++){const t=n.x+i*s,r=e.y+o*(t-e.x);this._points.push({x:t,y:r})}}else{const e=n.y;for(let s=1;s<=t;s++)this._points.push({x:n.x+i*s,y:e})}}}}else this._points.push(...a.points)}this._expr=a&&a.expr,this._points.forEach(t=>{t.x-=r,t.y-=n})}getLabel(){return""}_doApply(t){super._doApply(t),this._forward=f(0,this.num("forward")),this._backward=f(0,this.num("backward")),this._formatter=It.getFormatter(this.prop("numberFormat")||Ys.defaults.numberFormat)}_calcLine(t){const e=t.length;let i=0,s=0,r=0,n=0;t.forEach(t=>{i+=t.x,s+=t.y,r+=t.x*t.y,n+=t.x*t.x});const o=e*n-i*i,a=0===o?0:(e*r-i*s)/o;return{m:a,a:(s-a*i)/e}}_linear(t,e){if(e.length>1){const{m:i,a:s}=this._calcLine(e),r=t=>i*t+s;return{expr:`y = ${t.toStr(i)}x + ${t.toStr(s)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:P(t.y,0)})),{m:s,a:r}=this._calcLine(i),n=t=>t<=0?NaN:r+Math.log(t)*s;return{expr:`y = ${t.toStr(s)}log(x) ${r>0?"+":"-"} ${t.toStr(m(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:Math.log(t.y)})),{m:s,a:r}=this._calcLine(i),n=Math.exp(r),o=t=>t<=0?NaN:n*t**s;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(s)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,i=0,s=0,r=0,n=0,o=0;t.forEach(t=>{e+=t.x,i+=t.y,s+=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=i*s-o*o,h=Math.exp((s*r-o*n)/a);return{m:(i*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const i=e.map(t=>({x:t.x,y:t.y})),{m:s,a:r}=this._calcLine2(i),n=r,o=t=>n*Math.exp(s*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(s)}x))`,evaluator:o}}return{}}_polynomial(t,e){const i=e.length;if(i>1){const s=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let s=0;s<i;s++)n+=e[s].x**t*e[s].y;s.push(n),n=0;const h=[];for(let s=0;s<a;s++){for(let r=0;r<i;r++)o+=e[r].x**(t+s);h.push(o),o=0}r.push(h)}r.push(s);const h=function(t,e){const i=t,s=t.length-1,r=[e];for(let t=0;t<s;t++){let e=t;for(let r=t+1;r<s;r++)m(i[t][r])>m(i[t][e])&&(e=r);for(let r=t;r<s+1;r++){const s=i[r][t];i[r][t]=i[r][e],i[r][e]=s}for(let e=t+1;e<s;e++)for(let r=s;r>=t;r--)i[r][e]-=i[r][t]*i[t][e]/i[t][t]}for(let t=s-1;t>=0;t--){let e=0;for(let n=t+1;n<s;n++)e+=i[n][t]*r[n];r[t]=(i[s][t]-e)/i[t][t]}return r}(r,a),l=t=>h.reduce((e,i,s)=>e+i*t**s,0);return{expr:"y = "+(h.map((e,i)=>{const s=+e;if(!isFinite(s)||0===s)return"";const r=t.toStr(s);if("0"===r)return"";if(0===i)return s<0?`-${r}`:`${r}`;return`${s<0?"- ":"+ "}${r}${1===i?"x":`x^${i}`}`}).filter(t=>t).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const i=e.length,s=f(1,g(i-1,this.prop("movingInterval"))),r=[];let n=s;for(;n<=i;){const t=e.slice(n-s,n).reduce((t,e)=>t+P(e.y,0),0);r.push({x:e[n-1].x,y:t/s}),n++}return{expr:`y = movingAverage(${t.toStr(s)})`,points:r}}}var Ws;Ys.defaults=ii(ni.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,forward:0,backward:0,maExtrapolation:"none",numberFormat:"0.####"});const Xs={},Us={},Zs=/\$\{detail\}/g;class qs extends ni{}qs.defaults=ii(ni.defaults,{visible:!1});class Ks extends hi{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){const i=this.prop("textField");if(i){const e=t.getProp(i);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return rt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return this.num("offset")}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return f(-90,g(90,this.num("rotation")))}_isVisible(){return this.prop("visible")||r(this.prop("visibleCallback"))}_doSetSimple(t,e){return r(e)?(this._op.visibleCallback=e,this._op.visible=!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._overflowFit=(()=>{const t=this.prop("overflowFit");return"hidden"===t?1/0:"none"===t?NaN:+t})(),this._vertAdjust=this.num("verticalAdjust")}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Ws=Ks,Ks.OFFSET=4,Ks.defaults=ii(hi.defaults,{visible:void 0,position:"default",offset:Ws.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class Qs extends hi{_doInit(t){super._doInit(t),this._args={}}getText(t){return rt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return this.num("offset")}getGap(){return this.num("gap")}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,i,s){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=i,r.negativeTotal=s,r.total=i+s,r}isStackLabelVisible(t){const e=this.prop("visibleCallback");return e?e(t):this.visible}getStackLabelText(t,e){const i=this.prop("textCallback");if(r(i)){const e=i(t);if(n(e))return e}return this.getText(e)}getRotation(){return f(-90,g(90,this.num("rotation")))}getStackLabelStyle(t){const e=this.prop("styleCallback");if(r(e))return e(t)}_isVisible(){return this.prop("visible")||r(this.prop("visibleCallback"))}_doApply(t){super._doApply(t),this._overflowFit=(()=>{const t=this.prop("overflowFit");return"hidden"===t?1/0:"none"===t?NaN:+t})(),this._vertAdjust=this.num("verticalAdjust")}}Qs.OFFSET=4,Qs.defaults=ii(hi.defaults,{visible:!1,align:"center",gap:Qs.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Js={x:"xValue",y:"yValue",z:"zValue"};class tr extends ge{constructor(t,e,i){super(),this.series=t,this.point=e,this.delay=i?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 er extends ge{constructor(t,e,i){super(),this.series=t,this.points=e,i&&(i.cancel(),this._prevAnis=i._prevAnis?[...i._prevAnis,i]:[i],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 i=this._prevVrs.get(e);void 0!==i&&(e._vr=i*(1-t))})}),this.points.forEach(e=>{e._vr=1-t}),this.series._changed(),!0}}class ir extends ge{constructor(t,e,i){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach(t=>{this.addPoint(t)}),this._interval=i,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 i=this._points;for(let t=i.length-1;t>=0;t--)i[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(i[t]._vr)||i[t]._vr>=1)&&i.splice(t,1);return 0!==i.length&&(this.series._changed(),!0)}}class sr extends Bs{}const rr=12;class nr extends ni{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach(t=>{Xs[t.type]=t})}static _loadSeries(t,e,i,s){let r=t._getSeriesType(i.type);if(!r&&i.type&&console.error(`Unknown series type: '${i.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+i.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(i),n}static getPointTooltipParam(t,e,i){switch(i){case"series":return t.displayName();case"name":return e.getParam(i)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[i]);default:return e.getParam(i)}}_doInit(t){this._points=new Os(this),this._pointArgs={},this._paletteColors=Array(rr).fill(0).map((t,e)=>e);this.chart.general.prop("paletteMode")==xt&&rt.shuffle(this._paletteColors),this._pointLabel=this._addChild("pointLabel",this._createLabel(this.chart))}onDataValueChanged(t,e,i,s,r){rt.log("onDataValueChanged",e,i,s,r);const n=this._runPoints[e];if(n){const t={};t[i]=s,this.updatePoint(n,t)}}onDataRowUpdated(t,e,i){}onDataRowAdded(t,e){rt.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){rt.log("onDataRowDeleted",e);const i=this._runPoints[e];i&&this.removePoint(i)}onDataChanged(t){rt.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){let e;const i=this.prop("tooltipDetailCallback");if(i){this._getPointCallbackArgs(this._pointArgs,t);const s=i(this._pointArgs);e=n(s)?s:""}if(void 0===e){const t=this.prop("tooltipDetail");e=n(t)?t:""}return e}getTooltipText(t,e){let i;const s=this.prop("tooltipCallback");if(s){this._getPointCallbackArgs(this._pointArgs,e);const t=s(this._pointArgs);n(t)&&(i=t)}if(void 0===i){const t=this.prop("tooltipText");i=n(t)?t:"",i&&(i=i.replace(Zs,this.getTooltipDetail(e)))}return i}getTooltipParam(t,e,i){return nr.getPointTooltipParam(t,e,i)}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 i=[];return this._points.forEach(s=>{e>=s.xValue&&s.xValue>=t&&i.push(s)}),i}_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.prop("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.prop("label")||this.name}legendKey(){return this[this.prop("legendKey")]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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.prop("noClip"):this.prop("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.prop("xStart")),i=isNaN(e)?t.getValue(this.chart.general.getXStart(t)):e;return P(i,t.getXStart())}$_getXStep(t){return k(this.prop("xStep"),this.chart.general.prop("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 zs)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.prop("categoryField");if(null!=e){if(s(e)){const i=e.length-1,s=t.getCategorySeparator();return this._points._internalPoints().filter(t=>n(t.getProp(e[i]))).map(t=>e.map(e=>t.getProp(e)).join(s))}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 i=this.$_getXStart(t),s=this.$_getXStep(t);n(s)&&(s=s.trim());const r=n(s)?NaN:rt.getNumber(s);this._points.forEach((e,o)=>{let a=t.getValue(e.x);isFinite(a)||(a=i,isFinite(r)?i+=r:n(s)&&(i=t.incStep(i,s))),e.xValue=a}),e&&this._runPoints.forEach(t=>{!1!==t.visible&&e.push(t.xValue)})}else{const i=this.hasZ();this._points.forEach((e,s)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let s=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(s)&&t&&(s=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(i?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),s=e._prev.yValue+(s-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=s,e.isNull=!isFinite(s)}}),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 i=this._visPoints,s=i.length;if(s>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=i[0],o=n.xValue,a=o,h=n.yValue,l=h,c=r?n.zValue:null,_=c;n.vindex=0;for(let t=1;t<s;t++)n=i[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<s;t++){const e=i[t].zValue;isNaN(_)&&!isNaN(e)?c=_=e:e>_?_=e:e<c&&(c=e)}if(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],i=e.map(t=>t.y).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e),s=e.map(t=>t.x).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e);i.length>0&&(h=Math.min(h,i[0]),l=Math.max(l,i[i.length-1])),s.length>0&&(o=Math.min(o,s[0]),a=Math.max(a,s[s.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=c,e.zMax=this._maxZ=_)}this.$_prepareViewRanges(i),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return this.num("paddingRate")}_getRangeMinMax(t){let e,i;return"x"===t?(e=this._minX,i=this._maxX):"z"===t?(e=this._minZ,i=this._maxZ):(e=this._minY,i=this._maxY),{min:e,max:i}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:i,max:s}=this._getRangeMinMax(e);(this._runRanges=bt(this.prop("viewRanges"),i,s,!1,!1,!0,this._runColor))?t.forEach((t,i)=>{this._setViewRange(t,e)}):t.forEach((t,e)=>{t.range=pt})}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.prop("visibleInLegend")&&t.push(this)}getLabelPos(t){return this._getLabelDefaultPos(t,t.prop("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?P(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ks.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=Mt(this._pointLabel.prop("textCallback")),this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e===this._argsPoint&&t===this._argsObj||(this._preparePointArgs(t),(this._argsPoint=e).assignTo(t),this._argsObj=t),t}getPointText(t,e,i){let s;return r(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),n(s))?s:(s=t.getPointText(e),null!=s?s:i)}getPointStyle(t){const e=this.prop("pointStyleCallback");if(r(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}getPointLabelStyle(t){if(r(this._pointLabel.prop("styleCallback")))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.prop("styleCallback")(this._pointArgs)}pointClicked(t){const e=this.prop("onPointClick");if(r(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}pointHovered(t){const e=this.prop("onPointHover");r(e)&&(t&&this._getPointCallbackArgs(this._pointArgs,t),e(t?this._pointArgs:null))}getViewRangeAxis(){return this.prop("viewRangeValue")||this._defViewRangeValue()}isLabelsVisible(){return this._pointLabel.visible}isPointLabelVisible(t,e){const i=this._pointLabel;return!1!==i.visible&&(i.prop("visibleCallback")?(this._getPointCallbackArgs(this._pointArgs,t),i.prop("visibleCallback")(this._pointArgs)):!0===i.visible)}getPointAt(t,e){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const i=this.getPointAt(t);return i?i[e]:pt}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,i=!0){if(t instanceof Bs||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.cancel(),s=t.updateValues(this,e),s&&i&&this.chart.animatable()&&(s.ani=new tr(this,t,!1),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const i=this._doAddPoint(t);if(i){if(this._points.add(i),e&&this.chart.animatable()&&this._needAddAnimation()){const t=i._prev=i.copy();t.ani=new tr(this,i,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return i}addPoints(t,e=!0){const i=[];return s(t)&&t.forEach(t=>{const e=this._doAddPoint(t);e&&i.push(e)&&this._points.add(e)}),i.length>0&&(e&&this.chart.animatable()&&i.forEach(t=>{const e=t._prev=t.copy();e.ani=new tr(this,t,this._points.count>1),e.ani.start()}),this._dataPointsChanged()),i}_needDecayEffect(){return!1}removePointAt(t,e=!0){const i=this._points.get(t);return this.removePoint(i,e)}removePoint(t,e=!0){if(t instanceof Bs||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Bs&&this._points.contains(t)){let i=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new er(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new ir(this,[t],this._decayDuration)).start(),i=!0)}else this._points.remove(t)&&(i=!0);if(i)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(s(t)){const i=t.map(t=>this._points.get(t)).filter(t=>null!=t);return this.removePoints(i,e)}return 0}removePoints(t,e=!0){if(s(t)){let i=[];if(t.forEach(t=>{t instanceof Bs||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Bs&&this._points.contains(t)&&i.indexOf(t)<0&&i.push(t)}),i.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new er(this,i,this._decayAni).start(),this._changed(),i.length;i=this._points.removeAll(i),i.length>0&&(this._dropAni?i.forEach(t=>this._dropAni.addPoint(t)):(this._dropAni=new ir(this,i,this._decayDuration)).start())}else i=this._points.removeAll(i);if(i.length>0)return this._doPointsRemoved(i),this._dataPointsChanged(),i.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=this.prop("name")||`Series ${this.index+1}`,this._setData(this.prop("data")),this._createFielders(),this._decayDuration=f(0,this.num("decayDuration"))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Ks(t)}_createPoint(t){return new sr(t)}$_addPoint(t,e){const i=this._createPoint(t);return i.index=e,i.parse(this),(i.isNull||(i.isNull=null==t||null==i.y))&&(this._containsNull=!0),i}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return ms.create(t,nr.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 i=`_${e}er`;(!this[i]||e in t&&this[`_${e}`]!==t[e])&&(this[i]=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(s(t))return t;if(t){let e;if(t._obj instanceof _t)e=t._obj;else if(t instanceof _t)e=t;else if(Number.isFinite(t)||i(t)||a(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){this._doLoadPoints(t);const e=this.prop("onPointsLoaded");return r(e)&&e(this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this.prop("pointColors"),e=this.prop("color"),i=this._runColor=o(e)?`var(--color-${Math.max(1,(Math.floor(e)-1)%rr+1)})`:e;let r,a;s(t)?r=t:n(t)?t.endsWith("@pal")||t.endsWith("@palette")?r=this.chart.getPaletteColors(t.split("@")[0]):a=this.chart._assets.get(t):this._colorByPoint()&&(r=this.chart.general.prop("colors")),a instanceof Qe?this._runPoints.forEach((t,e)=>{t.color=t.color||a.getAt(e)||i}):s(r)?this._runPoints.forEach((t,e)=>{t.color=t.color||r[e%r.length]||i}):this._runPoints.forEach((t,e)=>{t.color=t.color||i}),this._preparePointArgs(this._pointArgs),this._labelPosCallback=Mt(this._pointLabel.prop("position")),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=Mt(this._pointLabel.prop("offset")),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const i=t[Js[e]];for(const e of this._runRanges)if(i>=e.fromValue&&i<=e.toValue)return void(t.range=e);t.range=pt}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}nr.LEGEND_MARKER="rct-legend-item-marker",nr.defaults=ii(ni.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 or extends oi{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(i=>t===i.row&&e===i.col)}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof xr&&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 i=[];return this._items.forEach(s=>{s._valid&&!s._legended&&(t<0||t===s.row)&&(e<0||e===s.col)&&(s.getLegendSources(i),s._legended=t>=0&&e>=0)}),i}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=[];s(t)?t.forEach((t,i)=>{r.push(this.$_loadItem(e,t,i))}):i(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach(t=>{t instanceof xr?n.push(...t.series):t instanceof nr&&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 i=this.$_loadItem(this.chart,t,this._series.length);if(i)return i._needAnimate=e,this._items.push(i),this._series.push(i),this.$_add(i),i}remove(t){let e;if(t instanceof nr?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.prop("zOrder")||0)-(+e.prop("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(i=>{if(i.visible){const s=i._group;(s?s.visible&&s._valid:i._valid)&&(t.push(i),i.hasShape()&&i.setShape(ps[e++%ps.length]),s||(i._valid=!0))}}),this._visibleSeries=t.sort((t,e)=>{let i=+(t._group?t._group.prop("zOrder"):t.prop("zOrder"))||0,s=+(e._group?e._group.prop("zOrder"):e.prop("zOrder"))||0;return i===s&&t._group&&t._group===e._group?(+t.prop("zOrder")||0)-(+e.prop("zOrder")||0):i-s});const i=1===this._visibleSeries.filter(t=>t.isClusterable()).length;this._visibleSeries.forEach((t,e)=>{t instanceof gr&&(t._single=i)}),this._visibles.forEach(t=>t._prepareRender())}prepareAfter(){this._visibles.forEach(t=>t.prepareAfter())}updateOptions(t,e){if(null==t)return;const i=this.chart,r=s(t)?t:[t];for(r.forEach((t,e)=>{e<this._items.length?this._items[e].updateOptions(t,!1):this._items.push(this.$_loadItem(i,t,e))});this._items.length>r.length;){const t=this._items.pop();if(t instanceof xr)t.series.forEach(t=>{const e=this._series.indexOf(t);e>=0&&this._series.splice(e,1),t.name&&delete this._map[t.name]});else if(t instanceof nr){const e=this._series.indexOf(t);e>=0&&this._series.splice(e,1),t.name&&delete this._map[t.name]}}this.$_rebuildSeriesList()}$_rebuildSeriesList(){const t=this._series=[];this._items.forEach(e=>{e instanceof xr?t.push(...e.series):e instanceof nr&&t.push(e)}),this._map={},this._widget=!0,t.forEach(t=>this.$_add(t)),this.chart._op.series=this._items.map(t=>t.options)}$_loadItem(t,e,i){const r=s(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const s=new r(t);return s._setIndex(i),s.init(),s._load(e),s}return nr._loadSeries(t,i,e)}$_add(t){!this._widget||t instanceof ur||(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 ar extends nr{_doInit(t){super._doInit(t),this._trendline=this._addChild("trendline",new Ys(this))}get trendline(){return this._trendline}connectable(t){return!0}}ar.defaults=ii(nr.defaults,{});class hr extends ni{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){const e=this.prop("styleCallback");if(e)return this.series._getPointCallbackArgs(this._args,t),e(this._args)}_doSetSimple(t,e){return n(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}}hr.defaults=ii(ni.defaults,{radius:3});class lr extends Bs{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return A(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 cr extends ni{_doSetSimple(t,e){return n(e)?(this.setStyle("stroke",e,!1),!0):super._doSetSimple(t,e)}}cr.defaults=ii(ni.defaults,{curved:!0});class _r extends Ks{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),this._connector=this._addChild("connector",new cr(this.chart))}get connector(){return this._connector}getWidgetAlign(){const t=this.prop("align");return"near"===t?-1:"far"===t?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}_r.defaults=ii(Ks.defaults,{visible:!0,convergent:!0,align:ws,dedupeMode:Vs});class dr extends ni{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this._save;let i,s=this.num("maxCount");return i=this._minDim?R(this._minDim,Bs.getSum(t)):+this.prop("minValue"),isNaN(s)&&isNaN(i)&&(s=dr.DEF_COUNT),(this._dirty=!e||e.value!==i||e.count!==s)&&(isNaN(i)||(t=t.filter(t=>t.y>=i)),s>0&&t.length>s&&(s>1&&s--,t=t.slice(0,s)),this._save={count:s,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=At(this.prop("minValue"),!0)}}dr.DEF_COUNT=10,dr.defaults=ii(ni.defaults,{visible:!1,x:"기타"});class ur extends nr{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),this._othersGroup=this._addChild("othersGroup",new dr(this.chart))}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:R(this._centerXDim,t),y:R(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.prop("legendByPoint")?!1!==this.prop("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.prop("zeroInLegend"))}_doApply(t){const e=this;var i,s;super._doApply(t),i=this.prop("centerX"),s=this.prop("centerY"),i!==e._centerX&&(e._centerX=i,e._centerXDim=At(k(i,e.prop("center"),ur.DEF_CENTER),!0)),s!==e._centerY&&(e._centerY=s,e._centerYDim=At(k(s,e.prop("center"),ur.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach(t=>this._sum+=t.yValue);const i=this.getSum();this._runPoints.forEach(t=>t._percent=100*t.yValue/i)}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.prop("legendKey"),i=this.othersGroup;if(i.visible){if(!this._groupedPoints&&(this._groupedPoints=i.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({x:i.prop("x"),maxCount:i.prop("maxCount"),minValue:i.prop("minValue")},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,i)=>(t.vindex=i,t._legendKey=t[e],t))}}ur.DEF_CENTER="50%",ur.defaults=ii(nr.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:ur.DEF_CENTER,centerY:ur.DEF_CENTER});class pr extends ur{getRadius(t,e){return R(this._radiusDim,g(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=At(A(t._radius=e,pr.defaults.radius),!0))}(this,this.prop("radius"))}}pr.defaults=ii(ur.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class gr extends ar{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this.prop("pointWidth")}getMinPointWidth(){return this.prop("minPointWidth")}getPointWidth(t,e){const i=this._group;let s=t;return i?(s*=i._clusterWidth,s*=1-2*i.prop("groupPadding"),s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,f(e,s)}getPointPos(t){const e=this._group;let i=t,s=0;return e?(s=i*e._clusterPos,i*=e._clusterWidth,s+=i*e.prop("groupPadding"),i-=i*e.prop("groupPadding")*2,s+=i*this._childPos,i*=this._childWidth):(s=i*this._clusterPos,i*=this._clusterWidth),s+=i*this._pointPad,s}isClusterable(){return!1!==this.prop("clusterable")}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender();const t=this.prop("pointPadding");this._pointPad=isNaN(t)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,t)),this._op.minPointWidth=P(this.getMinPointWidth(),0)}}gr.defaults=ii(nr.defaults,{pointWidth:1,minPointWidth:0});class fr extends Ks{getAlign(){return this.prop("align")}getAlignOffset(){return this.num("alignOffset")}get line(){return this._line}_doInit(t){super._doInit(t),this._line=this._addChild("line",new qs(this.chart))}}fr.defaults=ii(Ks.defaults,{align:"center",alignOffset:0});class mr extends gr{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new fr(t)}_doPrepareRender(){const t=this._group;if(super._doPrepareRender(),t?(this._depth=f(0,Et(this.prop("depth"),t.getDepth(),mr.DEPTH)),this._distance=t.getDistance()+P(this.prop("distance"),0)):(this._depth=f(0,P(this.prop("depth"),mr.DEPTH)),this._distance=P(this.prop("distance"),mr.DISTANCE)),this.prop("nullAsBase")&&null!=this.prop("baseValue")){const t=this.prop("baseValue");this._runPoints.forEach(e=>{e.isNull&&(e.y=t,e.isNull=!1)})}this._base=k(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this.prop("baseValue")}_getLabelDefaultPos(t,e){const i=this._group;return"default"===e&&i&&i._stacked&&i.stackLabel&&i.stackLabel.visible?"inside":e}}mr.DEPTH=10,mr.DISTANCE=5,mr.defaults=ii(gr.defaults,{nullAsBase:!1});class yr extends gr{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach(t=>{if(e){const i=this._getBottomValue(t);!isNaN(i)&&e.push(i)}})}}class br extends yr{}class xr extends ni{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach(t=>{Us[t.type]=t})}static registerSeries(...t){t.forEach(t=>{Us[t.seriesType]=t})}static collectTooltipText(t,e,i,r,n){function o(t,e,i,s){let r=e.replace(Zs,t.getTooltipDetail(i));return r=r.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+s+"."),r}const a=e.length>1&&s(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 s=r;t!==i&&t.needAxes()&&(s=t.getPointAt(r.xValue)),s&&(a?(n.items.push(t),n.rows.push([o(t,h[0],s,e),o(t,h[1],s,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,i,s){let r=s.indexOf("."),n=parseInt(s.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(i.xValue);o&&(e=t[n],i=o,s=s.substring(r+1))}return s.startsWith("series.")&&(e=t[+s.substring(7)]||e,s="series"),nr.getPointTooltipParam(e,i,s)}isGroupTooltip(){return!0}getTooltipText(t,e,i){return xr.collectTooltipText({tooltipHeader:this.prop("tooltipHeader"),tooltipRow:this.prop("tooltipRow"),tooltipListRow:this.prop("tooltipListRow"),tooltipFooter:this.prop("tooltipFooter")},this._visibles,t,e,i)}getTooltipParam(t,e,i){return xr.inflateTooltipParam(this._visibles,t,e,i)}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.prop("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(i=>{i.collectRanges(t,e)})}prepareReferents(t){this._series.forEach(e=>e.prepareReferents(t))}collectCategories(t){let e=[];return this._visibles.forEach(i=>e=e.concat(i.collectCategories(t))),e}getLegendSources(t){var e;if(!1!==this.prop("visibleInLegend")&&this.visible){const i=this._series,s=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.prop("reversed"))||"fill"!==this.prop("layout")&&"stack"!==this.prop("layout"))i.forEach(t=>t.getLegendSources(s));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(s);this.prop("reversedInLegend")&&s.reverse(),t.push(...s)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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=this.num("layoutMax");return t>0?t:xr.LAYOUT_MAX}_doInit(t){super._doInit(t),this._stackLabel=this._addChild("stackLabel",new Qs(this.chart))}_doLoad(t,i){super._doLoad(t,i),e.call(i,"children")&&this._syncChildren(i.children)}updateOptions(t,i=!0){return t&&e.call(t,"children")?(super.updateOptions(t,!1),this._syncChildren(t.children),i&&this._changed(),this):super.updateOptions(t,i)}saveOptions(t,e=!0,i=!1,s=!1){const r=super.saveOptions(t,e,i,s);return void 0!==r.children&&(r.children=this._series.map(t=>t.saveOptions())),r}_prepareRender(){const t=this._visibles;if(this._legended=null,this._stacked="stack"===this.prop("layout")||"fill"===this.prop("layout"),this._visibles=this._series.filter(t=>t.visible).sort((t,e)=>(+t.prop("zOrder")||0)-(+e.prop("zOrder")||0)),!(this._seriesChanged=!rt.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){}_syncChildren(t){const e=this.chart,r=this._seriesType(),n=this._series,o=[],a=(t,i)=>{const s=t.type||r;let a=n[i];a&&a._type()===s?(a._setIndex(i),a._load(t),o.push(a)):(a=nr._loadSeries(e,i,t,r),a._group=this,o.push(a))};s(t)?t.forEach((t,e)=>a(t,e)):i(t)&&a(t,0),this._series=o}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach(i=>{i.collectValues(t,e)})}$_collectPoints(t){const e=this._visibles,i=this._stackPoints=new Map;e.forEach(e=>{e.collectValues(t,null)}),e[0]._runPoints.forEach(t=>{i.set(t.xValue,[t])});for(let t=1;t<e.length;t++)e[t]._runPoints.forEach(t=>{const e=i.get(t.xValue);e?e.push(t):i.set(t.xValue,[t])});return i}$_collectStack(t,e){const i=this.getBaseValue(t),s=this.$_collectPoints(t),r=this._stackTotals=new Map;if(isNaN(i))for(const[t,i]of s.entries()){i[0].yGroup=i[0].yValue||0;for(let t=1;t<i.length;t++)i[t].yGroup=i[t-1].yGroup+(i[t].yValue||0);const s=i[i.length-1].yGroup;r.set(t,{x:i[0].xValue,positiveTotal:s>=0?s:0,negativeTotal:s<0?s:0}),e.push(s)}else for(const[t,n]of s.entries()){let s=n[0].yValue||0,o=s>=i?0:-1,a=s<i?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)s=n[t].yValue||0,s>=i?(o>=0&&(n[t].yGroup=n[o].yGroup+s*(s<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+s*(s>=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 i=this.getBaseValue(t),s=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(i))for(const t of r.values()){const i=t.reduce((t,e)=>t+(e.yValue||0),0);if(0===i){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)/i*s,r=e.yGroup=e.yValue+r;e.push(s)}}else for(const t of r.values()){const r=t.reduce((t,e)=>t+(m(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*s,e.yValue<i?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}xr.LAYOUT_MAX=100,xr.defaults=ii(ni.defaults,{layout:"default",layoutMax:xr.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class vr extends xr{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class wr extends xr{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this.prop("groupWidth")}isClusterable(){return!1!==this.prop("clusterable")}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}wr.defaults=ii(xr.defaults,{groupWidth:1,groupPadding:.1});class Sr extends ar{isMarker(){return!0}isXY(){return!0}}Sr.defaults=ii(nr.defaults,{colorByPoint:!1});class Vr extends ni{}class Cr extends ni{}const Pr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Ar={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},kr={minPadding:0,maxPadding:0};class Lr extends ni{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;this._handle=this._addChild("handle",new Vr(e)),this._mask=this._addChild("mask",new Cr(e)),this._borderLine=this._addChild("borderLine",new ni(e))}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return Math.max(0,this.num("thickness"))}getGap(){return Math.max(0,this.num("gap"))}getGapFar(){return Math.max(0,this.num("gapFar"))}getHandleOverflow(){return Lr.HANDLE_TRACK_OFFSET+Lr.HANDLE_RADIUS}getSize(){const t=f(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=l({},e.series,Pr[t]())}else s.series=Pr.area();i(e.xAxis)?s.xAxis=l({},e.xAxis,(Ar[e.xAxis.type]||Ar.linear)(),kr):s.xAxis=l({},kr),i(e.yAxis)?s.yAxis=l({},e.yAxis,(Ar[e.yAxis.type]||Ar.linear)(),kr):s.yAxis=l(Ar.linear(),kr),this._chartConfig=s,this._axisType=s.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this.prop("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.bool("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()}}Lr.HANDLE_RADIUS=9.75,Lr.HANDLE_TRACK_HEIGHT=6,Lr.HANDLE_TRACK_OFFSET=Lr.HANDLE_TRACK_HEIGHT/2,Lr.defaults=ii(ni.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Tr extends ni{constructor(){super(...arguments),this._gap=10}getGap(){return this._gap}_doApply(t){super._doApply(t);const e=parseFloat(String(this.prop("gap")));this._gap=isNaN(e)?Tr.defaults.gap:e}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}Tr.defaults=ii(ni.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Mr extends Tr{}Mr.defaults=ii(Tr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Nr extends ni{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:i,_point:s,_ctx:r}=this,n=i._group,o=!!r.axis;let a=i,h=s;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const i=Number(t[1])||0;e=e.replace(i+".",""),a=o?r.series[i]:n.getVisibleSeries()[i]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(s.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,i){let s=this.prop("scope");return this._ctx=this.visible&&this.owner.getTooltipContext(s,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this.prop("noClip");return!!a(t)&&t}isFollowPointer(t){const e=this.prop("followPointer");return e||!1!==e&&(null==t?void 0:t.followPointer())}getHeaderHeight(){return this.bool("simpleMode")?0:f(this.num("headerHeight"),0)}getTailSize(){return this.bool("simpleMode")?0:f(this.num("tailSize"),0)}getBorderRadius(){return this.bool("simpleMode")?0:f(this.num("borderRadius"),0)}hasListMarker(){return"none"!==this.prop("listMarkerShape")}getMarkerSize(){return this.hasListMarker()?this.num("listMarkerSize")||7:0}getMarkerGap(){return this.hasListMarker()?this.num("listMarkerGap"):0}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("numberFormat"))!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?It.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?ie.getFormatter(e._timeFormat):void 0)}(this.prop("timeFormat"))}}Nr.defaults=ii(ni.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,listMarkerShape:"circle",listMarkerSize:7,listMarkerGap:5,followTouch:!0});const Er="vline",Br="hline",Or="line",Dr="arrow";class $r extends _i{getImageUrl(){const t=this.prop("imageUrl");if(!n(t))return t;const e=t.indexOf("::");if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Je?i.getImage(r):s}return t}_isVisible(){return this.prop("visible")&&!N(this.prop("imageUrl"))}_doSetSimple(t,e){return n(e)?(this._op.imageUrl=e,!0):super._doSetSimple(t,e)}}$r.type="image";class Rr extends _i{getShape(){return this.prop("shape")||Rr.defaults.shape}hasCustomPath(){return n(this.prop("path"))&&this.prop("path").length>0}getHeadSize(){return this.getShape()!==Dr?Rr.defaults.headSize:this._headSize}_doApply(t){super._doApply(t),this.getShape()===Dr&&(this._headSize=f(1,this.num("headSize")),this._style=this.$_resolveArrowStyle())}_doSetSimple(t,e){return n(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}$_resolveArrowStyle(){const t=this._style;if(n(t))return t;const e=i(t)?{...t}:{},s=this.prop("lineWidth");return null!=s?e.strokeWidth=`${f(1,P(s,1))}px`:e.strokeWidth||e["stroke-width"]||(e.strokeWidth="1px"),e.stroke||(e.stroke="#555"),e.fill||(e.fill=e.stroke),e}}Rr.type="shape",Rr.defaults=ii(_i.defaults,{width:64,height:64,shape:"square",headSize:12});class Ir extends _i{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){var t;return null!==(t=this.prop("textOrientation"))&&void 0!==t?t:Ir.defaults.textOrientation}_isVisible(){return this.prop("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("numberFormat"))!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?It.getFormatter(i):pt),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?ie.getFormatter(t):pt)}(this.prop("timeFormat"))}}Ir.type="text",Ir.defaults=ii(_i.defaults,{text:"Text",textOrientation:"upright"});class Fr extends wi{_doInit(t){super._doInit(t),this._minorGrid=this._addChild("minorGrid",new Li(this.axis))}get minorGrid(){return this._minorGrid}getPositions(t,e){return t.hasBreak()?t._ticks.filter(e=>!t.isBreak(e.value)).map(i=>t.getPos(e,i.value)):t._ticks.map(i=>t.getPos(e,i.value))}getMinorPositions(t,e){if(!this._minorGrid.visible||t.isEmpty()||t._minorValues.length<1)return[];if(t._vlen===e&&t._minorMarkPoints.length===t._minorValues.length)return t._minorMarkPoints;const i=[];return t._minorValues.forEach(s=>{const r=t.getPos(e,s);isFinite(r)&&i.push(r)}),i}}class zr extends Ai{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,i,s,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,i,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},c=this.$_getStepPixels(e,l);let _,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,_=a?this._getStepsByPixels(e,P(.85*c,60),i,n,o,l):s(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof Wr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,i,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,i,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,i,n,o):c>0?this._getStepsByPixels(e,c,i,n,o,l):n!==o?[n,o]:[n],_}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?f(8,_(t/(.9*e))+1):P(this.prop("maxCount"),1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){super._doApply(t);const i=!r(this.prop("stepPixels"))&&rt.parseTuples(this.prop("stepPixels"));let n;if(this._stepPixels=i&&i.every(([,t])=>t>0)?i:void 0,e.call(this._op,"stepMultiples")){const t=this.prop("stepMultiples");if(r(t))n=t;else{let e;if(s(t)){let i=Number.MIN_SAFE_INTEGER;e=[],t.forEach(t=>{!isNaN(+t)&&t>i&&e.push(+t)})}n=e&&e.length>0?e:void 0,n&&(n=n.filter(t=>t>=1),n.length>0?n.sort((t,e)=>t-e):n=void 0)}}this._userMultiples=n}$_getStepPixels(t,e){let i=this._stepPixels;if(r(i)&&(i=i.call(void 0,e)),!i){const t=this.axis;i=t._isPolar?zr.STEP_PIXELS_P:t._isX?zr.STEP_PIXELS_X:zr.STEP_PIXELS_Y}for(let e=0;e<i.length;e++)if(t<=i[e][0])return f(1,i[e][1])}_findBaseAxis(){if(null!=this.prop("baseAxis")){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.prop("baseAxis"));e!==t&&e instanceof Wr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<_(t/e)*e&&(t=_(t/e)*e),t}_getStepsByCount(t,e,i,s,r){i>e?(i=e,e=NaN):s<e&&(s=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=s-i;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=_(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))i=this._normalizeMin(i,h);else{for(!function(t,e){if(!t)throw new I(e)}(i<e&&s>e,"base error"),t=f(3,t);;){if(!(_((e-i)/a)+_((s-e)/a)+1>t))break;a+=h}i=e-_((e-i)/a)*a}else i=n._fixedMin;l.push(mt(i));for(let e=1;e<t;e++)l.push(mt(l[e-1]+a));return l}_getStepsByInterval(t,e,i,s){const r=[];let n;if(i=mt(this._normalizeMin(i,t)),isNaN(e))for(r.push(n=i);n<s;)r.push(n=mt(n+t));else{for(r.push(n=e);n>i;)r.unshift(n=mt(n-t));for(n=e;n<s;)r.push(n=mt(n+t))}return this._step=t,r}_getStepMultiples(t,e){var i;return(null!==(i=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==i?i:this.prop("fineStep"))?zr.STEP_MULTIPLES[2]:this.prop("enableDecimals")&&1===t?zr.STEP_MULTIPLES[0]:zr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,i){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,i),s(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?i=>i>=t&&i<=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,i,s,r,n){s>=i?s=i:r<=i&&(r=i);const o=r-s;if(0===o||t<=0)return isNaN(s)?[]:[s];const a=this.getMaxCount(t,e);let h=f(1,c(t/e))+1,l=o/(h-1);const d=function(t){return Math.pow(10,t)}(c(p(l))),u=this._getStepMultiples(d,n),g=[];let m,y=0;if(l/=d,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*=d,(l<=0||!isFinite(l))&&(l=o/h),s=isNaN(i)?this._normalizeMin(s,l):i-_((i-s)/l)*l,this._step=l,g.push(mt(m=s));m<r;)g.push(mt(m+=l));if(!u||y>u.length-2||g.length<=a)break;l=u[++y],g.length=0}return g}}zr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],zr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],zr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],zr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],zr.defaults=ii(Ai.defaults,{baseRange:!1,enableDecimals:!0});class Hr extends Ti{}Hr.defaults=ii(Ti.defaults,{numberFormat:"0.##"});class Gr extends Hr{getTick(t,e){return this._getText(null,e,"*"===this.prop("useSymbols")||this.prop("useSymbols")&&this.axis.tick.canUseNumSymbols(),!1)}}Gr.defaults=ii(Hr.defaults,{useSymbols:!0});class jr extends mi{getSize(t){return Math.min(.9*t,R(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._space=this.num("space"),this._sizeDim=At(null!==(e=this.prop("size"))&&void 0!==e?e:jr.defaults.size,!1),this.axis._breaksChanged=!0}prop(t){return"space"===t?this._space:super.prop(t)}}jr.defaults=ii(mi.defaults,{size:"30%",space:16,gridVisible:!0});class Yr extends yi{_isVisible(){return this.prop("visible")}}Yr.defaults=ii(yi.defaults,{visible:!1});class Wr extends Bi{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),this._baseLine=this._addChild("baseLine",new Yr(this)),this._minorTick=this._addChild("minorTick",new ki(this))}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get minorTick(){return this._minorTick}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.prop("gridVisible")&&(t===e.prop("from")||t===e.prop("to"))}return!1}$_getPadding(t,e,i){if(!t){if(this._isX&&this._isPolar)return 0;t=Wr.PADDINGS}for(let s=0;s<t.length;s++)if(e<=t[s][0])return t[s][1]*i;return 0}_doApply(t){var i,s;super._doApply(t);const r=null!==(i=this.prop("minPadding"))&&void 0!==i?i:this.prop("padding"),o=null!==(s=this.prop("maxPadding"))&&void 0!==s?s:this.prop("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=rt.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=rt.parseTuples(o)),this._baseVal=+this.prop("baseValue"),this._strictMin=At(this.prop("strictMin"),!0),this._strictMax=At(this.prop("strictMax"),!0),e.call(this._op,"break")&&this.$_loadBreaks(this.prop("break"))}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Fr(this)}_createTickModel(){return new zr(this)}_prepareRender(){super._prepareRender(),this._minorTick._prepareRender()}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=P(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=P(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,i){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,i,s){if(isNaN(t)||isNaN(e))return[];if(s>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,i,s),this.$_createTicks(t,i,this._min,this._max,s)}const r=this._tick,n=r._baseAxis instanceof Wr&&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(i,this._calcedMin=t,this._calcedMax=e);if(n&&r.prop("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.prop("from"))||isNaN(e.prop("to"))||e.prop("from")<=a||e.prop("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=i/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():i,a,h);if(e){if(this._unitLen=e.len,_=!0,!this._zoom||t)if(e.min=e.min*(2*this.num("unitPadding")),t){let t=o.polarMargin;isNaN(t)?t=b*e.min/(h-a+e.min):t*=v,isNaN(this._fixedMax)&&this.getTotalAngle()+t>b&&(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,i,a,h),c=l.slice(0),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,i,this._runBase,a,h,!1),c=l.slice(0),l.length>0){const t=!0===r.prop("showFirst"),e=!0===r.prop("showLast");if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d&&!t;)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&&!t;)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&&!e;)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&&!e;)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,i,a,h,s);if(_&&p.length>1){const t=this._isPolar;let e=!1;const i=c;let s,r;if(i[0]<=a){for(r=-1;r<l.length-1&&i[r+1]<l[0];)r++;for(;r>=0&&(s=i[r])>=a;){const t=this.dataToAxis(p[0].value),i=this.dataToAxis(p[1].value);if(s<t&&t-s>=i-t&&("tick"===this.$_getStartFit()||s>a)){const t=this._createTick(0,s);p.unshift(t),l.unshift(s),e=!0}r--}}if(i[i.length-1]>=h){for(r=i.length;r>0&&i[r-1]>l[l.length-1];)r--;for(;r<i.length&&(s=i[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(s>=t&&s-t>=t-i&&("tick"===this.$_getEndFit()||s<h)){const t=this._createTick(0,s);p.push(t),l.push(s),e=!0}r++}}else if(t&&h>i[i.length-1])for(;(s=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(!(mt(h-t)>mt(t-i)))break;{const r=this._createTick(0,s+mt(t-i));p.push(r),l.push(r.value),e=!0}}e&&p.forEach((t,e)=>t.index=e)}return p}$_createTicks(t,e,i,s,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const i=this._createTick(e,t[e]);i.value!==o&&(n.push(i),o=i.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}$_buildMinorValues(t){if(!isFinite(t)||t<1||this._ticks.length<2)return[];const e=this._ticks,i=[];for(let s=0;s<e.length-1;s++){const r=e[s].value,n=e[s+1].value;if(this._canInterpolateMinorSegment(r,n)&&(!this.hasBreak()||!this.isBreak(r)&&!this.isBreak(n)))for(let e=1;e<=t;e++){const s=this._interpolateMinorValue(r,n,e,t);isFinite(s)&&i.push(s)}}return i}_canInterpolateMinorSegment(t,e){return t!==e&&isFinite(t)&&isFinite(e)}_interpolateMinorValue(t,e,i,s){return mt(t+(e-t)*i/(s+1))}_calcPoints(t,e){super._calcPoints(t,e),this._minorTick.visible||this.grid.minorGrid.visible?this.$_calcMinorPoints(t):(this._minorValues=[],this._minorMarkPoints=[]),this._markPoints=this._ticks.map(t=>t.pos)}$_calcMinorPoints(t){const e=this.$_buildMinorValues(this._minorTick._getCount()),i=[],s=[];e.forEach(e=>{const r=this.getPos(t,e);isFinite(r)&&(i.push(e),s.push(r))}),this._minorValues=i,this._minorMarkPoints=s}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,i,s){let r=0,n=i;const o=[n],a=this._sects=[],h=e-t.reduce((t,e)=>t+e.prop("space"),0);t.forEach(t=>{const e=t.getSize(h),i=Math.max(0,t.prop("space")),s={from:n,to:t.prop("from"),pos:r,len:e};r+=e,a.push(s,t._sect={from:t.prop("from"),to:t.prop("to"),pos:r,len:i}),r+=i;this.$_buildBrokenSteps(s).forEach(t=>{t>s.from&&t<=s.to&&o.push(t)}),i>0&&o.push(t.prop("to"))});const l=t[t.length-1];if(s>l.prop("to")){const t={from:l.prop("to"),to:s,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 i;if(this._runBreaks){const s=this._sects.find(t=>e<t.to)||this._lastSect,r=s.len*(e-s.from)/(s.to-s.from);i=this.prop("reversed")?yt(t-r-s.pos):yt(r+s.pos)}else{let s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this.prop("reversed")&&(s=t-s,isNaN(this._prevRate)||(s+=this._prevSize-t)),i=yt(s)}return this._ani?this._ani.getPos(i,this.prop("reversed")):i}valueAt(t,e){if(this._isHorz?this.prop("reversed")&&(e=t-e):this.prop("reversed")||(e=t-e),this._runBreaks){let t=0;for(const i of this._sects){if(e>=t&&e<t+i.len)return(i.to-i.from)*(e-t)/i.len+i.from;t+=i.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.prop("startFit"))}$_getEndFit(){return this.$_resolveFit(this.prop("endFit"))}$_calcStrict(t,e,i){if(t)return t.fixed?t.size:i<0?e-R(t,i):e+R(t,i)}_adjustMinMax(t,e,i){const s=this._isLog();let r,n=this.isZoomed(),a=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=f(u,t.getAxisPadRate())}),!this._isX&&c>0&&c<this._series.length&&(r={},this._series.forEach(t=>{const e=t._type();r[e]?r[e]=[g(t._yMin,r[e][0]),f(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]})),this._series.forEach(r=>{let c=r._sBase;o(c)&&!isNaN(c)&&(c=mt(c),s?c>=0&&c<=e&&c<=i&&(e=t=c):c<=e?r.isBased(this)?e=t=c:_=P(g(_,c),c):c>=i&&(r.isBased(this)?i=t=c:d=P(f(d,c),c))),h&&!n&&(s||r.canMinPadding(this,e,t))&&(h=!1),l&&!a&&(s||r.canMaxPadding(this,i,t))&&(l=!1)})}else h=n,l=a;n||(n=h),a||(a=l),this._fixedMin=this._fixedMax=NaN;const p=f(0,i-e),m=this.$_calcStrict(this._strictMin,e,-p),y=this.$_calcStrict(this._strictMax,i,p);let b=NaN,x=NaN,v=0,w=0;isNaN(m)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):b=this._minPadPixels:this._fixedMin=e=m,isNaN(y)?a?this._fixedMax=i:isNaN(this._maxPadPixels)?w=this.$_getPadding(this._maxPaddings,t,u):x=this._maxPadPixels:this._fixedMax=i=y;let S=e,V=i;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<S&&(S=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*w;e>V&&(V=e)}}else S-=p*v,V+=p*w;if(!isNaN(b)||!isNaN(x)){isNaN(b)&&(b=0),isNaN(x)&&(x=0);const e=Math.min(b+x,.9*t),i=p-c(p*(t-e)/t),s=Math.round(i*b/e);S-=s,V+=i-s}return!isNaN(_)&&_<=e&&S<_&&(S=this._fixedMin=_),!isNaN(d)&&d>=i&&V>d&&(V=this._fixedMax=d),V=f(V,S),{min:S,max:V}}$_calcXUnitLength(t,e,i){const s=[];let r=0;if(this._series.forEach(t=>{t.visible&&t.isClusterable()&&(s.push(...t._getVisiblePoints()),r++)}),0===r&&this._series.forEach(t=>{t.visible&&!t.isXY()&&s.push(...t._getVisiblePoints())}),s.length>0){const r=s.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,i)}}_calcUnitLen(t,e,i,s){if(t.length<2){if(this._ticks.length>0){const t=(s-i)/Math.max(8,this._ticks.length);return{len:P(e*=t/(s-i+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=g(n,t[e]-t[e-1]);return r*=n/(s-i+n),isFinite(r)||(r=e/2),{len:P(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new jr(this),i={...t};return i.from=this.getValue(i.from),i.to=this.getValue(i.to),!isNaN(i.from)&&!isNaN(i.to)&&i.from>i.to&&([i.from,i.to]=[i.to,i.from]),this._doApplyBreak(i),e.init(),e._load(i),isNaN(i.from)||isNaN(i.to)?null:e}}_doApplyBreak(t){}$_loadBreaks(t){if(s(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){return e.prop("from")<t.prop("to")}function e(t,e){t._op.to=e.prop("to")}const i=this._breaks.sort((t,e)=>t.prop("from")-e.prop("from")).filter(t=>t.visible&&t.prop("to")>t.prop("from"));if(this._mergedBreaks=null,i.length>0){const s=this._mergedBreaks=[];s.push(new jr(this)._initObject().loadOptions(i[0].options,!1));for(let r=1;r<i.length;r++){const n=s[s.length-1],o=i[r];t(n,o)?e(n,o):s.push(new jr(this)._initObject().loadOptions(o.options,!1))}}}}Wr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],Wr.defaults=ii(Bi.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class Xr extends Wr{get label(){return this._label}_createLabel(){return new Gr(this)}_adjustMinMax(t,e,i){const s=super._adjustMinMax(t,e,i),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof xr&&"fill"===r[0].prop("layout")&&(s.max=r[0].getLayoutMax()),s}}Xr.type="linear";const Ur=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Zr=[[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]],qr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Kr extends zr{getNextStep(t,e){const i=new Date(t);switch(e*=this._step,this._scale){case 7:i.setFullYear(i.getFullYear()+e);break;case 6:i.setMonth(i.getMonth()+e);break;case 5:i.setDate(i.getDate()+7*e);break;case 4:i.setDate(i.getDate()+e);break;case 3:i.setHours(i.getHours()+e);break;case 2:i.setMinutes(i.getMinutes()+e);break;case 1:i.setSeconds(i.getSeconds()+e);break;case 0:i.setMilliseconds(i.getMilliseconds()+e)}return+i}_getValidInterval(t,e,i,s,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&qr.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>=Ur[e]/2&&t<Ur[e+1]/2)return this._scale=e,Zr[e];this._scale=7}_getStepsByPixels(t,e,i,s,r){const n=[],o=r-s;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,c=f(1,Math.floor(o/(l-1)));const _=this._getStepMultiples(c),d=Ur[this._scale];if(c/=d,_)if(c>_[0]){let t=0;for(;t<_.length-1;t++)if(c>_[t]&&c<_[t+1]){c=_[t+1];break}}else c=_[0];const u=a.date(s),p=a.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=c=Math.ceil(c),m=new Date(e,0),e<t&&e+c>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=c,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=c=Math.ceil(c),m=new Date(t,e),m<h&&new Date(t,e+c)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+c)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),i=m.getDate();const s=5===this._scale?7:1;this._step=c=Math.ceil(c),m=new Date(t,e,i),m<h&&new Date(t,e,i+s*c)>h&&(i=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),i));do{n.push(+m),m.setDate(m.getDate()+c*s)}while(m<=p)}else{switch(this._step=c,c*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+c>t&&(g=t);do{n.push(g),g+=c}while(g<=r)}return n}_getStepsByInterval(t,e,i,s){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,c;this._scale=qr[a],t=Ur[this._scale];let _=new Date(i);switch(this._scale){case 7:const t=n.getFullYear();let e=_.getFullYear();_.setMonth(0,1),e<t&&t<e+h&&(_=new Date(t,0));break;case 6:_.setDate(1),_.setHours(0,0,0,0),c=new Date(_),c.setMonth(c.getMonth()+h),_<n&&n<c&&(_=new Date(n),_.setDate(1),_.setHours(0,0,0,0));break;case 5:case 4:let i=5===this._scale?7:1;_.setHours(0,0,0,0),c=new Date(_),c.setDate(c.getDate()+h*i),_<n&&c>n&&(_=new Date(n),_.setHours(0,0,0,0));break;case 3:_.setMinutes(0);case 2:_.setSeconds(0);case 1:_.setMilliseconds(0)}if(this._step=h,i=+_,isNaN(e))for(o.push(l=i);l<s;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>i;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<s;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,i,s)}_getStepsBySteps(t,e,i){const s=super._getStepsBySteps(t,e,i);if(s.length>=2){const t=(s[s.length-1]-s[0])/(s.length-1);this._getStepMultiples(t)}else this._getStepMultiples(Ur[4]);return s}buildSteps(t,e,i,s,r,n=!1){const o=super.buildSteps(t,e,i,s,r,n);if(void 0===this._scale&&o.length>=2){const t=(o[o.length-1]-o[0])/(o.length-1);this._getStepMultiples(t)}return o}}const Qr=[{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 Jr extends Hr{_doApply(t){super._doApply(t);const e=n(this.prop("timeFormat"))?this.prop("timeFormat"):void 0,r=n(this.prop("beginningFormat"))?this.prop("beginningFormat"):void 0,o=this.prop("timeFormats"),a=this.prop("useBeginningFormat");if(this._formats=Qr.map(t=>l(t)),e&&this._formats.forEach(t=>{t.format=t.beginningFormat=e}),a&&r&&this._formats.forEach(t=>{t.beginningFormat=r}),s(o))for(let t=0;t<o.length;t++){const e=this._formats[t],s=o[t];Nt(s)?e.format=s:i(s)&&(Nt(s.format)&&(e.format=s.format),a&&Nt(s.beginningFormat)&&(e.beginningFormat=s.beginningFormat))}}getTick(t,e){const i=this.chart,s=this.axis,r=s.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,i.startOfWeek);else{const e=this._formats,o=s.tick._scale,a=ie.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,i.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek)}}return this._getText(n,null,!1,!1)}}Jr.defaults=ii(Hr.defaults,{useBeginningFormat:!0});class tn extends Wr{get label(){return this._label}_createTickModel(){return new Kr(this)}_createLabel(){return new Jr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,i,s){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,i,s)}collectValues(){this._offset=60*P(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this.prop("baseValue");return o(t)?t:n(t)?new Date(t).getTime()+P(this._offset,0):NaN}getValue(t){return o(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 i=parseFloat(e);if(0!=i){let s=new Date(t);switch(e.charAt(e.length-1)){case"y":s.setFullYear(s.getFullYear()+i);break;case"m":s.setMonth(s.getMonth()+i);break;case"d":s.setDate(s.getDate()+i);break;case"w":s.setDate(s.getDate()+7*i);break;case"h":s.setHours(s.getHours()+i);break;case"n":s.setMinutes(s.getMinutes()+i);break;case"s":s.setSeconds(s.getSeconds()+i)}return+s}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.prop("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}}tn.type="time",tn.subtype="date",tn.defaults=ii(Wr.defaults,{baseValue:NaN});class en extends $s{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class sn extends br{pointLabelCount(){return 2}_createLegendMarker(t,e){return ms.create(t,nr.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new en(t)}_getBottomValue(t){return t.lowValue}}sn.type="barrange",sn.defaults=ii(br.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class rn extends Bs{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class nn extends mr{canCategorized(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createPoint(t){return new rn(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}nn.defaults=ii(mr.defaults,{colorByPoint:!1,pointOffset:0});class on extends nn{canDepth(){return!0}_createLegendMarker(t,e){return ms.create(t,nr.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}on.type="bar";class an extends wr{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}getDepth(){return this.prop("depth")}getDistance(){return this._distance}_doApply(t){super._doApply(t),this._distance=f(0,this.num("distance"))}_doPrepareSeries(t){const e=this.prop("layout");if("default"===e){const e=t.length>1?t.map(t=>t.prop("pointWidth")).reduce((t,e)=>t+e,0):t[0].prop("pointWidth");let i=0;t.forEach(t=>{t._childWidth=t.prop("pointWidth")/e,t._childPos=i,i+=t._childWidth})}if("overlap"===e){let e=this.getDistance();t.forEach(t=>{t._groupDistance=e+=P(t.prop("distance"),0),e+=t.depth})}else t.forEach(t=>{t._groupDistance=t.distance})}}an.defaults=ii(wr.defaults,{depth:10,distance:5});class hn extends an{_canContain(t){return t instanceof on}}hn.type="bargroup",hn.seriesType="bar";class ln extends Se{constructor(t){super(t,nr.LEGEND_MARKER),this.add(this._back=new ms(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new Le(t))}render(t,e){const i=Math.max(8,2*e),s=2.1*i;t===this._shape&&e===this._rd&&i===this._size||(this._shape=t,this._rd=e,this._size=i,this._back.resize(1,i),this._renderShape(e,s,i),this._marker.trans(s/2-e,i/2-e))}_renderShape(t,e,i){fs.setShape(this._marker,this._shape,t,t)}}class cn extends ln{constructor(t){super(t),this.insertFirst(this._line=new Le(t)),this.insertFirst(this._area=new Le(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,i){const s=["M",0,i/2,"L",e,0],r=["M",0,i/2,"L",e,0,"L",e,i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,i)}}class _n extends ln{constructor(t){super(t),this.insertFirst(this._line=new Le(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Le(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Le(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,i){const s=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i],r=["M",0,i,"L",e/2,.7*i,"L",e,i],n=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i,"L",e,i,"L",e/2,.7*i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,i)}}class dn extends Le{constructor(t,e=pt,i=pt){super(t,e),i&&this.setLine(i)}setLine(t,e,i,s){o(t)?this.setPath(fs.line(t,e,i,s)):t&&this.setPath(fs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(fs.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(fs.line(t,e,t,i))}setHLine(t,e,i){this.setPath(fs.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(fs.line(e,t,i,t))}}class un extends ln{constructor(t){super(t),this.insertFirst(this._line=new dn(t))}_renderShape(t,e,i){this._line&&(this._line.setHLine(i/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,i)}}class pn extends Bs{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class gn extends hr{}gn.defaults=ii(hr.defaults,{radius:4,hoverScale:1.75});class fn extends hr{constructor(t){super(t),this.series=t}getPosition(){return this.prop("position")}getShape(){return this.prop("shape")}getRadius(){return this.num("radius")}getRotation(){return this.prop("rotation")}getArrowStyleOverrides(t){const e=fn.STYLE_ISOLATION,s={};return n(t)?(s.stroke=e.stroke,s.strokeWidth=e.strokeWidth,s):(i(t)&&null==t.strokeDasharray&&(s.strokeDasharray=e.strokeDasharray),s)}getArrowStyle(t){const e=t&&this.getMarkerStyle(t);return e?i(e)?this.$_applyStyleIsolation(l({},e)):e:this._runStyle||this.$_buildRunStyle()}buildArrowSlots(t){if(!this.visible||t.length<2)return[];let e=-1,i=-1;for(let s=0;s<t.length;s++)t[s].isNull||(e<0&&(e=s),i=s);if(e<0||i<0||e===i)return[];switch(this.getPosition()){case"start":return[{index:e,at:"start"}];case"both":return[{index:e,at:"start"},{index:i,at:"end"}];default:return[{index:i,at:"end"}]}}calcAutoAngle(t,e,i){const s=this.series.getLineType(),r=this.series.prop("stepDir"),n=this.$_neighborIndex(t,e,-1),o=this.$_neighborIndex(t,e,1),a=this.series.chart.isInverted();return"end"===i?n<0?0:this.calcSegmentAngle(this.$_displayPos(t[n]),this.$_displayPos(t[e]),s,r,"end",a):o<0?0:this.calcSegmentAngle(this.$_displayPos(t[e]),this.$_displayPos(t[o]),s,r,"start",a)}calcSegmentAngle(t,e,i,s,r,n=!1){let o=0,a=0;if("step"===i){const i=this.$_stepsAlongCategory(s,r);(n?!i:i)?o=e.px-t.px:a=e.py-t.py}else o=e.px-t.px,a=e.py-t.py;return 0===o&&0===a?0:Math.atan2(a,o)*w+90}calcArrowAngle(t,e,i){const s=this.getRotation();if("auto"===s||"auto-reverse"===s){let r=this.calcAutoAngle(t,e,i);return"auto-reverse"===s&&(r+=180),r}return P(+s,0)}_doPrepareRender(t){this._runStyle=this.$_buildRunStyle()}$_stepsAlongCategory(t,e){return"center"===t||("backward"===t?"end"===e:"start"===e)}$_displayPos(t){const e=t.xPos,i=t.yPos;return null==e||isNaN(e)||null==i||isNaN(i)?t:{px:e,py:i,isNull:t.isNull}}$_buildRunStyle(){const t=this.prop("style");if(n(t))return t;const e=l({},i(t)?t:{});return e.fill||(e.fill=this.series._runColor),this.$_applyStyleIsolation(e)}$_applyStyleIsolation(t){return null==t.stroke&&(t.stroke=fn.STYLE_ISOLATION.stroke),t.stroke===fn.STYLE_ISOLATION.stroke&&null==t.strokeWidth&&(t.strokeWidth=fn.STYLE_ISOLATION.strokeWidth),t}$_neighborIndex(t,e,i){for(let s=e+i;s>=0&&s<t.length;s+=i)if(!t[s].isNull)return s;return-1}}fn.defaults=ii(hr.defaults,{visible:!1,shape:"triangle",radius:6,rotation:"auto",position:"end"}),fn.STYLE_ISOLATION={stroke:"none",strokeDasharray:"",strokeWidth:""};class mn extends Ks{getAlignOffset(){const t=+this.prop("alignOffset");return isNaN(t)?"left"===this.prop("align")||"right"===this.prop("align")?mn.ALIGN_GAP:0:t}getPosition(){return this.prop("position")}}mn.ALIGN_GAP=4,mn.defaults=ii(Ks.defaults,{align:"center"});class yn extends ar{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new gn(this))}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return Et(t.radius,this.marker.prop("radius"),gn.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 mn(t)}_createPoint(t){return new pn(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.prop("shape")||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new un(t)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),g(e/2,this.marker.prop("radius"))),i}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const i=t.length,s=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();s.push(e)}else{let e=0;for(;e<i;){const r=[];for(;e<i&&t[e].isNull;)e++;for(;e<i&&!t[e].isNull;)r.push(t[e++]);r.length>0&&s.push(r)}}if(e){const t=[],i=[];e.forEach(e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&i.push(e)}),t.length>0&&(t.sort((t,e)=>t.xValue-e.xValue),s[0].unshift(...t)),i.length>0&&(i.sort((t,e)=>e.xValue-t.xValue),s[s.length-1].push(...i))}return s}}yn.defaults=ii(nr.defaults,{nullAsBase:!1});class bn extends hi{constructor(t){super(t.chart),this.series=t}label(){const t=this.prop("text")||this.series.displayName();return this._getText(t,null,!1,!1)}getDefaultIconPos(){return"left"}}bn.defaults=ii(hi.defaults,{visible:!1,offset:8});class xn extends yn{_doInit(t){super._doInit(t),this._flag=this._addChild("flag",new bn(this)),this._arrow=this._addChild("arrow",new fn(this))}get flag(){return this._flag}get arrow(){return this._arrow}backDir(){return"backward"===this.prop("stepDir")?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this.prop("connectEnds");if(a(e))return e;if(!t||"spline"===this.prop("lineType"))return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof An||this._group instanceof kn?this._group.prop("lineType"):this.prop("lineType")}_connectNulls(){return this.prop("connectNullPoints")}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){super._doPrepareRender(),this._base=k(this._getGroupBase(),this._yAxisObj.getBaseValue(),0);const t=this.num("baseValue");this.prop("nullAsBase")&&!isNaN(t)&&this._runPoints.forEach(e=>{e.isNull&&(e.y=t,e.isNull=!1)}),this.flag._prepareRender(),this.arrow._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}xn.type=As,xn.defaults=ii(yn.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class vn extends xn{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}vn.type="spline";class wn extends pn{}class Sn extends xn{_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 i=t[t.length-1].toPoint();i.py=t[t.length-1].yLow,e.push(i),i=t[0].toPoint(),i.py=P(t[0].yLow,t[0].py),e.push(i)}return e}const e=this._group,i=this._lines,s=this._areas=[];if(e&&e._stacked){const e=[].concat(...i);s.push(e),s.push(t(e))}else i.forEach(e=>{const i=e.slice(0);s.push(i),s.push(t(i))})}_createLegendMarker(t,e){return new cn(t)}_createPoint(t){return new wn(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,i=[];let s=0;for(;s<e;){const r=t[s].isNull,n=[];do{n.push(t[s++])}while(s<e&&t[s].isNull==r);i.push(n)}return i}return super._doBuildLines(t,e)}}Sn.type=ks,Sn.defaults=ii(yn.defaults,{});class Vn extends wn{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 l(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 i=t.options,s=e.length>2?1:0;this.low=e[P(i.lowField,0+s)],this.y=e[P(i.yField,1+s)],s>0&&(this.x=e[P(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=A(e[t.prop("lowField")],e.low),this.y=k(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=L(t.lowValue,this.lowValue,e)}}class Cn extends mn{getPosition(){return"default"===this.prop("position")||null==this.prop("position")?"foot":this.prop("position")}}class Pn extends yn{pointLabelCount(){return 2}_createLabel(t){return new Cn(t)}_createLegendMarker(t,e){return new _n(t)}_createPoint(t){return new Vn(t)}getLineType(){return this.prop("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 i=super._doBuildLines(t,e),s=[];return i.forEach(t=>{const e=[];for(let i=t.length-1;i>=0;i--){const s=t[i],r=s.toPoint();r.py=s.yLow,e.push(r)}s.push(t,e)}),s}}Pn.type="arearange",Pn.defaults=ii(yn.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class An extends xr{_canContain(t){return t instanceof xn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}An.type="linegroup",An.seriesType=As,An.defaults=ii(xr.defaults,{lineType:"default"});class kn extends xr{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const i=this._visibles[e-1],s=t._areas,r=i._areas;for(let t=0;t<s.length;t+=2)s[t+1]=r[t].reverse();this.prop("layout")}}}_canContain(t){return t instanceof Sn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}kn.type="areagroup",kn.seriesType=ks,kn.defaults=ii(xr.defaults,{lineType:"default"});class Ln extends wn{}class Tn extends Sn{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new Ln(t)}_doLoadData(t){const e=super._doLoadData(t);if(s(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.prop("name")===this.prop("source")||t.index===this.prop("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)),i=this._loadTable(e);this._doLoadPoints(i),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,i){const s=i-t;return{x:i,y:Math.exp(-s*s/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},i=t.length;if(i<1)return;const s=t.reduce((t,e)=>t+e,0)/i,r=Math.sqrt(t.reduce((t,e)=>t+Math.pow(e-s,2))/(i-1)),n=r/this.num("pointsInSigma"),o=s-this.num("sigmas")*r,a=s+this.num("sigmas")*r;let h=s;const l=[];for(l.push(e(s,r,h));h>o;)h-=n,l.unshift(e(s,r,h));for(h=s;h<a;)h+=n,l.push(e(s,r,h));return l}}Tn.type="bellcurve",Tn.defaults=ii(Sn.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Mn extends Bs{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 l(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 i=t.options,s=e.length>5?1:0;s>0&&(this.x=e[P(i.xField,0)]),this.min=e[P(i.minField,0+s)],this.low=e[P(i.lowField,1+s)],this.mid=e[P(i.midField,2+s)],this.high=e[P(i.highField,3+s)],this.y=e[Et(i.maxField,t.prop("yField"),4+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.min=A(e[i.minField],e.min),this.low=A(e[i.lowField],e.low),this.mid=A(e[i.midField],e.mid),this.high=A(e[i.highField],e.high),this.y=A(e[i.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=L(t.minValue,this.minValue,e),this.lowValue=L(t.lowValue,this.lowValue,e),this.midValue=L(t.midValue,this.midValue,e),this.highValue=L(t.highValue,this.highValue,e)}}class Nn extends br{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Mn(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return ms.create(t,nr.LEGEND_MARKER,0,0,e,e,2)}}Nn.type="boxplot",Nn.defaults=ii(br.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 En extends Le{constructor(t,e,i){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,i&&this._assignShape(i,!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 fs.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 fs.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 Bn=2*Math.PI,On=-Math.PI/2;class Dn extends Se{constructor(t){super(t,nr.LEGEND_MARKER),this._sectors=[],this.add(this._back=new ms(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,i){if(this._size===t&&this._sectors.length===e)return void this._applyColors(i);this._size=t;const s=t/2,r=s,n=s;this._back.setBounds(0,0,t,t),this._sectors.forEach(t=>t.remove()),this._sectors=[];const o=Bn/e;let a=On;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:s,ry:s,start:a,angle:o,clockwise:!0},e=new En(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(i)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const i=t&&t[e]||"#ccc";this._sectors[e].setFill(i)}}}class $n{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)%rr+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.prop("legendKey");return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class Rn{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 In extends Ds{}class Fn extends ni{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.prop("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 i=0;for(const s of e){if(s===t)break;s instanceof zn&&s.pie&&s.pie.fields.length>0&&(i+=s.pie.fields.length)}return i}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 i=[];for(let s=0;s<e.length;s++){if(!this.isFieldVisible(s))continue;const r=this._getFieldValue(t,e[s]),n=o(r)&&r>0?r:0;n>0&&i.push({index:s,value:n})}if(0===i.length)return null;const s=i.reduce((t,e)=>t+e.value,0);if(s<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,a=this._totalRad;let h=this._startRad;const l=[];for(let t=0;t<i.length;t++){const e=i[t],o=n*(e.value/s)*a,c=this._legendSources[e.index];if(c){const t=new Rn;t.source=c,t.value=e.value,t.percent=Math.round(e.value/s*1e4)/100,t.startAngle=h,t.angle=o,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=o}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let i=0;i<t.length;i++)t[i].color=`var(--color-${(e+t[i].index)%rr+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,i=[],s=this._paletteOffset;for(let r=0;r<t;r++)i.push(e.length>0?e[r%e.length]:`var(--color-${(s+r)%rr+1})`);return i}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t,e){return a(e)?(this._op.visible=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._fields=(this.prop("fields")||[]).map(t=>String(t)),this._categories=s(this.prop("categories"))&&this.prop("categories").length>0?this.prop("categories"):this._fields;const e=this.prop("colors");s(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=x+v*P(this.num("startAngle")%360,0);const i=this.num("totalAngle");this._totalRad=v*f(0,g(360,i<=0?360:i)),this._clockwise=this.bool("clockwise"),this.prop("innerRadius")?this._innerRadiusDim=At(this.prop("innerRadius"),!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,i=this._sliceColors,s=this._categories,r=e.length;this._legendSources=e.map((e,n)=>{const o=i.length>0?i[n%i.length]:null,a=null==t?void 0:t.find(t=>t.legendKey()===this.hash+":"+e),h=new $n;return h._pie=this,h.field=e,h.label=s[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h})}_getFieldValue(t,e){if(t)return t[s(t)?+e:e]}}Fn.defaults=ii(ni.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class zn extends Sr{_doInit(t){super._doInit(t),this._pie=this._addChild("pie",new Fn(this.chart)),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this.prop("shape")||"circle"}getPixelMinMax(t){return{min:R(this._minSizeDim,t),max:R(this._maxSizeDim,t)}}getRadius(t,e,i){let s=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getTooltipText(t,e){const i=this._hoveredSlice;if(i&&this._pie){let t;const s=this._pie.prop("tooltipCallback");return s&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=i,t=s(this._pointArgs)),void 0===t&&(t=this._pie.prop("tooltipText")||"${label}: ${value} (${percent}%)"),t}return super.getTooltipText(t,e)}getTooltipParam(t,e,i){var s;const r=this._hoveredSlice;return r&&null!==(s=r.getParam(i))&&void 0!==s?s:super.getTooltipParam(t,e,i)}getTooltipHeaderColor(t){var e,i;return null!==(i=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==i?i:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new In(t)}_getNoClip(t){const e=super._getNoClip(t);return!a(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createLegendMarker(t,e){const i=this._pie;if(i&&i.visible&&i.fields.length>0){const s=new Dn(t);return s.render(e,i.fields.length,[]),s.setColorResolver(()=>i.getLegendSliceColors()),s}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,i=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,s=i?this.prop("legendMode")||"both":null;"slice"!==s&&super.getLegendSources(t),i&&"series"!==s&&e.getLegendSources().forEach(e=>t.push(e))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach(i=>{i.isNull||isNaN(i.zValue)||(t=g(t,i.zValue),e=f(e,i.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 i=0;i<this._points.count;i++){const s=this._points.get(i);if(s.xValue===t&&s.yValue===e)return s}}}zn.type="bubble",zn.defaults=ii(Sr.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 Hn extends vr{_canContain(t){return t instanceof xn}_doConstraintYValues(t){const e={};t.forEach(t=>{t._visPoints.forEach(t=>{if(!1!==t.visible){const i=t.xValue,s=e[i];s?s.push(t):e[i]=[t]}})});for(const t in e)e[t].sort((t,e)=>t.yValue-e.yValue).forEach((t,e)=>{t.yLabel=A(t.yLabel,t.yValue),t.yValue=t.yGroup=e});return rt.makeIntArray(0,t.length)}}Hn.type="bump",Hn.seriesType=As;class Gn extends Bs{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(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 i=t.options,s=e.length>4?1:0;s>0&&(this.x=e[P(i.xField,0)]),this.low=e[P(i.lowField,0+s)],this.close=e[P(i.closeField,1+s)],this.open=e[P(i.openField,2+s)],this.y=e[Et(i.highField,t.prop("yField"),3+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.low=A(e[i.lowField],e.low),this.open=A(e[i.openField],e.open),this.close=A(e[i.closeField],e.close),this.y=k(e[i.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=L(t.lowValue,this.lowValue,e),this.openValue=L(t.openValue,this.openValue,e),this.closeValue=L(t.closeValue,this.closeValue,e)}}class jn extends br{canCategorized(){return!0}_createPoint(t){return new Gn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const i=new be;return i.rect(0,.2*e,e,.6*e),i.vline(e/2,0,e),new Le(t,nr.LEGEND_MARKER).setPath(i.end())}}jn.type="candlestick",jn.defaults=ii(br.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Yn extends fr{}Yn.defaults=ii(fr.defaults,{position:"inside"});class Wn extends nn{get pointLabel(){return this._pointLabel}_createLabel(t){return new Yn(t)}}Wn.type=Ls;class Xn extends an{_canContain(t){return t instanceof Wn}}Xn.type="circlebargroup",Xn.seriesType=Ls;class Un extends $s{}class Zn extends hr{}Zn.defaults=ii(hr.defaults,{radius:4,shape:"circle"});class qn extends Ks{}qn.defaults=ii(Ks.defaults,{highVisible:!0,lowVisible:!0});class Kn extends br{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new Zn(this)),this._lowMarker=this._addChild("lowMarker",new Zn(this))}get marker(){return this._marker}get lowMarker(){return this._lowMarker}get pointLabel(){return this._pointLabel}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+f(0,this.marker.prop("radius"))}_createLabel(t){return new qn(t)}_createPoint(t){return new Un(t)}isPointLabelVisible(t,e){return!!super.isPointLabelVisible(t,e)&&(1===e?!1!==this.pointLabel.prop("lowVisible"):0!==e||!1!==this.pointLabel.prop("highVisible"))}prepareAfter(){const t=this.marker.prop("radius"),e=this.marker.prop("shape"),i=P(this.lowMarker.prop("radius"),t),s=this.lowMarker.prop("shape")||e;this._visPoints.forEach(r=>{r.radius=t,r.shape=e,r.lowRadius=i,r.lowShape=s}),super.prepareAfter()}}Kn.type="dumbbell";class Qn extends Bs{}class Jn extends mr{getSegmentSize(t){return R(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Qn(t)}_createLegendMarker(t,e){const i=new be;return i.rect(0,0,e,.4*e),i.rect(0,.6*e,e,.4*e),new Le(t,nr.LEGEND_MARKER).setPath(i.end())}}Jn.type="equalizer",Jn.defaults=ii(mr.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class to extends br{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new $s(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const i=(new be).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),s=new Le(t,nr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}_getBottomValue(t){return t.lowValue}}to.type="errorbar",to.defaults=ii(br.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class eo extends lr{}class io extends eo{constructor(t,e){super(t),this.points=e}}class so extends _r{getDistance(){return isNaN(this.prop("distance"))?"far"===this.prop("align")?so.ENDED_DIST:so.OUTSIDE_DIST:this.prop("distance")||0}}so.OUTSIDE_DIST=25,so.ENDED_DIST=10;class ro extends ur{getSize(t,e){return{width:f(.1*t,R(this._widthDim,t)),height:f(.1*e,R(this._heightDim,e))}}getNeckSize(t,e){return{width:rt.clamp(R(this._neckWidthDim,t),this._minNeckWidth,t),height:rt.clamp(R(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new so(t)}_createPoint(t){return new eo(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new io(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("width"))!==e._width&&(e._width=i,e._widthDim=kt(e._width,ro.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=kt(e._height,ro.defaults.height))}(this.prop("height")),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=kt(e._neckWidth,ro.defaults.neckWidth))}(this.prop("neckWidth")),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=kt(e._neckHeight,ro.defaults.neckHeight))}(this.prop("neckHeight")),this._minNeckWidth=Math.max(0,+this.num("minNeckWidth"))}}ro.type="funnel",ro.defaults=ii(ur.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class no extends Bs{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const oo={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 ao extends ar{getBinCount(t){const e=P(this.prop("binWidth"),0);if(e>0)return t/e;return P(this.prop("binsNumber"),0)<1?oo[this.prop("binsNumber")||"squreRoot"](t):void 0}_createPoint(t){return new no(t)}_doLoadPoints(t){function e(t){let e;return e=s(t)?t[P(this.yField,0)]:i(t)?k(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=[];let n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);isNaN(s)||n.push(s)}if(n.length>0){n=n.sort((t,e)=>t-e);const t=this.num("minValue"),e=this.num("maxValue");t<n[0]&&n.unshift(t),e>n[n.length-1]&&n.push(e);const i=n.length,s=n[0],o=n[i-1],a=this.getBinCount(i),h=this._binInterval=(o-s)/a;let l=0,c=s,_=c+h;for(let t=0;t<a;t++){let e=0;if(t==a-1)e=i-l;else for(;l<i&&n[l]<_;)e++,l++;r.push({x:c,y:e,min:c,max:t===a-1?o:_}),c=_,_=c+h}}super._doLoadPoints(r)}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=Et(this.prop("baseValue"),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return ms.create(t,nr.LEGEND_MARKER,0,0,e,e,2)}}ao.type="histogram",ao.defaults=ii(nr.defaults,{baseValue:0,binsNumber:"squreRoot"});class ho extends hr{}ho.defaults=ii(hr.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class lo extends Bs{_assignTo(t){return l(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const i=+t.prop("colorField"),s=+t.prop("iconField"),r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[P(r.xField,0)]),this.y=e[P(r.yField,0+n)],this.radius=e[P(r.radiusField,1+n)],isNaN(i)||(this.color=e[i]),isNaN(s)||(this.icon=e[s])}_readObject(t,e){super._readObject(t,e),this.radius=A(e[t.prop("radiusField")],e.radius)}}class co extends mr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new ho(this))}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.prop("radius")}_createPoint(t){return new lo(t)}prepareAfter(){const t=this.marker,e=t.prop("radius"),i=t.prop("shape"),s=this.prop("radiusField"),r=f(t.num("minRadius"),0),n=f(t.num("maxRadius"),r);if(s){const t=this._runPoints.map(t=>t.radius).filter(t=>"number"==typeof t&&!Number.isNaN(t)),e=Math.min(...t),s=Math.max(...t)-e||1;this._runPoints.forEach(t=>{const o=(t.radius-e)/s;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=i})}else this._runPoints.forEach(t=>{var s;t.radius=null!==(s=t.radius)&&void 0!==s?s:e,t.shape=i});super.prepareAfter()}}co.type="lollipop";class _o extends Gn{}class uo extends jn{_createPoint(t){return new _o(t)}_createLegendMarker(t,e){const i=new be;i.vline(e/2,0,e),i.hline(.4*e,e/2,e),i.hline(.7*e,0,e/2);const s=new Le(t,nr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}}uo.type="ohlc";class po extends pn{}class go extends yn{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new po(t)}_referOtherSeries(t){if(t.prop("name")===this.prop("source")||t.index===this.prop("source"))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const i=[],s=t.reduce((t,e)=>t+P(e.yValue,0),0);let r=0;t.forEach(t=>{t.isNull||i.push({x:t.xValue,y:r+=100*t.yValue/s})}),e._doLoadPoints(i),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}go.type="pareto",go.defaults=ii(yn.defaults,{curved:!1});class fo extends lr{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 l(super._assignTo(t),{sliced:this.sliced})}}class mo extends fo{constructor(t,e){super(t),this.points=e}}class yo extends hi{getDefaultIconPos(){return"left"}}class bo extends _r{getDistance(t,e,i){return i>0&&(e-=e*i),this._distanceDim?R(this._distanceDim,e,0):t?R(i?bo.INNER_DIST:bo.INSIDE_DIST,e):"far"===this.prop("align")?bo.ENDED_DIST:bo.OUTSIDE_DIST}}bo.INSIDE_DIST=At("30%",!1),bo.INNER_DIST=At("50%",!1),bo.OUTSIDE_DIST=25,bo.ENDED_DIST=10,bo.defaults=ii(_r.defaults,{radius:.7,rotationMode:"arc"});class xo extends ni{getLength(){return this.visible?this._runLength:0}prop(t){return"length"===t?this._runLength:"ratio"===t?this._runRatio:super.prop(t)}_isVisible(){return this.prop("visible")&&this._runLength>0}_doSetSimple(t,e){return o(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._runLength=f(0,this.num("length")),this._runRatio=f(.3,g(.8,this.num("ratio")))}}xo.DEPTH_RATIO=.6,xo.defaults=ii(ni.defaults,{visible:!1,length:25,ratio:xo.DEPTH_RATIO});class vo extends pr{_doInit(t){super._doInit(t),this._innerText=this._addChild("innerText",new yo(this.chart)),this._depth=this._addChild("depth",new xo(this.chart))}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?R(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new bo(t)}_createPoint(t){return new fo(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new mo(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset")}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=x+v*P(this.prop("startAngle")%360,0);let t=this.num("totalAngle");t<=0&&(t=360),this._totalRad=v*f(0,g(360,t)),this._groupPos=NaN}}vo.type="pie",vo.defaults=ii(pr.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class wo extends xr{getPolarSize(t,e){return R(this._polarDim,g(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 i;super._doApply(t),(i=this.prop("polarSize"))!==e._polarSize&&(e._polarSize=i,e._polarDim=At(i,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=At(t,!0))}(this.prop("innerSize"))}needAxes(){return!1}_canContain(t){return t instanceof vo}_doPrepareSeries(t){const e=t.map(t=>t.prop("groupSize")).reduce((t,e)=>t+P(e,1),0);let i=0;t.forEach(t=>{t._groupPos=i,i+=t._groupSize=P(t.prop("groupSize"),1)/e})}}wo.type="piegroup",wo.seriesType="pie",wo.defaults=ii(xr.defaults,{polarSize:"80%",innerSize:0});class So extends Bs{}class Vo extends Sr{_createPoint(t){return new So(t)}_getNoClip(t){const e=super._getNoClip(t);return!a(e)||e}_createLegendMarker(t,e){return new ln(t)}_colorByPoint(){return this.prop("colorByPoint")}setShape(t){this._defShape=t}get canPolar(){return!0}getShape(t){return this.prop("shape")||this._defShape}hasShape(){return!0}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),g(e/2,this.prop("radius"))),i}}Vo.type="scatter",Vo.defaults=ii(Sr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Co extends Bs{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 Po extends Ks{}Po.defaults=ii(Ks.defaults,{offset:0});class Ao extends yr{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Po(t)}_createPoint(t){return new Co(t)}_createLegendMarker(t,e){return ms.create(t,nr.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,i=t[0],s=i.y=i.save=i._isSum?0:i.y,r=s,n=s,o=i.from=0,a=0,h=i.to=s,l=0;for(let c=1,_=t.length;c<_;c++){i=t[c];if(!0===i._isMid&&c<_)e=n,o=l,h=o+e,l=h,s=e,n=0;else if(i._isSum)e=r,o=0,h=e,s=e;else{if(null==i.y)continue;e=i.y,o=a+s,h=o+e,n+=e,r+=e,s=e}i.yGroup=i.yValue=e,i.from=o,i.to=h,i.y=Math.max(o,h),i.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}Ao.type="waterfall",Ao.defaults=ii(yr.defaults,{tooltipDetail:"<b>${y}</b>"});class ko extends zr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,i,s,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,i,s,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,i,s,r){const n=this._log,o=this._pow,a=this._snap;s>=i?s=i:r<=i&&(r=i);const h=r-s;if(0===h||t<=0)return isNaN(s)?[]:[s];let l=[],d=f(1,c(t/e))+1;if(r-s>=.5){if(0===h)return isNaN(s)?[]:[s];let t=h/(d-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/d),s=isNaN(i)?this._normalizeMin(s,t):i-_((i-s)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-s)>u._roundThreshold,g=.5;let f=s,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{s=o(s);const t=(r=o(r))-s;let e=t/(d-1);const i=o(c(n(e))),a=this._getStepMultiples(i);if(e/=i,a&&a.length>0){let t=a[0];for(let i=0;i<a.length-1;i++)if(e>a[i]&&e<a[i+1]){t=e<=a[i]+(a[i+1]-a[i])/2?a[i]:a[i+1];break}e=t}e*=i,(e<=0||!isFinite(e))&&(e=t/d);const h=1e-10*e;let _=c(s/e)*e;for(_<s&&(_+=e),l.push(n(_));_<=r+h;)_+=e,_>0&&l.push(n(_))}return l}}ko.defaults=ii(zr.defaults,{arrangeDecimals:!0});class Lo extends Wr{_isLog(){return!0}_createLabel(){return new Gr(this)}_createTickModel(){return new ko(this)}_doApply(t){super._doApply(t);const e=this._logBase=f(2,this.num("logBase"));this._roundThreshold=Et(this._op.roundThreshold,this._op.roundThrrehold,Lo.defaults.roundThreshold),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 i=>{const s=c(i);return i===s?i:s+e((i-s)*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)}contains(t){return t>0&&super.contains(this._log(t))}trimRange(t,e){const i=t>0?this._log(t):NaN,s=e>0?this._log(e):NaN,[r,n]=super.trimRange(i,s);return[this._pow(r),this._pow(n)]}_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,mt(this._pow(e)))}_interpolateMinorValue(t,e,i,s){if(t<=0||e<=0)return NaN;const r=this._log(t),n=this._log(e);return isFinite(r)&&isFinite(n)?mt(this._pow(r+(n-r)*i/(s+1))):NaN}_canInterpolateMinorSegment(t,e){return super._canInterpolateMinorSegment(t,e)&&t>0&&e>0}_calcUnitLen(t,e,i,s){if((t=t.filter(t=>t>0)).length<2)return super._calcUnitLen(t,e,i,s);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=g(n,r(t[e])-r(t[e-1]));if(!isFinite(n)||n<=0)return super._calcUnitLen(t,e,i,s);const o=s-i,a=n/o;return{len:P(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)}}Lo.type="log",Lo.defaults=ii(Wr.defaults,{logBase:10,roundThreshold:500,roundThrrehold:500});class To extends ni{isChartScope(){return"chart"===this.prop("scope")}getHoverEffect(){return"auto"===this.prop("hoverEffect")?this.prop("hoverImageUrl")?"image":"background":this.prop("hoverEffect")}click(){const t=this.prop("onClick");if(t){t({chart:this.chart.wrapper,button:this})}}}To.defaults=ii(ni.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Mo extends oi{load(t){const e=this.chart,i=this._items=[];s(t)?t.forEach((t,s)=>{i.push(this.$_loadItem(e,t))}):t&&i.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map(t=>t.options)}$_loadItem(t,e){const i=new To(t);return i.init(),i._load(e),i}}const No="$ctrl";class Eo extends ni{isFloating(){return this.prop("floating")||"middle"===this.prop("verticalAlign")&&"center"===this.prop("align")}_doSetSimple(t,e){return n(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}Eo.defaults=ii(ni.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Bo extends ni{getHintDistance(t){const e=this.prop("hintDistance");return isNaN(e)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:e}getScope(t,e){return"auto"!==this.prop("scope")?this.prop("scope"):this.chart.general.prop("seriesHovering")?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}Bo.defaults=ii(ni.defaults,{scope:"auto"});class Oo extends ni{_doInit(t){this._pointHovering=this._addChild("pointHovering",new Bo(this.chart))}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this.prop("xStart"))&&void 0!==e?e:t.getXStart()}}var Do;Oo.defaults=ii(ni.defaults,{paletteMode:"normal",interactive:!0,animatable:!0,hoverable:!0,clickable:!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"}(Do||(Do={}));class $o extends lt{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new dt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new ti,(this._general=new Oo(this)).init(),(this._title=new Tr(this)).init(),(this._subtitle=new Mr(this)).init(),(this._legend=new ds(this)).init(),(this._credits=new Eo(this)).init(),(this._tooltip=new Nr(this)).init(),this._buttons=new Mo(this),$o.split_class&&(this._split=new $o.split_class(this)).init(),(this._body=new ls(this)).init(),(this._navigator=new Lr(this)).init(),(this._exporter=new cs(this)).init(),this._series=new or(this),this._xAxes=new Oi(this,!0),this._yAxes=new Oi(this,!1),this._gauges=new Hi(this),this._annotations=new di(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},$o.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[No]).win()}get options(){return this._op}get exporter(){return this._exporter}get chartOptions(){return this._general}get general(){return this._general}get credits(){return this._credits}_createChart(t){return new $o(t)}_generalInteractive(){return!1!==this._general.prop("interactive")}animatable(){return this._generalInteractive()&&!1!==this._general.prop("animatable")}loadAnimatable(){return this._loadAnimatable}hoverable(){return this._generalInteractive()&&!1!==this._general.prop("hoverable")}clickable(){return this._generalInteractive()&&!1!==this._general.prop("clickable")}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,i){class s{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter(t=>t.needAxes())}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,i){return xr.collectTooltipText({tooltipHeader:this.axis.prop("tooltipHeader"),tooltipRow:this.axis.prop("tooltipRow"),tooltipListRow:this.axis.prop("tooltipListRow"),tooltipFooter:this.axis.prop("tooltipFooter")},this.series,t,e,i)}getTooltipParam(t,e,i){return xr.inflateTooltipParam(this.series,t,e,i)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._general.pointHovering.getScope(e,i)),t){case"axis":return new s(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 Ii?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._general.prop("timeOffset")}get startOfWeek(){return this._general.prop("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(i=>i.col===t&&(!e||i.checkVisible())):this._xAxes._internalItems().filter(t=>!e||t.checkVisible())}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter(i=>i.row===t&&(!e||i.checkVisible())):this._yAxes._internalItems().filter(t=>!e||t.checkVisible())}_getXAxesAtPane(t,e,i){return this._splitted?this._xAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._xAxes._internalItems().filter(t=>!i||t.checkVisible())}_getYAxesAtPane(t,e,i){return this._splitted?this._yAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._yAxes._internalItems().filter(t=>!i||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 i=this._xAxes.items(),s=this._yAxes.items();let r;if(this.isInverted())switch(t){case Do.LEFT:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Do.RIGHT:r=i.filter(t=>t._isOpposite);break;case Do.BOTTOM:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Do.TOP:r=s.filter(t=>t._isOpposite)}else switch(t){case Do.LEFT:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Do.RIGHT:r=s.filter(t=>t._isOpposite);break;case Do.BOTTOM:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Do.TOP:r=i.filter(t=>t._isOpposite)}return r?e?r.filter(t=>t.checkVisible()):r:[]}_setProperties(t,e=!0){const i=this._op;for(const e in $o.defaults)t.hasOwnProperty(e)&&(i[e]=t[e]);i.type=i.type||"bar",i.gaugeType=i.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&ri(n={},r.base),i(r[s])&&(n||(n={}),ri(n,r[s])),n?ri(n,t):t}_load(t){var e,s;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(A(t.asset,t.assets)),r.options=r.chart=r.general=this._general._load(k(t.general,t.chart,t.options)),i(t.general)?this._credits._load(t.general.credits):i(t.chart)?this._credits._load(t.chart.credits):i(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(A(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(A(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(k(t.xAxis,t.xAxes,{})),this._yAxes.load(k(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(s=this._split)||void 0===s||s._load(t.split),this._annotations.load(A(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(A(t.exporting,t.exportOptions)),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const i=this[e];(i instanceof ni||i instanceof oi||i instanceof ti)&&i.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,i=this._yAxes,s=this._split;return[e,i].forEach(t=>{t.count<1&&!this._gaugeOnly&&t.load({})}),this._inverted=!this._polar&&this.inverted,this._splitted=s&&s.visible,this._assets.prepareRender(),e.disconnect(),i.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),i.prepare(),e.collectValues(),i.collectValues(),e.collectReferentValues(),i.collectReferentValues(),i.collectRanges(),e.collectRanges(),e.prepareRender(),i.prepareRender(),this._splitted&&this._split.prepareRender(e,i),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,i,s){this._xAxes._buildTicks(i?e:t,s),this._yAxes._buildTicks(i?t:e,s),this.$_calcAxesPoints(t,e,i,s)}$_calcAxesPoints(t,e,i,s){let r=i?e:t;this._xAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)}),r=i?t:e,this._yAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)})}axesLayouted(t,e,i){this.$_calcAxesPoints(t,e,i,101)}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t,e);return i&&(this._dataChanged(),this._modelChanged(i)),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._dataChanged(),this._modelChanged(null),i}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const i=document.querySelector(".rct-root");if(i){const s="data-palette",r=i.getAttribute(s);i.setAttribute(s,t);const n=getComputedStyle(i);this._palColors[t]=e=[];for(let t=1;t<=rr;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());i.setAttribute(s,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=l({},s))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach(s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])}),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return ri(ri({},i),t)}else s(e)&&e.forEach(e=>{let i=this._templates[e];return i?ri(ri({},i),t):i});return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Us[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Xs[t.toLowerCase()]}_getAxisType(t){return n(t)&&fi[t.toLowerCase()]}_getGaugeType(t){return n(t)&&$i[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&Ri[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ci[t.toLowerCase()]}getAxesGap(){return this._general.num("axisGap")}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}$o.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Bi.register(zs,Xr,Lo,tn),nr.register(Sn,Pn,sn,on,Tn,Nn,zn,jn,Wn,Kn,Jn,to,ro,ao,xn,vn,co,uo,go,vo,Vo,Ao),xr.register(kn,hn,Hn,Xn,An,wo),xr.registerSeries(kn,hn,Xn,An,wo),_i.register($r,Rr,Ir);class Ro{constructor(t,e){this._modelCallback=e,this._obj=new $o(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[No]=null===(t=this[No])||void 0===t?void 0:t.dispose(),this._obj=null,this.$_disposed=!0)}get options(){return this._obj.options}get general(){return this._obj._general}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,s){var r;if(i(t)){const i="load chart";rt.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new $o(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,rt.log("chart-items:",ei),rt.LOGGING&&console.timeEnd(i),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,i){this._obj.setParam(t,e,i)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[No].refresh()}}class Io{constructor(t,e){this._obj=new _t(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,i){this._obj.setValue(t,e,i)}getValues(t,e=0,i=-1){return this._obj.getValues(t,e,i)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Fo extends Z{constructor(t,e,i){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i}_doDispose(){var t;null===(t=this._orphans)||void 0===t||t.clear(),this.freeAll(),this._owner=null,this._creator=null,super._doDispose()}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,i=0){let s=this._pool.pop();return s||(s=new this._creator(t,this._styleName)),s}prepare(t,e,i){const s=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(s);o.push(e),null==i||i(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 i=this._views.indexOf(t);i>=0&&this._views.splice(i,1)}}freeAll(t,e=0){for(let i=(t=t||this._views).length-1;i>=0;i--)this.free(t[i],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 i=e.length-1;i>=t;i--)this.free(e[i],0)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===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 i=null===(e=this._orphans)||void 0===e?void 0:e.get(t);i&&(this.free(i),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}}class zo{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new zo(t,t,t,t):new zo(t,t,e,e):new zo(t,e,i,s)}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,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new zo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=P(t.paddingLeft,0),this.right=P(t.paddingRight,0),this.top=P(t.paddingTop,0),this.bottom=P(t.paddingBottom,0),this}applyMargin(t){return this.left=P(t.marginLeft,0),this.right=P(t.marginRight,0),this.top=P(t.marginTop,0),this.bottom=P(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}}}zo.Empty=Object.freeze(new zo),zo.Temp=new zo;class Ho extends Se{constructor(t,e=pt){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Ho.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Ho.IGNORE_ATTRS={width:"",height:""};class Go extends Se{constructor(t,e=pt){super(t,e,"g"),Se.DEBUGGING&&(this.add(this._debugRect=new ms(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,i,s,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,i,s,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),Se.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ms(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,i,s,r){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class jo extends Go{constructor(t,e,i){super(t,e),this._margins=new zo,this._paddings=new zo,this.add(this._background=new ms(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s,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,i,s,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 Yo extends Ho{measure(t,e,i,s,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,i,s,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 Wo extends Go{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,i){this._inverted=t,this._animatable=e,this._loadAnimatable=i}}class Xo extends Se{constructor(t,e,i){super(t,i,"image"),this._bounds=W,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&&!st||(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,i){this.url=t,this.resize(e,i)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,i=this._bounds.height;e>0&&!i?i=e/t.width*t.height:0==i||e||(e=i/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:i}}return this._bounds}resize(t,e,i){const s=this._proxy;return t||(t=NaN),e||(e=NaN),s&&(N(t)||N(e))&&(t>0&&N(e)?e=t/s.width*s.height:e>0&&N(t)?t=e/s.height*s.width:(t=s.width,e=s.height)),super.resize(t,e,i)}}class Uo extends Ho{constructor(e,i=pt){super(e),this.add(this._text=new $e(e,i)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.prop("effect");return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),s&&this._text.internalSetStyleOrClass(s),this._text.stain(),this._text.layoutText(),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new ms(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new $e(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()),i&&i!==this._failedIconUrl?(this._icon||this.add(this._icon=new Xo(t,!1)),this._icon.setImage(i,+this._model.prop("iconWidth"),+this._model.prop("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){const e=this._model;if(null==e?void 0:e.prop("autoContrast")){const i=this._back&&this._back.parent?this._back.dom:t;i&&this._text.setContrast(i,e.prop("darkStyle")||"rct-label-dark",e.prop("lightStyle")||"rct-label-light")}if(this._outline&&this._outline.parent){const t=se.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const i=this._text,s=this._outline,r=this._icon;let n=0;const o=i.getBBox(),a=o.width,h=o.height;let l=a,c=h,_=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();n=this._model.num("iconGap");const e=this._model.num("iconWidth"),i=this._model.num("iconHeight");switch(_=t.width||e||i,d=t.height||i||e,this._model.getIconPos()){case"left":case"right":l+=n+_,c=Math.max(d,h);break;default:c+=n+d,l=Math.max(_,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(t.paddingRight)||0),c+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(c-d)/2),u+=_+n,l-=_+n;break;case"right":r.trans(u+l-_,(c-d)/2),l-=_+n;break;case"top":r.trans((l-_)/2,p),p+=d+n;break;case"bottom":r.trans((l-_)/2,p+h+n)}switch(e){case"center":u+=l/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}return i.trans(u,p),s&&(s.anchor=i.anchor,s.setAttr("y",i.getAttr("y")),s.trans(i.tx,i.ty)),this._iconBox=r?{x:r.tx,y:r.ty,width:_,height:d}:null,this}getLayoutBox(){const t=this.getBBox(),e=this._iconBox;if(!e)return t;const i=Math.min(t.x,e.x),s=Math.min(t.y,e.y);return{x:i,y:s,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-s}}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new $e(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 Zo extends jo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new $e(t)),this._richText=new We}rotatedWidth(){const t=this.model.getRotation()*v,e=this.getBBox();return m(u(t)*e.height)+m(d(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*v,e=this.getBBox();return m(d(t)*e.height)+m(u(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,r){this._angle=e.getRotation();const n=e.prop("writingMode");n&&this._textView.setStyle("writingMode",n),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===n,this._richText.setFormat(e.prop("text")),!isNaN(e.num("lineHeight"))&&this._richText&&(this._richText.lineHeight=e.num("lineHeight")),this._richText.build(this._textView,i,s,null,null);const o=X(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=o.width;o.width=o.height,o.height=t}return o}_doLayout(e){const i=this._textView,s=i.getStyle("writing-mode"),r=s===wt||s===St;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":i.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}i.trans(o,n)}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 qo extends jo{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new $e(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new We}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null),X(this._textView.getBBox())}_doLayout(e){const i=this._textView;let s=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":i.anchor=t.TextAnchor.END,r+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE}i.trans(r,s)}}class Ko extends Go{constructor(t,e=ia.TICK_CLASS){super(t,e),this.add(this._lineView=new dn(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Qo extends Uo{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1,this.groupLevel=-1,this._backPad=null,this._backPadDom=null}setLabel(t,e,i,s,r,n){s?(t.prepareRich(s),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(i)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),t.buildSvg(this._text,this._outline,r,n,t,t._domain))}applyBackgroundCallback(t,e){const i=t.prop("backgroundStyleCallback");if("background"===t.prop("effect")&&i){const s=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(i(s))}}rotatedWidth(){const t=(this.rotation||0)*v,e=this.getBBox();return m(u(t)*e.height)+m(d(t)*e.width)}rotatedHeight(){const t=this.rotation*v,e=this.getBBox();return m(d(t)*e.height)+m(u(t)*e.width)}invalidateBackPad(){this._backPad=null,this._backPadDom=null}resizeBackBySpan(t,e,i=!0){const s=this._back;if(!s)return;const r=this.getBBox();let n=this._backPad;if(!n||this._backPadDom!==s.dom){const t=getComputedStyle(s.dom);n=this._backPad={l:parseFloat(t.paddingLeft)||0,t:parseFloat(t.paddingTop)||0,r:parseFloat(t.paddingRight)||0,b:parseFloat(t.paddingBottom)||0},this._backPadDom=s.dom}const{l:o,t:a,r:h,b:l}=n;s.transX(0),s.transY(0),i?s.setBounds((t-r.width)/-2-e-o,-a,t-1+o+h,r.height+a+l):s.setBounds(-o,(t-r.height)/-2-e-a,r.width+o+h,t-1+a+l)}resizeBackByWeight(t,e,i,s,r,n,o,a,h,l=0){const c=this._back;if(c)if(t._isHorz){const t=this.getBBox(),e=a;c.transY(-this.ty),c.transX((e-t.width)/-2-h),c.resize(e-1,r)}else{const t=this.getBBox(),r=a,_=e?n-o+l:i?n:l-o;c.transX(_-this.tx),c.transY((r-t.height)/-2-h),e?c.resize(s-l-2*(n+o),r-1):c.resize(s-n-l+o,r-1)}}}class Jo extends Se{constructor(t){super(t,void 0),this.add(this._back=new Le(t,"rct-crosshair-flag")),this.add(this._text=new $e(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const i=t.flag;this._text.text=(i.prop("prefix")||"")+e+(i.prop("suffix")||"");const s=this._text.getBBox(),r=new be,n=f(i.num("minWidth"),s.width+8);r.rect(0,0,n,s.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.prop("textStyles"))}}class ta extends Go{static isThumb(t){return t.classList.contains(ta.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new ms(t,ta.TRACK_CLASS)),this.add(this._thumbView=new ms(t,ta.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,i=t.end-t.start;this._len=f(0,e),this._page=g(i,e),this._pos=g(t.min+e-i,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,i=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.prop("reversed"),(t=f(0,g(t,i)))*(e.max-e.min-(e.end-e.start))/i+e.min}_doMeasure(t,e,i,s,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:s}:{width:i,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,i=e.axis._zoom,s=this._szThumb=P(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-i.min,h=e.getGap(),l=h+e.getGapFar();let c=this.width,_=this.height;if(this._vertical){c-=l,this._trackView.setBounds(h,0,c,_),_-=s;const t=(n||o===r?_:_*o/r)+s;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-_*a/r-t,c-2,t)}else{_-=h+e.getGapFar(),this._trackView.setBounds(0,h,c,_),c-=s;const t=(n||o===r?c:c*o/r)+s;this._reversed,this._thumbView.setBounds(n?0:c*a/r,h+1,t,_-2)}}}ta.CLASS_NAME="rct-axis-scrollbar",ta.TRACK_CLASS="rct-axis-scrollbar-track",ta.THUMB_CLASS="rct-axis-scrollbar-thumb";const ea=/\${label}.*?/g;class ia extends Go{constructor(t){super(t,ia.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._minorMarkViews=[],this._categoryTreeLevelSizes=[],this._categoryTreeLevelOffsets=[],this._categoryTreeExtraSize=0,this.add(this._lineView=new dn(t,ia.LINE_CLASS)),this.add(this._titleView=new Zo(t)),this.add(this._markContainer=new Se(t,"rct-axis-ticks")),this.add(this._minorMarkContainer=new Se(t,"rct-axis-minor-ticks")),this.add(this._labelContainer=new Se(t,"rct-axis-labels")),this.add(this._unitView=new qo(t)),this._labelViews=new Fo(this._labelContainer,Qo,"rct-axis-label")}$_checkScrollView(t,e,i,s,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new ta(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,s,r,1)[i];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?f(0,s.tick._getGap()):f(0,s.tick._getLength())+f(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsHorz(s,e,!0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).height,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"height",e,i),o}checkWidth(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?f(0,s.tick._getGap()):f(0,s.tick._getLength())+f(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsVert(s,i,!0,0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).width,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"width",e,i),o}prepareGuides(t,e,i,s,r){[s,r].forEach((s,r)=>{const n=this.model.guides.filter(t=>t.prop("front")==(1===r)&&t.canConstainedTo(e,i));s.setAll(t,n,!1)})}showCrosshair(t,e){const i=this.model;let s,r=this._crosshairView;r||this.add(r=this._crosshairView=new Jo(this.doc)),r.setVis(!0),r.setText(i.crosshair,e);const n=r.getBBox();i._isHorz?r.trans(t-n.width/2,i.tick._getLength()):(s="opposite"===i._runPos?g(0,this.width-n.width):f(0,this.width-i.tick._getLength()-n.width),r.trans(s,t-n.height/2))}setMargins(t,e,i,s){}hideCrosshair(){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,i=this.model;if((!e||e===i)&&t){const t=this._prevMin,e=this._prevMax,s=this._prevMin=i.axisMin(),r=this._prevMax=i.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&s!==t){if(i._isX&&i._zooming)return{axis:i,from:this._prevMin,to:r};i.chart.animatable()&&i.prop("animatable")&&i.checkExtents(t,e)}}this._prevModel=i}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,i,s,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,c=this._titleView,_=this._unitView;let d=0,u=0;return this._reversed=e.prop("reversed"),(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new dn(t,ia.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.tick._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach(n=>n.measure(t,e.tick,i,s,r)),e instanceof Wr?(this._minorMarkLen=e.minorTick._getLength(),this.$_prepareMinorTickMarks(t,e)&&this._minorMarkViews.forEach(n=>n.measure(t,e.minorTick,i,s,r))):this._minorMarkContainer.setVis(!1),this.$_prepareLabels(e,h?i:s)&&(u=h?this.$_measureLabelsHorz(e,i):this.$_measureLabelsVert(e,s,!1,r),e.label._inside&&(u=0)),this._labelSize=u,_.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).width)),d+=u,this._simpleMode?(c.setVis(!1),_.setVis(!1)):(c.visible&&(d+=h?c.mh:c.mw,d+=e.title.num("gap")),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?i:d,height:h?d:s}}_doLayout(){const t=this.model,e=t._isHorz,i=t._isOpposite,s=t._isBetween,r=t.label._inside,n=t.tick._inside,o=t._ticks,a=t._markPoints,h=this._labelViews,l=this._unitView,c=this._markLen,_=this._tickGap,d=this.width,u=this.height;this._lineView.visible&&(e?this._lineView.setHLine(i?u:0,0,d):this._lineView.setVLine(i?0:d,0,u),this._lineView2&&(e?this._lineView2.setHLine(u,0,d):this._lineView2.setVLine(0,0,u))),this._markContainer.visible&&this.$_layoutTickMarkViews(this._markViews,a,c,t,e,i,n,d,u),t instanceof Wr&&this._minorMarkContainer.visible&&this.$_layoutTickMarkViews(this._minorMarkViews,t._minorMarkPoints,this._minorMarkLen,t,e,i,n,d,u);const p=(r===n?c:0)+_,g=t instanceof zs?t:null;if(t._ani&&(this._labelContainer.visible?this._labelSize=e?this.$_measureLabelsHorz(t,d):this.$_measureLabelsVert(t,u,!1,0):(null==g?void 0:g.hasCategoryTree())&&(this._labelSize=this.$_measureCategoryTree(g,e,!1,e?d:u))),this._labelContainer.visible&&h.count>0?(h.count>o.length?h.prepare(o.length):h.count<o.length&&rt.warn("labelViews.count < ticks.length",h.count,o.length),e?(this.$_layoutLabelsHorz(h,o,r,s,i,d,u,p),this.$_layoutCategoryTreeHorz(t,r,i,d,u,p)):(this.$_layoutLabelsVert(h,o,r,s,i,d,u,p),this.$_layoutCategoryTreeVert(t,r,i,d,u,p))):e?this.$_layoutCategoryTreeHorz(t,r,i,d,u,p):this.$_layoutCategoryTreeVert(t,r,i,d,u,p),l.visible&&(e?this.$_layoutUnitHorz(l,h,i,d,u,p):this.$_layoutUnitVert(l,h,i,d,u,p)),!this._simpleMode){const s=t.title,o=this._titleView,a=this._scrollView,h=this._labelSize,l=r?n?0:c+_:p+h;let g=0,f=0;if(o.visible){const r=+s.prop("offset")||0,n=s.getGap();if(o.resizeByMeasured().layout(e),e){if(f+=i?0:l+n,t.prop("reversed"))switch(s.prop("align")){case"start":g=d-o.width/2-r;break;case"end":g=o.width/2+r;break;default:g=d/2-r}else switch(s.prop("align")){case"start":g=o.width/2+r;break;case"end":g=d-o.width/2-r;break;default:g=d/2+r}o.trans(g,f),f+=o.height}else{const t=0===o._angle?o.width:o.height;if(g=i?l+n+t/2:d-l-n-t/2,this._reversed)if(0===o._angle)switch(s.prop("align")){case"start":f=0+r;break;case"end":f=u-o.height-r;break;default:f=(u-o.height)/2+r}else switch(s.prop("align")){case"start":f=o.width/2-o.height/2+r;break;case"end":f=u-o.width/2-o.height/2-r;break;default:f=(u-o.height)/2+r}else if(0===o._angle)switch(s.prop("align")){case"start":f=u-o.height-r;break;case"end":f=0+r;break;default:f=(u-o.height)/2-r}else switch(s.prop("align")){case"start":f=u-o.width/2-o.height/2-r;break;case"end":f=o.width/2-o.height/2+r;break;default:f=(u-o.height)/2-r}o.trans(g,f)}}else f+=i?0:l;(null==a?void 0:a.visible)&&(e?(a.trans(0,f).resize(this.width,a.mh),a.setScroll(t._zoom,this._reversed)):(a.trans(0,0).resize(a.mw,this.height),a.setScroll(t._zoom,this._reversed)),a.layout())}}$_syncTickMarkViews(t,e,i,s,r=ia.TICK_CLASS){for(;i.length<s;){const s=new Ko(t,r);e.add(s),i.push(s)}for(;i.length>s;)i.pop().remove()}$_prepareTickMarkViews(t,e,i,s,r,n=ia.TICK_CLASS){return!!(e.visible=s)&&(this.$_syncTickMarkViews(t,e,i,r,n),!0)}$_layoutTickMarkViews(t,e,i,s,r,n,o,a,h){r?t.forEach((t,r)=>{t.resize(1,i),t.layout().trans(s.prev(e[r]),n?o?h:h-i:o?-i:0)}):t.forEach((t,r)=>{t.resize(i,1),t.layout().trans(n?o?-i:0:o?a:a-i,h-s.prev(e[r]))})}$_prepareTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._markContainer,this._markViews,e.tick.visible,e._markPoints.length)}$_prepareMinorTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._minorMarkContainer,this._minorMarkViews,e.minorTick.visible,e._minorMarkPoints.length,ia.MINOR_TICK_CLASS)}_prepareLabel(t,e,i,s,r){if(!r&&t.value===e.value)return;const n=i.getLabelText(e,s),o=e.label,a=i.getLabelStyle(e,s);if(t.value=e.value,null!=n){o&&n.match(ea)?t.setLabel(i,a,e,n.replace(ea,o),1e3,1e3):(i.prepareRich(n),i._paramTick=e,t.setModel(this.doc,i,i.getIconUrl(i.getIcon(e)),a),i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,a,e,o,1e3,1e3);t.applyBackgroundCallback(i,e),t.layout("center")}$_resolveCategoryTreeRotation(t,e,i,s,r){const n=t.getLevelRotation(e.level);if("auto"!==n)return n;if(!i)return 0;const o=t.getCategoryTreeSpan(e.start,e.end,s);return isNaN(o.size)||o.size<=0?0:r._text.getBBox().width>o.size?-90:0}$_prepareCategoryTreeLabel(t,e,i,s,r,n,o,a){const h=s.getLevelStyle(i.level);if(!(!n&&t.index===r&&t.groupLevel===i.level&&t.value===i.start&&t.col===i.end&&t.categoryTreeLabel===i.label&&this.$_equalSVGStyleOrClass(t.categoryTreeStyle,h))){t.index=r,t.groupLevel=i.level,t.value=i.start,t.col=i.end,t.categoryTreeLabel=i.label,t.categoryTreeStyle=h,t.invalidateBackPad(),e.prepareRich(i.label),t.setModel(this.doc,e,null,h),e.buildSvg(t._text,t._outline,NaN,NaN,e,e._domain);const n=s._ticks[i.start];n&&t.applyBackgroundCallback(e,n),t.setContrast(null).layout(s.getLevelAlign(i.level))}t.rotation=this.$_resolveCategoryTreeRotation(s,i,o,a,t)}$_isCategoryTreeSpanVisible(t){return!isNaN(t.center)&&!isNaN(t.size)}$_equalSVGStyleOrClass(t,e){if(t===e)return!0;if(null==t||null==e)return t==e;if(n(t)||n(e))return t===e;if(!i(t)||!i(e))return!1;const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!1;for(const i of s)if(t[i]!==e[i])return!1;return!0}$_applyLabelRotationVert(t,e,i,s,r){const n=e.x+e.width/2,o=e.y+e.height/2;return t.setRotation(n,o,i),{x:r-n,y:s-o}}$_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,i,s,r,n,o,a){const h=t.label,l=f(0,g(s-1,h.prop("startStep")||0)),c=t._ticks,_=c.length,u=(s=f(1,s))*(r=g(f(1,r),c.length)),p=n||0,y=m(p)*v,b=y<35*v;let x,w=!1,S=0;for(let n=0;n<r;n++){let r=n*s+l;for(;r<_;r+=u){let s=0;for(let e=r;e<r+u&&e<_;e++)s+=t.getLabelLength(i,c[e].value);if(r+u<_){x=e.pull(S++),x.rotation=p,x.row=n,x.index=r,this._prepareLabel(x,c[r],h,_,a),x.setVis(!0);const t=s;if(0===p&&x.getBBox().width>=t){w=!0;break}if(b&&x.getBBox().width*d(y)>=t){w=!0;break}if(0!==p&&x.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<_&&(x=e.pull(S++),x.row=n,x.rotation=p,x.index=t,this._prepareLabel(x,c[t],h,_,a),x.setVis(!0))}}!o&&e.freeFrom(S)}$_applyStep(t,e,i){const s=t.label,r=f(0,g(i-1,s.prop("startStep")||0));e.forEach(t=>t.index=-1);for(let t=r;t<e.length;t+=i)e[t].index=t;return e.forEach(t=>t.setVis(t.index>=0)),e.filter(t=>t.visible)}$_measureLabelsHorz(t,e,i=!1){const s=t.prop("reversed"),r=t.label,n=t instanceof zs?t:null;if(null==n?void 0:n.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(n,!0,i,e);let o=+r.prop("step")|0,a=+r.prop("rows")|0;const h=a;let l,c=+r.prop("rotation")%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i),d=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===r.prop("autoArrange"))a=h>1?g(h,t._ticks.length):1,this._labelViews.prepare(t._ticks.length,(e,s,n)=>{e.rotation=c,e.row=a>1?s%a:0,e.index=s,this._prepareLabel(e,t._ticks[s],r,n,i),e.setVis(!0)}),d=this.$_applyStep(t,d,o||1);else{switch(o=a=0,r.prop("autoArrange")){case"rows":a=this.$_getRows(d);break;case"step":o=this.$_getStep(d)}if(o>1){const s=t._ticks.length;for(;o<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,i);)o++}else if(a>1){const s=h>1?h:f(1,+r.prop("maxRows")|0);a=g(h>1?h:a,s);let n=!1;for(;t._ticks.length>a;){if(d.forEach((t,e)=>{t.row=e%a,t.index=e}),!this.$_checkOverlappedHorz2(t,this._labelViews,e,1,a,0,!1,i)){n=!0;break}if(a>=s)break;a++}if(n)this._labelRowPts=[];else{a=1,o=2;const s=t._ticks.length;for(;o<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,i);)o++}}else if((isNaN(c)||Math.abs(Math.tan(c*v))<1)&&(c=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i)){o=2;const s=t._ticks.length;for(;o<=s;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,i)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,i)&&d.forEach((t,e)=>{t.rotation=c});break}o++}}}else;if(d.length>0){if(a>1){const t=!isNaN(c)&&0!=c,e=this._labelRowPts;for(let t=0;t<a;t++)e.push(0);d.forEach(i=>{e[i.row]=f(e[i.row],t?i.rotatedHeight():i.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(c)||0==c){l=d[0].getBBox().height;for(let t=1;t<d.length;t++)l=f(l,d[t].getBBox().height);if(d.length>1){const e=t._ticks;let i=s?r.prop("lastOverflow"):r.prop("firstOverflow");if("hidden"===i){const t=d[0],i=t.rotatedWidth();let s=e[t.index].pos-i/2,r=0;for(let t=1;t<d.length;t++)r=f(r,d[t].getBBox().height);(s+i>d[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(l=r,t.hidden=!0):t.hidden=!1}if(i=s?r.prop("firstOverflow"):r.prop("lastOverflow"),"hidden"===i){const t=d[d.length-1],i=t.rotatedWidth(),s=d[d.length-2],r=e[t.index-1].pos+s.getBBox().width/2;let n=e[t.index].pos-i/2,o=0;for(let t=0;t<d.length-1;t++)o=f(o,d[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>o?(l=o,t.hidden=!0):t.hidden=!1}}}else{l=d[0].rotatedHeight();for(let t=1;t<d.length;t++)l=f(l,d[t].rotatedHeight())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),l}return 0}$_checkOverlappedVert2(t,e,i,s,r,n){const o=t.label,a=t._ticks,h=a.length,l=f(1,s);let c,_=o.prop("startStep")||0,d=0;for(;_<h;_+=l){let s=0;for(let e=_;e<_+l&&e<h;e++)s+=t.getLabelLength(i,a[e].value);if(_+l<h&&(c=e.pull(d++),c.rotation=r,c.index=_,this._prepareLabel(c,a[_],o,h,n),c.setVis(!0),c._text.getBBox().height>=s))return!0}const u=_-l;0<=u&&u<h&&(c=e.pull(d++),c.rotation=r,c.index=u,this._prepareLabel(c,a[u],o,h,n),c.setVis(!0)),e.freeFrom(d)}$_measureLabelsVert(t,e,i=!1,s=0){if(s>1&&t instanceof Wr)return this._prevWidth;const r=t instanceof zs?t:null;if(null==r?void 0:r.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(r,!1,i,e);const n=t.label,o=+n.prop("rotation")%360;let a=f(1,+n.prop("step")|0);const h=this.$_checkOverlappedVert2(t,this._labelViews,e,a,o,i);let l=this._labelViews._internalItems();if(h)if("none"===n.prop("autoArrange"))this._labelViews.prepare(t._ticks.length,(e,s,r)=>{e.rotation=o,e.index=s,this._prepareLabel(e,t._ticks[s],n,r,i),e.setVis(!0)}),l=this.$_applyStep(t,l,a||1);else{const s=t._ticks.length;for(;a<=s&&this.$_checkOverlappedVert2(t,this._labelViews,e,++a,o,i););}else;if(this._labelViews.freeHiddens(),l=this._labelViews._internalItems(),l.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",i=this._labelContainer.textAlign()||e;let s;if(isNaN(o)||0===o){l[0].setContrast(null).layout(i),s=l[0].getBBox().width;for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(i),s=f(s,l[t].getBBox().width)}else{l[0].setContrast(null).layout(i),s=l[0].rotatedWidth();for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(i),s=f(s,l[t].rotatedWidth())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),this._prevWidth=s}return 0}$_ensureCategoryTreeViews(){this._categoryTreeBandContainer||(this.add(this._categoryTreeBandContainer=new Se(this.doc,"rct-axis-tree-bands")),this._categoryTreeBandViews=new Fo(this._categoryTreeBandContainer,ms,"rct-axis-tree-band")),this._categoryTreeLabelContainer||(this.add(this._categoryTreeLabelContainer=new Se(this.doc,"rct-axis-tree-labels")),this._categoryTreeLabelViews=new Fo(this._categoryTreeLabelContainer,Qo,"rct-axis-tree-label")),this._categoryTreeDividerContainer||(this.add(this._categoryTreeDividerContainer=new Se(this.doc,"rct-axis-tree-dividers")),this._categoryTreeDividerViews=new Fo(this._categoryTreeDividerContainer,dn,"rct-axis-tree-divider"))}$_hideCategoryTreeViews(){var t,e,i;null===(t=this._categoryTreeLabelContainer)||void 0===t||t.setVis(!1),null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null===(i=this._categoryTreeDividerContainer)||void 0===i||i.setVis(!1)}$_measureCategoryTree(t,e,i,s){this.$_ensureCategoryTreeViews();const r=t.getCategoryTreeGroups(),n=t.getCategoryTreeDepth(),o=t.label,a=t._ani?this._categoryTreeLevelSizes:null,h=this._categoryTreeLevelSizes=[],l=this._categoryTreeLevelOffsets=[],c=ia.HIERARCHY_ROW_GAP;let _=0;this._categoryTreeLabelContainer.setStyleOrClass(o._style),this._categoryTreeLabelContainer.setVis(r.length>0),this._categoryTreeLabelViews.prepare(r.length,(n,l)=>{const c=r[l],_=t.isLevelVisible(c.level);if(this.$_prepareCategoryTreeLabel(n,o,c,t,l,i,e,s),n.setVis(_),_){const t=e?n.rotatedHeight():n.rotatedWidth();let i=f(h[c.level]||0,t);null!=(null==a?void 0:a[c.level])&&(i=f(i,a[c.level])),h[c.level]=i}});for(let e=0;e<n;e++)l[e]=_,t.isLevelVisible(e)&&(_+=(h[e]||0)+c);return this._categoryTreeExtraSize=_,_}$_syncCategoryTreeMeasure(t,e,i){t._ani&&this.$_measureCategoryTree(t,e,!1,i)}$_layoutCategoryTreeHorz(t,e,i,s,r,n){const o=t instanceof zs?t:null;if(!(null==o?void 0:o.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const a=o._isHorz?s:r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(o,!0,a);const h=o.getCategoryTreeGroups(),l=o.label,c=this._categoryTreeLabelViews,_=this._categoryTreeLevelOffsets,d=n,u=this._categoryTreeExtraSize;this.$_layoutCategoryTreeBandsHorz(o,a,e,i,r,d,u);const p=l.prop("fillToCategory"),g="background"===l.prop("effect");c.forEach((t,s)=>{const n=h[s];if(!o.isLevelVisible(n.level))return void t.setVis(!1);const l=o.getCategoryTreeSpan(n.start,n.end,a);if(!this.$_isCategoryTreeSpanVisible(l))return void t.setVis(!1);const c=o.getLevelAlign(n.level);t.setContrast(null).layout(c);const u=t.rotation,f=t.getBBox(),m=Math.abs(u)>15;let y,b,x=0;p&&!m&&(x="left"===c?(l.size-f.width)/-2:"right"===c?(l.size-f.width)/2:0);const v=this._categoryTreeLevelSizes[n.level]||(m?t.rotatedHeight():f.height);let w;w=e?i?r+d+_[n.level]+v/2:-d-_[n.level]-v/2:i?r-d-_[n.level]-v/2:d+_[n.level]+v/2;const S=o.getLabelX(a,l.center),V=f.x+f.width/2,C=f.y+f.height/2;t.setRotation(V,C,u),b=S-V+x,y=w-C,t.trans(b,y),t.setVis(!0),g&&t.resizeBackBySpan(l.size,x,!0)}),this.$_layoutCategoryTreeDividers(o,a,!0,e,i,s,r,n,0,u,0)}$_getBandY(t,e,i,s,r){const n=s+r,o=t?e?i:-n:e?i-n:0,a=t?e?i+n:0:e?i:n;return{yMin:g(o,a),yMax:f(o,a)}}$_getLevelBoundaryY(t,e,i,s,r,n){const o=this._categoryTreeLevelOffsets,a=t>=o.length?i:o[t];return s?r?n+e+a:-e-a:r?n-e-a:e+a}$_getLevelBoundaryX(t,e,i,s,r,n,o,a){const h=this._categoryTreeLevelOffsets,l=t>=h.length?i:h[t];return s?r?-e-l:n+e+l:r?o+a+l:n-e-l}$_getLevelColumnCenterX(t,e,i,s,r,n,o,a,h){const{x0:l,x1:c}=this.$_getLevelRowXRange(t,e,i,s,r,n,o,a,h);return(l+c)/2}$_getLevelRowYRange(t,e,i,s,r,n,o){const{yMin:a,yMax:h}=this.$_getBandY(i,s,r,n,o),l=0===t?a:this.$_getLevelBoundaryY(t,n,o,i,s,r),c=t===e-1?h:this.$_getLevelBoundaryY(t+1,n,o,i,s,r);return{y0:g(l,c),y1:f(l,c)}}$_getLevelRowXRange(t,e,i,s,r,n,o,a,h){const l=this.$_getLevelBoundaryX(t,n,o,i,s,r,a,h),c=this.$_getLevelBoundaryX(t+1,n,o,i,s,r,a,h);return{x0:g(l,c),x1:f(l,c)}}$_countCategoryTreeDividerLines(t,e=!0){const i=t.getCategoryTreeDepth();let s=0;e&&t.isDividerTopCap()&&(s+=1);for(let e=0;e<i;e++)t.isDividerEdge(e)&&(s+=2),t.isDividerBetween(e)&&(s+=t.getDividerEnds(e).length),t.isDividerBelow(e)&&(s+=1);return s}$_prepareCategoryTreeBands(t){var e,i;if(!t.isBandVisible())return null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null;const s=t.getBandGroups();return s.length?(this._categoryTreeBandContainer.setVis(!0),s):(null===(i=this._categoryTreeBandContainer)||void 0===i||i.setVis(!1),null)}$_getCategoryTreeLabelXBounds(t,e,i,s,r,n,o){const a=s+r,h=t?e?-n-a:i:e?0:o-r,l=t?e?0:i+a+n:e?o+a+n:i;return{xMin:g(h,l),xMax:f(h,l)}}$_getCategoryTreeEdgeYBounds(t,e){const i=t.getDividerLinePositions(e),s=t.getLabelY(e,i[0]),r=t.getLabelY(e,i[i.length-1]);return{yMin:g(s,r),yMax:f(s,r)}}$_applyCategoryTreeDividerLine(t,e,i){const s=e.getDividerStyle(i);null!=s?(t.setStyleOrClass(s),t.setVis(!0)):t.setVis(!1)}$_layoutCategoryTreeBandsHorz(t,e,i,s,r,n,o){const a=this.$_prepareCategoryTreeBands(t);if(!a)return;const{yMin:h,yMax:l}=this.$_getBandY(i,s,r,n,o),c=m(l-h);this._categoryTreeBandViews.prepare(a.length,(i,s)=>{const r=a[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelX(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:o,y:g(h,l),width:n.size,height:c},i.setVis(!0)})}$_layoutCategoryTreeBandsVert(t,e,i,s,r,n,o,a,h){const l=this.$_prepareCategoryTreeBands(t);if(!l)return;const{xMin:c,xMax:_}=this.$_getCategoryTreeLabelXBounds(i,s,r,n,o,a,h),d=m(_-c);this._categoryTreeBandViews.prepare(l.length,(i,s)=>{const r=l[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelY(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:c,y:o,width:d,height:n.size},i.setVis(!0)})}$_layoutCategoryTreeDividers(t,e,i,s,r,n,o,a,h,l,c){var _,d,u;if(!t.isDividerVisible())return void(null===(_=this._categoryTreeDividerContainer)||void 0===_||_.setVis(!1));const p=t.getDividerLinePositions(e);if(p.length<2)return void(null===(d=this._categoryTreeDividerContainer)||void 0===d||d.setVis(!1));const m=this.$_countCategoryTreeDividerLines(t,i);if(m<=0)return void(null===(u=this._categoryTreeDividerContainer)||void 0===u||u.setVis(!1));this._categoryTreeDividerContainer.setVis(!0),this._categoryTreeDividerViews.prepare(m);const y=t.getCategoryTreeDepth();let b=0;if(i){const i=a,{yMin:n}=this.$_getBandY(s,r,o,i,l),h=t.getLabelX(e,p[0]),c=t.getLabelX(e,p[p.length-1]),_=g(h,c),d=f(h,c);if(t.isDividerTopCap()){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t),e.setHLine(n,_,d)}for(let n=0;n<y;n++){const{y0:a,y1:h}=this.$_getLevelRowYRange(n,y,s,r,o,i,l);if(t.isDividerEdge(n)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,i);this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,h)}),t.isDividerBetween(n)&&t.getDividerEnds(n).forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,h)}),t.isDividerBelow(n)){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t,n),e.setHLine(h,_,d)}}}else{const{yMin:i,yMax:o}=this.$_getCategoryTreeEdgeYBounds(t,e);for(let _=0;_<y;_++){const{x0:d,x1:u}=this.$_getLevelRowXRange(_,y,s,r,n,a,l,c,h);if(t.isDividerEdge(_)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,i);this.$_applyCategoryTreeDividerLine(s,t,_),s.setHLine(r,d,u)}),t.isDividerBetween(_)&&t.getDividerEnds(_).forEach(i=>{const s=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,_),s.setHLine(r,d,u)}),t.isDividerBelow(_)){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t,_),e.setVLine(u,i,o)}}}}$_layoutCategoryTreeVert(t,e,i,s,r,n){var o,a;const h=t instanceof zs?t:null;if(!(null==h?void 0:h.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const l=r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(h,!1,l);const c=h.getCategoryTreeGroups(),_=h.label,d=this._categoryTreeLabelViews,u=this._categoryTreeExtraSize,p=this._titleView,g=p.visible?p.rotatedWidth()+(null!==(a=null===(o=p.model)||void 0===o?void 0:o.prop("gap"))&&void 0!==a?a:0):0,f=t.tick._getGap();this.$_layoutCategoryTreeBandsVert(h,l,e,i,s,n,f,u,g);const m=_.prop("fillToCategory"),y=m?_.prop("verticalAlign"):"middle",b="background"===_.prop("effect");d.forEach((t,r)=>{const o=c[r];if(!h.isLevelVisible(o.level))return void t.setVis(!1);const a=h.getCategoryTreeSpan(o.start,o.end,l);if(!this.$_isCategoryTreeSpanVisible(a))return void t.setVis(!1);const _=t.rotation,d=h.getLevelAlign(o.level);t.setContrast(null).layout(d);const p=t.getBBox(),x=Math.abs(_)>15,v=x?t.rotatedWidth():p.width,w=x?t.rotatedHeight():p.height;let S,V,C=0;m&&(C="top"===y?(a.size-w)/-2:"bottom"===y?(a.size-w)/2:0);const P=h.getLabelY(l,a.center)+C,A=this.$_getLevelColumnCenterX(o.level,h.getCategoryTreeDepth(),e,i,s,n,u,g,f);x?({x:S,y:V}=this.$_applyLabelRotationVert(t,p,_,P,A)):(S=A-v/2,V=P-w/2,isNaN(_)||t.setRotation(p.width/2,p.height/2,_)),t.trans(S,V),t.setVis(!0),b&&t.resizeBackBySpan(a.size,C,!1)}),this.$_layoutCategoryTreeDividers(h,l,!1,e,i,s,r,n,f,u,g)}$_layoutLabelsHorz(t,e,i,s,r,n,o,a){const h=this.model,l=h instanceof zs,c=l&&h.label.prop("fillToCategory"),_=h.label,d=this._reversed,p=this._labelContainer.textAlign()||"center",g=this._labelRowPts,f=t.get(0).rotation,m=f*v,y=+h.label.prop("rows")|0,b=f<-15&&f>=-90||f>15&&f<=90,x=t.count,w=l?h:null;let S,V,C;if(t.freeHiddens(),t.forEach((t,l)=>{const _=e[t.index];if(t.setVis(!!_)&&(t.setContrast(null).layout(p),S=t.getBBox(),V=w?w.getLabelX(n,_.pos):h.prev(_.pos),C=i?r?o+a+g[t.row]:-a-S.height-g[t.row]:r?o-a-S.height-g[t.row]:a+g[t.row],f<-15&&f>=-90?i?r?(C+=u(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=u(m)*S.height/2,t.setRotation(0,S.height/2,f)):r?(V-=S.width,C-=u(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=u(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):f>15&&f<=90?i?r?(V+=S.width,C-=u(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=u(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):r?(C+=u(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=u(m)*S.height/2,t.setRotation(0,S.height/2,f)):(V-=S.width/2,t.setRotation(S.width/2,0,r?-f:f)),t.trans(V,C),c&&w)){const e=w.getUnitLen(n,_.value),i=w.label.prop("align")||"center",h="left"===i?(e-S.width)/-2:"right"===i?(e-S.width)/2:0;t.transX(t.tx+h),t.resizeBackByWeight(w,s,r,n,o,a,0,e,h)}}),!c&&!b&&y<2&&x>1){let e=t.get(d?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=_.num("overflowGap");let r=!0;const n=e.rotatedWidth(),o=d?_.prop("lastOverflow"):_.prop("firstOverflow");let a,h=e.tx;h+n>=i.tx?"pull"===o?h=i?i.tx-n-s:0:r="hidden"!==o:(a=e.elementToSvg(0,0).x)<0&&("pull"===o?h=Math.min(i.tx-s,a+4):r="hidden"!==o),r?e.transX(h):e.setVis(!1)}(0,e,t.get(d?x-2:1)),e=t.get(d?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=_.num("overflowGap"),r=i.tx+i.rotatedWidth();let o=!0,a=e.tx;const h=e.rotatedWidth(),l=d?_.prop("firstOverflow"):_.prop("lastOverflow");let c,u;a<=r?"pull"===l?a=Math.max(r+s,n-h):o="hidden"!==l:(c=e.elementToSvg(e.getBBox().width,0).x)>(u=t.control.getBounds().width)&&("pull"===l?a=Math.max(r+s,a-(c-u+4)):o="hidden"!==l),o?e.transX(a):e.setVis(!1)}(this,e,t.get(d?1:x-2))}}$_layoutLabelsVert(t,e,i,s,r,n,o,a){var h,l;const c=this.model,_=c instanceof zs,d=_&&c.label.prop("fillToCategory"),u=r?i?"right":"left":s?"center":i?"left":"right",p=d?c.label.prop("verticalAlign"):"middle",g=d?c.label.prop("align"):u,f=this._titleView,m=f.visible?f.rotatedWidth()+(null!==(l=null===(h=f.model)||void 0===h?void 0:h.prop("gap"))&&void 0!==l?l:0):0,y=this._labelSize,b=c.tick._getGap();const x=this._reversed,v=_?c:null;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;const S=t.get(0).rotation,V=S<-15&&S>=-90||S>15&&S<=90;t.forEach((t,h)=>{const l=e[t.index];if(t.setVis(!!l)){t.setContrast(null).layout(g);const e=t.getBBox(),h=V?t.rotatedHeight():e.height,_=V?t.rotatedWidth():e.width,u=function(t,e){if(i)if(r)switch(t){case"center":return(y-e)/2-y-b-a;case"left":return-y-b-a;default:return-e-b-a}else switch(t){case"right":return n+a+b+y-e;case"center":return!f.visible&&s?(n-e)/2:n+a+b+(y-e)/2;default:return n+a+b}else if(r)switch(t){case"center":return a+(n-m-e-a+b)/2;case"right":return n-e-m+b;default:return a}else switch(t){case"left":return m-b;case"center":return!f.visible&&s?(n-e)/2:m+(n-m-e-a-b)/2;default:return n-a-e}}(g,_)+(_-e.width)/2,C=(v?v.getLabelY(o,l.pos):o-c.prev(l.pos))-e.height/2;if(0===S||isNaN(S)||t.setRotation(e.width/2,e.height/2,S),t.trans(u,C),d&&v){const i=v.getUnitLen(o,l.value),h="top"===p?(i-e.height)/-2:"bottom"===p?(i-e.height)/2:0;t.shiftY(h),t.resizeBackByWeight(v,s,r,n,o,a,b,i,h,m)}else!x&&t.ty+h>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+h:t.ty}})}$_layoutUnitHorz(t,e,i,s,r,n){const o=this.model,a=o.prop("reversed"),h="start"!==o.unitLabel.prop("position"),l=t.getBBox(),c=e.first,_=e.last,d=o.unitLabel.num("gap");let u,p;a?h?(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)):(u=c.getBBox(),p=Math.max(c.tx+u.width+d,s-l.width)):h?(u=_.getBBox(),p=Math.max(_.tx+u.width+d,s-l.width)):(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)),t.resizeByMeasured().layout().trans(p,n)}$_layoutUnitVert(t,e,i,s,r,n){const o=this.model,a=o.prop("reversed"),h="start"!==o.unitLabel.prop("position"),l=t.getBBox(),c=e.first,_=e.last,d=o.unitLabel.num("gap");let u,p=i?n:s-l.width-n;a?h?(_.getBBox(),u=Math.max(_.ty+l.height+d,r)):u=Math.min(c.ty-l.height-d,0):h?u=Math.min(_.ty-l.height-d,0):(c.getBBox(),u=Math.max(c.ty+l.height+d,r)),t.resizeByMeasured().layout().trans(p,u)}}ia.AXIS_CLASS="rct-axis",ia.LINE_CLASS="rct-axis-line",ia.TICK_CLASS="rct-axis-tick",ia.HIERARCHY_ROW_GAP=2,ia.MINOR_TICK_CLASS="rct-axis-minor-tick";class sa extends Se{constructor(t,e,i){super(t,sa.STYLE),this.add(this._back=new ms(t,sa.BACK_STYLE)),this.add(this._textView=new $e(t)),i&&this.dom.classList.add(i),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),i=(new zo).applyPadding(e),s=this._textView.getBBox();this._back.rect={x:0,y:0,width:s.width+i.left+i.right,height:s.height+i.top+i.bottom,rx:P(parseFloat(e.rx),0),ry:P(parseFloat(e.ry),0)},this._textView.trans(s.width/2+i.left,i.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}sa.STYLE="rct-button",sa.BACK_STYLE="rct-button-background";class ra extends Se{constructor(t,e){super(t,e,"circle")}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class na extends Le{setArc(t,e,i,s,r,n){this.setPath(fs.arc(t,e,i,i,s,close?s+r:s-r,n))}}class oa extends na{setPolyline(t){this.setPath(fs.polygon(...t))}}const aa={};class ha extends jo{static register(...t){t.forEach(t=>{aa[t[0].type]=t[1]})}constructor(t,e){super(t,ha.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Se(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,i){this.measure(this.doc,this.model,e,i,0),this._layoutView(this.chart().isInverted(),t,0,0,e,i)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,i,s,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),i,s,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this.model.prop("align")){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this.model.prop("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,i){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,i)}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.prop("backgroundStyle"))}_doLayout(t){const e=this.model.prop("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)}}ha.CLASS_NAME="rct-annotation";const la={};class ca extends Wo{static register(...t){t.forEach(t=>{la[t[0].type]=t[1]})}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new ms(t,ca.PANE_CLASS)),this.add(this._contentContainer=new Ce(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return ca.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const i=this.model;let s=i.getLeft(t),r=i.getTop(e);return isNaN(s)&&(s=i.getRight(t)-this.width,isNaN(s)&&(s=(t-this.width)/2)),isNaN(r)&&(r=i.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:s,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){return e.getSize(i,s)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const i=l(re.getPadding(this.dom));t-=i.left+i.right,e-=i.top+i.bottom,this._renderGauge(t,e),this._contentContainer.trans(i.left,i.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof ua)return t;t=t.parent}}}ca.GAUGE_CLASS="rct-gauge",ca.PANE_CLASS="rct-gauge-pane";class _a extends ge{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class da extends Uo{}class ua extends ca{_defaultCalss(){return ua.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Ce(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,i){super._setChartOptions(t,e,i),this._gaugeViews.forEach(s=>s._setChartOptions(t,e,i))}_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,i){i.forEach((i,s)=>{i.prepareGauge(t,e.getVisible(s))})}}ua.GAUGE_GROUP_CLASS="rct-gauge-group";const pa=function(t){const e=t.x+t.width/2,i=t.y+t.height/2,s=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(s)-r*Math.sin(s)),i+(t*Math.sin(s)+r*Math.cos(s))])},ga=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i],r=t[(i+1)%t.length],n=[r[0]-s[0],r[1]-s[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},fa=function(t,e){const i=t.map(([t,i])=>t*e[0]+i*e[1]);return[Math.min(...i),Math.max(...i)]},ma=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},ya=function(t,e){const i=pa(t),s=pa(e),r=ga(i),n=ga(s);for(const t of[...r,...n]){const e=fa(i,t),r=fa(s,t);if(!ma(e,r))return!1}return!0},ba=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 xa{static reveal(t,e){new Sa(t,e)}static grow(t,e){new Ca(t,e)}static spread(t,e){new Pa(t,e)}static fadeIn(t){new va(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);rt.isAnimation(i)&&(i.addEventListener("finish",()=>{t._animationFinished(i)}),t._animationStarted(i))}}class va extends xa{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:ge.DURATION,fill:"none"})}}class wa extends xa{static clipRect(t,e){const i=e.view||t;let s;if(t.model.needClip(!1))s=i.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)s=i.clipRect(0,0,t.width,t.height);else{const e=t.control;s=t.model.chart.isInverted()?i.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):i.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return s}constructor(t,e){super(t,e)}_createAnimation(t,e){const i=wa.clipRect(t,e);let s;switch(e&&e.from){case"top":s=this.$_top(i,e);break;case"bottom":s=this.$_bottom(i,e);break;case"right":s=this.$_right(i,e);break;default:s=this.$_left(i,e)}return null==s||s.addEventListener("finish",()=>{i.dom.remove()}),s}$_aniOptions(t){return{duration:ge.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 Sa extends ge{constructor(t,e){super(),this._series=t,this._cr=wa.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 Se}_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 Va extends ge{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Se}_stop(t){super._stop(t),this._series=null}}class Ca extends Va{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Pa extends Va{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Aa extends Uo{constructor(t){super(t,"rct-series-trendline-label")}}class ka extends Ce{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new Le(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new Le(t,"rct-series-trendline-variable")),this.add(this._line=new Le(t)),this.add(this._label=new Aa(t))}layout(t,e,i,s,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.prop("reversed"),a=e.owner._yAxisObj.prop("reversed"),h=this.$_getPoints(e,i);if(h.length<2)return this._line.setVis(!1),this._fixedArea.setVis(!1),this._variableArea.setVis(!1),this._label.setVis(!1),void(this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)));this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(i,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new Le(t,"rct-series-trendline-marker")),this.add(this._endMarker=new Le(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,i,h,s,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,i,h,s,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,e.label.getIconUrl(),e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(i,e,n,o,a,h,s,r))}$_getPoints(t,e){const i=t.owner,s=i.chart.isInverted(),r=i._xAxisObj,n=i._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map(t=>{const i=e.start+r.getPos(a,t.x),s=ss(e,n,t.y);return{x:e.cx+s*d(i),y:e.cy+s*u(i),a:i}}):t._points.map(t=>{let e,i;return s?(i=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),i=o-n.getPos(o,t.y)),{x:e,y:i}}),h}$_getLine(t,e){const i=new be;return i.move(e[0].x,e[0].y),i.lines(...e),i.end()}$_getVariable(t,e,i,s,r,n,o){const a=new be,h=r[0],l=r[r.length-1];if(s);else if(t)if(i){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(i){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,i,s,r,n,o){const a=new be,h=r[0],l=r[r.length-1];return s||(t?i?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):i?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 i=t.marker.getRadius();if(this._startMarker.setVis(i>0)&&this._endMarker.setVis(i>0)){const s=fs.getDrawer(t.marker.prop("shape"));this._startMarker.setPath(s(i)),this._endMarker.setPath(s(i)),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,i,s,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,c=this._label,_=h.getText();if(!_)return void c.setVis(!1);h.prepareRich(_),h.buildSvg(c._text,c._outline,NaN,NaN,h,e.getLabelDomain());const d=h.prop("position"),u=t?function(t){const e=Math.floor((n.length-1)*t),i=(n.length-1)*t-e;let s;if(e>=n.length-1)s=n[n.length-1].a;else{const t=n[e],r=n[e+1];s=t.a+(r.a-t.a)*i}return s}(d):0,p=t?h.getAlignPolar(u):h.getAlign(i,s,r,d),g=t?h.getVerticalAlignPolar(u):h.getVerticalAlign(i,s,r),f=h.getOffsetX(p)+("middle"===g?l:0),m=h.getOffsetY(g)+("center"===p?l:0);c.setContrast(null).layout(p);const y=Math.floor((n.length-1)*d),b=(n.length-1)*d-y;let x,v;if(y>=n.length-1)x=n[n.length-1].x,v=n[n.length-1].y;else{const t=n[y],e=n[y+1];x=t.x+(e.x-t.x)*b,v=t.y+(e.y-t.y)*b}const w=c.getBBox();switch(p){case"left":x-=w.width+f;break;case"center":x-=w.width/2+f;break;case"right":x+=f}switch(g){case"top":v-=w.height+m;break;case"middle":v-=w.height/2+m;break;case"bottom":v+=m}t||(x<0&&(x=0),v<0&&(v=0),x+w.width>o&&(x=o-w.width),v+w.height>a&&(v=a-w.height)),c.trans(x,v)}}class La extends ge{constructor(t,e,i,s){super(),this.duration=i?200:100,this._sv=t,this._focused=i,this._marker=e,i||(this._marker.setBoolData(Fa.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(s)}_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(Fa.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Ta extends Uo{constructor(t){super(t,"rct-point-label")}}class Ma extends Ce{constructor(t){super(t,"rct-point-labels"),this._labels=[new Fo(this,Ta),new Fo(this,Ta)],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=f(e,t.getBBox().width)),e}prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.prop("text"));e.point=s,e.setModel(t,n,n.getIconUrl(s.icon),r.getPointLabelStyle(s)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):e.setText(n.getText(n.getValue(s,i)))}prepare(t,e){const i=e.model,s=i.pointLabel;if(i.isLabelsVisible()){this.setVis(!0);const r=i.pointLabelCount(),n=this._labels,o=i._getLabeledPoints(),a=this._maps,h=s._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,h))&&(this.prepareLabel(t,l,h,r,i,s),a[h][r.pid]=l)}}),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const i=t[e].inflateBBox(-1,-1),s=t[e-1].inflateBBox(-1,-1);if(ba(i,s))return t}}dedupe(t,e,i){let s=0,r=t[s];if(i===Cs)for(let i=1;i<t.length;i++){const n=t[i],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(ya(h,l)?(r.point.yValue<t[i].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1),r=n,s=i):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1)),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ya(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,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(s,1)))}}else for(let i=1;i<t.length;i++){const n=t[i],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(ya(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});ya(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1))}}}arrangeVertical(t,e,i,s,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 c=Number.MAX_SAFE_INTEGER,_=0;for(let t=0;t<a;t++){const i=e[t].inflateBBox(0,-1),s=Math.abs(l-(i.y+i.height/2));s<c&&(c=s,_=t)}const d=(t,i)=>{0!==i&&e[t].shiftY(i)},u=(t,i)=>{const s=e[t].inflateBBox(0,-1),r=e[i].inflateBBox(0,-1);return s.y+s.height-r.y};for(let t=0;t<_;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>=_&&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,i)=>{for(let s=t;s<i;s++){const t=e[s].tbottom-e[s+1].ty;t>0&&d(s+1,t)}},i=(t,i)=>{for(let s=t;s>i;s--){const t=e[s].ty-e[s-1].tbottom;t<0&&d(s-1,t)}},s=e[0],r=e[a-1],n=e[_];let o=s.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const i=e[t+1].ty-e[t].tbottom;t<_?o+=i:h+=i}if(s.ty<0)if(o>=0){s.transY(0),t(0,_-1),n.ty<e[_-1].tbottom&&i(_,0),o=0;for(let t=0;t<_;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)s.transY(0),t(0,a-1),o=0;else{for(let t=_;t>0;t--){const i=e[t].ty-e[t-1].tbottom;d(t-1,i)}o=s.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),i(a-1,_+1),n.tbottom<e[_+1].ty&&t(_,a-1),h=0;for(let t=_;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),i(a-1,0),h=0;else{if(o>=0){s.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=_;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(s.ty<0&&h>0){const t=Math.min(s.ty+h,0);s.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===Ps&&e.forEach((t,e)=>{const s=t.ty+t.getBBox().height;(t.ty<0||s>p)&&(i.get(t.point).setVis(!1),t.setVis(!1))}),1}}class Na extends Ho{constructor(t){super(t),this.add(this._line=new Le(t))}setLine(t){this._line.setPath(t)}}class Ea extends Ho{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Fo(this,Na)}prepare(t){const e=this._lines,i=t._visPoints,s=t.pointLabel,r=this._map={};s.visible?e.prepare(i.length).forEach((t,e)=>{const s=i[e];t.visible=s.visible,r[s.pid]=t}):e.prepare(0)}get(t){return this._map[t.pid]}}class Ba extends Ce{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 Oa extends Uo{constructor(t){super(t,"rct-stack-label")}}class Da extends Ce{constructor(t){super(t,"rct-stack-labels"),this._labels=new Fo(this,Oa),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 $a={},Ra="rct-point-hover",Ia="rct-point-unhover";class Fa extends Wo{static register(...t){t.forEach(t=>{$a[t[0].type]=t[1]})}static isPointDom(t){for(;re.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 Ba(t,"rct-series-points")),this._labelContainer=new Ma(t),this._stackLabelContainer=new Da(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,e){return t.visible&&!t.isNull&&!t.isEmpty()&&this.model.isPointLabelVisible(t,e)}_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,i,s){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.general.prop("paletteMode")===vt,this.setData("index",e._seriesIndex%rr),this.setData("pointcolors",this._colorByPoint?this._getPointColors():pt),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.prop("reversed"),this._prepareSeries(t,e,i,s)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.prop("hoverStyle"))}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach(t=>{t!==e&&t.removeClass(Ra).addClass(Ia)})):this._getPointPool().forEach(t=>{t.containsClass(Ia)&&t.removeClass(Ia).addClass(Ra)})}_clearHoverClasses(t){t instanceof Se&&t.removeClass(Ra).removeClass(Ia)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.prop("hoverEffect"),i=this._hoverAnis,s=this._hoverPts,r=[],n=[];!1!==this.model.prop("interactive")&&e&&(s.forEach(e=>{if(e instanceof Se&&(!t||t.indexOf(e)<0)){const t=i.find(t=>t._marker===e);t&&t.cancel(),e.setBoolData(Fa.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Ka&&r.push(new La(this,e,!1,()=>{e.endHover(this,!1)}))}}),t&&t.forEach(t=>{if(t&&!t.point.isNull){const e=i.find(e=>e._marker===t);e&&e.cancel(),t instanceof Se&&(t.setBoolData(Fa.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Ka?r.push(new La(this,t,!0,()=>{t.endHover(this,!0)})):this instanceof th&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}})),i&&i.forEach((t,e)=>{t._started&&r.push(t)});const o=(null==s?void 0:s.length)>0?s[0].point:null,a=n.length>0?n[0].point:null;this._hoverAnis=r,this._hoverPts=n,o!==a&&this.model.pointHovered(a)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,i,s){if(!this.model.pointLabel.prop("autoRotation"))return;const{width:r,height:n}=t.getBBox(),o=e/i*((null!=s?s:i?i*w:360)||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&pe(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,i,s,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof ar&&e.trendline.visible?(this._trendView||this.add(this._trendView=new ka(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:i,height:s}}_doLayout(){const t=this.width,e=this.height,i=this.model,s=i.pointLabel,r=this._trendView;this._labelOverlap={model:s,inverted:this._inverted,width:t,height:e,fit:s._overflowFit,outline:s.prop("overlapOutline"),contrast:s.prop("overlapContrast")},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||i._needAnimate),i._needAnimate=!1,r&&r.setVis(r.visible&&(!i.trendline.prop("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 i=e.stackLabel;if(!i||!i.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const s=e._stackTotals,r=e._stackPoints;s&&0!==s.size&&r&&0!==r.size?this._doLayoutStackLabel(i,s,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,i){var s;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),c=t.getOffset(),_=t.prop("align"),p=this._labelContainer,g=p&&p.visible,f=o._body.getPolar(h),y=this._inverted,b=this.width,x=this.height,w=a.prop("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 C=0;const A=f?h.getTotalAngle():0,k=y?b:x,L=y?x:b,T=y?0:x;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[x,S]of e){const e=V.get(C++),M=t.getCallbackArgs(o,b.x,b.positiveTotal,b.negativeTotal);if(e.setVis(t.isStackLabelVisible(M))){const o=t.getStackLabelText(M,x),b=t.getStackLabelStyle(M);e.xValue=n,e.setModel(r,t,null,b),e.setText(o),e.layout(_);const V=y?0:t.getRotation(),{width:C,height:N}=e.getBBox(),E=V*v,B=0!==V?N*m(d(E))+C*m(u(E)):N,O=0!==V?C*m(d(E))+N*m(u(E)):C;let D,$;const R=i.get(n),I=R&&null!==(s=R.find(t=>t.yGroup===x))&&void 0!==s?s:null;if(f){const t=P(null==I?void 0:I.xPos,f.cx+f.rd*d(f.start+h.getPos(A,n))),i=P(null==I?void 0:I.yPos,f.cy+f.rd*u(f.start+h.getPos(A,n))),s=Math.atan2(i-f.cy,t-f.cx),r=ss(f,a,x)+(S!==w?-1:1)*(N/2+l);let o=0;"left"===_?o=-(C/2+c):"right"===_&&(o=C/2+c),D=f.cx+r*d(s)+-u(s)*o,$=f.cy+r*u(s)+d(s)*o,e.trans(D-C/2,$-N/2),0!==V&&e.setRotation(C/2,N/2,V)}else{const i=a.getPos(k,x),s=g&&I?p.get(I,0):null,r=s&&s.visible?s.getBBoxEx():null,o=R?R[R.length-1]:null,d=o?this.getPointView(o):null,u=(null==d?void 0:d.wPoint)||0;if(y){const s=S!==w?-1:1;if(D=T+i+s*(l+O/2)-C/2,r)if(s>0){const t=D+C/2-O/2,e=r.x+r.width-t;e>0&&(D+=e)}else{const t=D+C/2+O/2-r.x;t>0&&(D-=t)}const o=P(null==I?void 0:I.yPos,L-h.getPos(L,n)),a=w?"left"===_?"right":"right"===_?"left":_:_;$="left"===a?o-u/2-B/2-N/2-c:"right"===a?o+u/2+B/2-N/2+c:o-N/2+c,$+=N*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,D,C,k);if(null===d){e.setVis(!1);continue}D=d}else{const s=S!==w?1:-1;if($=T-i+s*(l+B/2)-N/2,r)if(s<0){const t=$+N/2+B/2-r.y;t>0&&($-=t)}else{const t=$+N/2-B/2,e=r.y+r.height-t;e>0&&($+=e)}const o=P(null==I?void 0:I.xPos,h.getPos(L,n));D="left"===_?o-u/2-O/2-C/2-c:"right"===_?o+u/2+O/2-C/2+c:o-C/2+c;const a=this._applyOverflowFit(t._overflowFit,$,N,k);if(null===a){e.setVis(!1);continue}$=a}e.trans(D,$),0!==V&&e.setRotation(C/2,N/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const i=this._randomPalette?Math.floor(rt.randomLike(e.index)*rr):e.index%rr;t.setData("index",this._model._paletteColors[i].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return P(this._growRate,1)}_getPosRate(){return P(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,i,s){const r=this.model;r instanceof ar&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),i,s)}_layoutLabel(t,e,i,s){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=i&&o>=0&&o<=s))return;h.layout(e.textAlign);const c=e.below=e.reversed?a<=0:a<0,_=h.getBBox();let d=!0;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const i=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===i?o-=e.wPoint/2+_.height-_.height*t._vertAdjust+p:"right"===i?o+=e.wPoint/2+_.height*t._vertAdjust+p:o-=_.height/2-_.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+_.width+p:"right"===u?n+=e.wPoint/2+p:n-=_.width/2;const g=n,f=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+_.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-_.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,c?n+=l:n-=_.width+l):(n-=e.base,o+=e.side,c?o-=_.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=c?a+_.width+l:a-l):(n-=e.base,o+=e.side,o+=c?a+l:a-_.height-l);break;case"far":r?n=c?l:i-_.width-l:c?(n-=e.base,o=s-_.height-l):o=l,d=!1;break;default:r?c?n-=_.width+l:n+=l:c?(n-=e.base,o+=e.side,o+=l):o-=_.height+l,d=!1}this._checkLabelOverlap(h,_,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,_,n,o)}_applyOverflowFit(t,e,i,s){if(isFinite(t)||t===1/0){if(e+i>=s)return t===1/0?null:s+t-i;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,i,s,r,n,o,a,h,l){const c=this._labelOverlap;let _=!1;if(!h){const s=c.fit;if(isFinite(s)||s===1/0){const h=c.inverted?o:a,l=c.inverted?e.width:e.height,d=c.inverted?c.width:c.height,u=c.inverted?r:n,p=h+l>=d,g=this._applyOverflowFit(s,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(_=p?g<i+u:g+l>i-u,c.inverted?o=g:a=g),_&&c.outline&&t.setOutline(c.model)}}return t.setContrast((h||_&&c.contrast)&&l),t.trans(o,a),!0}_clipRange(t,e,i,s,r,n){if(n){const i=t;t=e,e=i}const o="x"===i,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.prop("reversed"),l=a.getPos(o?t:e,f(a.axisMin(),s.fromValue)),c=a.getPos(o?t:e,g(a.axisMax(),s.toValue));n?o?h?r.setBounds(c,-e,m(c-l),e):r.setBounds(l,-e,m(c-l),e):r.setBounds(0,-f(l,c),t,m(c-l)):o?h?r.setBounds(c,0,m(c-l),e):r.setBounds(l,0,m(c-l),e):r.setBounds(0,e-f(l,c),t,m(c-l))}_setFill(t,e){i(e)&&e[Vt]?t.internalSetStyle(Vt,e[Vt]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,i,s){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,i,s),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=e.height,h=P(e.fit,0),l=this.model._yAxisObj.prop("reversed"),c=this.model.chart.isInverted(),_=n.prop("position");let d=this._getRotatedLabelDisplacement(o,i);if(!c&&_!==vs)if(l?_!==xs&&_!==bs||(d*=-1):_===bs&&(d*=-1),r-=d,l){const t=r+(-2*d+i.height)/2+i.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+i.height)/2<0&&(r=d-h)}t.trans(s,r)}_getRotatedLabelDisplacement(t,e){const i=t*Math.PI/180,s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),n=e.width,o=e.height;return n/2*s+o/2*r-o/2}}Fa.POINT_CLASS="rct-point",Fa.DATA_FOCUS="focus",Fa.DATA_UNFOCUS="unfocus",Fa.DATA_UNHOVER="unhover",Fa.LEGEND_MARKER="rct-legend-item-marker";class za extends Le{constructor(t){super(t,Fa.POINT_CLASS)}savePrevs(){}}class Ha extends za{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class Ga extends Se{constructor(t){super(t,Fa.POINT_CLASS)}savePrevs(){}}class ja extends Ga{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Ya=class extends Ha{layout(t,e,i,s,r,n,o){this.x=t,this.y=e,this.setPath(fs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,i,s))}shrink(t,e,i,s){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,i,s,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,i,s,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class Wa extends ja{constructor(t){super(t),this.add(this._topView=new Le(t)),this.add(this._frontView=new Le(t)),this.add(this._sideView=new Le(t))}layout(t,e,i,s,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const c=h<0?e:e-h;if(st&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(fs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(fs.polygon(t,c,t+a,c,t+a-r,c+n,t-r,c+n)),this._topView.setStyle("fill",se.interpolate(o?se.BLACK:se.WHITE,l,.2)),this._sideView.setPath(fs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",se.interpolate(o?se.WHITE:se.BLACK,l,.2))}}class Xa extends Ho{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Ua extends Fa{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,i,s){this._preparePoints(t,e,this._visPoints,!!s)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&xa.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach(t=>t.savePrevs())}getPointsAt(t,e){return[]}}class Za extends Ua{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Ea(t))}depthEnabled(){return!0}_prepareSeries(t,e,i,s){s?(this._depthAngle=s.prop("angle")*v,this._base=d(this._depthAngle)*e.depth,this._side=u(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,i,s),this._pointOff=e.prop("pointOffset")||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var i;const s=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=s.pointLabel,h=this._labelViews(),c=this._labelLineContainer,_=s._xAxisObj,p=s._yAxisObj,g=this._yReversed,m=this._depthExt,y=s._group?s._groupDistance:s.distance,b=m?y*(r?u(this._depthAngle):d(this._depthAngle)):0,x=m?y*(r?d(this._depthAngle):u(this._depthAngle)):0,v=2*_.unitPad(),w=P(s.prop("minPointWidth"),0),S=this._yLen=r?t:e,V=r?e:t,C=t=>p.getPos(S,t),A=t=>_.getPos(V,t),k=r?0:e,L=p.valueMin(),T=C(L),M=this._baseVal=s.getBaseValue(p),N=!isNaN(M),E=this._yBase=P(C(f(L,P(M,T))),T),B=this._pointOff,O=h&&l(this._labelInfo,{inverted:r,reversed:g,labelPos:s.getLabelPos(a),labelOff:s.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:x,side:this._side,base:this._base});h&&c.setVis(s.pointLabel.line.visible)&&(c.internalClearStyleAndClass(),c.internalSetStyleOrClass(s.pointLabel.line._style),c.prepare(s),O.pb=new be),this._prepareLayoutPoints(t,e),null===(i=this._getPointPool().getOrphans())||void 0===i||i.forEach(t=>{this._shrinkPoint(t)}),this._getPointPool().forEach((i,l)=>{const c=i.point;if(i.setVis(!c.isNull)){const d=_.getUnitLen(V,c.xValue)*(1-v);let u=s.getPointWidth(d,w),p=C(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=M>c.yGroup,e=c.yGroup<0,i=c.yValue<0,s=t&&e&&!i||t&&!e&&!i||!t&&e&&i||!t&&!e&&i,r=c.yGroup-c.yValue*(s?-1:1);g=C(r)}const f=(p-g)*n;let m=A(c.xValue)-d/2,y=k-p;isNaN(o+i.wSave)||(u=i.wSave+(u-i.wSave)*o),m+=s.getPointPos(d)+u/2,isNaN(o+i.xSave)||(m=i.xSave+(m-i.xSave)*o),c.xPos=m+=u*B,c.yPos=y,this._layoutPoint(i,l,m-b,k-E*(1-n)-g*n+x,u,f),r&&(y=V-A(c.xValue)+d/2,m=k,c.yPos=y-=s.getPointPos(d)+u/2+u*B,c.xPos=m+=N?C(c.yGroup)*n:C(c.yGroup*n)),O&&(O.labelView=h.get(c,0))&&(O.pointView=i,O.x=m,O.y=y,O.wPoint=u,O.hPoint=f,O.labelOff=s.getLabelOff2(c),this._layoutLabel(a,O,t,e))}})}_layoutLabel(t,e,i,s){if(super._layoutLabel(t,e,i,s),e.pb){const t=this._labelLineContainer.get(e.pointView.point),i=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?i.tx+i.getBBox().width:i.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?i.ty:i.ty+i.getBBox().height),t.setLine(e.pb.end())}}}class qa extends Ua{_getHighValue(t){return t.yValue}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._pointOff=+e.prop("pointOffset")||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const i=this.model,s=i.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=i.pointLabel,a=this._labelViews(),h=i._xAxisObj,c=i._yAxisObj,_=2*h.unitPad(),d=P(i.prop("minPointWidth"),0),u=s?t:e,p=s?e:t,g=s?0:e,f=this._pointOff,m=a&&l(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(o),labelOff:i.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach((l,y)=>{const b=l.point;if(l.setVis(!b.isNull)){const x=h.getUnitLen(p,b.xValue)*(1-_);let v=i.getPointWidth(x,d);const w=(c.getPos(u,this._getHighValue(b))-c.getPos(u,this._getLowValue(b)))*r;let S=h.getPos(p,b.xValue)-x/2,V=g-c.getPos(u,this._getHighValue(b))*r;isNaN(n+l.wSave)||(v=l.wSave+(v-l.wSave)*n),S+=i.getPointPos(x)+v/2,isNaN(n+l.xSave)||(S=l.xSave+(S-l.xSave)*n),b.xPos=S+=v*f,b.yPos=V,this._layoutPoint(l,y,S,V,v,w),s&&(V=p-h.getPos(p,b.xValue)+x/2,S=g,b.yPos=V-=i.getPointPos(x)+v/2+v*f,b.xPos=S+=c.getPos(u,this._getHighValue(b))*r),a&&(m.pointView=l,m.hPoint=w,m.x=S,m.y=V,(m.labelView=a.get(b,0))&&(m.hPoint=w,m.labelOff=i.getLabelOff2(b),this._layoutLabel(o,m,t,e)),(m.labelView=a.get(b,1))&&(s?m.x-=w:m.y+=w,m.hPoint=-w,m.labelOff=i.getLabelOff2(b),this._layoutLabel(o,m,t,e)))}})}}class Ka extends za{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-i)**2)-t}}class Qa extends Fa{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_adjustRotatedLabelPosition(t,e,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.prop("position");let l=this._getRotatedLabelDisplacement(o,i);if(!a&&h!==vs){(r-=l)-(2*l+i.height)/2<0&&(r=l),t.trans(s,r)}}_layoutLabelView(t,e,i,s,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*s*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-s-o.height-i),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class Ja extends ge{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 th extends Fa{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,e){return t===this._zombie||super.isPointLabelVisible(t,e)}_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 i;this._zombie&&(this._zombie=null,null===(i=this._zombieAni)||void 0===i||i.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Ja(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,i){return ms.create(t,"rct-legend-item-marker",0,0,i,i,i/2)}_preparePoint(t,e,i,s){this._clearHoverClasses(s),i.legendMarker()||i.setLegendMarker(this._createPointLegendMarker(t,i,this.chart()._legend.getMarkerSize())),this._setPointStyle(s,e,i);const r=getComputedStyle(s.dom);i._calcedColor=r.fill,i._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class eh extends ha{constructor(t){super(t,eh.CLASS_NAME),this.addToTransform(this._imageView=new Xo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,i,s,r){const n=this._size=e.getSize(i,s);this._deflatePaddings(n),this.$_setImage(this.model.getImageUrl());const o=this._imageView.getBBox();return this._inflaePaddings(o),X(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)}}eh.CLASS_NAME="rct-image-annotation";class ih extends ha{constructor(t){super(t,ih.CLASS_NAME),this.addToTransform(this._shapeView=new Le(t))}_doMeasure(t,e,i,s,r){const n=e.getSize(i,s),o=e.chart.getAxisOf(e,!0),a=e.chart.getAxisOf(e,!1),h=null==o?void 0:o.getPos(i,e.prop("x1")),l=null==o?void 0:o.getPos(i,e.prop("x2")),c=null==a?void 0:a.getPos(s,e.prop("y1")),_=null==a?void 0:a.getPos(s,e.prop("y2")),d=e.getShape();if(this.$_resetHeadView(),e.hasCustomPath())this._shapeView.setPath(e.prop("path"));else{let i=0,r=0;switch(d){case Br:!Number.isNaN(l)&&Number.isNaN(h)&&(i=l),Number.isNaN(_)||(r=Number.isNaN(c)?s-_:n.height/2),this._shapeView.setPath(fs.line(i,r,i+n.width,r));break;case Er:Number.isNaN(l)||(i=Number.isNaN(h)?l:n.width/2),!Number.isNaN(_)&&Number.isNaN(c)&&(r=s-_),this._shapeView.setPath(fs.line(i,r,i,r+n.height));break;case Or:{const t=this.$_lineEndpoints(h,l,c,_,s,n);this._shapeView.setPath(fs.line(t.xStart,t.yStart,t.xEnd,t.yEnd));break}case Dr:{const i=this.$_lineEndpoints(h,l,c,_,s,n),r=fs.arrowParts(i.xStart,i.yStart,i.xEnd,i.yEnd,e.getHeadSize()),o=this.$_headView(t);this._shapeView.setPath(r.body),o.setPath(r.head),o.setVis(r.head.length>0);break}default:fs.setShape(this._shapeView,e.getShape(),n.width/2,n.height/2)}}return this._deflatePaddings(n),n}_doLayout(t){var e;this._shapeView.trans(this._paddings.left,this._paddings.top),null===(e=this._headView)||void 0===e||e.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_headView(t){return this._headView||this.addToTransform(this._headView=new Le(t)),this._headView}$_resetHeadView(){this._headView&&(this._headView.setVis(!1),this._headView.setPath([]))}$_lineEndpoints(t,e,i,s,r,n){let o=0,a=0;return Number.isNaN(e)||(o=Number.isNaN(t)?e:t>e?n.width:0),Number.isNaN(s)||(a=Number.isNaN(i)?r-s:i<s?n.height:0),{xStart:o,yStart:a,xEnd:t>e?o-n.width:o+n.width,yEnd:i<s?a-n.height:a+n.height}}}ih.CLASS_NAME="rct-shape-annotation";class sh extends ha{constructor(e){super(e,sh.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new $e(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new We}_doMeasure(t,e,i,s,r){const n=e.getSize(i,s);this._hasExplicitWidth=!isNaN(n.width);const o=this._textView,a=e.prop("writingMode");a&&this._textView.setStyle("writingMode",a),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(n),this._richText._isVertical="vertical"===a,this._richText.setFormat(e.prop("text")),!isNaN(e.num("lineHeight"))&&this._richText&&(this._richText.lineHeight=e.num("lineHeight")),this._richText.build(o,i,s,null,e._domain);const h=X(this._textView.getBBox());return{width:P(n.width,h.width),height:P(n.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);const e=this._paddings,i=this.width-e.left-e.right,s=this.height-e.top-e.bottom,r=this._textView.getBBox();this._hasExplicitWidth&&r.width>i+.5?(this.isClip(this._textClip)||(this._textClip=this.control.clipBounds(),this._textView.setClip(this._textClip)),this._textClip.setBounds(e.left,e.top,i,s)):this._textView.setClip(null),super._doLayout(t)}remove(){var t;return this._textClip&&(null===(t=this.control)||void 0===t||t.removeDef(this._textClip.dom)),super.remove()}}sh.CLASS_NAME="rct-text-annotation";class rh extends Fo{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 i=e.get(t);i||(i=this.find(e=>e.point===t),i&&this.addOrphan(t,i))})}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class nh extends Ka{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;fs.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,i){const s=this.point,r=(+t.model.marker.prop("hoverScale")||1.8)-1;let n=this._radius;e?isNaN(i)||(n=this._radius=this._saveRadius*(1+i*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(i)?r:r*i)),fs.setShape(this,t.model.getShape(s),n,n),this.index>0?this.trans(s.px2-n,s.py2-n):this.trans(s.xPos-n,s.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,i){const s=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((s-e)**2+(r-i)**2)-t}distance2(t,e,i,s){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:s?Math.abs(n-i):Math.abs(r-e)}}class oh extends Ba{}class ah extends Fa{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new oh(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Le(t,"rct-line-series-line")),this._markers=new rh(this._pointContainer,nh),this.add(this._tester=new Le(t)),this._tester.setFill("#ff000010"),this._arrowViews=new Fo(this._pointContainer,Le,"rct-line-series-arrow rct-series-point")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),i=t._marker;if(i._line.setStyle("strokeWidth",e.strokeWidth),i._shape){const t=getComputedStyle(this.dom);i._marker.setStyles({fill:t.fill,stroke:t.stroke}),i._marker.internalSetStyles(this.model.marker._style),i._line.setStyle("strokeDasharray","")}else i._line.setStyle("strokeDasharray",e.strokeDasharray)}_computeNeedBelow(t){return this._based&&!!t.prop("belowStyle")}_prepareSeries(t,e,i){e instanceof xn&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._computeNeedBelow(e),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&&xa.grow(this):t&&xa.reveal(this,{from:function(t){const e=t.model._xAxisObj.prop("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),this.$_layoutArrows()}getPointsAt(t,e){return[]}getNearest(t,e){const i=this.model.marker.prop("radius"),s=this._markers._internalItems();if(s&&s.length>0){const 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)}}}getNearest2(t,e,i){const s=this.model.marker.prop("radius"),r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce((r,n)=>r.distance2(s,t,e,i)<n.distance2(s,t,e,i)?r:n);return{pv:n,dist:n.distance2(s,t,e,i)}}}getHintDistance(){return this.model.marker.prop("hintDistance")}canHover(t,e,i){return t<=this.model.marker.prop("radius")+i}_markersPerPoint(){return 1}_prepareBelow(t){var e,i;const s=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new Le(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=s.clipPath(),this._innerClip=s.clipPath(),this._outerLineClip=s.clipPath(),this._innerLineClip=s.clipPath()):this.isClip(this._upperClip)||(this._upperClip=s.clipBounds(),this._lowerClip=s.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===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const i=this._rangeClips;let s=this._rangeLines;if(e){for(s||(s=this._rangeLines=new Fo(this._lineContainer,Le)),s.prepare(e.length);i.length<e.length;){const t=new ke(this.doc);this.control.addClip(t),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach(t=>t.remove()),i.length=0)}$_resetClips(t,e,i,s){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:e,rd:s,rdInner:r,min:o,max:a,cyclic:h}=this._polar;if(null==o||null==a)return;const l=mt(f(0,g((b-m(o-a))/2,.2))),c=n?1:this._getGrowRate(),_=s-r,d=r+(f(i,r)-r)*c,u=r+_*c,p=u>0?d/u:0;this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(fs.donut(t,e,u,d)),this._outerLineClip.setPath(this._outerClip.getPath())):r>0?(this._outerClip.setPath(fs.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(fs.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(fs.circle(t,e,d)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(fs.sector(t,e,u,u,p,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():fs.sector(t,e,u,u,p,o-l,a+l,!0))):r>0?(this._outerClip.setPath(fs.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(fs.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(fs.sector(t,e,d,d,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():fs.sector(t,e,d,d,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(s?r?o.setBounds(0,-i,e,t):o.setBounds(0,-t,e,t-i):r?o.setBounds(0,0+i,t,e-i):o.setBounds(0,0,t,i)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-i):o.setBounds(0,-i,e,i):r?o.setBounds(0,0,t,i):o.setBounds(0,0+i,t,e-i))}$_prepareMarkers(t,e){var i;const s=t instanceof xn&&this._needBelow,r=s?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(i=this._markers)||void 0===i||i.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const i=this._markersPerPoint(),o=s&&t.prop("belowStyle"),a=e.length;this._markers.prepare(a*i,(i,h)=>{const l=e[h%a];l.isNull||(i.point=l,n[1]=s&&l.yValue<r?o:null,this._setPointStyle(i,t,l,n)),i.point=l,i.index=h<a?0:1})}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,i=t.point;t._shape=e.getShape(i),t._radius=e.getRadius(i)}_layoutMarker(t,e,i,s){const r=t._radius;e&&t.internalSetStyleOrClass(e),fs.setShape(t,t._shape,r,r),t.setPos(i,s),t.trans(i-=r,s-=r)}_layoutMarkers(t,e,i){const s=this.model,r=s.marker,n=r._style,o=this._inverted,a=s.needClip(!1),h=this._getGrowRate(),l=r.visible,c=r.prop("firstVisible"),_=r.prop("lastVisible"),p=r.prop("maxVisible"),m=r.prop("minVisible"),y=s.pointLabel,b=y.prop("align"),x=y.getAlignOffset(),v=y.getPosition(),w=this._labelContainer._textAlign,S=this._labelViews(),V=s._xAxisObj,C=s._yAxisObj,P=this._polar=s.chart._body.getPolar(V),A=!!P,{cx:k,cy:L,rd:T,rdInner:M,start:N,total:E}=P||{},B=o?e:i,O=P?E:o?i:e,D=o?0:i,$=t.length,R=this._yReversed,I=C instanceof Xr?s.getBaseValue(C):NaN,F=I>C.axisMin(),z=A?F?ss(P,C,I):M:F?C.getPos(B,I):0;this._pointContainer.visible&&this._shrinkPoints(s),t.forEach((t,y)=>{let H,G,j,Y;P?(j=N+V.getPos(O,t.xValue),P.min=null==P.min?j:g(P.min,j),P.max=null==P.max?j:f(P.max,j),Y=R?isNaN(t.yGroup)?F?z:T:F?z+(ss(P,C,t.yGroup)-z)*h:rs(P,C,t.yGroup,h):isNaN(t.yGroup)?F?z:M:F?z+(ss(P,C,t.yGroup)-z)*h:rs(P,C,t.yGroup,h),H=t.px=k+Y*d(j),G=t.py=L+Y*u(j),t.angle=j):(H=t.px=V.getPos(O,t.xValue),G=t.py=D-C.getPos(B,t.yGroup),o&&(H=C.getPos(B,t.yGroup),G=i-V.getPos(O,t.xValue))),t.xPos=H,t.yPos=G;const W=H,X=G,U=this._markers.get(y),Z=S&&S.get(t,0);if(U&&U.setVis(!t.isNull&&(A||!a||H>=0&&H<=e&&G>=0&&G<=i))){this._prepareMakrer(U),this._layoutMarker(U,n,H,G);const e=r.getMarkerStyle(t);e&&U.internalSetStyleOrClass(e),s._maxY,t.yGroup,s._minY,t.yGroup;const i=0==y&&null!=c?c:y==$-1&&null!=_?_:s._maxY==t.yGroup&&null!=p?p:s._minY==t.yGroup&&null!=m?m:l;if(U.setStyle("opacity",i?"1":"0"),Z){Z.setContrast(null).layout(w);const e=Z.getBBox(),i=U._radius,r=s.getLabelOff2(t);if(Z.visible=!0,P){switch(v){case"inside":R?t.yValue<I?Y-=r:Y+=r:t.yValue<I?Y+=r:Y-=r;break;case"foot":R?t.yValue<I?Y-=e.height/2+r:Y+=e.height/2+r:t.yValue<I?Y+=e.height/2+r:Y-=e.height/2+r;break;default:R?t.yValue<I?Y+=e.height/2+r:Y-=e.height/2+r:t.yValue<I?Y-=e.height/2+r:Y+=e.height/2+r}H=k+Y*d(j),G=L+Y*u(j)-e.height/2,this.applyAutoRotation(Z,j,E)}else switch(v){case"inside":G-=e.height/2+r;break;case"foot":G+=r+(l?i:0);break;default:G-=e.height+r+(l?i:0)}switch(b){case"left":H-=e.width+(l?i:0)+x;break;case"right":H+=(l?i:0)+x;break;default:H-=e.width/2+x}this._checkLabelOverlap(Z,e,W,X,i,i,H,G,!1,null),this._layoutLabelRotation(Z,e,H,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 i=this.width,s=this.height,r=this._inverted,n=e instanceof xn&&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),re.setImportantStyle(t.dom.style,Vt,"none"),t.setClip(this._rangeClips[n]),this._clipRange(i,s,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),re.setImportantStyle(t.dom.style,Vt,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);if(t){const e=!isNaN(l)&&l>h.axisMin()?ss(t,h,l):t.rdInner;this.$_resetClips(i,s/2,e,!0)}else r?this.$_resetClips(i,s,isNaN(l)?0:h.getPos(i,l),!0):this.$_resetClips(i,s,isNaN(l)?s:s-h.getPos(s,l),!1);a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.prop("belowStyle")),re.setImportantStyle(a.dom.style,Vt,"none"))}}_buildLine(t,e,i,s){const r=this.model;"spline"===e?this._drawCurve(t,i,s):r instanceof xn&&"step"===e?this._drawStep(t,i,s,i?r.backDir():r.prop("stepDir")):this.$_drawLine(t,i,s)}_buildLines(t,e){const i=this.model,s=i.getLineType(),r=new be;return"spline"===s?this._drawCurves(t,e,r):i instanceof xn&&"step"===s?this._drawSteps(e,r,i.prop("stepDir")):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,i){if(t.length>1){const s=this._model instanceof xn&&this._model.prop("connectNullPoints");i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&s||i.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach(t=>this.$_drawLine(t,!1,e))}_drawStep(t,e,i,s){if(t.length>1){i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(s){case"backward":i.line(t[e-1].px,t[e].py),i.line(t[e].px,t[e].py);break;case"center":i.line((t[e].px+t[e-1].px)/2,t[e-1].py),i.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&i.line(t[e].px,t[e].py);break;default:i.line(t[e].px,t[e-1].py),i.line(t[e].px,t[e].py)}}}_drawSteps(t,e,i){t.forEach(t=>this._drawStep(t,!1,e,i))}_drawCurve(t,e,i){t.length>1&&(i.moveOrLine(e,t[0].px,t[0].py),i.spline(t,0,t.length-1))}_drawCurves(t,e,i){if(t){const{cx:s,cy:r,rdInner:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof Xr?a.getBaseValue(h):NaN,c=l>h.axisMin()?ss(t,h,l):this._yReversed?0:n,_=e[0],p=_.length;let g,f;o?(i.move(_[0].px,_[0].py),i.closedSpline(_,!0)):(g=s+c*d(_[0].angle),f=r+c*u(_[0].angle),i.move(g,f),i.line(_[0].xPos,_[0].yPos),i.closedSpline(_,!1),g=s+c*d(_[p-1].angle),f=r+c*u(_[p-1].angle),i.line(g,f))}else e.forEach(t=>this._drawCurve(t,!1,i))}_buildAreas(t,e,i){const s=new be;i=i||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,s),this._buildLine(o,i,!0,s)}return s.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.prop("hoverStyle"))}_doLayout(){super._doLayout(),this.$_layoutArrows()}$_layoutArrows(){const t=this.model;if(!(t instanceof xn))return void this._arrowViews.prepare(0);const e=t.arrow,i=this._visPoints,s=e.buildArrowSlots(i);if(0===s.length)return void this._arrowViews.prepare(0);const r=this._getGrowRate(),n=e.getShape(),o=e.getRadius()*r,a=t.needClip(!1),h=this.width,l=this.height,c=!!this._polar;this._arrowViews.prepare(s.length,(t,r)=>{const _=s[r],d=i[_.index],u=d.xPos,p=d.yPos,g=e.calcArrowAngle(i,_.index,_.at),f=!d.isNull&&(c||!a||u>=0&&u<=h&&p>=0&&p<=l);if(t.setVis(f)){fs.setShape(t,n,o,o);const i=e.getArrowStyle(d);this.$_applyArrowStyle(t,e,i),t.trans(u-o,p-o),t.setRotation(o,o,g)}})}$_applyArrowStyle(t,e,i){t.internalClearStyleAndClass(),i&&t.internalSetStyleOrClass(i);const s=e.getArrowStyleOverrides(i);s&&t.internalSetStyles(s),n(i)&&this.$_isolateClassArrowStrokeDasharray(t,fn.STYLE_ISOLATION.strokeDasharray)}$_isolateClassArrowStrokeDasharray(t,e){const i=getComputedStyle(t.dom).strokeDasharray,s=getComputedStyle(this.dom).strokeDasharray;i&&"none"!==i?s&&"none"!==s&&i===s&&t.internalSetStyle("strokeDasharray",e):t.internalSetStyle("strokeDasharray",e)}}class hh extends ah{constructor(t){super(t,hh.CLASS),this._flagView=new Uo(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,i=e.flag,s=this._flagView,r=this.parent.parent;let n;if(s.setVis(i.visible&&!!(n=i.label()))){s.setText(n),s.setModel(this.doc,i,i.getIconUrl(),null),s.setContrast(null).layout("left");const o=i.prop("offset"),a=s.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let c;c=("step"==e.prop("lineType")&&"forward"==e.prop("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 _={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[c],{width:d,height:u}=a,p=d/2,g=u/2,{width:f,height:m}=r,y=f/2,b=m/2,x=l>u+o,v=m>l+u+o,w=h>d+o,S=f>h+d+o,V={top:x,right:S,bottom:v,left:w};c=null!==(t=_.find(t=>V[t]))&&void 0!==t?t:c;const C=h>p&&f-h>p?h-p:h>y?f-d:0,P=l>g&&m>l+g?l-g:l>b?m-u:0;switch(c){case"top":h=C,l=x?l-u-o:0;break;case"bottom":h=C,l=v?l+o:m-u;break;case"left":h=w?h-d-o:0,l=P;break;case"right":h=S?h+o:f-d,l=P}s.trans(h,l)}}}hh.CLASS="rct-line-series";class lh extends ah{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new oh(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Le(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Le(t,"rct-areanrange-series-line")),re.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,i){super._layoutMarkers(t,e,i);const s=this.model,r=s.marker,n=r._style,o=r.visible,a=this._inverted,h=s._xAxisObj,l=s._yAxisObj,c=a?e:i,_=a?0:i,p=this._labelViews(),g=this._labelContainer._textAlign,f=this._polar=s.chart._body.getPolar(h),m=s.pointLabel,y=m.prop("position"),b=m.prop("align"),x=m.getAlignOffset(),v=this._getGrowRate();for(let e=0,i=t.length;e<i;e++){const i=t[e];i.yLow=_-l.getPos(c,i.lowValue)}const w=this._markers;for(let h=0,_=t.length;h<_;h++){const m=t[h],S=w.get(_+h),V=p&&p.get(m,1);let C,A,k,L;this._prepareMakrer(S),f?(k=P(m.angle,0),L=rs(f,l,m.lowValue,v),C=m.px2=f.cx+L*d(k),A=m.py2=f.cy+L*u(k)):a?(C=m.px2=l.getPos(c,m.lowValue),A=m.py2=w.get(h).ty+S._radius):(C=m.px2=m.xPos,A=m.py2=m.yLow);const T=C,M=A;if(S&&S.setVis(!m.isNull&&C>=0&&C<=e&&A>=0&&A<=i)){this._layoutMarker(S,n,C,A);const t=r.getMarkerStyle(m);if(t&&S.internalSetStyleOrClass(t),S.setStyle("opacity",o||0==h&&!0===r.prop("firstVisible")||h===_-1&&!0===r.prop("lastVisible")?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius,i=s.getLabelOff2(m);if(f){let e=L;switch(y){case"inside":e-=i;break;case"foot":e-=t.height/2+i;break;default:e+=t.height+i}C=f.cx+e*d(k),A=f.cy+e*u(k)-t.height/2,this.applyAutoRotation(V,k,f.total)}else switch(y){case"inside":A-=t.height/2+i;break;case"foot":A+=i+(o?e:0);break;default:A-=t.height+i+(o?e:0)}switch(b){case"left":C-=t.width+(o?e:0)+x;break;case"right":C+=(o?e:0)+x;break;default:C-=t.width/2+x}this._checkLabelOverlap(V,t,T,M,e,e,C,A,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,i=this.model;if(!this._areaContainer.setVis(i._lines.length>0))return;const s=this._buildAreas(i._lines,i.getLineType());e.setPath(s),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),i._runColor&&e.setFill(i._runColor),this._setFill(e,i._style),i.prop("areaStyle")&&e.internalSetStyleOrClass(i.prop("areaStyle"))}}class ch extends ah{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new oh(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Le(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}_computeNeedBelow(t){return this._based&&!(!t.prop("belowStyle")&&!t.prop("belowAreaStyle"))}_prepareBelow(t){const e=this._area;let i=this._lowArea;if(super._prepareBelow(t))return i||this._areaContainer.add(i=this._lowArea=new Le(this.doc,"rct-area-series-area")),t?this._yReversed&&this._needBelow?(e.setClip(this._innerClip),i.setClip(this._outerClip)):(e.setClip(this._outerClip),i.setClip(this._innerClip)):(e.setClip(this._upperClip),i.setClip(this._lowerClip)),!0;null==i||i.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const i=this.doc,s=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new Fo(this._areaContainer,Le,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<g(e.length,s.length);t++)this.isClip(s[t])||(s[t]=this.control.addClip(new ke(i)));for(;s.length<e.length;)s.push(this.control.addClip(new ke(i)));for(;s.length>e.length;)s.pop().remove()}else r&&(r.freeAll(),s.forEach(t=>t.remove()),s.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,i){super._layoutMarkers(t,e,i);const s=this._inverted,r=this.model._yAxisObj,n=s?e:i,o=s?0:i,a=this._polar;for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.isNull)i.yLow=NaN;else if(a&&!isNaN(i.angle)){const t=ss(a,r,i.yGroup-i.yValue),e=i.angle;i.yLow=a.cy+t*u(e)}else i.yLow=o-r.getPos(n,i.yGroup-i.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;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,s=this.height,r=e.chart.isInverted(),n=this._needBelow?this._lowArea:void 0,o=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach((t,n)=>{const a=e._runRanges[n];t.setBoolData("simple",this._simpleMode),t.setPath(o),t.internalClearStyleAndClass(),t.setFill(a.color),this._setFill(t,a.style),a.areaStyle&&t.internalSetStyleOrClass(a.areaStyle),t.setClip(this._rangeAreaClips[n]),this._clipRange(i,s,e._runRangeValue,a,this._rangeAreaClips[n],r)}):(t.setPath(o),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Vt,e._runColor),this._setFill(t,e.prop("style")),e.prop("areaStyle")&&t.internalSetStyleOrClass(e.prop("areaStyle"))),n&&(n.setBoolData("simple",this._simpleMode),n.setPath(o),n.internalClearStyleAndClass(),e._runColor&&n.internalSetStyle(Vt,e._runColor),e.prop("areaStyle")&&n.internalSetStyleOrClass(e.prop("areaStyle")),this._setFill(n,e.prop("belowStyle")),e.prop("belowAreaStyle")&&n.internalSetStyleOrClass(e.prop("belowAreaStyle")))}setCircular(t){this._circular=t}$_layoutPolar(t,e,i){const s=this.model,r=s._group,n=s._xAxisObj,o=s._yAxisObj,a=this._yReversed,h=o instanceof Xr?s.getBaseValue(o):NaN,l=this._polar,{cx:c,cy:_,rd:p,rdInner:m,cyclic:y}=l,x=new be,v=i.length;if(!r||"stack"!==r.prop("layout")&&"fill"!==r.prop("layout")){const r=h>o.axisMin(),w=r?ss(l,o,h):a?0:m,S=s.chart._body.prop("circular");let V,C,P,A,k=!1,L=!1;if("spline"===s.prop("lineType"))this._drawCurves(this._polar,s.buildLines(i),x);else{y?x.move(i[0].xPos,i[0].yPos):(V=c+w*d(i[0].angle),C=_+w*u(i[0].angle),x.move(V,C),x.line(i[0].xPos,i[0].yPos));for(let t=1;t<v;t++)x.line(i[t].xPos,i[t].yPos);y||(V=c+w*d(i[v-1].angle),C=_+w*u(i[v-1].angle),x.line(V,C))}const T=i.map(t=>t.angle),M=this._polar.min=g(...T),N=this._polar.max=f(...T),E=(new be).push(x.end());if(r)y?x.circle(c,_,w):a&&x.push(...fs.arc(c,_,w,w,M,N,!0)),P=x.end(),k=!0,y?E.circle(c,_,w):E.push(...fs.arc(c,_,w,w,M,N,!0)),A=E.end(),L=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),i=n._ticks;x.push("Z"),y?S?x.circle(c,_,p):x.polygon(...i.map(i=>({x:c+d(t+i.pos/p*e/b)*p,y:_+u(t+i.pos/p*e/b)*p}))):S?x.push(...fs.sector(c,_,p,p,0,M,N,!0)):x.polygon({x:c,y:_},...i.map(i=>({x:c+d(t+i.pos/p*e/b)*p,y:_+u(t+i.pos/p*e/b)*p}),{x:c,y:_})),m>0&&x.circle(c,_,m),P=x.end(!0),k=!0}else P=x.end();t.setPath(P),t.setAttr("fill-rule",k?"evenodd":""),e&&(e.setPath(A||""),e.setAttr("fill-rule",L?"evenodd":""))}else{const e=t=>{if(isNaN(t.angle))return{x:t.xPos,y:t.yLow};const e=ss(l,o,t.yGroup-t.yValue);return{x:c+e*d(t.angle),y:_+e*u(t.angle)}},s=e(i[0]);x.move(P(s.x,c),P(s.y,_)),x.line(P(i[0].xPos,c),P(i[0].yPos,_));for(let t=1;t<i.length;t++)x.line(P(i[t].xPos,c),P(i[t].yPos,_));const r=e(i[i.length-1]);x.line(P(r.x,c),P(r.y,_));for(let t=i.length-1;t>=0;t--){const s=e(i[t]);x.line(P(s.x,c),P(s.y,_))}t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),re.setImportantStyle(t.dom.style,Ct,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(s._runColor),e.addStyleOrClass(s._style),e.internalSetStyleOrClass(s.prop("belowStyle")),s.prop("belowAreaStyle")&&e.internalSetStyleOrClass(s.prop("belowAreaStyle")),re.setImportantStyle(e.dom.style,Ct,"none")),s._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new Te(this.doc)));const t=m>0?m/p:0,e=fs.sector(c,_,p,p,t,l.start,l.start+l.total,!0);this._arcClip.setPath(e),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class _h extends qa{constructor(t){super(t,"rct-barrange-series"),this._bars=new rh(this._pointContainer,Ya)}_getPointPool(){return this._bars}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*P(t.point.width,1),t.hPoint=n,t.layout(i,s+n,this._rd,this._rd,0,0,this._inverted)}}class dh extends En{constructor(t){super(t,Fa.POINT_CLASS)}savePrevs(){}}class uh extends Za{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,i,s){this._polar=i,super._prepareSeries(t,e,i,s)}_preparePoints(t,e,i,s){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,s)}_setPointStyle(t,e,i){super._setPointStyle(t,e,i),i.yValue<e.getBaseValue(e._yAxisObj)&&e.prop("belowStyle")&&t.addStyleOrClass(e.prop("belowStyle"))}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,i,s){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(s!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=s))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_parepareSectors(t,e,i){this._sectors||(this._sectors=new rh(this._pointContainer,dh)),this._sectors.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),i=t.pointLabel,s=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.prop("reversed"),h=2*n.unitPad(),l=r.getPolar(n),{cx:c,cy:_,rd:p,rdInner:f}=l,m=o instanceof Xr?t.getBaseValue(o):NaN,y=m>o.axisMin(),b=ss(l,o,m),x=this._pointOff,v=n.getTotalAngle();let w,S,V,C,P;s&&(w=this._labelInfo,S=t.getLabelPos(i),V=t.getLabelOff(i.getOffset()),C=this._labelContainer._textAlign),this._sectors.forEach((i,r)=>{const A=i.point;if(i.setVis(!A.isNull)){const r=rs(l,o,A.yGroup,e),k=n.getUnitLen(v,A.xValue)*(1-h),L=t.getPointWidth(k,0);let T,M,N=l.start+n.getPos(v,A.xValue)-k/2;N+=L*x,N+=t.getPointPos(k)+L/2;const E=ss(l,o,A.yGroup);if(a?y?(T=b+(E-b)*e,M=b):(T=p,M=r):y?(T=b+(E-b)*e,M=b):(T=r,M=f),i.setSector({cx:c,cy:_,rx:T,ry:T,innerRadius:T>0?M/T:0,start:N-L/2,angle:L,clockwise:!0}),N=i.start+i.angle/2,A.xPos=c+i.rx*d(N),A.yPos=_+i.ry*u(N),s&&(P=w.labelView=s.get(A,0))){P.layout(C),V=t.getLabelOff2(A);const{width:e,height:s}=P.getBBox(),r=i.ry,n=M;let o,h;o=a?y?A.yValue<m?"outside"===S?r+s/2+V:"head"===S?r-s/2-V:"foot"===S?b+s/2+V:r-(r-b)/2+V:"outside"===S?r-s/2-V:"head"===S?g(b,r+s/2+V):"foot"===S?b-s/2-V:b-(b-r)/2-V:"outside"===S?n-s/2-V:"head"===S?g(r,n+s/2+V):"foot"===S?r-s/2-V:r-(r-n)/2-V:y?A.yValue<m?"outside"===S?r-s/2-V:"head"===S?r+s/2+V:"foot"===S?b-s/2-V:b-(b-r)/2-V:"outside"===S?r+s/2+V:"head"===S?r-s/2-V:"foot"===S?b+s/2+V:r-(r-b)/2+V:"outside"===S?r+s/2+V:"head"===S?r-s/2-V:.7*r+V,h=_+o*u(N),o=c+o*d(N),"outside"!==S&&P.setContrast(i.dom),this.applyAutoRotation(P,N,l.total),P.trans(o-e/2,h-s/2)}}})}}class ph extends uh{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new rh(t,Wa):new rh(t,Ya)}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._rdTop=+e.prop("topRadius")||0,this._rdBottom=+e.prop("bottomRadius")||0}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*P(t.point.width,1),t.hPoint=n,t.layout(i,s,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof Ya){const e=this.model._xAxisObj;t.shrink(e.prop("reversed"),e._vlen,this._rdTop,this._rdBottom)}}}class gh extends ch{constructor(t){super(t,"rct-bellcurve-series")}}class fh extends Xa{constructor(t){super(t,Fa.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const i=this.point,s=i.yValue-i.minValue,r=t/2;const n=0+e-e*(i.lowValue-i.minValue)/s,o=0+e-e*(i.highValue-i.minValue)/s,a=e*(i.highValue-i.lowValue)/s;i.color&&this._box.setFill(i.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*(i.midValue-i.minValue)/s,0,t)}_doInitChildren(t){this.add(this._stemUp=new dn(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new dn(t,"rct-boxplot-point-stem")),this.add(this._box=new ms(t,"rct-boxplot-point-box")),this.add(this._mid=new dn(t,"rct-boxplot-point-mid")),this.add(this._min=new dn(t,"rct-boxplot-point-min")),this.add(this._max=new dn(t,"rct-boxplot-point-max"))}}class mh extends qa{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new rh(this._pointContainer,fh)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,i){this._boxes.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class yh extends Ka{}class bh extends Qa{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new Ce(t,"rct-bubble-pie"))}_createMarkers(t){return new rh(t,yh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&xa.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,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_preparePie(t,e,i){const s=e.pie,r=s&&s.visible&&s.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;i.forEach(t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)}),this._pieSectors||(this._pieSectors=new Fo(this._pieContainer,En,Fa.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();s.getLegendSources().forEach(e=>{e.legendMarker()||e.setLegendMarker(ms.create(t,Fa.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 i;const s=this.model,r=this._inverted,n=s.needClip(!1),o=this._getGrowRate(),a=+s.prop("rotation")||0,h=s.pointLabel.prop("position"),l=this._labelContainer._textAlign,c=this._labelViews(),_=s._xAxisObj,p=s._yAxisObj,g=this._polar=s.chart._body.getPolar(_),f=r?t:e,m=r?e:t,y=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:b,max:x}=s.getPixelMinMax(y),v=r?0:e,w=fs.getDrawer(s.prop("shape")),S=s.pie,V=S&&S.visible&&S.fields.length>0;let C,A=0;null===(i=this._markers.getOrphans())||void 0===i||i.forEach(t=>{t.setPath(w(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))}),this._markers.forEach((i,y)=>{var k,L;const T=i.point,M=c&&(C=c.get(T,0));if(i.setVis(!T.isNull&&!isNaN(T.zValue))){const c=i._radius=s.getRadius(T.zValue,b,x),y=c*o*P(T._vr,1);let L,N;if(g){const t=g.start+_.getPos(m,T.xValue),e=ss(g,p,T.yValue);L=g.cx+e*d(t),N=g.cy+e*u(t)}else L=_.getPos(m,T.xValue),N=v-p.getPos(f,T.yValue),r&&(L=p.getPos(f,T.yValue),N=e-_.getPos(m,T.xValue));T.xPos=L,T.yPos=N;const E=!n||L>=0&&L<=t&&N>=0&&N<=e;if(V&&T.pieSlices)if(i.setVis(!1),E)S.resolveSliceColors(T.pieSlices),A=this.$_renderPieSectors(T,T.pieSlices,A,L,N,y,S.getInnerRadius(y),S.clockwise);else for(let t=0;t<T.pieSlices.length;t++)null===(k=this._pieSectors.get(A++))||void 0===k||k.setVis(!1);else i.setVis(E)&&i.setPath(w(y)).trans(L,N).rotate(a);E&&M?(C.setContrast(V&&T.pieSlices?null:i.dom),C.layout(l),this._layoutLabelView(C,h,s.getLabelOff2(T),c,L,N)):M&&M.setVis(!1)}else{if(V&&T.pieSlices)for(let t=0;t<T.pieSlices.length;t++)null===(L=this._pieSectors.get(A++))||void 0===L||L.setVis(!1);M&&M.setVis(!1)}})}$_renderPieSectors(t,e,i,s,r,n,o,a){let h=i;for(const i of e){const e=this._pieSectors.get(h++);if(e){const h={cx:s,cy:r,rx:n,ry:n,innerRadius:o,start:i.startAngle,angle:m(i.angle),clockwise:a};if(e.setSector(h),e.setFill(i.color),e.setVis(!0),this._sectorMap){const a=i.startAngle+i.angle/2,h=(n+o)/2,l=s+h*d(a),c=r+h*u(a),_={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:c}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:i,pv:_})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;const i=this._markers._internalItems();if(i&&i.length>0){const s=i.reduce((i,s)=>i.distance(i._radius,t,e)<s.distance(s._radius,t,e)?i:s);return{pv:s,dist:s.distance(s._radius,t,e)}}}canHover(t,e,i){return t<=e._radius+i}}let xh=class extends Xa{constructor(t){super(t,Fa.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue;const r=0+e-e*(0===s?1:(g(i.openValue,i.closeValue)-i.lowValue)/s),n=0+e-e*(0===s?1:(f(i.openValue,i.closeValue)-i.lowValue)/s),o=g(n,r),a=f(1,m(r-n)),h=i.close<i.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 dn(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new dn(t,"rct-candlestick-point-wick")),this.add(this._body=new ms(t))}};class vh extends qa{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new rh(this._pointContainer,xh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._sticks.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}}class wh extends za{layout(t,e,i){const s=new be;s.circle(t,e,i),this.setPath(s.end())}}class Sh extends uh{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new rh(t,wh)}_layoutPoint(t,e,i,s,r,n){t.layout(i,s-n/2,n/2-1)}}let Vh=class extends Xa{constructor(t){super(t,Fa.POINT_CLASS),this.add(this._line=new dn(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Le(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Le(t,"rct-dumbbell-point-marker"))}layout(t,e,i,s){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=i/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let c=t.getMarkerStyle(o);c&&r.internalSetStyleOrClass(c),c=e.getMarkerStyle(o),c&&n.internalSetStyleOrClass(c),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,s),fs.setShape(r,o.shape,a,a),fs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,s-a)}};class Ch extends qa{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new rh(this._pointContainer,Vh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),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 Ph=class extends Ho{constructor(t){super(t,Fa.POINT_CLASS),this._segments=new Fo(this,Le),this._decimal=0,this.add(this._back=new Le(t)),this._back.setTransparent(!0)}prepareSegments(t,e,i,s){this._decimal=i,this._segments.prepare(Math.round(e)).forEach((t,e)=>{})}layout(t,e,i){const s=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=s/2,r<0&&(t=t.map(t=>-t)),this._back.setPath(fs.rectangle(e,i,s,-r)),this._segments.forEach((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(fs.rectangle(e,i-t[2*a],s,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(fs.rectangle(e,i-t[2*a],s,n(-1,t[2*a]-t[2*a+1])))})}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class Ah extends Za{constructor(t){super(t,"rct-equalizer-series"),this._bars=new rh(this._pointContainer,Ph)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(e,i)}_shrinkPoint(t){}_layoutPoints(t,e){const i=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,i),super._layoutPoints(t,e)}_layoutPoint(t,e,i,s,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(i=t.xSave+(i-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,i,s)}$_parepareBars(t,e){this._bars.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_buildSegments(t,e){const i=t._yAxisObj.axisMax(),s=t.prop("segmented"),r=t.num("segmentGap"),n=this._pts=[];let o,a,h=0;const l=t._yAxisObj,c=l.axisMin(),_=t.getBaseValue(l)||0,d=l.getPos(l.prop("reversed")?0:e,_);for(a=t.prop("maxCount")>0?t.prop("maxCount"):Math.round(e/(t.getSegmentSize(e)+r/2)),o=(e-r*(a-1))/a;n.length<2*a;)n.push(h,h+o),h+=o+r;n[n.length-1]=e;const u=n.length/2;this._bars.forEach(r=>{const a=r.point;if(r.setVis(!a.isNull)){const h=a.yValue>=_?(e-d)/e*(a.yValue-_)/(i-_):d/e*(_-a.yValue)/(_-c);let l=-1,p=0;for(let t=0;t<u-1;t++)if(h>=n[2*t]/e&&h<n[2*(t+1)]/e){l=t+1,p=!s&&h<n[2*t+1]/e?h*e-n[2*t]:o;break}l<0&&(l=u,p=o),0===h&&(l=0),r.prepareSegments(u,l,p,t.prop("backStyle"))}})}}let kh=class extends Xa{constructor(t){super(t,Fa.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new dn(t)),this.add(this._whiskerUp=new dn(t)),this.add(this._whiskerDown=new dn(t)),this.add(this._back=new ms(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const i=t/2;this.x=this.tx+i,this._stem.setVLine(i,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Lh extends qa{constructor(t){super(t,"rct-errorbar-series"),this._bars=new rh(this._pointContainer,kh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class Th extends za{}class Mh extends th{constructor(t){super(t,"rct-funnel-series"),this._segments=new rh(this._pointContainer,Th),this.add(this._lineContainer=new Ea(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&&xa.reveal(this,{from:this.model.prop("reversed")?"bottom":"top"})}_refreshZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,i){this._segments.prepare(i.length,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcRates(t){const e=this._zombie,i=this._zombieRate,s=t.length;let r=0,n=0;if(t.forEach(t=>{r+=t.yValue*(t===e?i:t._isDeleted()?t._vr:1)}),s>1||s>0&&!e)if(1==s&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===s&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<s-1;o++){const s=t[o],a=mt(s.yValue*(s===e?i:s._isDeleted()?s._vr:1)/r)||0;s.yRate=100*a,s.yPos=n,s.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==s){const e=t[0],s=mt(i);n=1-s,e.yRate=100*s,e.yPos=n,e.height=s,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const i=function(t){return _?y+(S-y)*(x-t)/(x-V):y+(S-y)*(t-b)/(V-b)},s=this.model,r=this._labelViews(),n=s.pointLabel,o="inside"===s.getLabelPos(n),a=n.getDistance(),h=n.getWidgetAlign(),l=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,_=s.prop("reversed"),d=n.prop("opposite"),u=s.getSize(t,e),p=s.getNeckSize(u.width,u.height),g=new be,f=s.getCenter(t,e),y=f.x-u.width/2,b=f.y-u.height/2,x=b+u.height,v=y+u.width/2,w=u.height-p.height,S=y+(u.width-p.width)/2,V=_?x-w:b+w,C=[],P=new be,A=(null==r?void 0:r.getWidth(0))||0;let k,L;this._lineContainer.setStyleOrClass(n.connector.prop("style")),this._segments.forEach(n=>{const f=n.point;if(n.setVis(!f.isNull)){const y=f.yPos*u.height,T=(f.yPos+f.height)*u.height,M=_?x-y:b+y,N=_?x-T:b+T,E=T<w;let B,O,D,$;if(L=null==c?void 0:c.get(f),y>=w?(B=S,O=B+p.width,g.move(B,M).lines(O,M,O,N,B,N),n.ny=n.nx1=NaN):E?(B=i(M),O=B+2*(v-B),D=i(N),$=D+2*(v-D),g.move(B,M).lines(O,M,$,N,D,N),n.ny=NaN,n.nx1=D-B,n.nx2=$-B):(B=i(M),O=B+2*(v-B),D=S,$=D+p.width,g.move(B,M).lines(O,M,$,V,$,N,D,N,D,V),n.nx1=D-B,n.nx2=$-B,n.ny=m(V-M),n.nx3=D,n.nx4=$),n.setPath(g.close(!0)),f.xPos=v,f.yPos=M+(N-M)/2,r&&(k=r.get(f,0))&&k.visible){const i=s.getLabelOff2(f);if(o){null==L||L.setVis(!1);const t=k.isDomAnimating(),e=k.getBBox(),s=E?(O-B+($-D))/2:p.width;switch(!t&&k.layout(l||"center"),h){case-1:k.trans(f.xPos-s/2+i,f.yPos-e.height/2);break;case 1:k.trans(f.xPos+s/2-e.width-i,f.yPos-e.height/2);break;default:k.trans(f.xPos-e.width/2,f.yPos-e.height/2)}}else-1===h?this.$_layoutLabelAligned(!1,f,n,k,l,d,L,P,u,v,i,a):1==h?this.$_layoutLabelEnded(!1,f,n,k,l,d,L,P,v,i,a,A,t,e):this.$_layoutLabelOutside(!1,f,n,k,l,d,L,P,v,i,a);k.setContrast(o&&n.dom),C.push(k),k.setPosY(k.ty),this._layoutLabelRotation(k)}else L&&L.setVis(!1)}});const T=n.prop("convergent"),M=n.prop("dedupeMode"),N=n.prop("overflow");r&&(o||0===h?"preserveOrder"!==M&&"largestFirst"!==M||r.dedupe(C,c,M):(null==r?void 0:r.arrangeVertical(this,C,c,e,T,M,N))&&this._segments.forEach(i=>{const n=i.point;if(!n.isNull&&(k=r.get(n,0),L=null==c?void 0:c.get(n),null==k?void 0:k.visible)){const r=s.getLabelOff2(n);-1===h?this.$_layoutLabelAligned(!0,n,i,k,l,d,L,P,u,v,r,a):1==h?this.$_layoutLabelEnded(!0,n,i,k,l,d,L,P,v,r,a,A,t,e):this.$_layoutLabelOutside(!0,n,i,k,l,d,L,P,v,r,a)}}))}$_calcX(t,e,i,s){const r=e.getBBox(),n=s?-1:1,o=r.height;let a=i+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=s?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,i,s,r,n,o,a,h,l,c,_){const d=s.isDomAnimating(),u=t?s.getBBoxEx():s.getBBox(),p=e.yPos;!t&&!d&&s.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,i,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-_,e).end()):o.setLine(a.reset(0,0).line(f+_-g,e).end()),o.trans(g,p)}t||(n?f-=c+_+u.width:f+=_+c,s.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,i,s,r,n,o,a,h,l,c,_,d,u){const p=s.isDomAnimating(),g=t?s.getBBoxEx():s.getBBox(),f=e.yPos;!t&&!p&&s.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,i,h,n);let y;if(y=n?c+l+_:d-c-_-l,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(y-m-c,e).end()):o.setLine(a.reset(0,0).line(y+c-m,e).end()),o.trans(m,f)}t||(n?y-=l+c+g.width:y+=c+l,s.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,i,s,r,n,o,a,h,l,c){const _=s.isDomAnimating(),d=t?s.getBBoxEx():s.getBBox(),u=e.yPos;!t&&!_&&s.layout(r||(n?"right":"left"));let p=this.$_calcX(e,i,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-c,e).end()):o.setLine(a.reset(0,0).line(c,e).end()),o.trans(p,u)}t||(n?p-=c+l+d.width:p+=c+l,s.trans(p,u-d.height/2))}}let Nh=class extends Ha{layout(t,e){this.setPath(fs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Eh extends Ua{constructor(t){super(t,"rct-histogram-series"),this._bars=new rh(this._pointContainer,Nh)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){t.wPoint=r,t.hPoint=n,t.layout(i,s)}_layoutPoints(t,e){const i=this.model,s=this._inverted,r=this._getGrowRate(),n=i.pointLabel,o=this._labelViews(),a=i._xAxisObj,h=i._yAxisObj,c=s?t:e,_=s?e:t,d=h.getPos(c,i.getBaseValue(h)),u=s?0:e,p=o&&l(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(n),labelOff:i.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach((l,g)=>{const f=l.point,m=a.getPos(_,f.min),y=a.getPos(_,f.max),b=h.getPos(c,f.yValue),x=y-m+(y>m?-1:1),v=b-d;let w=m+(y-m)/2,S=u;f.xPos=w,f.yPos=S-=b,this._layoutPoint(l,g,w,S+v,x,v*r),p&&(p.labelView=o.get(f,0))&&(s&&(S=_-w,w=u,f.yPos=S,f.xPos=w+=h.getPos(c,f.yGroup)),p.pointView=l,p.x=w,p.y=S,p.wPoint=x,p.hPoint=v,p.labelOff=i.getLabelOff2(f),this._layoutLabel(n,p,t,e))})}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutBars(t,e){const i=this.model._xAxisObj,s=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach((o,a)=>{const h=o.point,l=i.getPos(t,h.min),c=i.getPos(t,h.max),_=l+(c-l)/2,d=s.getPos(e,o.point.yValue)*n,u=f(1,c-l-1);h.xPos=_,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(_,r)})}}class Bh extends Ho{constructor(t){super(t,Fa.POINT_CLASS),this.add(this._line=new dn(t,"rct-lollipop-point-bar")),this.add(this._marker=new Le(t,"rct-lollipop-point-marker"))}layout(t){var e;const i=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),fs.setShape(this._marker,this.point.shape,i,i),this._marker.trans(-i,-i)}savePrevs(){this.xSave=this.tx}}class Oh extends Za{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_shrinkPoint(t){}_layoutPoint(t,e,i,s,r,n){t.trans(i,s-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,i){const s=e.marker,r=s._style;s.prop("styleCallback"),this._bars||(this._bars=new rh(this._pointContainer,Bh)),this._bars.prepare(i.length,(t,n)=>{const o=t.point=i[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=s.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)})}}class Dh extends Xa{constructor(t){super(t,Fa.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue,r=-t/2;const n=0+e-e*(g(i.openValue,i.closeValue)-i.lowValue)/s,o=0+e-e*(f(i.openValue,i.closeValue)-i.lowValue)/s,a=i.close<i.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 dn(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new dn(t,"rct-ohlc-point-tick")),this.add(this._bar=new dn(t)),this.add(this._back=new ms(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class $h extends qa{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new rh(this._pointContainer,Dh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this.$_prepareSticks(e,i)}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}$_prepareSticks(t,e){this._sticks.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}}class Rh extends ah{constructor(t){super(t,"rct-pareto-series")}}class Ih extends Le{setOff(t){return this.off=m(t),this}}class Fh extends En{constructor(t){super(t,Fa.POINT_CLASS)}render(t,e,i){this._assignShape(i,!1)}}class zh extends Se{constructor(t){super(t,Fa.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new En(t))}setSides(t,e,i,s,r){const n=this.point,o=mt(y),a=mt(((t?n.startAngle:n.startAngle+n.angle)+y/2+b)%b),h=mt(a+(t?n.angle:-n.angle)-1e-4+b)%b,l=o-(a+m(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=i.setOff(o-h),a<=y/2&&!(h>=a&&h<y/2)||h>=3*y/2&&!(a<h&&a>3*y/2)?(this._outArcView=s.setOff(g(e.off,i.off)),this._inArcView=r.setOff(1/0)):a>=3*y/2&&h<=y/2?(this._outArcView=s.setOff(1/0),this._inArcView=r.setOff(l)):a>=y/2&&h<=3*y/2?(this._outArcView=s.setOff(g(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=s.setOff(l),a>=0&&a<=y&&this._outArcView.setOff(g(this._outArcView.off,this._side1View.off)),h>=y&&h<b&&this._outArcView.setOff(g(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,i){const s=fs.isCircled(i.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=i.innerRadius>0,o=i.depth,a=this._outPath,h=this._inPath,l=i.clockwise?i.angle:-i.angle;st&&(r=this.control.getIEColor(r)),this._outArcView.setPath(fs.arc3d(i.cx,i.cy,i.rx,i.ry,o,i.start,i.start+l,i.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(fs.arc3dInner(i.cx,i.cy,i.rx*i.innerRadius,i.ry*i.innerRadius,o,i.start,i.start+l,i.clockwise,h)),this._side1View.setVis(!s),this._side2View.setVis(!s),this._side1View.visible&&(n?(this._side1View.setPath(fs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(fs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(fs.polygon(i.cx,i.cy,a.x1,a.y1,a.x1,a.y1+o,i.cx,i.cy+o)),this._side2View.setPath(fs.polygon(i.cx,i.cy,a.x2,a.y2,a.x2,a.y2+o,i.cx,i.cy+o)))),this._sectorView._assignShape(i,!1),this._side1View.setStyle("fill",se.interpolate("#000",r,.2)),this._side2View.setStyle("fill",se.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",se.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",se.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Fa.DATA_FOCUS,t),this._side2View.setBoolData(Fa.DATA_FOCUS,t),this._inArcView.setBoolData(Fa.DATA_FOCUS,t),this._outArcView.setBoolData(Fa.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,i,s){return this._side1View.transEx(t,e,i,s),this._side2View.transEx(t,e,i,s),this._inArcView.transEx(t,e,i,s),this._outArcView.transEx(t,e,i,s),super.transEx(t,e,i,s)}}class Hh extends th{constructor(e){super(e,"rct-pie-series"),this._deep=!1,this._pb=new be,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 ra(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Uo(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new Ce(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Ea(e))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const i=e.innerText,s=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.prop("ratio"):1,this.setBoolData("deep",s),this.$_prepareSectors(t,e,this._visPoints,s),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&i.visible)&&(this._textView.setModel(t,i,i.getIconUrl(),null),i.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 i=this.model,s=i._group,r=Math.floor(s.getPolarSize(t,e)/2),n=s.getInnerRadius(r)*r,o=r-n;this._rx=n+(i._groupPos+i._groupSize)*o,this._rxInner=(n+i._groupPos*o)/this._rx}_runShowEffect(t){t&&xa.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.prop("autoSlice"),!1))})}_doPointClicked(t){if((t instanceof Fh||t instanceof zh)&&this.model.prop("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 zh&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,i,s){const r=i.length;let n=this._sides;s!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(s?(this._sectors=new rh(this._pointContainer,zh,null),n=this._sides=new Fo(this._sideContainer,Ih,"rct-pie-series-side")):this._sectors=new rh(this._pointContainer,Fh,null)),this._deep=s,n&&n.prepare(4*r,(t,e)=>t.index=e),this._sectors.prepare(r,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcAngles(t){const e=this._zombie,i=this._zombieRate,s=t.length,r=this._model.prop("clockwise")?1:-1,n=t.filter(t=>(t.visible||t===e)&&!t.isNull).map(t=>t.yValue*(t===e?i:t._isDeleted()?t._vr:1)).reduce((t,e)=>t+e,0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%b;if(s>1||s>0&&!e)t.forEach(t=>{1===s&&t._isDeleted()||1===s&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=mt(t.yValue*(t===e?i:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)});else if(1==s){const e=t[0];e.startAngle=a,e.angle=r*i*o,e.yRate=100}}$_layoutSectors(t,e,i){const s=this.model,r=s.prop("clockwise"),n=this._getGrowRate(),o=s.getCenter(e,i),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,c=this._rxInner,_=this._depth,p=this._ratio,g=this._sides,f=s.pointLabel,y=f.connector.prop("curved"),b=this._labelViews(),x="inside"===s.getLabelPos(f),v=P(f.prop("radius"),.7),w=this._pb,S=f.getDistance(x,l,c),V=f.getWidgetAlign();let C=null==b?void 0:b.textAlign();const A=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,k=this._slicedOff=s.getSliceOffset(l)*n,L=[],T=[],M=[],N=(null==b?void 0:b.getWidth(0))||0,E=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(f.connector.prop("style")),!b||C||V||(C="center"),this._textView.visible){this._textView.layout("center"),this._textView.setContrast(null);const t=this._textView.getLayoutBox();this._textView.trans(a-t.x-t.width/2,h-t.y-t.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(O=null==A?void 0:A.get(f),f.isNull)t.setVis(!1),b&&(B=b.get(f,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=E>1&&f.sliced,g=f.startAngle,P=g+f.angle/2;let A=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(A+=d(P)*k,D+=u(P)*k),t.trans(A,D).setVis(!0),f.xPos=a+d(P)*(k+l*v),f.yPos=h+u(P)*(k+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:c,start:g,angle:m(f.angle),clockwise:r,depth:_}),b&&(B=b.get(f,0))){const r=s.getLabelOff2(f);let n;x?(null==O||O.setVis(!1),this.$_layoutLabelInside(f,B,C,r,S,o?k:0)):(n=-1===V?this.$_layoutLabelAligned(!1,f,B,C,O,w,y,r,S,o?k:0):1==V?this.$_layoutLabelEnded(!1,f,B,C,O,w,y,r,S,o?k:0,N,e,i):this.$_layoutLabelOutside(!1,f,B,C,O,w,y,r,S,o?k:0),n?L.push(B):T.push(B),this._layoutLabelRotation(B)),B.setContrast(x&&t.dom).setVis(!0),M.push(B)}else null==O||O.setVis(!1)}}),g&&g.sortDom((t,e)=>{let i=e.off-t.off;return 0===i&&(i=t.index-e.index),i});const D=f.prop("convergent"),$=f.prop("dedupeMode"),R=f.prop("overflow");b&&(x||0===V?"preserveOrder"!==$&&"largestFirst"!==$||b.dedupe(M,A,$):b.arrangeVertical(this,L,A,i,D,$,R)+b.arrangeVertical(this,T,A,i,D,$,R)>0&&this._sectors.forEach(t=>{const r=t.point;if(!r.isNull){const t=E>1&&r.sliced,n=s.getLabelOff2(r);B=b.get(r,0),O=null==A?void 0:A.get(r),(null==B?void 0:B.visible)&&(-1===V?this.$_layoutLabelAligned(!0,r,B,C,O,w,y,n,S,t?k:0):1==V?this.$_layoutLabelEnded(!0,r,B,C,O,w,y,n,S,t?k:0,N,e,i):this.$_layoutLabelOutside(!0,r,B,C,O,w,y,n,S,t?k:0))}}))}$_layoutLabelAligned(t,e,i,s,r,n,o,a,h,l){const c=i.isDomAnimating(),_=e.startAngle+e.angle/2,p=this._cx,g=this._cy,f=this._rx,m=this._ry,y=f+l,b=m+l,x=p+d(_)*y,v=g+u(_)*b,w=x<p;!t&&!c&&i.layout(s||(w?"right":"left"));const S=i.getBBox(),V=v-S.height/2;let C,P,A,k=g+u(_)*m;if(w?(C=p+d(Math.PI)*f-h,P=C-S.width-a,A=p+d(Math.PI)*y-h,S.width):(C=p+d(0)*f+h,P=C+a,A=p+d(0)*y+h),r&&r.setVis(y>0)){const e=t?i.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(x-C),e,x-C,0).end()):r.setLine(n.reset(0,e).line(x-C,0).end()),r.setPos(C,k),!c&&r.trans(C,v)}return t||(i.setPos(P,k-S.height/2),!c&&i.trans(P,k-S.height/2)),w}$_layoutLabelEnded(t,e,i,s,r,n,o,a,h,l,c,_,p){const g=i.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,y=this._cy,b=this._rx,x=this._ry,v=b+l,w=x+l;let S=m+d(f)*v,V=y+u(f)*w;const C=S<m;!t&&!g&&i.layout(s||(C?"right":"left"));const P=i.getBBox(),A=V-P.height/2;let k,L,T,M=y+u(f)*x;if(C?(k=h+c+a,T=h+c-P.width,L=k):(k=_-h-c-a,T=_-h-c,L=k),r&&r.setVis(v>0)){const e=t?i.ty-A: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(k,M),!g&&r.trans(L,V)}return t||(i.setPos(T,M-P.height/2),!g&&i.trans(T,M-P.height/2)),C}$_layoutLabelOutside(t,e,i,s,r,n,o,a,h,l){const c=i.isDomAnimating();!t&&!c&&i.layout(s);const _=i.getBBox(),p=e.startAngle+e.angle/2,g=this._cx,f=this._cy,m=this._rx+.5*h,y=this._ry+.5*h,b=d(p)*l,x=u(p)*l,v=g+d(p)*this._rx,w=f+u(p)*this._ry,S=g+d(p)*m;let V=f+u(p)*y;const C=S<g;let P,A;return C?(P=S-.2*h,A=P):(P=S+.2*h,A=P),r&&r.setVis(m>0)&&(o?r.setLine(n.reset(0,0).quad(S-v,V-w,P-v,V-w).end()):r.setLine(n.reset(0,0).lines(S-v,V-w,P-v,V-w).end()),r.setPos(v,w),!c&&r.trans(v+b,w+x)),t||(C?A-=_.width+a:A+=a,V-=_.height/2,i.setPos(A,V),!c&&i.trans(A+b,V+x)),C}$_layoutLabelInside(t,e,i,s,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.prop("autoRotation"),c=h.prop("rotationMode"),_=a.prop("clockwise");!o&&e.layout(i||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,i=g(a.prop("totalAngle")||360,360);if("angle"===c){let s=p/t*i+90,r=(s+a.prop("startAngle"))%360;r+=_?0:360,s+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,s)}else this.applyAutoRotation(e,p,t,i)}else this._layoutLabelRotation(e);const f=h.prop("align")===Ss?.3:h.prop("align")===ws?.5:.7,m=u>0?u+(this._rx-u)/2:l?"angle"===c?this._rx*f+s:.8*this._rx+s:.7*this._rx+s,y=this._deep?m*this._ratio:m,b=Math.cos(p),x=Math.sin(p);let v=this._cx+b*m,w=this._cy+x*y;e.move(v-d.width/2,w-d.height/2),v=this._cx+b*(n+m),w=this._cy+x*(n+y),e.trans(v-d.width/2,w-d.height/2)}$_slice(t,e,i){if(e&&this._sectors.count<2)return;const s=this.model,r=this._labelViews(),n=s.pointLabel.getWidgetAlign(),o=this._slicedOff,a=s.prop("autoSlice")?s.prop("sliceDuration"):0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(d(l)*o,u(l)*o,a):t.transEx(0,0,a),!r)return;const c=s.pointLabel,_=this._lineContainer,p=c.connector.prop("curved"),g="inside"===s.getLabelPos(c),f=r.get(h,0),m=s.pointLabel.getDistance(g,this._rx,this._rxInner);if(f){const t=!g&&_.get(h);if(i){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,f,e,s.getLabelOff2(h),m,o):0===n&&this.$_layoutLabelOutside(!1,h,f,e,t,this._pb,p,s.getLabelOff2(h),m,o)}if(e){let e=f.tx,i=f.ty,s=t.tx,r=t.ty;(g||0===n)&&(f.trans(f.x,f.y).transEx2(e,i,a),t&&t.trans(t.x,t.y).transEx(s,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 Gh extends Ka{setHoverRate(t,e,i){const s=this.point,r=fs.getDrawer(t.model.getShape(s)),n=(+t.model.prop("hoverScale")||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(i)?1:i)*n):o=t._radius*(1+n-(isNaN(i)?n:n*i)),this.setPath(r(o)),this.trans(s.xPos,s.yPos)}endHover(t,e){delete this._hoverRadius}}class jh extends Qa{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new rh(t,Gh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&xa.grow(this)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const i=this.model,s=this._inverted,r=i.needClip(!1),n=i._xAxisObj,o=i._yAxisObj,a=this._polar=i.chart._body.getPolar(n),h=this._getGrowRate(),l=this._radius=Math.max(0,i.num("radius"))*h,c=i.num("rotation"),_=i.num("jitterX"),p=i.num("jitterY"),g=i.pointLabel.prop("position"),f=this._labelContainer._textAlign,m=this._labelViews(),y=s?t:e,b=a?a.total:s?e:t,x=s?0:e;let v;this._markers.forEach((w,S)=>{const V=w.point,C=m&&(v=m.get(V,0));if(w.setVis(!V.isNull)){const m=fs.getDrawer(i.getShape(V)),S=rt.jitter(V.xValue,_),P=rt.jitter(V.yGroup,p);let A,k;if(a){const t=a.start+n.getPos(b,S),e=rs(a,o,P,h);A=a.cx+e*d(t),k=a.cy+e*u(t)}else A=n.getPos(b,S),k=x-o.getPos(y,P),s&&(A=o.getPos(y,P),k=e-n.getPos(b,S));if(V.xPos=A,V.yPos=k,w.setVis(!!a||!r||A>=0&&A<=t&&k>=0&&k<=e)){const t=w._hoverRadius||l;w.setPath(m(t)),w.trans(A,k).rotate(c),C&&(v.setContrast(w.dom),v.layout(f),this._layoutLabelView(v,g,i.getLabelOff2(V),t,A,k))}else C&&C.setVis(!1)}else C&&C.setVis(!1)})}getNearest(t,e){const i=this._markers._internalItems();if(i&&i.length>0){const s=this.model.prop("radius"),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)}}}canHover(t,e,i){return t<=this.model.prop("radius")+i}}class Yh extends qa{constructor(t){super(t,"rct-waterfall-series"),this._bars=new rh(this._pointContainer,Ya),this.add(this._lineContainer=new Ce(t,"rct-waterfall-series-lines")),this._lines=new Fo(this._lineContainer,dn)}_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,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,s+=n,t.layout(i,s,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?s:s-n:a<0?s-n:s,t.setHLine(h,this._xPrev+this._wPrev/2,i-r/2)}this._xPrev=i,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,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i._isSum&&e.prop("sumColor")?this._setPointColor(t,e.prop("sumColor")):i.y<0&&e.prop("negativeColor")?this._setPointColor(t,e.prop("negativeColor")):i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];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(i.length-1,(t,e)=>{t.visible=!i[e].isNull&&!i[e+1].isNull})}}function Wh(t,e){return new(aa[e._type()])(t)}function Xh(t,e){return new($a[e._viewType()])(t)}Fa.register([Sn,ch],[Pn,lh],[on,ph],[sn,_h],[Tn,gh],[Nn,mh],[zn,bh],[jn,vh],[Wn,Sh],[Kn,Ch],[Jn,Ah],[to,Lh],[ro,Mh],[ao,Eh],[xn,hh],[co,Oh],[uo,$h],[go,Rh],[vo,Hh],[Vo,jh],[Ao,Yh]),ha.register([Ir,sh],[$r,eh],[Rr,ih]);class Uh extends Go{constructor(t){super(t,"rct-axis-grid"),this._lines=new Fo(this,dn),this.add(this._minorLineContainer=new Se(t,"rct-axis-minor-grid")),this._minorLines=new Fo(this._minorLineContainer,dn)}_prepareStyleOrClass(t){}_doMeasure(t,e,i,s,r){return{width:i,height:s}}_doLayout(){const t=this.model,e=t.axis,i=e.prop("reversed"),s=this.width,r=this.height,n=e._isHorz?s:r;if(t instanceof Fr&&e instanceof Wr){const o=t.minorGrid,a=t.visible&&!e.isEmpty()?t.getMinorPositions(e,n):[],h=this._minorLines.prepare(a.length,t=>{t.internalClearStyleAndClass(),t.setClass("rct-axis-minor-grid-line"),t.internalSetStyleOrClass(o._style)});this._minorLineContainer.setVis(a.length>0),this.$_layoutGridLines(h,a,e,i,s,r,()=>!!a.length)}else this._minorLines.prepare(0),this._minorLineContainer.setVis(!1);const o=e.isEmpty()?[]:t.getPositions(e,n),a=this._lines.prepare(o.length,e=>{e.internalClearStyleAndClass(),e.setClass("rct-axis-grid-line"),e.internalSetStyleOrClass(t._style)}),h=a.count-1;a.forEach((t,i)=>{t.setBoolData("first",0===i),t.setBoolData("last",o[i]===(e._isHorz?s:r))});const l=A(t.prop("firstVisible"),t.visible),c=A(t.prop("lastVisible"),t.visible);this.$_layoutGridLines(a,o,e,i,s,r,e=>0===e?l:e===h?c:t.visible)}$_layoutGridLines(t,e,i,s,r,n,o){const a=t.count-1;if(i._isHorz){const h=P(i._prevRate,1);t.forEach((t,l)=>{t.setVis(o(l,a))&&t.setVLine(i.prev(e[l])+(s?r*(1-h):0),0,n)})}else{const h=s?P(i._prevRate,1):1;t.forEach((t,s)=>{t.setVis(o(s,a))&&t.setHLine(n*h-i.prev(e[s]),0,r)})}}}class Zh extends Se{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Le(t)),this._mask.setStroke("none"),this.add(this._upLine=new Le(t)),this._upLine.setFill("none"),this.add(this._downLine=new Le(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,i){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const s=this._model._sect.len,r=new be;if(i){let t=0,i=0,n=s/2,o=s;for(r.move(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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,i=0,n=s/2,o=s;for(r.move(e,n);e<t;)e+=20,r.line(e,i),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,i),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 qh extends Se{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Uo(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.prop("text"))){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const i=e.label.getText();e.label.prepareRich(i)}}layout(t,e,i){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")),i?this._doLayoutPolar(t,e,i):this._doLayout(t,e)}_getContrastTarget(){return null}}class Kh extends qh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?oa:dn)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.prop("value")))&&i(e._style)&&this._line.setStyles(e._style)}_doLayout(t,e){const i=this.model,s=i.prop("value"),r=i.label,n=this._line,o=this._labelView.setVis(r.visible)?this._labelView:null,a=this._labelView.getBBox(),h=r.num("offsetX"),l=r.num("offsetY");let c,_;if(this.vertical()){const d=i.axis.getPos(t,s),u=n.setVis(!isNaN(d));if(null==o||o.setVis(u),u&&(n.setVLine(d,0,e),o)){switch(r.prop("align")){case"center":c=d-a.width/2+h;break;case"right":c=d+h;break;default:c=d-a.width-h}switch(r.prop("verticalAlign")){case"bottom":_="outside"!==r.prop("position")?e-a.height-l:e+l;break;case"middle":_=(e-a.height)/2-l;break;default:_="outside"!==r.prop("position")?l:-1*(a.height+l)}}}else{const d=e-i.axis.getPos(e,s),u=n.setVis(!isNaN(d));if(null==o||o.setVis(u),u&&(n.setHLine(d,0,t),o)){switch(r.prop("align")){case"center":c=(t-a.width)/2-h;break;case"right":c="outside"!==r.prop("position")?t-a.width-h:t+h;break;default:c="outside"!==r.prop("position")?h:-1*(a.width+h)}switch(r.prop("verticalAlign")){case"bottom":_=d+l;break;case"middle":_=d-a.height/2-l;break;default:_=d-a.height-l}}}(null==o?void 0:o.visible)&&o.trans(c,_)}_doLayoutPolar(t,e,i){const s=this.model,r=this._line,n=this._labelView.setVis(s.axis.contains(s.prop("value"))&&s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=is(i,s.axis),h=i.rdInner+s.axis.getPos(a,s.prop("value"));r.setArc(i.cx,i.cy,h,o,s.axis.getTotalAngle(),!1),r.setStyle(Vt,"none"),n&&n.trans(i.cx+h*d(i.start),i.cy+h*u(i.start))}}class Qh extends qh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?En:ys)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.prop("position"))?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:i,endValue:s}={startValue:e.prop("startValue"),endValue:e.prop("endValue")},r=!h(i)&&!h(s);this._range=r?e.axis.trimRange(g(i,s),f(i,s)):[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 i=this.model,s=i.label,r=this._box,[n,o]=this._range,a=this._labelView.setVis(s.visible)?this._labelView:null,h=this._labelView.getBBox(),l=s.num("offsetX"),c=s.num("offsetY");if(this.vertical()){const _=i.axis.getPos(t,n),d=i.axis.getPos(t,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(d!==_);if(null==a||a.setVis(u),u){let i,n;switch(s.prop("align")){case"center":i=_+(d-_-h.width)/2+l;break;case"right":i=d-h.width-l;break;default:i=_+l}switch(s.prop("verticalAlign")){case"bottom":n="outside"!==s.prop("position")?e-h.height-c:e+c;break;case"middle":n=(e-h.height)/2-c;break;default:n="outside"!==s.prop("position")?c:-1*(h.height+c)}r.setBox(_,0,d,e),a&&a.trans(f(0,g(t,i)),n)}}else{const _=e-i.axis.getPos(e,n),d=e-i.axis.getPos(e,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(_!==d);if(null==a||a.setVis(u),u){let e,i;switch(s.prop("align")){case"center":e=(t-h.width)/2-l;break;case"right":e="outside"!==s.prop("position")?t-h.width-l:t+l;break;default:e="outside"!==s.prop("position")?l:-1*(h.width+l)}switch(s.prop("verticalAlign")){case"bottom":i=_-h.height-c;break;case"middle":i=d+(_-d-h.height)/2-c;break;default:i=d+c}a&&a.trans(e,i),r.setBox(0,d,t,_)}}}_doLayoutPolar(t,e,i){const s=this.model,r=this._box,n=this._labelView.setVis(s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=is(i,s.axis),h=i.rdInner+s.axis.getPos(a,this._range[0]),l=i.rdInner+s.axis.getPos(a,this._range[1]);if(r.setSector({cx:i.cx,cy:i.cy,rx:l,ry:l,innerRadius:h/l,start:o,angle:b,clockwise:!0}),n){const t=h+(l-h)/2;n.trans(i.cx+t*d(i.start),i.cy+t*u(i.start))}}}class Jh extends Ce{constructor(){super(...arguments),this._views=new Fo(this,Le)}prepare(){this._rows=[]}addAll(t,e){const i=this._rows;e.forEach(t=>{i.push(...t.grid.rows.getRows())})}layout(t,e){const i=this._rows;this._views.prepare(i.length),this._views.forEach((s,r)=>{const n=i[r],o=n.axis,a=Math.max(o.valueMin(),n.from),h=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const i=f(0,g(t,o.getPos(t,a))),r=f(0,g(t,o.getPos(t,h)));s.setPath(fs.rectangle(i,0,r-i,e))}else{const i=f(0,g(e,o.getPos(e,a))),r=f(0,g(e,o.getPos(e,h)));s.setPath(fs.rectangle(0,e-i,t,i-r))}s.internalClearStyleAndClass(),s.setFill("none"),s.setFill(n.color),n.style&&s.internalSetStyleOrClass(n.style)})}}class tl extends Ce{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Qh?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,i){e.forEach(e=>{let s;e instanceof Pi?s=this._rangePool.pop()||new Qh(t,i):e instanceof Ci&&(s=this._linePool.pop()||new Kh(t,i)),this.add(s),s.prepare(t,e)})}add(t){return this._views.push(t),super.add(t)}}class el extends Le{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,i,s,r,n=!1){const o=this.model.axis,a=o._isHorz,h=new be;if(this._bar){const l=o._isHorz?s:r;let _;if(t?_=t.point.xValue:(this.model.prop("showAlways")||n)&&(_=o.prop("reversed")?o.xValueAt(a?s-e:i):o.xValueAt(a?e:r-i)),o instanceof zs&&(_=c(_)),!isNaN(_)){const t=o.getPos(l,_);let e=o.getUnitLen(l,_);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,s,e)}}else(t||this.model.prop("showAlways")||n)&&(a?h.vline(e,0,r):h.hline(i,0,s));this.setPath(h.end())}}class il extends sa{constructor(t){super(t,"Reset Zoom",il.CLASS_NAME),this.setVis(!1)}}il.CLASS_NAME="rct-reset-zoom";class sl extends Ce{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new ms(t,"rct-empty-view-back")),this.add(this._labelView=new Uo(t,"rct-empty-view-label"))}layout(t,e,i){this.setStyleOrClass(t._style),"background"===t.prop("effect")&&this._backView.setStyleOrClass(t.prop("backgroundStyle")),this._backView.resize(e,i);const s=this._labelView;t.buildSvg(s._text,s._outline,e,i,null,null),s.layout("center");const r=s.getBBox();s.trans((e-r.width)/2,(i-r.height)/2)}}class rl extends Ce{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Fo(this,dn)}layout(t,e,i,s,r,n){const o=e.model,a=o.axis,{side:h,base:l}=s,c=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(c.length,(e,s)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),i?e.setLine(0,n-c[s],r,n-h-c[s]):e.setLine(c[s]+l,0,c[s],n)})}}class nl extends Ce{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new Le(t)),this.add(this._gridContainer=new Ce(t,"rct-body-depth-grids")),this.add(this._lineView=new dn(t,"rct-body-depth-side-line")),this.add(this._endView=new dn(t,"rct-body-depth-side-line"))}layout(t,e,i,s,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,i,s,n,o),this.$_renderGrids(t,e,r,i,s,n,o)}$_renderBack(t,e,i,s,r,n){const{side:o,base:a}=s,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)),i?(t.setPath(fs.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(fs.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,i,s,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())i.has(t)||(h.delete(t),e.remove());for(const[l,c]of i.entries())if(l._isX===this.isX){let i=h.get(l);i||(i=new rl(t),h.set(l,i),a.add(i)),i.layout(e,c,s,r,n,o)}}}class ol extends Ce{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new nl(t,!0)),this.add(this._ySideView=new nl(t,!1)),this.add(this._orgLineView=new dn(t,"rct-body-depth-org-line"))}render(t,e,i,s,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,c=this._ySideView;l.setVis(i.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,i.xSide,e,r,s)),c.setVis(i.ySide.visible)&&(e?c.setBounds(0,o-h,n,h):c.setBounds(0,0,a,o),c.layout(t,i.ySide,!e,r,s)),this._orgLineView.setVis(i.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class al extends Go{constructor(t,e){super(t,al.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 ms(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Le(t,"rct-body-background")),this.add(this._depthLayer=new ol(t)),this.add(this._image=new Xo(t,!0,"rct-body-image")),this.add(this._emptyView=new sl(t)),this.add(this._gridRowContainer=new Jh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Ce(t,"rct-axis-grids")),this.add(this._baseContainer=new Ce(t,"rct-axis-bases")),this.add(this._guideContainer=new tl(t,"rct-axis-guides")),this.add(this._annotationContainer=new Ce(t,"rct-annotations")),this.add(this._seriesContainer=new Ce(t,"rct-series-container")),this.add(this._axisBreakContainer=new Ce(t,"rct-axis-breaks")),this.add(this._labelContainer=new Ce(t,"rct-label-container")),this.add(this._stackLabelContainer=new Ce(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new tl(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Ce(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Ce(t,"rct-feedbacks")),this.add(this._zoomButton=new il(t)),this._crosshairViews=new Fo(this._feedbackContainer,el)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,i){const s=e.chart,r=e.depth.visible;this._animatable=we._animatable&&s.animatable(),this._polar=i,this._prepareSeries(t,e,s._getSeries().getVisibleSeries(),r),s._getGauges()&&this._prepareGauges(t,s,s._getGauges().getVisibles()),this._prepareAnnotations(t,s._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,i){return this._depthExt=t._body._getDepth(e,i)}pointerMoved(t,e,i=!1){const s=this.width,r=this.height,n=this._inverted,o=this._polar,a=this._seriesViews,h=a.length,l=t.x>=0&&t.x<s&&t.y>=0&&t.y<r;let c,_;if(Fa.isPointDom(e))for(let t=h-1;t>=0;t--)if(_=a[t].pointByDom(e),_){c=a[t];break}const d=null==e?void 0:e.classList,u=(null==d?void 0:d.value)&&(d.contains("rct-contextmenu-item")||d.contains("rct-contextmenu-list")),p=l&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!u;this._crosshairViews.forEach(e=>{e.setVis(p)&&e.layout(_,t.x,t.y,s,r)});let g=!1;if(_)this.$_setFocused(c,_,t);else if(h>0){const e=this.chart().general.pointHovering.getHintDistance(null==c?void 0:c.model);let s,r,_=!o;for(const t of a)if(!(t.model instanceof yn)){_=!1;break}if(c=null,_)if(h>1){const i=[];a.forEach(o=>{s=P(o.getHintDistance(),e),r=o.getNearest2(t.x,t.y,n),i.push({hint:s,sv:o,pv:r})});const o=i.reduce((e,i)=>{if(!e.pv||!i.pv)return e||i;const s=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=s*s+r*r,o=i.pv.pv.point.xPos-t.x,a=i.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:i});c=o.sv,r=o.pv,s=o.hint}else c=a[0],s=P(c.getHintDistance(),e),r=c.getNearest2(t.x,t.y,n);else a.forEach(i=>{if(i.getHintDistance&&(s=P(i.getHintDistance(),e),s>0)){const e=i.getNearest(t.x,t.y);(!r||e.dist<r.dist)&&(c=i,r=e)}});l&&r&&c.canHover(r.dist,r.pv,s)?this.$_setFocused(c,r.pv,t):i&&l&&this._focused?(this.$_setFocused(this._focusedSeries,this._focused,t),g=!0):this.$_setFocused(null,null,t)}else i&&l&&this._focused&&(this.$_setFocused(this._focusedSeries,this._focused,t),g=!0);return g&&this._focused&&this.$_layoutPersistedCrosshair(this._focused,s,r,p),l}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_layoutPersistedCrosshair(t,e,i,s){const r=null==t?void 0:t.point;r&&this._crosshairViews.forEach(n=>{n.setVis(s)&&n.layout(t,r.xPos,r.yPos,e,i)})}$_setFocused(t,e,i){const s=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=n&&!1!==n.prop("interactive"),a=this.chart().general.pointHovering,h=this._focused,l=this._siblings,c=this._siblingSeries;let _,d,u;if(o&&e&&a.visible)switch(a.getScope(n,e.point)){case"axis":u=n._xAxisObj.getSeries();case"group":u||(u=n._group.getVisibleSeries());const r=u.map(t=>{if(t instanceof Sr){let e,s=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof zn){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:s,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,s,r);o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2)-a}else o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2);o<s&&(s=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)});_=u.map(t=>s.getSeriesView(t)),d=[],r.forEach((t,e)=>{d.push(_[e].getPointView(t))});break;default:_=[t],d=[e]}let p=[];if(_&&_.forEach((t,e)=>{p.push(...t.getSiblings(d[e]))}),p=p.length>1?p.sort((t,e)=>t.hash-e.hash):p.length>0?p:null,H.equalArrays(l,p)||(_&&_.forEach((t,e)=>{t.focusPoints(t.getSiblings(d[e]))}),c&&c.forEach(t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)}),this._siblingSeries=_,this._siblings=p),e!==h){let i=this._focusedSeries;this._focused=e,t!==i&&(i&&this.$_focusSeries(i,!1),this._focusedSeries=t,o&&this.$_focusSeries(t,!0),o&&r.general.prop("seriesHovering")&&this.$_hoverSeries(t))}this._focused&&o&&(this._focused!==h||!s.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?i.x>0&&i.x<this.width&&i.y>0&&i.y<this.height?s.showTooltip(n,e,[],this,i):s.hideTooltip():!this._focused&&s.tooltipVisible()&&s.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(Fa.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Fa.DATA_UNHOVER,t&&e!==t)})}hoverPoint(t){const e=this.chart().seriesByPoint(t),i=this.getSeries(e);i?(i.hoverPoint(t),this._hoverPointSeries.push(i)):this._hoverPointSeries&&(this._hoverPointSeries.forEach(t=>t.hoverPoint(null)),this._hoverPointSeries.length=0)}clearPointFocus(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach(t=>{t.focusPoints(null),t._hoverAnis.forEach(t=>t.cancel()),t._hoverAnis=[]}),this.hideCrosshairs(),this._focused=null;const t=this._focusedSeries;t&&this.$_focusSeries(t,!1),this._focusedSeries=null,this._siblings=null,this._siblingSeries=null}clearHover(){this.clearPointFocus(),this._owner.hideTooltip()}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)}getConnectedAxes(){const t=new Set;return this._seriesViews.forEach(e=>{const i=e.model._xAxisObj,s=e.model._yAxisObj;i&&t.add(i),s&&t.add(s)}),Array.from(t)}showAxisCrosshair(t,e,i){const s=this.width,r=this.height;this._crosshairViews.forEach(n=>{n.model.axis===t?n.setVis(!0)&&n.layout(null,e,i,s,r,!0):n.setVis(!1)})}hideCrosshairs(){this._crosshairViews.forEach(t=>t.setVis(!1))}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,i,s){const r=this.chart().isInverted(),n=this.$_zoomAxes(!0),o=r?this.height:this.width;let a=!1;for(let h=0;h<n.length;h++){const l=n[h],c=l.valueAt(o,r?o-s:t),_=l.valueAt(o,r?o-e:i);l.zoom(c,_)&&(a=!0)}a&&(this._zoomRequested=!0)}isAxisZoomed(){return this.getConnectedAxes().some(t=>t.isZoomed())}pinchZoom(t,e,i,s,r){if(this.chart().isPolar())return!1;if(!(i>0)||isNaN(i))return!1;if(!this.model.canZoom())return!!this.isAxisZoomed()&&this.panBy(s,r);const n=this.chart().isInverted(),o=this.model.prop("zoomType")||"none",a=this.svgToElement(t,e);if(!a||isNaN(a.x)||isNaN(a.y))return!1;const h=a.x,l=a.y;let c=!1;const _="y"===o||"both"===o;if("x"===o||"both"===o){const t=this.$_zoomAxes(!0),e=n?this.height:this.width,o=n?e-l:h,a=n?-r:s;for(let s=0;s<t.length;s++)this.$_pinchAxis(t[s],e,o,i,a)&&(c=!0)}if(_){const t=this.$_zoomAxes(!1),e=n?this.width:this.height,o=n?h:e-l,a=n?s:-r;for(let s=0;s<t.length;s++)this.$_pinchAxis(t[s],e,o,i,a)&&(c=!0)}return c&&(this._zoomRequested=!0),c}panBy(t,e){if(this.chart().isPolar()||!this.isAxisZoomed())return!1;const i=this.chart().isInverted();let s=!1;const r=this.$_zoomAxes(!0);for(let n=0;n<r.length;n++){const o=r[n];if(!o.isZoomed())continue;const a=i?this.height:this.width,h=i?-e:t;this.$_panAxis(o,a,h)&&(s=!0)}const n=this.$_zoomAxes(!1);for(let r=0;r<n.length;r++){const o=n[r];if(!o.isZoomed())continue;const a=i?this.width:this.height,h=i?t:-e;this.$_panAxis(o,a,h)&&(s=!0)}return s&&(this._zoomRequested=!0),s}$_zoomAxes(t){const e=this.getConnectedAxes().filter(e=>!!e._isX===t);if(e.length>0)return e;const i=this.chart(),s=t?i.xAxis:i.yAxis;return s?[s]:[]}$_pinchAxis(t,e,i,s,r){if(!(t&&e>0))return!1;const n=t._prepareZoom(),o=n.start,a=n.end-o,h=n.total();if(!(a>0&&h>0))return!1;const l=t.valueAt(e,i);if(null==l||isNaN(l))return!1;const c=i-r,_=t.valueAt(e,c),d=null==_||isNaN(_)?0:l-_;let u=a/s;if(u>=.999*h)return!!t.isZoomed()&&(t.resetZoom(),!0);const p=.02*h;u<p&&(u=p);let m=l-u*H.clamp((l-o)/a,0,1)-d,y=m+u;return m<n.min&&(y+=n.min-m,m=n.min),y>n.max&&(m-=y-n.max,y=n.max),m=f(m,n.min),y=g(y,n.max),t.zoom(m,y,.02)}$_panAxis(t,e,i){if(!((null==t?void 0:t.isZoomed())&&e>0&&i))return!1;const s=t._zoom;if(!s)return!1;const r=e/2,n=t.valueAt(e,r),o=t.valueAt(e,r-i);if(null==n||null==o||isNaN(n)||isNaN(o))return!1;const a=g(f(n-o,s.end-s.max),s.start-s.min);return!!a&&t.zoom(s.start-a,s.end-a,.02)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find(e=>e.model===t)}removeFocus(){this.clearHover()}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,i,s,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:i,l=a?a.hBody:s;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,i)=>{e.measure(t,this._series[i],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,i)=>{e.measure(t,this._gauges[i],h,l,r)}),this._annotationViews.forEach((e,i)=>{e.measure(t,this._annotations[i],h,l,r)}),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:i,height:s}}_clipSeries(t,e,i){const s=i?this._seriesClip:this._seriesClip2;t&&t.setClip(s),e&&e.setClip(s)}_renderBackground(t,e,i){t.setPath(fs.rectangle(0,0,e,i))}_setImage(t,e,i,s){if(e.setVis(t.visible&&!!t.prop("url")))return e.setImage(t.prop("url"),i,s),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const i=this._depthExt,s=this.width,r=this.height;let n=i?i.wBody:s,o=i?i.hBody:r,a=i?i.base:0;if(this._inverted){const t=i?i.side:0;this._seriesClip.setBounds(-t,-n,r,s),this._seriesClip2.setBounds(-t,0,s,r)}else this._seriesClip.setBounds(-a,0,s,r),this._seriesClip2.setBounds(-a,0,s,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&&i&&i.depth>0),this._seriesViews.forEach(t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(i),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,i,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,i=e.axis;t.setStyleOrClass(e._style),i._isHorz?i.prop("reversed")?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):i.prop("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,i){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,i))}$_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(la[e._type()])(t)}$_prepareGrids(t,e){const i=e._needAxes(),s=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())i&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())i&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof Wr)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));if(i){const i=new Set,l=[],c=t=>{t&&!i.has(t)&&(i.add(t),l.push(t))};e._getXAxesAtPane(a,h,!0).forEach(c),e._getYAxesAtPane(a,h,!0).forEach(c),this.getConnectedAxes().forEach(t=>{t.checkVisible()&&c(t)}),l.forEach(e=>{const i=e.grid;if(!r.has(e)&&(i.visible||i.prop("firstVisible")||i.prop("lastVisible"))){const i=new Uh(t);r.set(e,i),s.add(i)}if(e instanceof Wr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const i=new dn(t,"rct-axis-baseline");o.set(e,i),n.add(i),i.tag=e}})}}_prepareSeries(t,e,i,s){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=s?e.depth:null;for(const t of o.keys())i.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=i,a.forEach(t=>{i.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())}),a.length=0,i.forEach(e=>{const i=o.get(e)||Xh(t,e);i._setChartOptions(n,this._animatable,r.loadAnimatable()),i.parent||(this._seriesContainer.add(i),this._labelContainer.add(i._labelContainer)),o.set(e,i),a.push(i),i.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,i){const s=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())i.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=i,o.forEach(t=>t.remove()),o.length=0,i.forEach(i=>{const a=n.get(i)||this.$_createGaugeView(t,i);s.add(a),n.set(i,a),o.push(a),a.prepareGauge(t,i),a._setChartOptions(r,this._animatable,e.loadAnimatable())})}_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Wh(t,e);(e.prop("front")?s:i).add(o),r.set(e,o),n.push(o)})}$_prepareAxisBreaks(t,e){const i=this._axisBreakContainer,s=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 Wr&&o.push(...t._getBreaks())}));s.length<o.length;){const e=new Zh(t);i.add(e),s.push(e)}for(;s.length>o.length;)s.pop().remove();s.forEach((t,e)=>t.setModel(o[e]))}$_prepareCrosshairs(t){const e=this._crosshairViews,i=this.getCol(),s=this.getRow(),r=[],n=new Set,o=t=>{const e=null==t?void 0:t.crosshair;e&&e.visible&&!n.has(e)&&(n.add(e),r.push(e))};t._needAxes()&&(this.getConnectedAxes().forEach(o),t._getXAxesAtPane(i,s,!0).forEach(o),t._getYAxesAtPane(i,s,!0).forEach(o)),e.prepare(r.length,(t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)})}_layoutAnnotations(t,e,i,s){this._annotationViews.length>0&&this._annotationViews.forEach(r=>{r._layoutView(t,e,0,0,i,s),!this._polar&&r.model.needClip()&&r.resetClip(this.control,i,s)})}}al.BODY_CLASS="rct-body";class hl extends Se{constructor(t){super(t,ll.HANDLE_STYLE),this.add(this._back=new ms(t)),this.add(this._shape=new Le(t)),this._shape.setFill("white")}layout(t,e,i){if(t!==this._w||e!==this._h||i!==this._vertical){const s=2*Lr.HANDLE_RADIUS,r=new be;this._back.rect={x:-s/2,y:-s/2,width:s,height:s,rx:s/2};const n=s/3;r.polygon(-n-1,0,-1,-n,-1,n),r.polygon(n+1,0,1,-n,1,n),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=i}}}class ll extends Go{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(ll.HANDLE_STYLE)}static isMask(t){return t.classList.contains(ll.MASK_STYLE)}constructor(t){super(t,ll.CLASS_NAME),this.add(this._back=new ms(t,ll.BACK_STYLE)),this.add(this._container=new Ce(t,null)),this.add(this._mask=new ms(t,ll.MASK_STYLE)),this.add(this._trackView=new ms(t,ll.TRACK_CLASS)),this.add(this._thumbView=new ms(t,ll.THUMB_CLASS)),this.add(this._startHandle=new hl(t)),this.add(this._endHandle=new hl(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,i,s,r){const n=e._naviChart;let o,a,h=i,l=s;return e._vertical?(h=e.getSize(),o=e.getThickness(),a=s):(l=e.getSize(),o=i,a=e.getThickness()),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:h,height:l}}_doLayout(t){const e=this.model,i=e.axis()._zoom,s=e.mask,r=e.handle,n=this.width,o=this.height;if(this._back.resize(n,o),e._vertical);else{const t=i?(i.start-i.min)*n/i.total():0,e=i?(i.end-i.min)*n/i.total():n;this._mask.setVis(s.prop("visible"))&&(this._mask.setBounds(t,0,e-t,o),this._mask.setStyleOrClass(s._style));const a=Lr.HANDLE_TRACK_HEIGHT,h=Lr.HANDLE_TRACK_OFFSET;if(this._trackView.setBounds(-2,o,n+4,a),this._trackView.setRadius(4),this._thumbView.setBounds(t,o,e-t,a),this._startHandle.setVis(r.prop("visible")),this._endHandle.setVis(r.prop("visible")),this._startHandle.visible&&this._endHandle){const i=2*Lr.HANDLE_RADIUS;this._startHandle.layout(i,i,!1),this._startHandle.trans(t,o+h),this._endHandle.layout(i,i,!1),this._endHandle.trans(e,o+h),this._startHandle.setStyleOrClass(r._style),this._endHandle.setStyleOrClass(r._style)}}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,n,o,1),this._seriesView.resize(n,o),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,n,o,1),this._xAxisView.resize(n,o),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const i=e.firstSeries;let s=this._seriesView;s&&s.model!==i&&(s.remove(),s=this._seriesView=null),s||(this._container.add(s=this._seriesView=Xh(t,i)),s._simpleMode=!0),s&&s.prepareSeries(t,i,!1,null)}$_prepareXAxisView(t,e){const i=e.xAxis;let s=this._xAxisView;s&&s.model!==i&&(s.remove(),s=this._xAxisView=null),s||(this._container.add(s=this._xAxisView=new ia(t)),s._simpleMode=!0)}$_prepareYAxisView(t,e){const i=e.yAxis;let s=this._yAxisView;s&&s.model!==i&&(s.remove(),s=this._yAxisView=null),s||(this._container.add(s=this._yAxisView=new ia(t)),s._simpleMode=!0)}}ll.CLASS_NAME="rct-navigator",ll.BACK_STYLE="rct-navigator-back",ll.MASK_STYLE="rct-navigator-mask",ll.HANDLE_STYLE="rct-navigator-handle",ll.HANDLE_BACK_STYLE="rct-navigator-handle-back",ll.TRACK_CLASS="rct-navigator-track",ll.THUMB_CLASS="rct-navigator-thumb";class cl extends Ee{constructor(t){super(),this.chart=t}}class _l extends cl{constructor(t,e,i){super(t),this._body=e,this._vertical=i}_doStart(t,e,i,s,r){if(this._body.chart().isPolar())return!1;const n=this._body.svgToElement(e,i);return this._xStart=f(0,n.x),this._yStart=f(0,n.y),this._body.addFeedback(this._feedback=new ms(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const i=this._body.svgToElement(t,e);this._vertical?(e=f(0,g(this._body.height,i.y)),this._body.setZoom(0,g(f(0,this._yStart),e),this._body.width,f(g(this._yStart,this._body.height),e))):(t=f(0,g(this._body.width,i.x)),this._body.setZoom(f(0,g(this._xStart,t)),0,f(g(this._xStart,this._body.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,i,s,r){const n=this._body.svgToElement(s,r);return this._vertical?(r=f(0,g(this._body.height,n.y)),this._feedback.setBounds(0,g(this._yStart,r),this._body.width,m(this._yStart-r))):(s=f(0,g(this._body.width,n.x)),this._feedback.setBounds(g(this._xStart,s),0,m(this._xStart-s),this._body.height)),!0}}class dl extends cl{constructor(t,e){super(t),this._view=e}_doStart(t,e,i,s,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?i-t.y:e-t.x,this._zoomLen=o.length(),!0}return!1}_doDrag(t,e,i,s,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(s,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(s,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class ul extends cl{constructor(t,e,i){super(t),this._view=e,(this._isStart=e._startHandle.contains(i))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,i,s,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?i-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,i,s,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(s,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,c=n.model.prop("minSize"),_=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(_,NaN,c):o.zoom(l,NaN,c):a>0&&a<n.width?o.zoom(NaN,_,c):a>=n.width&&o.zoom(NaN,o._zoom.max,c),!0}}class pl extends cl{constructor(t,e){super(t),this._body=e}_doStart(t,e,i,s,r){return!this._body.chart().isPolar()&&!!this._body.isAxisZoomed()}_doDrag(t,e,i,s,r){return this._body.panBy(s-e,r-i),!0}}class gl extends cl{constructor(t,e,i){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,i,s,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?i-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,i,s,r){const n=this._view,o=n.svgToElement(s,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=f(0,g(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class fl{constructor(t){this._isTouchPointer=!1,this._touchSticky=!1,this._touchMoved=!1,this._touchPastSlop=!1,this._suppressMouseHover=!1,this._tapPrevFocus=null,this._docDismissBound=!1,this._touchInBody=!1,this._touchPointers=new Map,this._pinchActive=!1,this._pinchLastDist=0,this._pinchLastMidX=0,this._pinchLastMidY=0,this._pinchBody=null,this.$_docPointerDown=t=>{if(!this._touchSticky)return;const e=this._chart.dom();e&&e.contains(t.target)||this.$_endTouchSticky(!0)},this._chart=t}handleDown(t){const e=t.target;if(!e)return;const i=this.$_pointerToPoint(t),s=this.$_isTouch(t);if(s){if(t.isPrimary&&this._touchPointers.size>0&&(this._touchPointers.clear(),this.$_endPinch(),this.$_endTouchSticky(!0),this._chart.setTouchAction(),this.$_clearTouchSessionFlags()),this._touchPointers.set(t.pointerId,{x:i.x,y:i.y}),this._touchPointers.size>=2)return this._pinchActive?(this._touchPointers.delete(t.pointerId),this._chart.setPointerCapture(t),void this._stopEvent(t)):(this.$_beginPinch(),this._pinchActive||t.isPrimary?void(this._pinchActive&&this._chart.setPointerCapture(t)):void this._touchPointers.delete(t.pointerId));if(!t.isPrimary)return}else if(!t.isPrimary)return;this._clickElement=e,this._dragTracker&&this.$_stopDragTracker(t,e,i.x,i.y),this._prevX=this._clickX=i.x,this._prevY=this._clickY=i.y,this._isTouchPointer=s,this._touchMoved=!1,this._touchPastSlop=!1,this._touchInBody=s&&this.$_isInBody(e,i.x,i.y),s?(this._suppressMouseHover=!0,this._tapPrevFocus=this._touchSticky?this._chart.chartView().getFocusPointView():null,this._touchInBody&&(this.$_beginTouchSticky(),this.$_showAtPointer(t)),this.$_lockTouchGesture(e,i.x,i.y,t)):(this._suppressMouseHover=!1,this.$_endTouchSticky(!1),this._chart.setTouchAction())}handleUp(t){if(this.$_isTouch(t)||this._isTouchPointer){const e=this._touchPointers.has(t.pointerId);if(this._touchPointers.delete(t.pointerId),this._chart.releasePointerCapture(t),this._pinchActive&&(this._touchPointers.size<2&&this.$_endPinch(t),this._touchPointers.size>0))return;if(!e)return}this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY),(this.$_isTouch(t)||this._isTouchPointer)&&this._chart.setTouchAction(),this.$_clearTouchSessionFlags()}handleMove(t){const e=this._chart.chartView(),i=t.target,{x:s,y:r}=this.$_pointerToPoint(t),n=this.$_isTouch(t)||this._isTouchPointer,o=n&&this.$_followTouch(),a=n?this._touchPointers.has(t.pointerId):t.buttons>=1||0===t.buttons&&0===t.button;if(n&&this._touchPointers.has(t.pointerId)&&this._touchPointers.set(t.pointerId,{x:s,y:r}),n&&this._pinchActive&&this._touchPointers.size>=2)return this.$_updatePinch(),this._chart.setTouchAction("none"),this._stopEvent(t),this._prevX=s,void(this._prevY=r);if(a){const i=this.isDragging(),a=this._clickElement,h=m(this._clickX-s),l=m(this._clickY-r);n&&!i&&(h>5||l>5)&&(this._touchPastSlop=!0),n&&!i&&(h>10||l>10)&&(this._touchMoved=!0),n&&!o&&!i&&this._touchInBody&&(h>10||l>10)&&this.$_endTouchSticky(!0),s<0||s>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(i?this.$_doDrag(t,a,s,r):!this._dragTracker&&(h>3||l>3)?n&&this.$_isBodyZoomTarget(a)&&!this.$_canOneFingerPan(a,s,r)||this.$_startMove(t,a,s,r):this._dragTracker&&!i&&this.$_startMove(t,a,s,r))}else{if(n)return;this.$_stopDragTracker(t,i,s,r,!0)}this._prevX=s,this._prevY=r,this.isDragging()?(e.pointerLeaved(-1,-1,null),e.forceHideTooltip(),this.$_endTouchSticky(!1),this._chart.setTouchAction("none"),this._stopEvent(t)):n&&o&&a&&this._touchInBody?(this._touchPastSlop&&(this.$_showAtPointer(t,!0),this._stopEvent(t)),this._chart.setTouchAction("none")):n&&this._touchInBody&&a&&this.$_canOneFingerPan(this._clickElement,s,r)?(this._chart.setTouchAction("none"),this._stopEvent(t)):n||this._touchSticky||this._suppressMouseHover||(t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):e.getButton(i)||e.pointerMoved(t.pointX,t.pointY,t.target))}handleLeave(t){if(this.$_isTouch(t)||this._touchSticky||this._suppressMouseHover)return;this.$_endTouchSticky(!1);this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleCancel(t){if(this.$_isTouch(t)||this._isTouchPointer){const e=this._touchPointers.has(t.pointerId);if(this._touchPointers.delete(t.pointerId),this._chart.releasePointerCapture(t),this._pinchActive&&this._touchPointers.size<2&&this.$_endPinch(t),!e)return}this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY,!0),this.$_endTouchSticky(!0),0===this._touchPointers.size&&this._chart.setTouchAction(),this.$_clearTouchSessionFlags()}handleClick(t){var e;const i=this._chart.chartView();if(this._touchSticky&&!this._touchMoved&&!this._touchPastSlop){const t=this._clickElement,e=i.resolveBody(t);if((null==e?void 0:e.contains(t))&&!this.$_hasClickTarget(t)){const t=i.getFocusPointView();if(!t||t===this._tapPrevFocus)return void this.$_endTouchSticky(!0)}}if(this._chart.model.clickable()){const t=this._chart.model,s=this._clickElement,r=i.getButton(s);let n,o,a,h,l;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),r)!0!==r.click()&&i.buttonClicked(r);else if(o=i.legendByDom(s)){const r=null===(e=o.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof r||!1!==r({chart:t.wrapper,source:o.legend.getSources(o)})){const e=H.makeArray(o.legend.getSources(o),!0),r=!o.source.visible;e.forEach(e=>{if(e instanceof Bs){const s=e,r=t.seriesByPoint(s);if(r){r.setPointVisible(s,!s.visible);const t=i.findSeriesView(r);t instanceof th&&t.togglePointVisible(s)}}else e.visible=r});const n=i.resolveBody(s)||i.bodyView();null==n||n.hoverSeries(r?o.source:null)}}else(a=i.seriesByDom(s))?a.clicked(s):(l=i.htmlButtonByDom(s))?l.click():(h=i.annotationByDom(s))?h.clicked():(n=i.creditByDom(s))&&n.clicked(s)}}handleDblClick(t){const e=this._chart.chartView()._navigatorView,i=this._clickElement;!e.visible||e.dblClick(i)}handleWheel(t){}dispose(){this.$_unbindDocDismiss(),this._touchSticky=!1,this._tapPrevFocus=null,this._touchPointers.clear(),this._pinchActive=!1,this._pinchBody=null,this._suppressMouseHover=!1,this._dragTracker&&(this._dragTracker.cancel(),this._dragTracker=null)}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}shouldPreventTouchMove(t){return!!(this._pinchActive||this.isDragging()||this._touchMoved||this._touchPastSlop)||this.$_markTouchPastSlopFromTouch(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_isTouch(t){return"touch"===t.pointerType}$_clearTouchSessionFlags(){0===this._touchPointers.size&&(this._isTouchPointer=!1,this._touchInBody=!1,this._suppressMouseHover=!1)}$_followTouch(){var t;const e=null===(t=this._chart.model)||void 0===t?void 0:t._tooltip;return!0===(null==e?void 0:e.prop("followTouch"))&&!1!==(null==e?void 0:e.prop("visible"))}$_showAtPointer(t,e=!1){const i=this._chart.chartView(),s=this.$_hitTarget(t);i.getButton(s)||i.pointerMoved(t.pointX,t.pointY,s,e)}$_hitTarget(t){const e=t.target,i=this._chart.svg(),s=this._chart.doc();if(!i||!s)return e;const r="function"==typeof s.elementsFromPoint?Array.from(s.elementsFromPoint(t.clientX,t.clientY)||[]):"function"==typeof s.elementFromPoint?[s.elementFromPoint(t.clientX,t.clientY)].filter(Boolean):[];let n=null;for(let t=0;t<r.length;t++){const e=r[t];if(e&&i.contains(e)&&!this.$_isTooltipDom(e)){if(Fa.isPointDom(e))return e;n||(n=e)}}return n||e}$_isTooltipDom(t){var e;let i=t;const s=this._chart.svg();for(;i&&i!==s;){if(null===(e=i.classList)||void 0===e?void 0:e.contains("rct-tooltip"))return!0;i=i.parentElement}return!1}$_hasClickTarget(t){if(!t||!this._chart.model.clickable())return!1;const e=this._chart.chartView();return!!(e.getButton(t)||e.legendByDom(t)||e.htmlButtonByDom(t)||e.annotationByDom(t)||e.creditByDom(t))}$_beginTouchSticky(){this._touchSticky=!0,this.$_bindDocDismiss()}$_endTouchSticky(t){if(this._touchSticky=!1,this._tapPrevFocus=null,this.$_unbindDocDismiss(),t){const t=this._chart.chartView();t.pointerLeaved(-1,-1,null),t.forceHideTooltip()}}$_bindDocDismiss(){this._docDismissBound||(this._chart.doc().addEventListener("pointerdown",this.$_docPointerDown,!0),this._docDismissBound=!0)}$_unbindDocDismiss(){this._docDismissBound&&(this._chart.doc().removeEventListener("pointerdown",this.$_docPointerDown,!0),this._docDismissBound=!1)}$_isBodyZoomTarget(t){if(!t)return!1;if(ta.isThumb(t)||ll.isHandle(t)||ll.isMask(t))return!1;const e=this._chart.chartView().bodyOf(t);return!!(e&&e.model.canZoom()&&e.contains(t))}$_canPinch(t){var e;return!(!t||(null===(e=t.chart())||void 0===e?void 0:e.isPolar()))&&(t.model.canZoom()||t.isAxisZoomed())}$_canOneFingerPan(t,e,i){if(this.$_followTouch())return!1;const s=this.$_bodyAt(t,e,i);return!(!s||!s.isAxisZoomed())}$_plotTouchLock(t,e,i){return this.$_isTouchCaptureTarget(t)?"capture":this.$_isInBody(t,e,i)?this.$_canOneFingerPan(t,e,i)?"capture":this.$_followTouch()?"none":null:null}$_lockTouchGesture(t,e,i,s){const r=this.$_plotTouchLock(t,e,i);s&&"capture"===r?(this._chart.setPointerCapture(s),this._chart.setTouchAction("none")):r?this._chart.setTouchAction("none"):this._chart.setTouchAction()}$_isTouchCaptureTarget(t){return!!t&&(ta.isThumb(t)||ll.isHandle(t)||ll.isMask(t))}$_isInBody(t,e,i){return!!this.$_bodyAt(t,e,i)}$_bodyAt(t,e,i){return this._chart.chartView().resolveBody(t,e,i)}$_clientToPoint(t,e){const i=this._chart.svg().getBoundingClientRect();return{x:t-i.left,y:e-i.top}}$_pointerToPoint(t){return this.$_clientToPoint(t.clientX,t.clientY)}$_markTouchPastSlopFromTouch(t){var e,i;if(!t||null==this._clickX||null==this._clickY)return!1;const s=(null===(e=t.touches)||void 0===e?void 0:e[0])||(null===(i=t.changedTouches)||void 0===i?void 0:i[0]);if(!s)return!1;const r=this.$_clientToPoint(s.clientX,s.clientY);return(m(this._clickX-r.x)>5||m(this._clickY-r.y)>5)&&(this._touchPastSlop=!0,!0)}$_pinchPoints(){const t=[];return this._touchPointers.forEach(e=>t.push(e)),t}$_beginPinch(){if(this._pinchActive)return;const t=this.$_pinchPoints();if(t.length<2)return;this.isDragging()&&(this._dragTracker.cancel(),this._dragTracker=null);const e=(t[0].x+t[1].x)/2,i=(t[0].y+t[1].y)/2,s=this._chart.chartView().bodyAtPoint(e,i)||this.$_bodyAt(this._clickElement,e,i);this.$_canPinch(s)&&(this._pinchActive=!0,this._pinchBody=s,this._pinchLastDist=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,this._pinchLastMidX=e,this._pinchLastMidY=i,this._touchInBody=!0,this._touchMoved=!0,this._touchPastSlop=!0,this.$_endTouchSticky(!0),this._chart.setTouchAction("none"))}$_updatePinch(){const t=this.$_pinchPoints();if(t.length<2||!this._pinchBody)return;const e=(t[0].x+t[1].x)/2,i=(t[0].y+t[1].y)/2,s=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=s/(this._pinchLastDist||s),n=e-this._pinchLastMidX,o=i-this._pinchLastMidY,a=m(r-1)<.01,h=m(n)<.5&&m(o)<.5;if(!a||!h){const t=a?1:r,s=h?0:n,l=h?0:o;this.$_canPinch(this._pinchBody)&&this._pinchBody.pinchZoom(e,i,t,s,l)}this._pinchLastDist=s,this._pinchLastMidX=e,this._pinchLastMidY=i}$_endPinch(t){if(this._pinchActive=!1,this._pinchBody=null,this._pinchLastDist=0,1===this._touchPointers.size){let t=null;this._touchPointers.forEach(e=>{t=e}),t&&(this._prevX=this._clickX=t.x,this._prevY=this._clickY=t.y,this._touchMoved=!0,this._touchPastSlop=!0,this._touchInBody=this.$_isInBody(this._clickElement,t.x,t.y),this._isTouchPointer=!0,this.$_lockTouchGesture(this._clickElement,t.x,t.y))}else t&&0===this._touchPointers.size&&(this._touchInBody=!1)}_getDragTracker(t,e,i){const s=this._chart.chartView(),r=s.bodyOf(t);if(ta.isThumb(t))return new dl(this._chart,s.getScrollView(t));if(ll.isHandle(t))return new ul(this._chart,s._navigatorView,t);if(ll.isMask(t)&&r&&r.model.isZoomed())return new gl(this._chart,s._navigatorView,t);if(r&&r.contains(t)){if(this._isTouchPointer)return!this.$_followTouch()&&r.isAxisZoomed()?new pl(this._chart,r):null;if(r.model.canZoom())return new _l(this._chart,r,s._inverted)}}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(t,e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){this.$_startDrag(e,this._prevX,this._prevY,i,s)&&(i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,i,s,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,s-e,r-i)),this._dragTracker){if(this._dragTracker.start(t,e,i,s,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,i,s),this._dragTracker=null,this._chart.setTouchAction())}}class ml extends Ce{constructor(t){super(t,ml.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,i){if(this.setVis(i&&i.length>0)){const s=this._itemViews,r=this._separators;for(;s.length<i.length;){const i=new $e(e,"rct-history-item");i.anchor=t.TextAnchor.START,s.push(i)}for(;s.length>i.length;)s.pop().remove();for(;r.length<i.length-1;){const i=new $e(e);i.anchor=t.TextAnchor.START,i.text=">",r.push(i)}for(;r.length>i.length-1;)r.pop().remove();this.$_layout(i)}}$_layout(t){const e=this._itemViews,i=this._separators,s=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+s,i[o].transX(n),n+=i[o].width+s)}}ml.TITLE_CLASS="rct-history";class yl extends Go{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new ms(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new $e(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.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,i,s,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.prop("markerVisible"))?this._marker.getBBox():W,l=X(this._label.getBBox());return this._gap=e.legend.num("markerGap"),{width:h.width+this._gap+l.width,height:f(h.height,l.height)}}_doLayout(t){const e=this._rMarker,i=P(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.getBBox().height)/2)}}class bl extends jo{constructor(t){super(t,bl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Fo(this,yl)}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.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){const n=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=P(e.prop("itemsPerLine"),Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?e.num("gap"):0,o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this.$_prepareItems(t,n),this.$_measure(t,e,o,this._ipr,i,s)}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("useTextColor"),s=this._sizes,r=t.prop("itemsAlign"),n=t.num("lineGap"),o=t.num("itemGap"),a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,_=a.top+h.top;let d,u=c,p=_;this._itemViews.forEach(t=>{const e=t.model.source,s=e.legendColor(),r=e.legendStroke();t._marker.setColor(s),r&&t._marker.setStroke(r),i&&e.visible?t._label.setFill(s):t._label.setFill("")}),e.forEach((t,e)=>{l?(t.forEach(t=>{t.mw=s[e],t.resizeByMeasured().layout(this._wMarkers[e])}),p=_,"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+=s[e]+n):(t.forEach(t=>{t.resizeByMeasured().layout(NaN)}),u=c,"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+=s[e]+n)})}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.items(),a=this._itemViews,h=e.num("itemGap"),l=e.num("lineGap"),c=e.getMarkerSize(),_=a.count,d=this._rowViews=[],u=this._sizes=[];let p,g,m,y;a.forEach((e,i)=>{e.setMarker(o[i].source.legendMarker(t,c)),e.measure(t,o[i],r,n,1)});let b=0,x=0;if(i){for(;b<_;)y=a.get(b),x%s===0?(d.push(m=[y]),g=y.mh,x++,b++):(g+=h+y.mh,g<=n?(m.push(y),x++,b++):x=0);this._wMarkers=[],p=g=0,d.forEach((t,e)=>{let i=0,s=0,r=0;t.forEach(t=>{s+=t.mh,i=f(i,t.mw),r=f(r,t._rMarker.width),t._col=e}),s+=h*(t.length-1),g=f(g,s),p+=i,u.push(i),this._wMarkers.push(r)}),p+=l*(d.length-1)}else{for(;b<_;)y=a.get(b),x%s===0?(d.push(m=[y]),p=y.mw,x++,b++):(p+=h+y.mw,p<=r?(m.push(y),x++,b++):x=0);p=g=0,d.forEach(t=>{let e=0,i=0;t.forEach(t=>{e+=t.mw,i=f(i,t.mh)}),e+=h*(t.length-1),p=f(p,e),g+=i,u.push(i)}),g+=l*(d.length-1)}return{width:p,height:g}}}bl.LEGEND_CLASS="rct-legend";class xl extends Se{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new ra(t))}layout(){}}class vl extends Se{constructor(t,e,i,s){super(t,e),this.add(this._markContainer=new Ce(t,"rct-polar-axis-markers")),this._markViews=new Fo(this._markContainer,xl),this.add(this._gridContainer=new Se(t,"rct-polar-axis-grids")),this._labelViews=new Fo(this._labelContainer=i,Qo,s?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,i,s){this._model=e,this._circular=i,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,i,s)}layout(t,e,i,s){const r=this._model._ticks;return this._doLayout(this._model,e,i,s,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,i,s){const r=i.getLabelText(e,s),n=e.label,o=i.getLabelStyle(e,s);if(t.value=e.value,null!=r){n&&r.match(ea)?t.setLabel(i,o,e,r.replace(ea,n),1e3,1e3):(i.prepareRich(r),i._paramTick=e,i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const i=e.label;if(i.visible&&e.checkVisible()){const t=e._ticks;i.chart._body.getPolar(e),i.prop("rotation");const s=t.length;this._labelContainer.setStyleOrClass(i._style),this._labelViews.prepare(s,(e,s,r)=>{e.setVis(!0),this._prepareLabel(e,t[s],i,r)})}else this._labelViews.forEach(t=>t.setVis(!1))}prepareGuides(t,e,i){let s=this._model.guides.filter(t=>!t.prop("front"));e.setAll(t,s,!0),s=this._model.guides.filter(t=>t.prop("front")),i.setAll(t,s,!0)}}class wl extends vl{constructor(t,e,i){super(t,"rct-polar-xaxis",i,!0),this._gridLines=new Fo(this._gridContainer,dn,wl.GRID_CLASS),e.insertFirst(this._startView=new dn(t,wl.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new dn(t,wl.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new oa(t,wl.LINE_CLASS))}_doPrepare(t,e,i){const s=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(s.visible)&&(n.setStyleOrClass(s._style),n.setFill("none")),this._startView.setVis(i&&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,i,s,r,n){const o=t.getStartAngle(),a=t.getTotalAngle(),h=t.chart._body.getPolar(t).rdInner;if(r.forEach(t=>t.pos=t.pos/s*a/b),this._gridContainer.visible&&this._gridLines.forEach((n,a)=>{const l=r[a].pos,c=e+d(o+l)*s,_=i+u(o+l)*s,p=e+d(o+l)*h,g=i+u(o+l)*h;n.setFill("none"),n.setLine(p,g,c,_),n.setStyleOrClass(t.grid.prop("style"))}),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),h=s+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",c=[],_=t.label.prop("rotation")||0,p="auto"===_;this._labelViews.forEach((t,s)=>{if(t.setVis(s%a===0)){t.layout(l);const n=r[s],a=t.getBBox(),g=t.angle=o+n.pos,f=(g*w%360+360)%360,m=f>90&&f<270;if(p){const s=e-a.width/2+d(g)*(h+a.width/2),r=i-a.height/2+u(g)*(h+a.width/2);t.trans(s,r),t.setRotation(a.width/2,a.height/2,m?g*w+180:g*w)}else{const s=e+d(g)*(h+a.width/2)-a.width/2,r=i+u(g)*(h+a.height/2)-a.height/2;t.trans(s,r),t.setRotation(a.width/2,a.height/2,_)}c.push(t)}});let g=0,f=c[g];for(let t=1;t<c.length;t++){const e=c[t],i=f.inflateBBox(-1,-1),s=e.inflateBBox(-1,-1),r=Object.assign(i,{rotation:f.rotation}),n=Object.assign(s,{rotation:e.rotation});if(ya(r,n)?(e.setVis(!1),c.splice(t,1),--t):(f=e,g=t),t===c.length-1&&c.length>1){if(rt.diffAngle(f.angle,c[0].angle)<b/6){const t=Object.assign(c[0].inflateBBox(-1,-1),{rotation:c[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});ya(t,e)&&(f.setVis(!1),c.splice(g,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,i,s,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+d(o)*s,i+u(o)*s),r.map(t=>{const r=t.pos;h.push(e+d(o+r)*s,i+u(o+r)*s)}),n&&r[r.length-1].pos<a&&h.push(e+d(o+a)*s,i+u(o+a)*s),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e+d(o)*h,i+u(o)*h,e+d(o)*s,i+u(o)*s),this._endView.setLine(e+d(o+a)*h,i+u(o+a)*h,e+d(o+a)*s,i+u(o+a)*s))}}wl.LINE_CLASS="rct-polar-xaxis-line",wl.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",wl.GRID_CLASS="rct-polar-xaxis-grid-line";class Sl extends vl{constructor(t,e,i){super(t,"rct-polar-yaxis",i,!1),this._gridViews=new Fo(this._gridContainer,oa,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new dn(t,"rct-polar-yaxis-line")),e.add(this._baseView=new oa(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,i,s){const r=t.line,n=t instanceof Wr&&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,i,s,r,n){const o=t.chart._body.getPolar(t),a=o.rdInner,h=is(o,t);function l(t,s){if(t.setFill("none"),c)t.setArc(e,i,s,g,f,!0);else{const r=[];p&&_[0].pos>0&&r.push(e+d(g)*s,i+u(g)*s),_.forEach(t=>{const n=t.pos;r.push(e+d(g+n)*s,i+u(g+n)*s)}),p&&_[_.length-1].pos<f&&r.push(e+d(g+f)*s,i+u(g+f)*s),t.setPolyline(r)}}const c=this._circular,_=n._ticks,p=n.isArced(),g=n.getStartAngle(),f=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach((e,i)=>{l(e,a+r[i].pos),e.setStyleOrClass(t.grid.prop("style"))}),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",s="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(p){const t=n.getStartAngle();this._labelViews.forEach((n,h)=>{const l=n.getBBox(),c=a+r[h].pos;n.setContrast(null).trans(e+d(t)*c-l.width*s+o,i+u(t)*c-l.height/2)})}else this._labelViews.forEach((t,n)=>{const h=t.getBBox();t.setContrast(null).trans(e-h.width*s+o,i-(a+r[n].pos)-h.height/2)})}this._lineView.visible&&(p?this._lineView.setLine(e+a*d(g),i+a*u(g),e+s*d(g),i+s*u(g)):this._lineView.setVLine(e,i-a,i-s)),this._baseView.visible&&l(this._baseView,a+t.getPos(h,t.getBaseValue()))}}class Vl extends al{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,i,s,r){const n=e.chart,o=super._doMeasure(t,e,i,s,r);return this._circular=this.model.prop("circular"),this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,i){const{cx:s,cy:r,rd:n,rdInner:o}=this.model.getPolar(null);t.setPath(o>0?fs.donut(s,r,n,o):fs.circle(s,r,n))}_setImage(t,e,i,s){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,i=this.model.setPolar(t,e),{cx:s,cy:r,rd:n,rdInner:o}=i.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(i.image,this._image,t,e),this._layoutInnerText(i,s,r,o),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(s,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(i.chart.yAxis,s,r,n),this._yAxisViews.forEach(t=>{t.layout(i.chart.xAxis,s,r,n)}),[this._guideContainer,this._frontGuideContainer].forEach(t=>{t._views.forEach(t=>t.visible&&t.layout(this.width,this.height,i.getPolar(t.model.axis)))}),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(i,t,e)}_prepareInnerText(e){this._innerTextView||(this.add(this._innerTextView=new Uo(e,"rct-polar-body-inner")),this._innerTextView._text.anchor=t.TextAnchor.MIDDLE)}_layoutInnerText(t,e,i,s){var r;const n=t.innerText;if(!(null===(r=this._innerTextView)||void 0===r?void 0:r.setVis(t.hasInner()&&n.visible)))return;this._innerTextView.setModel(this.doc,n,n.getIconUrl(),null),n.buildSvg(this._innerTextView._text,this._innerTextView._outline,2*s,2*s,t,null),this._innerTextView.layout("center"),this._innerTextView.setContrast(null);const o=this._innerTextView.getBBox();this._innerTextView.trans(e-o.x-o.width/2,i-o.y-o.height/2)}_prepareAxes(t,e,i,s,r){if(this._prepareInnerText(t),!this._xAxisContainer){const e=this._image,i=this._axisBreakContainer;this.insertAfter(this._xAxisLabelContainer=new Ce(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),i),this.insertAfter(this._yAxisLabelContainer=new Ce(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),i),this.insertAfter(this._lineContainer=new Ce(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new Ce(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new Ce(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<i.length;){const e=new Sl(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>i.length;)n.pop().remove();n.forEach((e,n)=>{e.setVis(!0),e.prepare(t,i[n],s,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)}),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new wl(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,s,r))}}class Cl extends jo{constructor(t,e){super(t,e?Cl.SUBTITLE_CLASS:Cl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new $e(t)),this._richText=new We}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null),X(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Cl.TITLE_CLASS="rct-title",Cl.SUBTITLE_CLASS="rct-subtitle";class Pl extends Se{constructor(e){super(e,"rct-tooltip-row"),this._hasMarker=!0,this.add(this._marker=new Le(e,"rct-tooltip-row-marker")),this.add(this._textView=new $e(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new $e(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,i,s,r){var n;const o=e.getMarkerSize(),a=o+e.getMarkerGap(),h=e.hasListMarker();if(this._hasMarker=h,h){const t=fs.getDrawer(e.prop("listMarkerShape")||"circle");this._marker.setVis(!0),this._marker.setPath(t(o/2)),this._marker.setFill((null===(n=s.legendColor)||void 0===n?void 0:n.call(s))||"")}else this._marker.setVis(!1);r[0]?(i.setFormat(r[0]),i.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a)):this._textView.text="",r[1]?(i.setFormat(r[1]),i.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+this._textView.getBBox().width+P(e.prop("listGap"),4))):this._detailView.text=""}alignDetail(t){if(this._detailView.transX(t-this._detailView.getBBox().width),this._hasMarker){const t=this._marker.getBBox();this._marker.trans(t.width/2,this.r.height/2)}}}class Al extends Se{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new $e(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new Ce(e,"")),this.add(this._footerView=new $e(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new Fo(this._rowLayer,Pl)}layout(t,e,i,s){const r=this._headerView,n=this._footerView,o=P(e.prop("listRowGap"),4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!s.header)&&(i.setFormat(s.header),i.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(s.items.length).forEach((r,n)=>{r.trans(0,h),r.layout(t,e,i,s.items[n],s.rows[n]),h+=r.getBBox().height+o,l=r._width=f(l,(r.r=r.getBBox()).width)}),n.setVis(!!s.footer)&&(i.setFormat(s.footer),i.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach(t=>{t.alignDetail(l)})}}class kl extends Se{constructor(e){super(e,kl.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Le(e,"rct-tooltip-back")),this.add(this._top=new Le(e,"rct-tooltip-top")),this.add(this._textView=new $e(e,"rct-tooltip-text")),this.add(this._listView=new Al(e)),this._back.setAttr("filter","url(#"+we.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new We,this.close(!0,!1)}setOnHidden(t){this._onHidden=t}show(t,e,i,r,n,o,a){const h=i.point,l=this._model=t.chart._tooltip,c=l.setTarget(t,h,r&&r.map(t=>t.point));if(!c)return;const _=c.isGroupTooltip();let d,u=this._list;if(_){u.header=u.footer="",u.items=[],u.rows=[];const e=c.getTooltipText(t,h,u);if(0===u.rows.length){if(d=s(e)?e.join(" "):e,!d||!d.trim())return;u.rows=u.items.map(()=>[d,""])}}else{const e=l.prop("text")||c.getTooltipText(t,h,null);if(d=s(e)?e.join(" "):e,!d||!d.trim())return}this.setStyleOrClass(l._style);const p=e.contentWidth(),m=e.contentHeight(),y=this._listView,b=this._textView,x=l.getHeaderHeight(),v=l.getTailSize(),w=t.chart.isInverted(),S=t._yAxisObj;let V,C,P,A=S.prop("reversed");t instanceof mr&&t.getBaseValue(S)>i.point.yValue&&(A=!A),_?(y.setVis(!0),b.setVis(!1),y.layout(e.doc(),l,this._richText,this._list),V=y.getBBox()):(y.setVis(!1),b.setVis(!0),this._richText.setFormat(d),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),V=b.getBBox()),C=f(l.num("minWidth"),V.width+16),P=f(l.num("minHeight"),V.height+12)+x;let k=t.getTooltipHeaderColor(h);null===k&&(k=t._calcedColor,t instanceof ur?(t.prop("legendByPoint")||t._colorByPoint())&&(k=h._calcedColor):t._colorByPoint()&&(k=getComputedStyle(i.dom).fill)),this._top.setFill(k);const L=this.isVisible()?300:0,T=l.num("offset")+v,M=a.getFocusPointView().getBounds(),N=e.dom().getBoundingClientRect();let E,B,O=!1;const D=l.isFollowPointer(t);if(w&&!t.isWidget)E=o-P/2-f(0,g(o-P/2,m-P)),O=D?A?C+T>n:n+C+T>p:A?C+T>M.x-N.x+M.width:M.x-N.x-T>p-C,O&&(A=!A),B=A?"left":"right",this.$_drawTooltip(0,0,C,P,B,E),A?n-=C+T:n+=T,o-=P/2;else{E=n-C/2-f(0,g(n-C/2,p-C));const t=D?o-e.getRootDistance().y:M.y-N.y-e._padding.top,i=D?m-o:N.bottom-M.bottom;if(t>=P+T||i>=P+T){(A?i>=P+T:t>=P+T)?B=A?"bottom":"top":(B=A?"top":"bottom",A=!A),this.$_drawTooltip(0,0,C,P,B,E),n-=C/2,A?o+=T:o-=P+T}else{E=o-P/2-f(0,g(o-P/2,m-P));const t=M.x-N.x;B=p-t>=C+T||t<C+T?"right":"left",this.$_drawTooltip(0,0,C,P,B,E),"right"===B?n+=T:n-=C+T,o-=P/2}}return n=f(0,g(n,p-C)),o=f(0,g(o,m-P)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(f(0,n-20),f(0,o-20)),this.transEx(n,o,L/2,!1)):this.transEx(n,o,L,!1),0===L&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:C,h:P}}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.prop("hideDelay"):Nr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){var t;pe(this.dom,"opacity",void 0,0,200,()=>{this.setStyle("visibility","hidden")}),null===(t=this._onHidden)||void 0===t||t.call(this)}$_drawTooltip(t,e,i,s,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let c=["M",t+h,e,"L",t+i-h,e,"Q",t+i,e,t+i,e+h,"L",t+i,e+s-h,"Q",t+i,e+s,t+i-h,e+s,"L",t+h,e+s,"Q",t,e+s,t,e+s-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":c=c.concat(["M",t+i/2-a/2+n,e+s,"L",t+i/2+n,e+s+a,"L",t+i/2+a/2+n,e+s]);break;case"bottom":c=c.concat(["M",t+i/2-a/2+n,e,"L",t+i/2+n,e-a,"L",t+i/2+a/2+n,e]);break;case"left":c=c.concat(["M",t+i,e+s/2-a/2+n,"L",t+i+a,e+s/2+n,"L",t+i,e+s/2+a/2+n]);break;case"right":c=c.concat(["M",t,e+s/2-a/2+n,"L",t-a,e+s/2+n,"L",t,e+s/2+a/2+n])}const _="bottom"===r,d=_?["M",t,e+s-l,"l",i,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-i,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",i-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-i,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(i-p.width)/2,e+=(s-p.height+(_?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(c)}}kl.CLASS_NAME="rct-tooltip";class Ll extends Ve{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new kl(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,i,s,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,i,s,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)}setOnHidden(t){this._tooltipView.setOnHidden(t)}}class Tl extends Z{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDispose(){this._dom.remove(),this._dom=null,super._doDispose()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,i=re.isHoverAt(e),s=this._model=t;return re.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(s.num("width"))?s.prop("autoWidth")?e.style.width="max-content":e.style.width="":e.style.width=Pt(s.prop("width")),isNaN(s.num("height"))?e.style.height="":e.style.height=Pt(s.prop("height")),"custom"===s.prop("hintMode")?(s.prop("hint")?e.dataset.hint=s.prop("hint"):delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=s.prop("hint")||""),s.prop("imageUrl")?re.setStyles(this._img,{display:"",width:T(s.prop("imageWidth")),height:T(s.prop("imageHeight"))}):re.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(st?this._hovered:i),this._span.textContent=s.prop("text")||"",this}layout(t){const e=this._dom,i=e.style,s=this._model,r=s.prop("align"),n=s.prop("verticalAlign");i.left=T("left"===r?t.x+(s.prop("offsetX")||0):"right"===r?t.x+t.width-e.offsetWidth-(s.prop("offsetX")||0):t.x+(t.width-e.offsetWidth)/2+(s.prop("offsetX")||0)),i.top=T("top"===n?t.y+(s.prop("offsetY")||0):"bottom"===n?t.y+t.height-e.offsetHeight-(s.prop("offsetY")||0):t.y+(t.height-e.offsetHeight)/2+(s.prop("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"),i=t.createElement("div");return e.className="rct-html-button",re.setStyles(e,{position:"absolute",textAlign:"center"}),re.setStyles(i,{display:st?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(i),this._img=t.createElement("span"),this._img.className="rct-html-button-image",re.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),i.appendChild(this._img),this._span=t.createElement("span"),re.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),st&&re.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),i.appendChild(this._span),e}$_setImage(t){const e=this._model;e.prop("imageUrl")?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.prop("hoverImageUrl")||e.prop("imageUrl")})`:this._img.style.backgroundImage=`url(${e.prop("imageUrl")})`:this._img.style.backgroundImage=""}}class Ml extends Yo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Cl(t,!1)),this.add(this.subtitleView=new Cl(t,!0))}_doMeasure(t,e,i,s,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,c=0,_=0,d=this.titleView,u=i,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,i,s,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,i,s,r),_=this._hSub=a.height,c=this._wSub=a.width,g=o.num("titleGap")):d.setModel(o),o.prop("position")){case"leftSide":case"left":case"rightSide":case"right":p=f(l,_),u=h+g+c;break;default:p=l+g+_,u=f(u,h+c)}return p>0&&(p+=this.titleView.visible?n.getGap():o.getGap()),{width:u,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.visible?this._wTitle>t.wPlot||"chart"===s.prop("alignBase")?t.wChart:t.wPlot:0,o=r&&r.visible?this._wSub>t.wPlot||"chart"===r.prop("alignBase")?t.wChart:t.wPlot:0;let a=this._wTitle>t.wPlot||s&&"chart"===s.prop("alignBase")?0:t.xPlot,h=this._wSub>t.wPlot||r&&"chart"===r.prop("alignBase")?0:t.xPlot;if(n>0&&o>0){const t=(t,e,i)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},l=()=>{const e=f(this._hTitle,this._hSub);u=f(u,u+t(s,e,this._hTitle)),g=f(g,g+t(r,e,this._hSub))},c=(t,e,i)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},_=()=>{if(p=f(p,p+c(s,n,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":m=p;break;case"right":m=p+this._wTitle-this._wSub;break;default:m=p+(this._wTitle-this._wSub)/2}else m=f(m,m+c(r,o,this._wSub))},d=r.num("titleGap");let u=0,p=a,g=0,m=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"leftSide":case"left":p=m+this._wSub+d,l();break;case"rightSide":m=p+this._wTitle+d,l();break;case"right":switch(m=p+this._wTitle+d,r.prop("align")){case"center":m=f(m,m+(o-this._wTitle-this._wSub)/2);break;case"right":m=f(m,h+o-this._wSub)}l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}break;case"right":switch(r.prop("position")){case"leftSide":p+=n-this._wTitle,m=p-d-this._wSub,l();break;case"left":switch(p+=n-this._wTitle,r.prop("align")){case"center":m+=(n-this._wTitle-this._wSub)/2;break;case"right":m=p-d-this._wSub}l();break;case"rightSide":case"right":m+=o-this._wSub,p=m-d-this._wTitle,l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}break;default:switch(r.prop("position")){case"leftSide":p+=(n-this._wTitle)/2,m=p-this._wSub-d,l();break;case"left":switch(p+=(n-this._wTitle)/2,r.prop("align")){case"left":break;case"center":m+=(p-m-this._wSub)/2;break;case"right":m=p-this._wSub-d}l();break;case"rightSide":p+=(n-this._wTitle)/2,m=p+this._wTitle+d,l();break;case"right":switch(p+=(n-this._wTitle)/2,r.prop("align")){case"left":m=p+this._wTitle+d;break;case"center":m+=p+this._wTitle+d,m+=(o-m-this._wSub)/2;break;case"right":m+=o-d-this._wSub}l();break;case"top":_(),u=g+this._hSub+d;break;default:_(),g=u+this._hTitle+d}}const y=P(s.prop("offset"),0),b=P(r.prop("offset"),0);0!==y&&(p+="right"===s.prop("align")?-y:y,"leftSide"!==r.prop("position")&&"rightSide"!==r.prop("position")||(m+="right"===s.prop("align")?-y:y)),0!==b&&"leftSide"!==r.prop("position")&&"rightSide"!==r.prop("position")&&(m+="right"===r.prop("align")?-b:b),e.resizeByMeasured().layout().trans(p,u),i.resizeByMeasured().layout().trans(m,g)}else if(n>0||o>0){const t=n?s:r,l=n?e:i,c=n||o,_=n?this._wTitle:this._wSub;let d=n?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":d+=c-_;break;default:d+=(c-_)/2}const u=P(t.prop("offset"),0);0!==u&&(d+="right"===t.prop("align")?-u:u),l.trans(d,0)}}}class Nl extends Yo{_doInitChildren(t){this.add(this._legendView=new bl(t))}_doMeasure(t,e,i,s,r){const n=e._legend,o=this._legendView.measure(t,n,i,s,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 i=this.width,s=this.height,r=0,n=0;switch(this._pos){case"left":i-=e;break;case"right":i-=e,r+=e;break;case"top":s-=e;break;default:n+=e,s-=e}t.trans(r,n).resize(i,s),t.layout()}}class El extends Yo{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,i,s,r,n){const o=this.views;let a;for(o.length;o.length<s.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>s.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach((t,e)=>{t.prepare(s[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,i){this.views.forEach((s,r)=>{s.prepareGuides(t,NaN,NaN,e,i)})}checkHeights(t,e,i){return this.views.length>0?this.$_checkHeights(this.views,t,e,i):0}$_checkHeights(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkHeight(e,i,s)}),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,i){return this.views.length>0?this.$_checkWidths(this.views,t,e,i):0}$_checkWidths(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkWidth(e,i,s)}),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const i of this.views)if(null===(e=i._scrollView)||void 0===e?void 0:e.contains(t))return i._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map(t=>t.model))}clean(){this.views.forEach(t=>t.clean())}_doMeasure(t,e,i,s,r){this._inverted;let n=0,o=0;return[this.views].forEach(e=>{if(e){const a=(this.isX,i),h=(this.isX,s);let l=0,c=0;e.forEach(e=>{if(e.visible){const i=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=i.width,c+=i.height}}),this.isHorz?c+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),o=f(o,c)}}),{width:n,height:o}}_doLayout(t){const e=this.control,i=e.loaded,s=[];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(i);e&&s.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===Do.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Do.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}}),this.isHorz?o+=r+t:a+=n+t}});const h=s.length>0&&e.chart.body.prop("zoomCallback");h&&Promise.resolve().then(()=>{s.forEach(({axis:t,from:e,to:i})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof zs?Math.floor(e):e,to:t instanceof zs?Math.floor(i):i})})})}}class Bl extends Go{constructor(e){super(e,"rct-credits"),this.add(this._textView=new $e(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}_doMeasure(t,e,i,s,r){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.getBBox()}}class Ol extends Ce{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 Ce(t,"rct-annotations")),this.add(this._plotContainer=new Ce(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new al(t,this));for(const e in Do){const i=new El(t,Do[e]);this._plotContainer.add(i),this._axisSectionMap[Do[e]]=i}Ol.pane_class&&this.add(this._paneContainer=new Ol.pane_class(t,this)),this.add(this._titleSectionView=new Ml(t)),this.add(this._legendSectionView=new Nl(t)),this.add(this._frontAnnotationContainer=new Ce(t,"rct-front-annotations")),this.add(this._creditView=new Bl(t)),this.add(this._navigatorView=new ll(t)),this.add(this._historyView=new ml(t))}_doDispose(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.dispose(),super._doDispose()}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,i,s,r){var n,o,a;const h=this._model=e,l=h.isPolar(),c=h._credits,_=h._legend,d=h._navigator;let u,p=i,g=s;if(e._width=i,e._height=s,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(c.visible)&&(u=this._creditView.measure(t,c,p,g,r),c.isFloating()||("middle"!==c.prop("verticalAlign")?g-=u.height+c.num("offsetY")+c.num("gap"):"center"!==c.prop("align")&&(p-=u.width+c.num("offsetX")+c.num("gap")))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(_.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),_._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],i,s,r)})}layout(){var t;const e=this.width,i=this.height;let s=e,r=i;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,c=l.num("gap"),_=l.prop("align"),d=l.prop("verticalAlign"),u=l.num("offsetX"),p=l.num("offsetY"),g=this._bodyView._depthExt;let f=0,m=0,y=0,b=0,x=0,v=0,w=0,S=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==d?(f=p,r-="top"===d?y=h.height+f+c:b=h.height+f+c):(m=u,s-="left"===_?x=h.width+m+c:v=h.width+m+c)));const V=this._titleSectionView;let C=0;const P=S+y;V.visible&&(V.resizeByMeasured(),r-=C=V.height),w=x,S=i-b;const A=this._navigatorView;let k=0;A.visible&&(A.model._vertical||(A.resize(A.mw,A.model.getThickness()),r-=k=A.mh));const L=this._legendSectionView;let T,M,N=0,E=0;if(L.visible)switch(L.resizeByMeasured().layout(),N=L.height,E=L.width,a._location){case"top":T=C+y,r-=N;break;case"bottom":r-=N,T=S-N,S-=N;break;case"right":s-=E,M=e-E;break;case"left":s-=E,w+=E,M=0}A.visible&&(S-=k,A.layout().transY(S+A.model.getGap()));let B,O=0,D=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(w,P+C).resize(s,r),this._paneContainer.layout(),O=r,D=s,B=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Do.LEFT,Do.RIGHT].forEach(i=>{(e=t[i])&&e.visible&&(s-=e.mw)}),[Do.TOP,Do.BOTTOM].forEach(i=>{(e=t[i])&&e.visible&&(r-=e.mh)}),(e=t[Do.LEFT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0),w+=e.mw),(e=t[Do.RIGHT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0)),(e=t[Do.BOTTOM])&&e.visible&&(e.resize(s-(g?g.base:0),e.mh),o||e.transX(w),e.layout(0),S-=e.mh),(e=t[Do.TOP])&&e.visible&&(e.resize(s-(g?g.base:0),e.mh),o||e.transX(w),e.layout(0))),A.visible&&A.layout().transX(w);const i={x:w,y:S};this._plotWidth=s,this._plotHeight=r,o||((e=t[Do.LEFT])&&e.visible&&e.trans(i.x-e.mw,i.y-e.height),(e=t[Do.RIGHT])&&e.visible&&e.trans(i.x+s,i.y-e.height),(e=t[Do.BOTTOM])&&e.visible&&e.trans(i.x,i.y),(e=t[Do.TOP])&&e.visible&&e.trans(i.x,i.y-r-e.height));const n=this._currBody;O=this._plotHeight-0,D=this._plotWidth-0,w=i.x,S=i.y-this._plotHeight,n.resize(D,O),n.trans(w,S),n.layout(),B=n.getRect(),n._seriesViews.forEach(t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}})}if(D+=0,V.visible&&V.layout({xPlot:w,wPlot:D,wChart:e}).trans(0,P),L.visible){const t=a.prop("align"),n=a.prop("verticalAlign");if("body"===a._location){let e=a.num("offsetX");switch(t){case"right":w+=D-E-e;break;case"center":w+=(D-E)/2+e;break;default:w+=e}switch(e=a.num("offsetY"),n){case"bottom":S+=O-N-e;break;case"middle":S+=(O-N)/2+e;break;default:S+=e}}else if(isNaN(T)){const t=a.num("offsetY");if(w=M,"chart"===a.prop("alignBase")){switch(n){case"top":S=t;break;case"bottom":S=i-N-t;break;default:S=(i-N)/2+t}S+N>i&&(S=(i-N)/2)}else switch(n){case"top":S+=t;break;case"bottom":S=S+r-N-t;break;default:S=S+(r-N)/2+t}S+N>i&&(S=(i-N)/2),S<0&&(S=0)}else{const i=a.num("offsetX");if(S=T,"chart"===a.prop("alignBase"))switch(t){case"left":w=i;break;case"right":w=e-E-i;break;default:w=(e-E)/2+i}else switch(t){case"left":w+=i;break;case"right":w=w+s-E-i;break;default:w+=(s-E)/2+i}w+E>e&&(w=(e-E)/2),w<0&&(w=0)}L.trans(w,S)}if(h.visible){let t,s;switch(h.layout(),d){case"top":s=f;break;case"middle":s=(i-h.height)/2+f;break;default:if(b>0){if(s=i-b+c,L.visible){const t=L.y+N+c;t>s&&(s=t)}}else s=i-h.height-f}switch(_){case"left":if(t=m,x>0&&L.visible&&"left"===a._location){const e=L.x+E+c;e>t&&(t=e)}break;case"center":t=(e-h.width)/2+m;break;default:if(v>0){if(t=e-v+c,L.visible&&"right"===a._location){const e=L.x-c-h.width;e<t&&(t=e)}}else t=e-h.width-m}h.trans(t,s)}this.$_layoutHtmlButtons(e,i),this.$_layoutAnnotations(this._inverted,e,i,B),this.hideTooltip()}showTooltip(t,e,i,s,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:c}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},_=s.getTooltipPos(),d=h?r.x+_.x:l+_.x,u=h?r.y+_.y:c+_.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new Ll(this.doc,o)),this._htmlTooltipView.setOnHidden(()=>this.$_clearPointFocus())),this._htmlTooltip=!0,this._htmlTooltipView.show(t,e,i,d,u,s)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||(this.add(this._tooltipView=new kl(this.doc)),this._tooltipView.setOnHidden(()=>this.$_clearPointFocus())),this._tooltipView.show(t,o,e,i,d,u,s))}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,i;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(i=this._tooltipView)||void 0===i||i.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)}$_clearPointFocus(){var t,e;this.$_hideCrosshairs(),(null===(t=this._model)||void 0===t?void 0:t.isSplitted())?this._paneContainer.bodies.forEach(t=>t.clearPointFocus()):null===(e=this._currBody)||void 0===e||e.clearPointFocus()}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new ia(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 i=this._annotationViews.find(e=>e.dom.contains(t));return i||((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}plotBodies(){var t,e;return(null===(t=this._model)||void 0===t?void 0:t.isSplitted())&&(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.bodies||[]:this._currBody?[this._currBody]:[]}bodyAtPoint(t,e){const i=this.plotBodies();for(let s=0;s<i.length;s++)if(this.$_pointInBody(i[s],t,e))return i[s];return null}resolveBody(t,e,i){const s=t?this.bodyOf(t):null;return s&&(null==e||null==i||this.$_pointInBody(s,e,i))?s:null!=e&&null!=i?this.bodyAtPoint(e,i):s}getFocusPointView(){var t,e;const i=this.plotBodies();for(let s=0;s<i.length;s++){const r=null===(e=(t=i[s]).getFocusPointView)||void 0===e?void 0:e.call(t);if(r)return r}return null}$_pointInBody(t,e,i){if(!t)return!1;const s=t.svgToElement(e,i);return s.x>=0&&s.y>=0&&s.x<=t.width&&s.y<=t.height}$_bodyAtContainerPoint(t,e){const i=this.plotBodies();for(let s=0;s<i.length;s++){const r=i[s],n=r.controlToElement(t,e);if(n.x>=0&&n.y>=0&&n.x<=r.width&&n.y<=r.height)return r}return null}pointerMoved(t,e,i,s=!1){var r,n,o,a,h;if(!(null===(r=this._model)||void 0===r?void 0:r.hoverable()))return;const l=i,c=l?this.bodyOf(l):null,_=!!(c&&l&&c.contains(l)),d=this._model&&((_?c:null)||this.$_bodyAtContainerPoint(t,e)||c),u=null==l?void 0:l.classList,p=(null==u?void 0:u.value)&&(u.contains("rct-contextmenu-item")||u.contains("rct-contextmenu-list"));let g=this._hoverItem;if(this._hoverItem=null,(null===(n=this._model)||void 0===n?void 0:n.isSplitted())&&this._paneContainer.bodies.forEach(t=>{t!==d&&t.clearHover()}),d){const r=d.controlToElement(t,e),n=d.pointerMoved(r,i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(l)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(l);if(t){const e=t.legend;H.makeArray(e.getSources(t),!0).forEach(t=>{e.prop("seriesHovering")&&t instanceof nr?d.hoverSeries(t):e.prop("pointHovering")&&t instanceof Bs&&d.hoverPoint(t)})}}if(g instanceof _s&&!(this._hoverItem instanceof _s)&&(d.hoverPoint(null),d.hoverSeries(null)),this.$_handleAnnotationHover(i),!n)return this.$_hideCrosshairs(),void d.clearHover();if(null===(o=this._model)||void 0===o?void 0:o.isSplitted())this.$_updateSplitCrosshair(d,r,p);else for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>{this.$_axisFlagAndMoved(t,d,r,p)})}else(null===(a=this._model)||void 0===a?void 0:a.isSplitted())?this._paneContainer.bodies.forEach(t=>t.clearHover()):null===(h=this._currBody)||void 0===h||h.clearHover(),this.$_hideCrosshairs(),this.$_handleAnnotationHover(i)}pointerLeaved(t,e,i){var s,r;this.$_clearAnnotationHover(),this.$_hideCrosshairs(),(null===(s=this._model)||void 0===s?void 0:s.isSplitted())?this._paneContainer.bodies.forEach(t=>t.clearHover()):null===(r=this._currBody)||void 0===r||r.clearHover()}$_hideCrosshairs(){var t,e;if(null===(t=this._model)||void 0===t?void 0:t.isSplitted())this.$_clearSplitCrosshair();else{for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>t.hideCrosshair());null===(e=this._currBody)||void 0===e||e.hideCrosshairs()}}$_axisFlagAndMoved(t,e,i,s){const r=t.model,n=r.crosshair,o=r._isHorz?e.width:e.height,a=r._isHorz?i.x:i.y,h=n.visible&&!s&&n.flag.visible&&!n.isBar()&&n.getFlag(o,a);if(h){if(t.showCrosshair(a,h),n.prop("onChange")){const t=[],s=this._model.inverted;e._seriesViews.forEach(e=>{let n,o=Number.MAX_SAFE_INTEGER;e.model._visPoints.forEach(t=>{const e=t.xPos,a=t instanceof Vn&&!s?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=r._isX?Math.abs(i.x-e):Math.abs(i.y-a);h<o&&(o=h,n=t)}),t.push(n)}),n.moved(a,h,t)}}else t.hideCrosshair()}$_updateSplitCrosshair(t,e,i){const s=this._paneContainer,r=t.getConnectedAxes(),n=r.find(t=>t._isX&&t.crosshair.visible);s.bodies.forEach(i=>{i!==t&&(n&&i.isConnected(n)?i.showAxisCrosshair(n,e.x,e.y):i.hideCrosshairs())}),r.forEach(r=>{if(!r.crosshair.visible)return;const n=s.axisViewOf(r);n&&this.$_axisFlagAndMoved(n,t,e,i)})}$_clearSplitCrosshair(){const t=this._paneContainer;null==t||t.bodies.forEach(t=>t.hideCrosshairs());const e=this._model;e&&[e._getXAxes(),e._getYAxes()].forEach(e=>e.forEach(e=>{const i=null==t?void 0:t.axisViewOf(e);null==i||i.hideCrosshair()}))}getAxis(t){for(const e in this._axisSectionMap){const i=this._axisSectionMap[e].views.find(e=>e.model===t);if(i)return i}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Do){const i=this._axisSectionMap[Do[e]].getScrollView(t);if(i)return i}}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 i,s;e?(this._polarView||(this._polarView=new Vl(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(i=this._bodyView)||void 0===i||i.setVis(!1),this._polarView.setVis(!0)):(null===(s=this._polarView)||void 0===s||s.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(),i=[];e._internalItems().forEach((e,s)=>{let r=this._htmlButtons[s];r||(r=new Tl(t),this.control.appendDom(r.dom),this._htmlButtons[s]=r),i.push(r)});for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].dispose();this._htmlButtons=i}$_layoutHtmlButtons(t,e){const i=this.control._padding,s=this._htmlButtons;if(s.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:i.left,y:i.top,width:t,height:e},o=this._model._getButtons()._internalItems();s.forEach((t,e)=>{const i=o[e];t.setVisible(i.visible)&&t.setModel(i).layout(i.isChartScope()?n:r)})}}$_prepareAxes(t,e){const i=this._currBody._gridRowContainer,s=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const i in o){const a=o[i];n?a.prepare(t,this,e,e.getAxes(i,!0),s,r):a.visible=!1}i.prepare()}$_prepareAxisGuides(t,e){const i=this._currBody._guideContainer,s=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,i,s)}}$_measurePlot(t,e,i,s,r){const n=this._axisSectionMap,o=i,a=s;let h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,c,this._inverted,r),i-=n[Do.LEFT].checkWidths(t,i,s),i-=n[Do.RIGHT].checkWidths(t,i,s),s-=n[Do.BOTTOM].checkHeights(t,i,s),s-=n[Do.TOP].checkHeights(t,i,s),h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r);for(const i in n){const s=n[i];s.visible&&s.measure(t,e,l,c,r)}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===Do.LEFT||t===Do.RIGHT?i-=e.mw:t!==Do.BOTTOM&&t!==Do.TOP||(s-=e.mh))}r++,h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const i in n){const s=n[i];s.visible&&(s.measure(t,e,l,c,r),s.prepareGridRows(t,this._bodyView._gridRowContainer))}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===Do.LEFT||t===Do.RIGHT?i-=e.mw:t!==Do.BOTTOM&&t!==Do.TOP||(s-=e.mh))}h=this._bodyView.checkDepth(e,i,s),l=i-(h?h.base:0),c=s-(h?h.side:0),e.axesLayouted(l,c,this._inverted),this._bodyView.measure(t,e._body,i,s,r)}$_measurePolar(t,e,i,s,r){const n=e._body,o=n.getRadius(i,s),a=n.getInnerRadiusPx(o),h=2*Math.PI*o,l=o-a;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(h,l,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(h,l,!1),this._polarView.measure(t,e._body,i,s,r)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Wh(t,e);(e.prop("front")?s:i).add(o),r.set(e,o),n.push(o)})}$_layoutAnnotations(t,e,i,s){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach(s=>{if("container"===s.model.prop("scope"))n=-r.left,o=-r.top,a=e+r.left+r.right,h=i+r.top+r.bottom;else n=o=0,a=e,h=i;s._layoutView(t,this,n,o,a,h)})}$_handleAnnotationHover(t){var e,i;if(!t)return;const s=this.htmlButtonByDom(t);if(s!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=s,void(null===(i=this._hoverButton)||void 0===i||i.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 Dl;!function(t){t.EXPORT="$$realchart_export"}(Dl||(Dl={}));class $l extends we{static $_conf(t,e){!function(t,e){const i=_e(e);if(!t||!i)return;let s=ce.get(t);s||ce.set(t,s=new Set),s.add(i)}(t,e)}constructor(t,e){super(t,e),this._contextMenuDismissHandler=null,this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new Ro(null,(t,e)=>{this.$_changeModel(t,e)})}_createChartView(t){return new Ol(t)}_createPointerHandler(){return new fl(this)}_doDispose(){this.$_unbindContextMenuDismiss(),this.setPointerHandler(null),this._chart=null,super._doDispose()}onModelChanged(t,e,i){e instanceof _i&&i===ni.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,i){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof Ro&&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 i;null===(i=this._chartView.getAxis(t))||void 0===i||i.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Dl.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e),this.$_bindContextMenuDismiss()}}_canOverflowRender(){return!1}_doRender(t){var e;const i=this.model,s=i._general,r=this._chartView;if(this.clearTemporaryDefs(),i&&(this.setData("theme",s.prop("theme"),!0),this.setData("palette",s.prop("palette")),this.setResizeDelay(s.prop("resizeDelay")),i._prepareRender(),this._loadModules()),this.loaded||r.clean(),t.width>0&&t.height>0&&r.setVis(!1!==s.prop("visible"))&&(r.measure(this.doc(),i,t.width,t.height,1),r.setRect(t),r.layout(),i&&i.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,s,r){if(this.model){const s=this.model._general._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}$_bindContextMenuDismiss(){if(this._contextMenuDismissHandler)return;const t=this.doc();this._contextMenuDismissHandler=t=>{var e,i;const s=null===(e=this.chart)||void 0===e?void 0:e.exporter;if(!(null==s?void 0:s.isCompose())||!s.isContextMenuVisible())return;const r=t.target;(null===(i=null==r?void 0:r.closest)||void 0===i?void 0:i.call(r,".rct-contextmenu-button"))||s.toggleContextMenu()},t.addEventListener("pointerdown",this._contextMenuDismissHandler,!0)}$_unbindContextMenuDismiss(){this._contextMenuDismissHandler&&(this.doc().removeEventListener("pointerdown",this._contextMenuDismissHandler,!0),this._contextMenuDismissHandler=null)}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e._exporter.options)}}}class Rl{static getVersion(){return oe.version}static setLicenseKey(t){oe.code=t}static setLocale(t,e){e&&ht(t,e),(t=>{t&&(at=nt[ot=t.substring(0,2)]),at||(at=nt[ot="ko"])})(t)}static registerLocale(t,e){ht(t,e)}static setDebugging(t){Se.DEBUGGING=t}static setLogging(t){rt.LOGGING=t}static setAnimatable(t){we._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new $l(t,e);return o.chart.load(i(s)?s:{},r,n),o.chart[No]=o,o.chart}static createData(t,e){return new Io(t||{},e)}}class Il{static empty(){return new Il}static create(t=0,e=0){return new Il(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class Fl{static empty(){return new Fl}static create(t=0,e=0){return new Fl(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const zl=Rl.getVersion,Hl=Rl.setDebugging,Gl=Rl.setLogging,jl=Rl.setAnimatable,Yl=Rl.configure,Wl=Rl.createChart,Xl=Rl.createData,Ul=Rl.setLicenseKey;t.Annotation=_i,t.AnnotationView=ha,t.ArcElement=na,t.AreaRangeSeries=Pn,t.AreaRangeSeriesView=lh,t.AreaSeries=Sn,t.AreaSeriesGroup=kn,t.AreaSeriesView=ch,t.AssetCollection=ti,t.Axis=Bi,t.AxisBaseLine=Yr,t.AxisCollection=Oi,t.AxisGrid=wi,t.AxisItem=mi,t.AxisLabel=Ti,t.AxisLine=yi,t.AxisScrollBar=Mi,t.AxisScrollView=ta,t.AxisSectorLine=Ei,t.AxisTick=Ai,t.AxisTitle=bi,t.AxisView=ia,t.BarRangeSeries=sn,t.BarRangeSeriesView=_h,t.BarSeries=on,t.BarSeriesBase=nn,t.BarSeriesGroup=hn,t.BarSeriesGroupBase=an,t.BarSeriesPoint=rn,t.BarSeriesView=ph,t.BarSeriesViewBase=uh,t.BasedSeries=mr,t.BasedSeriesView=Za,t.BellCurveSeries=Tn,t.BellCurveSeriesView=gh,t.Body=ls,t.BodyDepth=hs,t.BodyView=al,t.BoxPlotSeries=Nn,t.BoxPlotSeriesView=mh,t.BoxPointElementEx=ja,t.BubblePie=Fn,t.BubbleSeries=zn,t.BubbleSeriesView=bh,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Hn,t.CandlestickSeries=jn,t.CandlestickSeriesView=vh,t.CategoryAxis=zs,t.CategoryAxisGrid=Fs,t.CategoryAxisLabel=Is,t.CategoryAxisTick=Rs,t.Chart=Ro,t.ChartControl=$l,t.ChartData=Io,t.ChartDataCollection=dt,t.ChartElement=Go,t.ChartItem=ni,t.ChartObject=$o,t.ChartPointerHandler=fl,t.ChartText=ai,t.ChartView=Ol,t.CircelBarPointLabel=Yn,t.CircleBarSeries=Wn,t.CircleBarSeriesGroup=Xn,t.CircleBarSeriesView=Sh,t.CircleElement=ra,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=Qi,t.CircularGaugeGroup=Ji,t.CircularGaugeLabel=qi,t.ClockGaugeType="clock",t.ClusterableSeries=gr,t.ClusterableSeriesGroup=wr,t.Color=se,t.ConnectableSeries=ar,t.ConstraintSeriesGroup=vr,t.ContentView=Wo,t.ContinuousAxis=Wr,t.Credits=Eo,t.Crosshair=gi,t.DataPoint=Bs,t.DataPointCollection=Os,t.DataPointLabel=Ks,t.Dom=re,t.DumbbellSeries=Kn,t.DumbbellSeriesView=Ch,t.ElementPool=Fo,t.EqualizerSeries=Jn,t.EqualizerSeriesView=Ah,t.ErrorBarSeries=to,t.ErrorBarSeriesView=Lh,t.Exporter=cs,t.FunnelSeries=ro,t.FunnelSeriesView=Mh,t.Gauge=Fi,t.GaugeBase=Ii,t.GaugeGroup=zi,t.GaugeGroupView=ua,t.GaugeItem=class extends ni{constructor(t){super(t.chart)}},t.GaugeLabel=Zi,t.GaugeRangeBand=Ui,t.GaugeRangeLabel=Xi,t.GaugeScale=Wi,t.GaugeView=ca,t.HeatmapSeriesType="heatmap",t.HistogramSeries=ao,t.HistogramSeriesView=Eh,t.IconedText=hi,t.ImageAnnotation=$r,t.ImageAnnotationView=eh,t.ImageElement=Xo,t.LayerElement=Ce,t.Legend=ds,t.LegendItem=_s,t.LegendItemView=yl,t.LegendView=bl,t.LineElement=dn,t.LinePointLabel=mn,t.LineSeries=xn,t.LineSeriesBase=yn,t.LineSeriesBaseView=ah,t.LineSeriesGroup=An,t.LineSeriesPoint=pn,t.LineSeriesView=hh,t.LinearAxis=Xr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=Lo,t.LollipopSeries=co,t.LollipopSeriesView=Oh,t.LowRangedSeries=br,t.MarkerSeries=Sr,t.MarkerSeriesPointView=Ka,t.MarkerSeriesView=Qa,t.NavigatorMask=Cr,t.NavigiatorHandle=Vr,t.ORG_ANGLE=x,t.OhlcSeries=uo,t.OhlcSeriesView=$h,t.OthersGroup=dr,t.PI_2=b,t.PaneContainer=class extends Ce{},t.ParetoSeries=go,t.ParetoSeriesView=Rh,t.PathBuilder=be,t.PathElement=Le,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=vo,t.PieSeriesGroup=wo,t.PieSeriesLabel=bo,t.PieSeriesText=yo,t.PieSeriesView=Hh,t.Point=Il,t.PointElement=za,t.PointHovering=Bo,t.PointLabelLineContainer=Ea,t.PointLabelLineView=Na,t.PointLabelView=Ta,t.PointViewPool=rh,t.RAD_DEG=w,t.RObject=Z,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=pr,t.RangedSeries=yr,t.RcAnimation=ge,t.RcControl=we,t.RcElement=Se,t.RcObject=Z,t.RectElement=ms,t.SVGNS=Tt,t.ScaleView=class extends Go{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Ce(t,"rct-gauge-scale-ticks")),this._ticks=new Fo(this._tickContainer,dn),this.add(this._labelContainer=new Ce(t,"rct-gauge-scale-tick-labels")),this._labels=new Fo(this._labelContainer,da)}},t.ScatterSeries=Vo,t.ScatterSeriesView=jh,t.SectionView=Yo,t.SectorElement=En,t.Series=nr,t.SeriesAnimation=xa,t.SeriesGroup=xr,t.SeriesMarker=hr,t.SeriesNavigator=Lr,t.SeriesView=Fa,t.ShapeAnnotation=Rr,t.ShapeAnnotationView=ih,t.Size=Fl,t.SplineSeries=vn,t.StackLabel=Qs,t.Subtitle=Mr,t.SvgShapes=fs,t.TextAnnotation=Ir,t.TextAnnotationView=sh,t.TextElement=$e,t.TimeAxis=tn,t.Title=Tr,t.Tooltip=Nr,t.TreemapSeriesType="treemap",t.TrendLineArea=Hs,t.TrendLineLabel=Gs,t.Trendline=Ys,t.Utils=rt,t.ValueGauge=Gi,t.ValueGaugeView=class extends ca{constructor(){super(...arguments),this.valueOf=(t,e,i)=>{const s=t.getParam(e);return o(s)?It.getFormatter(i||t.label.numberFormat).toStr(s):s},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.prop("animatable")&&t.prop("value")!==t._prevValue&&(this._ani=new _a(this).start(()=>{t._runValue=NaN,t._prevValue=t.prop("value")}))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=Ao,t.WaterfallSeriesView=Yh,t.Widget=Di,t.WidgetSeries=ur,t.WidgetSeriesConnector=cr,t.WidgetSeriesLabel=_r,t.WidgetSeriesPoint=lr,t.WidgetSeriesView=th,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Ds,t.absv=m,t.assignObj=l,t.buildValueRanges=bt,t.calcPercent=R,t.configure=Yl,t.copyObj=function(t){if(t&&"object"==typeof t&&!s(t))return l({},t)},t.cos=d,t.createChart=Wl,t.createData=Xl,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=ii,t.fixnum=mt,t.getVersion=zl,t.incv=L,t.isArray=s,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=st,t.isNumber=o,t.isObject=i,t.isString=n,t.maxv=f,t.minv=g,t.parsePercentSize=At,t.pickNum=P,t.pickProp=A,t.pickProp3=k,t.pixel=T,t.rectToSize=X,t.setAnimatable=jl,t.setDebugging=Hl,t.setLicenseKey=Ul,t.setLogging=Gl,t.sin=u,t.toStr=function(t){return null==t?null:String(t)}});