realchart 1.4.33 → 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/gauge.js +2 -2
- package/gauge.mjs +2 -2
- package/heatmap.js +2 -2
- package/heatmap.mjs +2 -2
- package/ie/gauge.ie.js +2 -2
- package/ie/heatmap.ie.js +2 -2
- package/ie/index.ie.js +2 -2
- package/ie/pictogram.ie.js +2 -2
- package/ie/split.ie.js +2 -2
- package/ie/treemap.ie.js +2 -2
- package/ie/vector.ie.js +2 -2
- package/ie/wordcloud.ie.js +2 -2
- package/index.d.ts +350 -88
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +27 -8
- package/pictogram.d.ts +1 -1
- package/pictogram.js +2 -2
- package/pictogram.mjs +2 -2
- package/split.d.ts +2 -0
- package/split.js +2 -2
- package/split.mjs +2 -2
- package/treemap.js +2 -2
- package/treemap.mjs +2 -2
- package/vector.d.ts +1 -1
- package/vector.js +2 -2
- package/vector.mjs +2 -2
- package/wordcloud.js +2 -2
- package/wordcloud.mjs +2 -2
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.
|
|
3
|
+
* RealChart v1.5.0
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t=Object.prototype.hasOwnProperty,e=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,i=function(t){return"function"==typeof t},r=function(t){return"string"==typeof t},n=function(t){return"number"==typeof t},o=function(t){return"boolean"==typeof t},a=function(t){return null==t||isNaN(t)},h=Object.assign,l=Math.floor,c=Math.ceil,_=Math.cos,d=Math.sin,u=Math.log10,p=Math.min,g=Math.max,f=Math.abs,m=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},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,s){return void 0!==t?t:void 0!==e?e:s},L=(t,e,s)=>t+(e-t)*s;function N(t){return t+"px"}function T(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 s={};return s[t]=e,s}const O=(t,e)=>t.replace("%1",e),D=(t,e)=>{throw new Error(O(t,e))};function R(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}class $ extends Error{}const F=(new Date).getTime(),I=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 s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(e){var s=e.getMonth(),i=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][s]+i;return s>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,s){const i=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+s),e.setDate(p(i,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,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!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 s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static 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 s=parseFloat(t);return isFinite(s)?s:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static 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,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static 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 s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(e,s){const i=performance.now();s(),t.log(e,performance.now()-i+"ms")}static clamp(t,e,s){return g(e,p(s,t))}static clampEx(t,e,s){return isNaN(e)||(t=g(e,t)),isNaN(s)||(t=p(s,t)),t}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static 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,s){const i=f(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],s=t[0];for(let i=1;i<t.length;i++)e=p(e,t[i]),s=g(s,t[i]);return{min:e,max:s}}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 s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static irandom(t,e){if(void 0!==e){const s=Math.floor(t),i=Math.floor(e);return Math.floor(Math.random()*(i-s)+s)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,s,i){const r=[];for(let n=0;n<i;n++)r.push(t.irandom(e,s));return r}static saveAsFile(t,e){const s=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),i=URL.createObjectURL(s),r=document.createElement("a");r.href=i,r.download=e,r.click(),URL.revokeObjectURL(i)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};I.LOGGING=!1,I.week_days=["일","월","화","수","목","금","토"],I.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],I.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=I;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 r(e)?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,s,i){return new t(e).getContrast(s,i)}static interpolate(e,s,i){const r=new t(null);return r.r=Math.ceil(e.r+(s.r-e.r)*i),r.g=Math.ceil(e.g+(s.g-e.g)*i),r.b=Math.ceil(e.b+(s.b-e.b)*i),r.a=(s.a+e.a)/2,r}static interpolate3(e,s,i,r,n=.5){const o=new t(null);return r<n?(o.r=Math.ceil(e.r+(s.r-e.r)*(r/n)),o.g=Math.ceil(e.g+(s.g-e.g)*(r/n)),o.b=Math.ceil(e.b+(s.b-e.b)*(r/n)),o.a=(s.a+e.a)/2):(o.r=Math.ceil(s.r+(i.r-s.r)*((r-n)/(1-n))),o.g=Math.ceil(s.g+(i.g-s.g)*((r-n)/(1-n))),o.b=Math.ceil(s.b+(i.b-s.b)*((r-n)/(1-n))),o.a=(i.a+s.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,s=null){return(s=s||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),s.g=Math.ceil(this.g+(255-this.g)*e),s.b=Math.ceil(this.b+(255-this.b)*e),s.a=this.a,s}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 s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}};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}),Y=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function X(t){return{width:t.width,height:t.height}}function U(t){return t.width<=0||t.height<=0}let Z=0;class q{constructor(){this._hash=++Z,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 K extends Error{}const Q=function(i,r){if(i===r)return!0;if(null==i||null==r)return!1;if(i instanceof Date&&r instanceof Date)return i.getTime()===r.getTime();if(s(i)&&s(r)){if(i.length!==r.length)return!1;for(let t=0;t<i.length;t++)if(!Q(i[t],r[t]))return!1;return!0}if(e(i)&&e(r)){const e=Object.keys(i),s=Object.keys(r);if(e.length!==s.length)return!1;for(const s of e){if(!t.call(r,s))return!1;if(!Q(i[s],r[s]))return!1}return!0}return!1},J=function(i,r){const n=e(i)?i:{};for(const i in r)if(t.call(r,i)){let t=r[i];s(t)?n[i]=t.slice(0):t instanceof Date?n[i]=new Date(t):e(t)?n[i]=J(n[i],t):n[i]=t}return n},tt=class i extends q{_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 s=this._op[t];return void 0!==s?s:void 0!==e?e:this.constructor.defaults[t]}num(t,e){return function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):e):t}(this._op[t],e,this.constructor.defaults[t])}bool(t,e,s=!1){const i=this._op[t];return void 0===i?e??this.constructor.defaults[t]??s:Boolean(i)}propAt(t,e){const s=this._resolvePath(t);if(-1!==s)return 0===s?this.prop(t,e):s.rest?s.child.propAt(s.rest,e):void 0}numAt(t,e){const s=this._resolvePath(t);return-1===s?NaN:0===s?this.num(t,e):s.rest?s.child.numAt(s.rest,e):NaN}boolAt(t,e,s=!1){const i=this._resolvePath(t);return-1!==i&&(0===i?this.bool(t,e,s):!!i.rest&&i.child.boolAt(i.rest,e,s))}props(...t){const e=this._op,s=this.constructor.defaults,i={};for(const r of t){const t=e[r];i[r]=void 0!==t?t:s[r]}return i}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,i=!1,r=!1,n=!1){const o={};let a,h;return s(t)?a=t:e(t)&&([a,h]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,i,r,h,n),o}saveTo(t,i,r=!1,n=!1,o=!1){let a,h;return s(i)?a=i:e(i)&&([a,h]=this.$_splitProps(i)),this._doSave(t,a,this.constructor.defaults,r,n,h,o),t}updateOptions(t,e=!0){const s=this._op;let i,r;if(void 0!==t&&!this._doSetSimple(s,t)){const e={};for(const s in t)this._doUpdateProp(s,t[s])?(r??=[]).push(s):this._findChild(s)?(i??=[]).push(s):t[s]!==this.prop(s)&&(this.$_validateOptions(s,t[s]),e[s]=t[s],(r??=[]).push(s));J(s,e)}return this._doApply(s),i?.forEach(e=>this._findChild(e).updateOptions(t[e])),e&&this._optionChanged(r),this}updateOption(t,i,r=!0,n=!1){if(this._doUpdateProp(t,i))return this._doApply(this._op),r&&this._optionChanged(t),this;const o=this._findChild(t);if(o)o.updateOptions(i);else{const o=this._op;(n||i!==this.prop(t))&&(this.$_validateOptions(t,i),s(i)?i=i.slice(0):i instanceof Date?i=new Date(i):e(i)&&(i=J({},i)),o[t]=i,this._doApply(o),r&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const s=this._op,i=this.prop(t),r=!o(i)||!i;return this.$_validateOptions(t,r),s[t]=r,this._doApply(s),e&&this._optionChanged(t),this}removeOption(e,s=!0){const i=this._op,r=this._findChild(e);return r?r.clearOptions(!0):t.call(i,e)&&(delete i[e],this._doApply(i),s&&this._optionChanged(e)),this}updateAt(t,e,s=!0,i=!1){const r=this._resolvePath(t);return-1===r?this:0===r?this.updateOption(t,e,s,i):r.rest?r.child.updateAt(r.rest,e,s,i):(r.child.updateOptions(e,s),this)}toggleAt(t,e=!0){const s=this._resolvePath(t);return-1===s?this:0===s?this.toggleOption(t,e):s.rest?s.child.toggleAt(s.rest,e):this}removeAt(t,e=!0){const s=this._resolvePath(t);return-1===s?this:0===s?this.removeOption(t,e):s.rest?s.child.removeAt(s.rest,e):(s.child.clearOptions(!0,e),this)}clearOptions(t=!1,e=!0){return function e(s){s._op={},t&&s._children&&s._children.forEach(t=>e(t)),s._doApply(s._op)}(this),e&&this._optionChanged(),this}clean(t=!0){return function e(s){const i=s._op,r=s.constructor.defaults;for(const t of Object.keys(i))Q(i[t],r[t])&&delete i[t];t&&s._children&&s._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("."),s=e<0?t:t.substring(0,e),i=e<0?"":t.substring(e+1),r=this._findChild(s);if(r)return{child:r,rest:i};if(i&&this._isChildCollection(s)){const t=i.indexOf("."),e=t<0?i:i.substring(0,t),r=this._getChildItem(s,e);if(r)return{child:r,rest:t<0?"":i.substring(t+1)}}return e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_doLoad(i,r){for(const n in r)if(t.call(r,n)){let t,o=r[n];this._doLoadProp(n,o)?i[n]=o:(t=this._findChild(n))?t.$_load(o):s(o)?i[n]=o.slice(0):o instanceof Date?i[n]=new Date(o):e(o)?i[n]=Object.assign({},o):i[n]=o}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doUpdateProp(t,e){return!1}_doApply(t){}_doSave(i,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 e of p)if(!_||!_.has(e)){const r=t.call(c,e);if(!r&&!a&&!u)continue;const o=n[e],h=r?c[e]:o;(a||u||!Q(h,o))&&(this._doSaveProp(i,e,h)||(s(h)?i[e]=this._doSaveArray(e,h)||h.slice():void 0!==h?i[e]=h:u&&(i[e]=void 0)))}_?.forEach((s,n)=>{const c=null!=h&&t.call(h,n),_=d&&r.indexOf(n)>=0;if(d&&!c&&!_)return;const u=c||_;if(o||u){const t=c&&e(h[n])?h[n]:void 0,r=l&&u,o=s.saveOptions(t,!0,a,r);(r||a||Object.keys(o).length>0)&&(i[n]=o)}})}_doSaveProp(t,e,s){return!1}_doSaveArray(t,e){return e.map(t=>t instanceof i?t.saveOptions([],!0):t)}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof K?e:new K(`Invalid value for option "${t}": ${e.message}`)}}$_splitProps(t){const e=[];let s;for(const i of Object.keys(t))this._children?.has(i)?(s??={})[i]=t[i]:e.push(i);return[e,s]}_doValidateOptions(t,e){}};tt.defaults={};let et=tt;const st=class t extends q{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,s){t.SHAPES.set(e,s)}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,s,i)=>{t.arc(e,s,i/2,0,2*Math.PI)}),t.set("square",(t,e,s,i)=>{const r=i/2;t.rect(e-r,s-r,i,i)}),t.set("diamond",(t,e,s,i)=>{const r=i/2;t.moveTo(e,s-r),t.lineTo(e+r,s),t.lineTo(e,s+r),t.lineTo(e-r,s),t.closePath()}),t.set("triangle",(t,e,s,i)=>{const r=i/2;t.moveTo(e,s-r),t.lineTo(e+r,s+r),t.lineTo(e-r,s+r),t.closePath()}),t.set("triangle-down",(t,e,s,i)=>{const r=i/2;t.moveTo(e,s+r),t.lineTo(e+r,s-r),t.lineTo(e-r,s-r),t.closePath()}),t.set("star",(t,e,s,i)=>{const r=i/2,n=.4*r,o=Math.PI/5;let a=-Math.PI/2;t.moveTo(e+r*Math.cos(a),s+r*Math.sin(a));for(let i=1;i<10;i++){a+=o;const h=1&i?n:r;t.lineTo(e+h*Math.cos(a),s+h*Math.sin(a))}t.closePath()}),t.set("plus",(t,e,s,i)=>{const r=i/2,n=i/6;t.moveTo(e-n,s-r),t.lineTo(e+n,s-r),t.lineTo(e+n,s-n),t.lineTo(e+r,s-n),t.lineTo(e+r,s+n),t.lineTo(e+n,s+n),t.lineTo(e+n,s+r),t.lineTo(e-n,s+r),t.lineTo(e-n,s+n),t.lineTo(e-r,s+n),t.lineTo(e-r,s-n),t.lineTo(e-n,s-n),t.closePath()}),t.set("cross",(t,e,s,i)=>{const r=i/2,n=i/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 i=0;i<a.length;i++){const r=a[i][0]*o-a[i][1]*o,n=a[i][0]*o+a[i][1]*o;0===i?t.moveTo(e+r,s+n):t.lineTo(e+r,s+n)}t.closePath()}),t.set("wye",(t,e,s,i)=>{const r=i/2,n=i/6/2,o=[];for(let t=0;t<3;t++){const e=-Math.PI/2+t*Math.PI*2/3,s=Math.cos(e),i=Math.sin(e),a=[s*r,i*r],h=[s*n-i*n,i*n+s*n],l=[s*n+i*n,i*n-s*n];o.push(h,a,l)}t.moveTo(e+o[0][0],s+o[0][1]);for(let i=1;i<o.length;i++)t.lineTo(e+o[i][0],s+o[i][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,s,i,r,n){const o=Math.min(i,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,s),t.lineTo(e+i-h,s),h>0&&t.arcTo(e+i,s,e+i,s+h,h),t.lineTo(e+i,s+r-l),l>0&&t.arcTo(e+i,s+r,e+i-l,s+r,l),t.lineTo(e+c,s+r),c>0&&t.arcTo(e,s+r,e,s+r-c,c),t.lineTo(e,s+a),a>0&&t.arcTo(e,s,e+a,s,a),t.closePath()):_.roundRect(e,s,i,r,a)}static _splinePath(t,e,s,i=!1){const r=e.length;if(r<2)return;if(i||t.moveTo(e[0][0],e[0][1]),2===r)return void t.lineTo(e[1][0],e[1][1]);const n=s/6;for(let s=0;s<r-1;s++){const i=e[s-1]??e[s],r=e[s],o=e[s+1],a=e[s+2]??o,h=r[0]+(o[0]-i[0])*n,l=r[1]+(o[1]-i[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,s=!0){const i=this._canvas.parentElement,r=Math.max(0,Math.floor(A(t,i&&i.clientWidth))),n=Math.max(0,Math.floor(A(e,i&&i.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),s&&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,s,i){const r=this._ctx;return r.beginPath(),r.rect(t,e,s,i),r.clip(),this}resolveStroke(t,e,s,i,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,s,i,r,o)}}resolveFill(t,e,s,i,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,s,i,r,o)}}line(e,s,i,r,n){const o=this._ctx;return o.save(),t._applyLine(o,n),o.beginPath(),o.moveTo(e,s),o.lineTo(i,r),o.stroke(),o.restore(),this}hline(e,s,i,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(s)+.5:s;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(e,o),n.lineTo(e+i,o),n.stroke(),n.restore(),this}vline(e,s,i,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,s),n.lineTo(o,s+i),n.stroke(),n.restore(),this}polyline(e,s){if(e&&e.length>1){const i=this._ctx;i.save(),t._applyLine(i,s),i.beginPath(),i.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)i.lineTo(e[t][0],e[t][1]);i.stroke(),i.restore()}return this}spline(e,s,i=1){if(e&&e.length>1){const r=this._ctx;r.save(),t._applyLine(r,s),r.beginPath(),t._splinePath(r,e,i),r.stroke(),r.restore()}return this}polygon(e,s,i){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(),s&&(t._applyFill(r,s),r.fill()),i&&(t._applyLine(r,i),r.stroke()),r.restore()}return this}rect(e,s,i,r,n,o){const a=this._ctx;if(a.save(),n&&(t._applyFill(a,n),a.fillRect(e,s,i,r)),o){const n=1===(o.width??1)?.5:0;t._applyLine(a,o),a.strokeRect(Math.floor(e)+n,Math.floor(s)+n,i,r)}return a.restore(),this}roundRect(e,s,i,r,n,o,a){if(i>0&&r>0){const h=this._ctx;h.save(),h.beginPath(),t._roundRectPath(h,e,s,i,r,n),o&&(t._applyFill(h,o),h.fill()),a&&(t._applyLine(h,a),h.stroke()),h.restore()}return this}circle(e,s,i,r,n){if(i>0){const o=this._ctx;o.save(),o.beginPath(),o.arc(e,s,i,0,2*Math.PI),r&&(t._applyFill(o,r),o.fill()),n&&(t._applyLine(o,n),o.stroke()),o.restore()}return this}arc(e,s,i,r,n,o,a=!1){if(i>0){const h=this._ctx;h.save(),t._applyLine(h,o),h.beginPath(),h.arc(e,s,i,r,n,a),h.stroke(),h.restore()}return this}pie(e,s,i,r,n,o,a,h=!1){if(i>0){const l=this._ctx;l.save(),l.beginPath(),l.moveTo(e,s),l.arc(e,s,i,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,s,i,r,n,o,a,h){if(r>0&&i>=0&&i<r){const l=this._ctx;l.save(),l.beginPath(),l.arc(e,s,r,n,o,!1),l.arc(e,s,i,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,s,i,r,n,o){if(r>0){const a=t.SHAPES.get(e);if(!a){const e=this._ctx;e.save(),e.beginPath(),a(e,s,i,r),n&&(t._applyFill(e,n),e.fill()),o&&(t._applyLine(e,o),e.stroke()),e.restore()}}return this}bar(e,s,i,r,n,o){const a=this._ctx,h=Math.round(e),l=Math.round(s),c=Math.max(1,Math.round(i)),_=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,s=1===e?.5:0,i=1===e?1:0;t._applyLine(a,o),a.strokeRect(h+s,l+s,c-i,_-i)}return a.restore(),this}area(e,s,i,r){if(e&&e.length>1){const n=this._ctx;n.save(),n.beginPath(),n.moveTo(e[0][0],s);for(let t=0;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);if(n.lineTo(e[e.length-1][0],s),n.closePath(),i&&(t._applyFill(n,i),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,s,i,r,n=1){if(e&&e.length>1){const o=this._ctx;o.save(),o.beginPath(),o.moveTo(e[0][0],s),o.lineTo(e[0][0],e[0][1]),t._splinePath(o,e,n,!0),o.lineTo(e[e.length-1][0],s),o.closePath(),i&&(t._applyFill(o,i),o.fill()),r&&(o.beginPath(),t._splinePath(o,e,n),t._applyLine(o,r),o.stroke()),o.restore()}return this}text(e,s,i,r){if(null!=e&&""!==e){const n=this._ctx;n.save(),t._applyText(n,r),n.fillText(e,s,i),n.restore()}return this}measureText(t,e){const s=this._ctx;s.save(),e&&(s.font=e);const i=s.measureText(t);return s.restore(),i}drawImage(t,e,s,i,r,n,o,a,h){const l=this._ctx;return void 0!==n&&void 0!==o&&void 0!==a&&void 0!==h&&void 0!==i&&void 0!==r?l.drawImage(t,n,o,a,h,e,s,i,r):void 0!==i&&void 0!==r?l.drawImage(t,e,s,i,r):l.drawImage(t,e,s),this}createLinearGradient(t,e,s,i,r){const n=this._ctx.createLinearGradient(t,e,s,i);for(const t of r)n.addColorStop(t.offset,t.color);return n}createRadialGradient(t,e,s,i,r,n,o){const a=this._ctx.createRadialGradient(t,e,s,i,r,n);for(const t of o)a.addColorStop(t.offset,t.color);return a}verticalGradient(t,e,s){return this.createLinearGradient(0,t,0,e,s)}horizontalGradient(t,e,s){return this.createLinearGradient(t,0,e,0,s)}blit(t,e,s,i,r){return this._cssWidth>0&&this._cssHeight>0&&t.drawImage(this._canvas,0,0,this._canvas.width,this._canvas.height,e,s,i??this._cssWidth,r??this._cssHeight),this}};st.SHAPES=st._builtinShapes();const it=(new Date).getTime(),rt="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class nt{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&nt.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(s,nt.month_days[nt.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!s(t))return h({},t)}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-it}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static parseTuples(t){if(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 s of Object.keys(t))e[s]=this.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(t,e){const s=+new Date;e(),nt.log(t,+new Date-s+"ms")}static clamp(t,e,s){return g(e,p(s,t))}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isAnimation(t){return"[object Animation]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=f(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}static diffAngle(t,e){const s=f(t-e);return p(s,b-s)}}nt.LOGGING=!1,nt.week_days=["일","월","화","수","목","금","토"],nt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],nt.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]],nt.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const ot={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 at="ko",ht=ot[at]||ot[at="ko"];const lt=(t,s)=>{t&&e(s)&&(ht=ot[t.substring(0,2)]=Object.assign(ot.ko,ot.en,s))};class ct extends q{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const _t=function(t){return t&&"object"==typeof t};class dt extends ct{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),s(e)&&e.forEach(t=>this._rows.push(this.$_readRow(t)))}$_buildOptions(t){const e=t.fields;let i;i=s(e)?e.slice():r(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(s(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else _t(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&D(ht.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class ut{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 dt({},i):_t(i)&&s(i.values)&&(r=new dt(i.options,i.values)),this._map[e]=r}}}const pt="%".charCodeAt(0),gt=void 0,ft={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"},mt=function(t){const e=ft[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return ft[t]=e,e}return e};function yt(t){return parseFloat(t.toPrecision(12))}function bt(t){return Math.floor(1e6*t)/1e6}const xt=function(t,i,n,o=!0,a=!0,l=!1,c){let _,d;if(o&&(i=-Number.MAX_VALUE,n=Number.MAX_VALUE),s(t))_=[],t.forEach(t=>{if(e(t)&&r(t.color)){const e={fromValue:A(t.fromValue,d?d.toValue:i),toValue:A(t.toValue,n),color:t.color,style:t.style?h({},t.style):gt};e.fromValue<e.toValue&&(_.push(e),d=e)}}),_=_.sort((t,e)=>t.fromValue-e.fromValue).filter(t=>t.toValue>=i&&t.fromValue<n),a&&_.forEach(t=>{t.fromValue=g(t.fromValue,i),t.toValue=p(t.toValue,n)});else if(e(t)&&s(t.colors)&&t.colors.length>0){const e=t.colors,r=s(t.styles)?t.styles:null;if(_=[],s(t.steps)&&t.steps.length>0){const o=s(t.steps)?t.steps:null;i<o[0]&&o.unshift(i),n>o[o.length-1]&&o.push(n);for(let t=0;t<o.length-1;t++)_.push({fromValue:o[t],toValue:o[t+1],color:e[p(t,e.length-1)],style:r?r[p(t,r.length-1)]:gt})}else{let s=A(t.fromValue,i);const o=A(t.toValue,n),a=(o-s)/e.length;let h=0;for(;s<o;)_.push({fromValue:s,toValue:s+=a,color:e[p(h,e.length-1)],style:r?r[p(h,r.length-1)]:gt}),h++}}if(l&&_&&_.length>0){let t=0,e=i;for(;t<_.length;)_[t].fromValue>e&&_.splice(t,0,{fromValue:e,toValue:_[t].fromValue,color:c}),e=_[t].toValue,t++;_[t-1].toValue<n&&_.push({fromValue:_[t-1].toValue,toValue:n,color:c})}return _},wt="shuffle",vt="random",St="vertical-lr",Vt="vertical-rl",Ct="fill",At="stroke";function Pt(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function kt(t){return null==t?null:String(t)}function Lt(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===pt?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;Tt(ht.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function Nt(t,e){return Lt(t,!0)||Lt(e,!1)}const Tt=(t,e)=>{throw new Error(O(t,e))},Mt="http://www.w3.org/2000/svg",Et=function(t){return"function"==typeof t?t:null},Bt=function(t){return"string"==typeof t&&t.length>0},Ot=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},Dt="0".charCodeAt(0),Rt="#".charCodeAt(0),$t=",".charCodeAt(0),Ft="s".charCodeAt(0),It="a".charCodeAt(0);class zt{static getFormatter(t){let e=zt.Formatters[t];return e||(zt.Formatters[t]=e=new zt(t)),e}static get Default(){return zt.getFormatter(zt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===Dt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===Rt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===Dt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===$t){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Ft){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===It){s.signDisplay="never";break}}return s.minimumIntegerDigits=g(1,s.minimumIntegerDigits),s}}}zt.DEFAULT_FORMAT="",zt.Formatters={};const Ht=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Gt=[".","/","-",":"],jt="Z".charCodeAt(0),Wt="z".charCodeAt(0),Yt="A".charCodeAt(0),Xt="a".charCodeAt(0),Ut="y".charCodeAt(0),Zt="M".charCodeAt(0),qt="m".charCodeAt(0),Kt="W".charCodeAt(0),Qt="w".charCodeAt(0),Jt="d".charCodeAt(0),te="H".charCodeAt(0),ee="h".charCodeAt(0),se="S".charCodeAt(0),ie="s".charCodeAt(0);class re{static getFormatter(t){let e=re.Formatters[t];return e||(re.Formatters[t]=e=new re(t)),e}static get Default(){return re.getFormatter(ht.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||ht.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case Ut:i+=a>2?t.getFullYear():M(t.getFullYear()%100);break;case Zt:i+=a>1?M(t.getMonth()+1):t.getMonth()+1;break;case Jt:i+=a>1?M(t.getDate()):t.getDate();break;case Kt:i+=a>1?M(z.weekOfYear(t,e)+1):z.weekOfMonth(t,e,!0)+1;break;case Qt:i+=a>1?z.long_week_days[t.getDay()]:z.week_days[t.getDay()];break;case te:i+=a>1?M(t.getHours()):t.getHours();break;case ee:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?M(e):e}else i+=a>1?M(t.getHours()):t.getHours();break;case qt:i+=a>1?M(t.getMinutes()):t.getMinutes();break;case ie:i+=a>1?M(t.getSeconds()):t.getSeconds();break;case Xt:case Yt:t.getHours()<12?i+=ht.am:i+=ht.pm;break;case se:let s=t.getMilliseconds();i+=3==a?E(s):2==a?M(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(Gt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),Ht.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Yt&&e<=jt||e>=Xt&&e<=Wt)&&D(ht.invalidDateFormat,t)}e.push(n)}if(r<i&&z.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&z.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||ht.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}re.Formatters={};class ne{static isBright(t){return new ne(t).isBright()}static getContrast(t,e,s){return new ne(t).getContrast(e,s)}static interpolate(t,e,s){const i=new ne(t),r=new ne(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return rt?new ne(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 ne(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}ne.BLACK="#000",ne.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class oe{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:oe.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(t,e){const s=t.createElementNS(Mt,"clipPath");return s.id=e,s.append(t.createElementNS(Mt,"rect")),s}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(t){return oe.isElement(t)&&t.namespaceURI===Mt}static isSVGClipPathElement(t){return oe.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var ae;oe.instanceOf=function(t,e){return oe.isElement(t)&&t.tagName===e.toUpperCase()},oe.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(ae||(ae={}));const he={name:"RealChart",version:"1.4.33",license:"enterprise",code:null};class le{static decode(t){const e=le.CHARS,s=le.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}le.PAD="=",le.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class ce{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=ce.xor,i=ce.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=ce.xor,i=ce.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map(function(t){return 255&t.charCodeAt(0)});const s=ce.kb,i=ce._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:s.p.slice(0).map(function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*ce.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)}),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=c.p.length;r<o;)i(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;)i(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const s=ce._decryptBlock;let i=ce._init(e),r=[],n=le.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*ce.POW24|n[a+1]*ce.POW16|n[a+2]*ce.POW8|n[a+3],h.right=n[a+4]*ce.POW24|n[a+5]*ce.POW16|n[a+6]*ce.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}ce.POW2=Math.pow(2,2),ce.POW3=Math.pow(2,3),ce.POW4=Math.pow(2,4),ce.POW8=Math.pow(2,8),ce.POW16=Math.pow(2,16),ce.POW24=Math.pow(2,24),ce.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 _e{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=ce.decrypt(t,"dkdl"+this._getLDKey(ce.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}const de=new Map;function ue(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const pe=function(t){const e=location.hostname;let s;const i="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(s=he.code||window.realChartLic,!s)throw new Error(i)}catch(t){throw new Error(i)}const r=_e.decrypt(s);if(!function(t,e){if("RealChart"===t)return!0;const s=ue(e),i=de.get(t);return!!i&&i.has(s)}(r.name,t)||"RealChart"!==he.name)throw new Error(i);try{const t=r.server.toLowerCase(),s=location.pathname.toLowerCase();if(he.license!=ae.Developer&&!_e.includedDomains(t,e.toLowerCase(),s))throw new Error(i);const n=r.lic.toLowerCase();if(!Object.values(ae).includes(n))throw new Error(i);if(he.license=r.lic,n==ae.Evaluation||n==ae.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(i)}return!0},ge={linear:t=>t,inOutSine:t=>-(_(y*t)-1)/2},fe=function(t,e,s,i,r,n){const o=B(e,null!=s?s:"initial"),a=B(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class me{constructor(){this.delay=0,this.duration=me.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=p(1,g(0,yt(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=A(t,me.DURATION),this.delay=e||0,this._easing=ge[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout(()=>this._stop(!1),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}me.DURATION=700,me.SHORT_DURATION=300;class ye extends me{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const be=function(t){return new ye(t).start()},xe=function(t){return isNaN(t)?0:t};class we{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=>{n(t)||r(t)?this._path.push(t):this._path.push(t.x,t.y)}),this}move(t,e){return n(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return n(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return n(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return n(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0,"Z"),this}lines(...t){if(n(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",xe(t[e]),xe(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",xe(t[e].x),xe(t[e].y));return this}polygon(...t){return n(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},c=Math.sqrt(h.x*h.x+h.y*h.y);if(0===c)return void this.line(t[s].px,t[s].py);h.x/=c,h.y/=c;let _=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,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 s=d+o.x,p=u+o.y,g=t[i].px+n.x,f=t[i].py+n.y;this.curve(s,p,g,f,t[i].px,t[i].py),_=t[i+1].px-t[i].px,o.x=l.x*_*r,o.y=l.y*_*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,c=n.py-(o.py-s.py)*i;this.curve(a,h,l,c,n.px,n.py)}}}const 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)"};class Se extends q{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},pe(e),!t&&oe.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Se.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),oe.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){T(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){oe.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(Ve.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(Mt,"clipPath")).forEach(t=>t.remove())}clearTemporaryDefs(){this.$_clearDefs(Ve.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){return this.addClip(new Le(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new Me(this.doc()))}clipDonut(){return this.addClip(new Ee(this.doc()))}clipPath(){return this.addClip(new Te(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(r(t))for(const e of Array.from(this._defs.children))if(oe.isElement(e)&&e.id===t){t=e;break}oe.isElement(t)&&t.parentNode===this._defs&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_setTesting(){this._testing=!0,Ve.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,e,s){if(this._inited)return;const i=t.defaultView;e instanceof i.HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof i.HTMLDivElement||D(ht.invalidOuterDiv,e),t=this._container.ownerDocument;const r=this._dom=t.createElement("div");h(r.style,ve),r.className=s,this._container.appendChild(r);const n=this._svg=t.createElementNS(Mt,"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"+he.version,n.appendChild(o);const a=this._defs=t.createElementNS(Mt,"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),h(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),r.appendChild(this._tester),rt&&(this._canvas=t.createElement("canvas"))}_initDefs(t,e){let s=t.createElementNS(Mt,"filter");s.setAttribute("id",Se.SHADOW_FILTER);const i=t.createElementNS(Mt,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(Mt,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(Mt,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(Mt,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const a=t.createElementNS(Mt,"feMerge"),h=t.createElementNS(Mt,"feMergeNode"),l=t.createElementNS(Mt,"feMergeNode");l.setAttribute("in","SourceGraphic"),a.appendChild(h),a.appendChild(l),s.appendChild(a),e.appendChild(s)}_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{nt.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=N(s),r.style.height=N(i)),h(this._htmlRoot.style,{left:N(e.left-t.left),top:N(e.top-t.top)});const n=this._container.firstElementChild;if(n.removeAttribute("style"),h(n.style,ve),s>0&&i>0){this._doRenderBackground(n,this._root,s,i);const t=this._padding=oe.getPadding(this._root.dom);this._doRender({x:t.left,y:t.top,width:s-t.left-t.right,height:i-t.top-t.bottom})}}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),nt.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout(()=>{i&&this.invalidateLayout(),this._resizeTimer=null},s):this.invalidateLayout()}}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}Se.CLASS_NAME="rct-control",Se.SHADOW_FILTER="rr-chart-shadow-filter",Se._animatable=!0;class Ve extends q{constructor(t,e,s=gt){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(Mt,s||"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,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,e){const s=t.createElementNS(Mt,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(Mt,e);return this._dom.insertBefore(i,s),i}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 T(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){let t=this._dom.getBBox();return rt&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return rt&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return this._ani instanceof ye||!!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=nt.isValidNum(t)?t:this._tx,e=nt.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=nt.isValidNum(t)?t:this._tx,e=nt.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",()=>{this.$_cleanMove(r,i)}),r.addEventListener("cancel",()=>{this.$_cleanMove(r,i)})):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=nt.isValidNum(t)?t:this._tx,e=nt.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}),a.addEventListener("cancel",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&nt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&nt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter(t=>t.length>0)),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(mt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(mt(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(mt(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(r(t))t&&this._dom.classList.add(t);else if(e(t)){const e=this.dom.style;for(let s in t)e.setProperty(mt(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){r(t)?(this._resetClass(),t&&this.addClass(t)):e(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){r(t)?t&&this.addClass(t):e(t)&&this.internalSetStyles(t)}addStyleOrClass(t){r(t)?t&&this.addClass(t):e(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){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=be({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=g(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:A(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=be({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=g(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,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(Ve.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort((e,s)=>t.indexOf(e)-t.indexOf(s))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach(t=>this._dom.appendChild(t._dom))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return Ve.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(nt.isValidNum(e)||nt.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+nt.pick(this._originX,t.getAttribute("x"),0)+" "+nt.pick(this._originY,t.getAttribute("y")||0)+")"),nt.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=nt.getNumber(this._scaleX,1),n=nt.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}Ve.DEBUGGING=!1,Ve.TESTING=!1,Ve.ASSET_KEY="_asset_",Ve.CLIP_KEY="_clip_",Ve.TEMP_KEY="_temp_";class Ce extends q{constructor(t,e,s=!1){super(),this._control=e,this._dom=t.createElement("div"),s&&(this._svg=t.createElementNS(Mt,"svg"),oe.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,s,i){return oe.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class Ae extends Ve{constructor(t,e){super(t,e,"g")}}class Pe extends Ve{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class ke extends Ve{constructor(t){super(t,gt,"clipPath");const e=this._id=nt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Le extends ke{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Ve(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Ne extends Ve{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=r(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Te extends ke{constructor(t){super(t),this._path=new Ne(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class Me extends ke{constructor(t){super(t),this.add(this._circle=new Ve(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class Ee extends ke{constructor(t){super(t),this.add(this._donut=new Ne(t))}setDonut(t,e,s,i){this._donut.setPath((new we).donut(t,e,s,i).end())}}class Be{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}var Oe,De,Re;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Oe||(Oe={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(De||(De={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Re||(Re={}));class $e extends Ve{constructor(t,e=void 0){super(t,e,"text"),this._layout=De.TOP,this._overflow=Re.WRAP,this._dirty=!0,this._text="",this.anchor=Oe.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case De.MIDDLE:i=Math.floor(s/2);break;case De.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=g(0,t),(e=p(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(ne.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Fe="$_TH",Ie="$_TW";class ze{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?zt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(z.isDate(n)){const t=s[3]?re.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),gt),0===this._literals[2].length&&(this._literals[2]=gt)}else this._literals.push(r,n,gt,gt);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class He extends ze{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class Ge extends He{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach(t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}}),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const je={t:class extends He{tag(){return"</t>"}},b:class extends He{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends He{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:Ge};class We{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new ze).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in je){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new je[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const Ye=/<br.*?>|\r\n|\n/;class Xe{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,s,i,r){if(this._isVertical)return void this.buildVertical(t,e,s,i,r);const n=t.doc,o=A(this.lineHeight,1),a=this._lines,h=a.length,l=[],c=[];t.clearDom(),i=i||t;const _=t.getStyle("writing-mode"),d=this._vertical=_===St||_===Vt;for(let e=0;e<h;e++){const s=a[e];let h=0,_=0,u=null;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r),o=s.getBBox();if(s[Ie]=o.width,s[Fe]=o.height,d?(h=g(h,s[Ie]),_+=s[Fe]):(h+=s[Ie],_=g(_,s[Fe])),u||(u=s),e instanceof Ge){const i=n.createElementNS(Mt,"a");i.setAttribute("href",e.url),i.setAttribute("target",e.target),i.appendChild(s),t.appendDom(i)}}c.push(u),s[Fe]=_*o,s[Ie]=h*o,l.push(0==e?s[Ie]/2:s[Ie])}if(h>0){let e=a[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(d?null!=c[s-1]&&(i=Math.floor(e[Ie]-t.getAscent(e[Ie]))+t.getAscent(a[s][Ie])):r=e[Fe]-t.getAscent(e[Fe])+t.getAscent(a[s][Fe]),null==c[0]&&c[s]==c.find(t=>null!=t)){const r=t.insertElement(n,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();i+=o.width,r[Ie]=o.width,r[Fe]=e[Fe]=o.height,c[0]=r}switch(_){case St:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case Vt:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}e=a[s]}if(d){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=c,r=i[Ie];if(e)i.setAttribute("dx",String(_===Vt?s-r/2:r/2));else switch(_){case St:i.setAttribute("x",String((s-r)/-2));break;case Vt:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(a[0][Fe])}}buildVertical(t,e,s,i,r){const n=t.doc,o=A(this.lineHeight,1),a=this._lines,h=a.length,l=[];let c=0;const _=[];t.clearDom(),i=i||t;for(let e=0;e<h;e++){const s=a[e];let h=0,d=0,u=null,p=!1;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r);" "===s.textContent&&(p=!0,s.textContent=".");const o=s.getBBox();if(s[Ie]=o.width,s[Fe]=o.height,p&&(s.textContent=" ",s[Fe]*=.6,p=!1),h+=s[Ie],d=g(d,s[Fe]),u||(u=s),e instanceof Ge){const i=n.createElementNS(Mt,"a");i.setAttribute("href",e.url),i.setAttribute("target",e.target),i.appendChild(s),t.appendDom(i)}}_.push(u),s[Fe]=d*o,s[Ie]=h*o,c=g(h,c),l.push(0==e?s[Ie]/2:s[Ie])}if(h>0){let e=a[0];_[0].setAttribute("x",String((c-_[0].getBBox().width)/2));for(let s=1;s<_.length;s++)_[s]&&(_[s].setAttribute("x",String((c-_[s].getBBox().width)/2)),_[s].setAttribute("dy",String(e[Fe]-t.getAscent(e[Fe])+t.getAscent(a[s][Fe]))),e=a[s]);t.layoutText(a[0][Fe])}}layout(t,e,s,i,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=Oe.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=Oe.END,a=n.height-r.bottom;break;default:t.anchor=Oe.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Oe.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=Oe.END,o=s-r.right;break;default:t.anchor=Oe.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(Ye);for(let t of s)e.push((new We).parse(t))}}}class Ue{constructor(t){this.source=t}hasDef(){return!0}}class Ze extends Ue{_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((s,i)=>{!function(t,e,s,i,r){const n=t.createElementNS(Mt,"stop");n.setAttribute("offset",String(s)),n.setAttribute("stop-color",i),n.setAttribute("stop-opacity",String(r)),e.appendChild(n)}(t,e,i/(n.length-1),s,null==o[i]?1:o[i])})}prepare(){}}class qe extends Ze{getEelement(t,e){const s=t.createElementNS(Mt,"linearGradient");let{x1:i,x2:r,y1:n,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),e.dir){case"up":n=1;break;case"right":r=1;break;case"left":i=1;break;default:o=1}return s.setAttribute("x1",i),s.setAttribute("y1",n),s.setAttribute("x2",r),s.setAttribute("y2",o),s}}qe.TYPE="lineargradient";class Ke extends Ze{getEelement(t,e){const s=t.createElementNS(Mt,"radialGradient");return T(e.cx)||s.setAttribute("cx",e.cx),T(e.cy)||s.setAttribute("cy",e.cy),T(e.r)||s.setAttribute("r",e.r),this._setStops(t,s),s}}Ke.TYPE="radialgradient";class Qe extends Ue{prepare(){}getEelement(t,s){const i=t.createElementNS(Mt,"pattern"),n=t.createElementNS(Mt,"path");let o,a,l,c,_=!1;if(i.setAttribute("id",s.id),i.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=Qe.STOCK[+s.pattern%Qe.STOCK.length];o=t.path,a=t.style,_=!t.fill,l=t.width||20,c=t.height||20}else r(s.pattern)&&(o=s.pattern,l=s.width||s.height||20,c=s.height||s.width||20);i.setAttribute("width",String(l)),i.setAttribute("height",String(c)),n.setAttribute("d",o),a&&h(n.style,a),s.style&&h(n.style,s.style),_&&(n.style.fill="none");let d=s.backgroundStyle;if(r(d)||e(d)){const e=t.createElementNS(Mt,"rect");i.append(e),e.style.fill=r(d)?d:d.fill,e.setAttribute("width",String(l)),e.setAttribute("height",String(c))}return i.append(n),i}}Qe.TYPE="pattern",Qe.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 Je extends Ue{prepare(){const t=this.source;this._colors=s(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&nt.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(nt.randomLike(t)*e.length)]:e[t%e.length]}hasDef(){return!1}getEelement(t,e){this._colors=s(e.colors)?e.colors:[]}}Je.TYPE="colors";class ts extends Ue{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach(e=>{if(r(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}})}getImage(t){return r(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ts.SIZE,height:e.height||e.width||ts.SIZE})}}ts.TYPE="images",ts.SIZE=20;class es{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(e(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach(s=>{const i=s.getEelement(t,s.source);i.setAttribute(Ve.ASSET_KEY,"1"),e.addDef(i)})}unregister(t){this._items.forEach(e=>{t.removeDef(e.source.id)})}get(t){return this._map[t]}prepareRender(){this._items.forEach(t=>{t.prepare()});for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map(t=>t.source)}$_loadItem(t){if(e(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Qe.TYPE:s(t.colors)?e=Je.TYPE:s(t.images)&&(e=ts.TYPE)),e)switch(e.toLowerCase()){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);case ts.TYPE:return new ts(t)}}}}let ss=0;const is=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},rs=["__proto__","constructor","prototype"],ns=function(i,r){const n=e(i)?i:{};for(const i in r)if(t.call(r,i)&&!rs.includes(i)){const t=r[i];s(t)?n[i]=t.slice(0):e(t)?t._obj instanceof dt?n[i]=t:nt.isDate(t)?n[i]=new Date(t):n[i]=ns(n[i],t):n[i]=t}return n};class os extends et{constructor(t){super(),this.chart=t,ss++}_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 s=this._op[t];return Ot(s,e,this.constructor.defaults[t])}_load(t){var e;const s=this._op,i=this.visible;return this._config=t,void 0===t||this._doSetSimple(s,t)||this._doLoad(s,t),this._doApply(s),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this)),s}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this._load(t),this}saveOptions(t,e=!0,s=!1,i=!1){return void 0===t&&arguments.length<=1?super.saveOptions(void 0,!0,s,i):"boolean"==typeof t?super.saveOptions(void 0,t,s,i):super.saveOptions(t,e,s,i)}updateOptions(t,s=!0){var i;const r=this.visible;if(e(t)){const e={},s=[];for(const i in t)this._findChild(i)?this._doUpdateProp(i,t[i])||s.push(i):e[i]=t[i];super.updateOptions(e,!1),s.forEach(e=>{this._findChild(e).updateOptions(t[e],!1)})}else super.updateOptions(t,!1);return this.visible!==r&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),s&&this._optionChanged(),this}updateOption(t,e,s=!0,i=!1){var r;const n=this.visible;let o=!1;if(this._doUpdateProp(t,e))this._doApply(this._op),o=!0;else{const s=this._findChild(t);s?(s.updateOptions(e,!1),o=!0):(i||e!==this.prop(t))&&(super.updateOption(t,e,!1,i),o=!0)}return this.visible!==n&&(null===(r=this.chart)||void 0===r||r._visibleChanged(this)),o&&s&&this._optionChanged(t),this}toggleOption(t,e=!0){var s;const i=this.visible;return super.toggleOption(t,!1),this.visible!==i&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),e&&this._optionChanged(t),this}removeOption(e,s=!0){var i;const r=this.visible,n=this._findChild(e);let o=!1;return n?(n.clearOptions(!0,!1),o=!0):t.call(this._op,e)&&(super.removeOption(e,!1),o=!0),this.visible!==r&&(null===(i=this.chart)||void 0===i||i._visibleChanged(this)),o&&s&&this._optionChanged(e),this}clearOptions(t=!0,e=!0){var s;const i=this.visible;return super.clearOptions(t,!1),this.visible!==i&&(null===(s=this.chart)||void 0===s||s._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(e,s,i=!0){if(!e)return this;let r=this._op.style,n=!1;return null!==s&&""!==s||(s=void 0),void 0===s?r&&t.call(r,e)&&(delete r[e],n=!0):r&&r[e]==s||(r||(r=this._style=this._op.style={}),r[e]=String(s),n=!0),n&&(this.$_applyOptions(this._op),i&&this._optionChanged()),this}setStyles(t,s=!1,i=!0){let r=!1,n=this._op.style;if(s&&n&&(delete this._op.style,r=!0,n=this._style=void 0),e(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._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(i,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(t.call(r,n)){let t=r[n];const o=this._findChild(n);this._doLoadProp(n,t)?i[n]=t:o?o._load(t):s(t)?i[n]=t.slice(0):e(t)?t._obj instanceof dt?i[n]=t._obj:nt.isDate(t)?i[n]=new Date(t):i[n]=h({},t):i[n]=t}}_doSetSimple(t,e){return o(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 s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`,i=this.prop(e);i!==this[s]&&(this[`${s}Dim`]=Lt(this[s]=i,!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}os.REFRESHED="refreshed",os.defaults=is(et.defaults,{visible:!0});class as{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 hs extends os{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?zt.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,s,i,r,n){this._richTextImpl?(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n)):(t&&(t.clearDom(),t.text=""),e&&(e.clearDom(),e.text=""))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Xe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return r(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,s){if(nt.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=nt.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let n=r(t)?t:this._getNumberText(e,s,i)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(n=o+n),a&&(n+=a),n}}hs.defaults=is(os.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ls extends hs{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 s=t._assets.get(e);s instanceof ts&&(this._images=s)}this._root=this.prop("iconRoot")||""}getIconUrl(t){const e=this.prop("icon")||t;return r(e)?this.getUrl(e):null}getUrl(t){if(t){r(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 s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof ts?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}ls.defaults=is(hs.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class cs extends os{}const _s={};class ds extends os{static register(...t){t.forEach(t=>{_s[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 s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted();let i,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);s?this._y=e-a.getPos(e,n):this._x=a.getPos(t,n),isNaN(o)||(s?r=this._h=e-a.getPos(e,o)-this._y:i=this._w=a.getPos(t,o)-this._x)}if(!isNaN(a)){const n=this.chart.getAxisOf(this,!1);s?this._x=n.getPos(t,a):this._y=e-n.getPos(e,a),isNaN(h)||(s?i=this._w=n.getPos(t,h)-this._x:r=this._h=e-n.getPos(e,h)-this._y)}}return isNaN(i)?i=R(this._widthDim,t):i<0&&(this._x+=i,i=-i),isNaN(r)?r=R(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:i,height:r}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this.prop("align")){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this.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(os.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(r(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=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,(i=this.prop("offsetX"))!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(this.prop("offsetY")),this._setDims(t,"width","height")}_doPrepareRender(t){}}ds.defaults=is(os.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class us extends as{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter(s=>{const i=s.prop("row"),r=s.prop("col");return t===i&&e===r})}getAnnotation(t){const e=this._map[t];if(e instanceof ds)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t,i){const r=this.owner.chart,n=this._items=[],o=this._map={};s(t)?t.forEach((t,e)=>{n.push(this.$_loadItem(r,t,e,i?this.owner:void 0))}):e(t)&&n.push(this.$_loadItem(r,t,0,i?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")):gt})}$_loadItem(t,e,s,i){let n=e.type;n||(n=r(e.imageUrl)?"image":r(e.shape)?"shape":"text");const o=t._getAnnotationType(n);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a.init(),a.index=s,a._load(e),a}}class ps extends me{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t,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 s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class gs extends os{}gs.defaults=is(os.defaults,{minWidth:50});class fs extends os{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=this._addChild("flag",new gs(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 s=this.axis.axisValueAt(t,e);if(s instanceof this.chart.win.Date)try{return re.getFormatter(this.prop("timeFormat")).toStr(new Date(s),this.chart.startOfWeek)}catch{return re.getFormatter(fs.defaults.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}else try{return zt.getFormatter(this.prop("numberFormat")).toStr(s)}catch{return zt.getFormatter(fs.defaults.numberFormat).toStr(s)}}moved(t,e,s){const i=this.prop("onChange");i&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),i(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t,e){return i(e)?(this._op.visible=!0,this._op.onChange=e,!0):super._doSetSimple(t,e)}}fs.defaults=is(os.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const ms={};class ys extends os{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class bs extends ys{_isVisible(){const t=this.prop("visible");return null==t?this.axis._isX:t}_doSetSimple(t,e){return r(e)?(this._op.visible=!0,this._op.style={stroke:e},!0):super._doSetSimple(t,e)}}bs.defaults=is(ys.defaults,{visible:void 0});class xs extends ys{getGap(){return this._gap}getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return rt?"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")&&!T(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(this.prop("rotation"));const s=parseFloat(String(this.prop("gap")));this._gap=isNaN(s)?xs.defaults.gap:s}}xs.defaults=is(ys.defaults,{align:"middle",offset:0,gap:5});class ws extends ys{_isVisible(){return this.bool("visible")&&!T(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}ws.defaults=is(ys.defaults,{position:"end",gap:2});class vs extends ys{getRows(){if(!1===this.prop("visible"))return[];const t=this.axis,e=this.prop("colors"),s=e?e.length:0,i=[],r=this._style;if(this.prop("belowColor")&&t.isBaseVisible()&&i.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this.prop("belowColor"),style:r}),s>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%s]&&i.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%s],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%s]&&i.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%s],style:r});n[n.length-1].value<t.valueMax()&&e[o%s]&&i.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%s],style:r})}return i}_doSetSimple(t,e){return r(e)?(this._op.colors=[e,null],!0):s(e)?(this._op.colors=e,!0):super._doSetSimple(t,e)}}class Ss extends ys{_doInit(t){this._rows=this._addChild("rows",new vs(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}}Ss.defaults=is(ys.defaults,{visible:void 0,depthVisible:void 0});class Vs extends ls{getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}Vs.defaults=is(ls.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Cs extends ys{_doInit(t){this._label=this._addChild("label",new Vs(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)}}Cs.defaults=is(ys.defaults,{front:!1,zindex:0});class As extends Cs{}class Ps extends Cs{}class ks extends ys{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 nt.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:ks.DEF_LENGTH,this._gap=this.num("gap",ks.defaults.gap)}}ks.DEF_LENGTH=7,ks.defaults=is(ys.defaults,{visible:!1,gap:3});class Ls extends ys{_getLength(){return this._length}_getCount(){return this._count}_doSetSimple(t,e){return nt.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._length=this.num("length",Ls.defaults.length),this._count=g(1,l(this.num("count",Ls.defaults.count)))}}Ls.defaults=is(ys.defaults,{visible:!1,count:4,length:4});class Ns extends ys{}Ns.defaults=is(ys.defaults,{visible:!1});class Ts extends ls{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 s=t.index,i=this.prop("textCallback");if(i){const e=i(this.axis.getTickLabelArgs(s,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==s?P(n,r):s==e-1?P(o,r):r}getLabelStyle(t,s){const i=this._op,r=t.index;if(i.styleCallback){const s=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(e(s))return s}return 1==s?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==s-1?i.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}}Ts.defaults=is(ls.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ms extends ys{getThickness(){return Math.max(0,this.num("thickness",Ms.defaults.thickness))}getMinThumbSize(){return Math.max(0,this.num("minThumbSize",Ms.defaults.minThumbSize))}getGap(){return Math.max(0,this.num("gap",Ms.defaults.gap))}getGapFar(){return Math.max(0,this.num("gapFar",Ms.defaults.gapFar))}}Ms.defaults=is(ys.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class Es{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?nt.clamp(t,this.min,this.max):nt.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class Bs extends bs{}class Os extends os{static register(...t){t.forEach(t=>{ms[t.type]=t,t.subtype&&(ms[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 xs(this)),this._unitLabel=this._addChild("unitLabel",new ws(this)),this._line=this._addChild("line",new bs(this)),this._sectorLine=this._addChild("sectorLine",new Bs(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 fs(this)),this._scrollBar=this._addChild("scrollBar",new Ms(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 s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=p(...s),e._yMax=g(...s),t.push(...s))})}collectRanges(){this._series.forEach(t=>{t.needAxes()&&t.collectRanges(this,this._values)})}collectReferentValues(){this._series.forEach(t=>{t.prepareReferents(this)}),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter(t=>t._valid),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this.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 s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.isSplitted()){const t=[s[0].row];for(let e=1;e<s.length;e++)t.indexOf(s[e].row)<0&&t.push(s[e].row);t.forEach(t=>{let e=0,i=0;s.forEach(s=>{s.row==t&&s.isClusterable()&&(e+=A(s.groupWidth(),1))}),s.forEach(s=>{if(s.row==t&&s.isClusterable()){const t=A(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}})})}else{let t=0,e=0;s.forEach(e=>{e.isClusterable()&&(t+=A(e.groupWidth(),1))}),s.forEach(s=>{if(s.isClusterable()){const i=A(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}})}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach(e=>e.pos=this.getPos(t,e.value))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+nt.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[g(t,this._min),p(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Es(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return r&&(i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed()),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this.bool("reversed"),t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new ps(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(e){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 Ps(i):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new As(i):new Ps(i),e.init(),e._load(t),r.push(e)}))};super._doApply(e),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=g(0,p(360,this.num("totalAngle"))),t.call(this._op,"guide")?n(this.prop("guide")):t.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?yt(p(...t)||0):NaN,max:t.length>0?yt(g(...t)||0):NaN}}}Os.defaults=is(os.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 Ds extends as{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;s(t)?t.forEach((t,s)=>this._items.push(this.$_loadAxis(e,t,s))):this._items.push(this.$_loadAxis(e,t,0)),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 r(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach(t=>t.disconnect())}prepare(){this._items.forEach(t=>t._prepare())}collectValues(){this._items.forEach(t=>t.collectValues())}collectRanges(){this._items.forEach(t=>t.collectRanges())}collectReferentValues(){this._items.forEach(t=>{t.collectReferentValues()})}prepareRender(){this._items.forEach(t=>t._prepareRender())}afterRender(){this._items.forEach(t=>t.afterRender())}_buildTicks(t,e){this._items.sort((t,e)=>t.isBased()?1:e.isBased()?-1:0).forEach(s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)})}connect(t){const e=this.isX,s=this._items,i=t.options,o=e?i.xAxis:i.yAxis;let a;if(n(o)&&o>=0&&o<s.length?a=s.find(t=>t._index===o):r(o)&&(a=s.find(t=>t.prop("name")===o)),a||(a=s[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,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach(t=>t.resetZoom())}$_loadAxis(t,e,i){var r;let n=t._getAxisType(e.type);if(!n){let 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(T(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 Rs extends os{_doPrepareRender(t){}}const $s={},Fs={};class Is extends Rs{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")}}Is.defaults=is(Rs.defaults,{size:"100%"});class zs extends os{constructor(t){super(t.chart)}}class Hs extends Is{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach(t=>{$s[t.type]=t})}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}Hs.defaults=is(Is.defaults,{duration:500});class Gs extends Is{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach(t=>{Fs[t.type]=t,Fs[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(e){super._doApply(e),t.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,i){const r=this._gaugesType();s(i)?i.forEach((e,s)=>this.$_add(Hs._loadGauge(t,e,r))):e(i)&&this.$_add(Hs._loadGauge(t,i,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}Gs.defaults=is(Is.defaults,{minValue:0});class js extends as{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter(s=>{const i=s.row||0,r=s.col||0;return t===i&&e===r})}getGauge(t){const e=this._map[t];if(e instanceof Hs)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t){const i=this.chart,r=this._items=[],n=this._map={};s(t)?t.forEach((t,e)=>{r.push(this.$_loadItem(i,t,e))}):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach(t=>{if(t.name&&(n[t.name]=t),t instanceof Gs)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)}),i._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($s).length&&0===Object.keys(Fs).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 Ws extends Hs{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 g(this.prop("minValue"),p(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")}}}Ws.defaults=is(Hs.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class Ys extends os{constructor(t){super(t.chart),this.scale=t}}Ys.defaults=is(os.defaults,{reversed:!1,length:7});class Xs extends ls{getText(t){return nt.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class Us extends os{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._line=this._addChild("line",new os(e)),this._tick=this._addChild("tick",new Ys(this)),this._label=this._addChild("label",new Xs(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,s=NaN){s=A(s,e);const{min:i,max:r}=this._adjustMinMax(p(e,s),g(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(g(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=A(s.prop("minValue"),t),e=A(s.prop("maxValue"),e),this._min=p(t,e),this._max=g(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.prop("minValue"),i=e.prop("maxValue");return isNaN(s)&&(s=p(...t)),isNaN(i)&&(i=g(...t)),this._min=p(s,i),this._max=g(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){let i;const r=this.prop("steps"),n=this.prop("stepCount"),o=this.prop("stepInterval"),a=this.prop("stepPixels");return i=Array.isArray(r)?r.slice(0):n>0?this._getStepsByCount(n,e,s):o>0?this._getStepsByInterval(o,e,s):a>0?this._getStepsByPixels(t,a,e,s):[e,s],this._min=i[0],this._max=i[i.length-1],i}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(yt(e));for(let e=1;e<t;e++)n.push(yt(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,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(yt(l=s));;){if(l+=o,l>=i){r.push(yt(i));break}r.push(yt(l))}return r}}Us.defaults=is(os.defaults,{position:"default",stepPixels:48,gap:8});class Zs extends os{}Zs.defaults=is(os.defaults,{visible:!1});class qs extends os{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._rangeLabel=this._addChild("rangeLabel",new Zs(e)),this._tickLabel=this._addChild("tickLabel",new os(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:qs.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=this.prop("ranges"))!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=xt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}qs.defaults=is(os.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ks extends hs{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ks.defaults=is(hs.defaults,{animatable:!0});class Qs extends Ks{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")}}Qs.defaults=is(Ks.defaults,{offsetX:0,offsetY:0});class Js{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ti.DEF_CENTER),this.setCenterY(ti.DEF_CENTER),this.setRadius(ti.DEF_RADIUS),this.setInnerRadius(ti.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Lt(P(t,ti.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Lt(P(t,ti.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Lt(P(t,ti.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Lt(P(t,ti.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Lt(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),s=p(e,this._innerDim?R(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?R(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=A(t%360,0),i=g(0,p(360,A(e,360)));this._startRad=x+w*s,this._handRad=w*s,this._sweepRad=w*i}}class ti extends Ws{_doInit(t){super._doInit(t),this._props=new Js}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 Qs(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 Js)}_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"))}}ti.DEF_CENTER="50%",ti.DEF_RADIUS="40%",ti.DEF_INNER="80%",ti.defaults=is(Ws.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class ei extends Gs{_doInit(t){this._props=new Js,this._label=this._addChild("label",new Qs(this.chart))}get label(){return this._label}getProps(){return this._props}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=this.num("itemGap");let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach((t,e)=>{const n=t._childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s})}}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(this.prop("centerX")),e.setCenterY(this.prop("centerY")),e.setRadius(this.prop("radius")),e.setInnerRadius(this.prop("innerRadius")),e.setValueRadius(this.prop("valueRadius"))}}ei.defaults=is(Gs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let si=class extends os{constructor(t){super(t.chart),this.body=t}_isVisible(){var t,e,s,i;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===(i=null===(s=this.body)||void 0===s?void 0:s.canZoom)||void 0===i?void 0:i.call(s))}};si.defaults=is(os.defaults,{visible:void 0});class ii extends hs{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this.prop("text")||this.chart._body.emptyView.prop("text")||ii.DEF_TEXT}}function ri(t,e){return e._vlen>0?e._vlen:g(0,A(t.rd,0)-A(t.rdInner,0))}function ni(t,e,s){const i=A(t.rdInner,0),r=ri(t,e);return r<=0?i:i+e.getPos(r,s)}function oi(t,e,s,i){const r=A(t.rdInner,0),n=ri(t,e);return n<=0?r:r+e.getPos(n,s)*i}ii.DEF_TEXT="표시할 데이터가 없습니다.",ii.defaults=is(os.defaults,{visible:void 0});class ai extends ls{getDefaultIconPos(){return"left"}}class hi extends os{}hi.defaults=is(os.defaults,{visible:!1});class li extends os{_doInit(t){this._line=this._addChild("line",new hi(this.chart)),this._endLine=this._addChild("endLine",new hi(this.chart)),this._gridLine=this._addChild("gridLine",new hi(this.chart))}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}li.defaults=is(os.defaults,{});class ci extends os{_doInit(t){this._xSide=this._addChild("xSide",new li(this.chart)),this._ySide=this._addChild("ySide",new li(this.chart)),this._orgLine=this._addChild("orgLine",new hi(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 n(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._angle=p(60,g(30,this.num("angle")))}prop(t,e){return"angle"===t?this._angle:super.prop(t,e)}}ci.defaults=is(os.defaults,{visible:!1,length:32,angle:32});class _i extends os{constructor(t){super(t),this._annotations=new us(this)}_doInit(t){this._depth=this._addChild("depth",new ci(this.chart)),this._image=this._addChild("image",new cs(null)),this._emptyView=this._addChild("emptyView",new ii(this.chart)),this._innerText=this._addChild("innerText",new ai(this.chart)),this._zoomButton=this._addChild("zoomButton",new si(this))}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof Is&&this.contains(s)?s: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 s=this._depth.num("length"),i=this._depth.prop("angle"),r=c(_(i*w)*s),n=c(d(i*w)*s);return{depth:s,angle:i,base:r,side:n,wBody:t-r,hBody:e-n}}}getRadius(t,e){return R(this._radiusDim,p(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?p(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,p(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(e){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(e),this._setDims(e,"radius","innerRadius","centerX","centerY"),t.call(this._op,"annotation")?i(this.prop("annotation")):t.call(this._op,"annotations")&&i(this._op.annotations)}_doPrepareRender(t){this._annotations.prepareRender(),this._innerText._prepareRender()}}_i.defaults=is(os.defaults,{circular:!0,zoomType:"none",radius:"45%",innerRadius:0,centerX:"50%",centerY:"50%"});class di extends os{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}di.defaults=is(os.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ui extends os{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class pi extends Rs{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 ui(this,t)),this.prop("reversed")&&(this._items=this._items.reverse());const e=this._itemMap={},s=this._visItems=[];this._items.forEach(t=>{const i=t.source.legendKey();if(nt.isNotEmpty(i)&&""!==i){const r=e[i];r?r.push(t):(e[i]=[t],s.push(t))}else s.push(t)})}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var gi;pi.defaults=is(Rs.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 fi=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),mi=.001;class yi{static _createDrawers(...t){const e={};return t.forEach(t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)}),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static arrowParts(t,e,s,i,r){const n=s-t,o=i-e,a=Math.sqrt(n*n+o*o);if(a<.001)return{body:this.line(t,e,s,i),head:[]};const h=null!=r?g(1,p(r,.9*a)):p(.15*a,12),l=Math.atan2(o,n),c=y/6,u=s+h*_(l+Math.PI-c),f=i+h*d(l+Math.PI-c),m=s+h*_(l+Math.PI+c),b=i+h*d(l+Math.PI+c);return{body:["M",t,e,"L",(u+m)/2,(f+b)/2],head:["M",u,f,"L",s,i,"L",m,b,"Z"]}}static polygon(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const o=i>0,a=o?0:1;return r>0?n>0?(r=p(f(i)/2,s/2,r),n=p(f(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=p(f(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=p(f(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=p(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return b-t<mi}static arc(t,e,s,i,r,n,o,a=!1){const h=p(b,f(n-r)),l=this.isCircled(h),c=h>y?1:0,u=o?1:0,g=_(r),m=d(r),x=_(n-=l?u?mi:-.001:0),w=d(n),v=[];return v.push("M",t+s*g,e+i*m,"A",s,i,0,c,u,t+s*x,e+i*w),l&&v.push("M",t,e),a&&v.push("Z"),v}static sector(t,e,s,i,r,n,o,a){const h=p(b,f(o-n)),l=this.isCircled(h),c=h>y?1:0,u=a?1:0,g=_(n),m=d(n),x=_(o-=l?u?mi:-.001:0),w=d(o),v=s*r,S=i*r,V=[];return V.push("M",t+s*g,e+i*m,"A",s,i,0,c,u,t+s*x,e+i*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-u,t+v*g,e+S*m),V.push("Z"),V}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){v.push("M",t,e,"A",s,i,0,u,c,n,o),v.push("L",n,o+r),v.push("A",s,i,0,u,1-c,t,e+r),v.push("Z")}const c=a?1:0;let u,g=p(b,f(o-n));const m=this.isCircled(g);let x=(n%b+b)%b,w=(o%b+b)%b;const v=[];let S,V,C,A;if(!m&&(c&&x<=y&&w>=0&&w<x||!c&&w<=y&&x>=0&&x<w))u=0,c?(S=t+s*_(n),V=e+i*d(n),C=t+s*_(y),A=e+i*d(y),l(S,V,C,A),h&&(h.x1=S,h.y1=V),S=t+s*_(0),V=e+i*d(0),C=t+s*_(o),A=e+i*d(o),l(S,V,C,A),h&&(h.x2=C,h.y2=A)):(S=t+s*_(n),V=e+i*d(n),C=t+s*_(0),A=e+i*d(0),l(S,V,C,A),h&&(h.x1=S,h.y1=V),S=t+s*_(y),V=e+i*d(y),C=t+s*_(o),A=e+i*d(o),l(S,V,C,A),h&&(h.x2=C,h.y2=A));else{S=t+s*_(n),V=e+i*d(n),C=t+s*_(o-=m?c?mi:-.001:0),A=e+i*d(o),c?(x=m||x<=b&&!(w>=x&&w<b)?0:x,w=m||w>y&&!(x<=w&&x>y)?y:w):(x=m||x>y&&!(w<=x&&w>y)?y:x,w=m||w<b&&!(x>=w&&x<b)?0:w);const r=t+s*_(x),a=e+i*d(x),p=t+s*_(w-=m?c?mi:-.001:0),g=e+i*d(w);u=f(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,s,i,r,n,o,a,h){const l=p(b,f(o-n)),c=this.isCircled(l),u=a?1:0,g=t+s*_(n),m=e+i*d(n),x=t+s*_(o-=c?u?mi:-.001:0),w=e+i*d(o),v=l>y?1:0,S=[];return S.push("M",g,m,"A",s,i,0,v,u,x,w),S.push(c?"M":"L",x,w+r),S.push("A",s,i,0,v,1-u,g,m+r),h&&(h.x1=g,h.y1=m,h.x2=x,h.y2=w),S.push("Z"),S}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*d(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,c=i/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*_(r),o+h*d(r));for(let t=0;t<5;t++)g.push("L",n+a*_(r),o+h*d(r),"L",n+l*_(r+p),o+c*d(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=gi[e](0,0,g(2*s,0),g(2*i,0));break;default:r=gi.circle(s,i,g(p(s,i),0))}t.setPath(r)}}gi=yi,yi._drawers=Object.assign({circle:t=>gi.circle(0,0,t),none:t=>[]},gi._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class bi extends Ve{static create(t,e,s,i,r,n,o=0){return new bi(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=gt,s=gt){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class xi extends Ne{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(yi.box(t,e,s,i)),this}}const wi="head",vi="far",Si="inside",Vi="none",Ci="near",Ai="displayAll",Pi="largestFirst",ki="hidden",Li="line",Ni="area",Ti="circlebar",Mi="treemap",Ei="heatmap",Bi="vector",Oi="wordcloud",Di="pictogram",Ri="pictorialbar",$i="pictorial",Fi="racebar",Ii="raceline";let zi=0;const Hi="_deleted",Gi="_drop",ji="_save";class Wi{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=zi++,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 i=this.source;null==i?this.isNull=!0:s(i)?0===i.length?this.isNull=!0:this._readArray(t,i):e(i)?(this._readObject(t,i),(s(i.drillDown)||e(i.drillDown))&&(this.drillDown=i.drillDown)):this._readSingle(i),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];if(null!=i&&"object"==typeof i)for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[Hi]=!0}_isDeleted(){return this[Hi]}_setDrop(t){this[Gi]=t}_getDrop(){return this[Gi]}_setSave(t){this[ji]=t}_getSave(){return this[ji]}updateValues(t,i){if(this._prev=this.copy(),e(i)?this.source=Object.assign(e(this.source)?this.source:{},i):s(i)?this.source=i.slice(0):this.source=i,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=gt}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return h(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[A(s.xField,0)],this.y=e[A(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=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 Yi{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,s){function i(t,s,i){return e(t)?t.pid===s:t===i}return this._points.find(e=>i(t,e.pid,e.xValue)&&(void 0===s||i(s,e.pid,e.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 s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))}),e}clean(){this._points=this._points.filter(t=>!t[Hi])}getProps(t){return this._points.map(e=>e.getProp(t))}getCategories(t){return this._points.map(e=>e[t])}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter(t=>t.xValue>=i&&r>=t.xValue).slice(0):e.filter(t=>t.xValue>i-.5&&r+.5>t.xValue).slice(0)}return e}}class Xi extends Wi{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return h(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[A(s.xField,0)]),this.y=e[A(s.yField,0+i)],this.z=e[A(s.zField,1+i)]}}_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 Ui extends Wi{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 h(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[A(s.lowField,0+i)],this.y=e[Ot(s.highField,s.yField,1+i)],i>0&&(this.x=e[A(s.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 Zi extends ks{getPosition(){const t=this.prop("position");return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Zi.defaults=is(ks.defaults,{step:1});class qi extends Ts{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}}qi.defaults=is(Ts.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class Ki extends Ss{getPositions(t,e){if(t.isNumericScale())return t._ticks.filter(t=>isFinite(t.pos)).map(t=>t.pos);const s=t._ani,i=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(s?s.getPos(n[t],i):n[t])}t._ticks[0].value!==e&&n.length>1&&r.unshift(s?s.getPos(n[1],i):n[1])}else for(let t=1,e=n.length-2;t<=e;t++)r.push(s?s.getPos(n[t],i):n[t])}return r}}class Qi extends Os{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,s=e.length;if(s<3)return-1;let i=2,r=s-2;for(;i<=r;){const s=i+r>>>1;if(t<e[s-1])r=s-1;else{if(!(t>=e[s]))return this._catMin+s-2;i=s+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 Qi.categoryTreeDefaults;if(!1===t.visible)return null;const s={...Qi.categoryTreeDefaults,...t};return e(t.divider)&&e(Qi.categoryTreeDefaults.divider)&&(s.divider={...Qi.categoryTreeDefaults.divider,...t.divider}),e(t.band)&&(s.band={visible:!0,...t.band}),s}$_normalizeDivider(t){const e=Qi.categoryTreeDividerDefaults;return!1===t?{...e,visible:!1}:!0===t||null==t?{...e}:{...e,...t}}$_isDividerOn(t){var s;const i=this._categoryTreeOp,r=null===(s=null==i?void 0:i.levels)||void 0===s?void 0:s[t],n=null==r?void 0:r.divider;if(void 0!==n){if(!1===n)return!1;if(!0===n)return!0;if(e(n)&&void 0!==n.visible)return!1!==n.visible}return!1!==this.$_normalizeDivider(null==i?void 0:i.divider).visible}$_dividerProp(t,s){var i;const r=this._categoryTreeOp,n=null===(i=null==r?void 0:r.levels)||void 0===i?void 0:i[t];return e(null==n?void 0:n.divider)&&void 0!==n.divider[s]?!1!==n.divider[s]:!1===(null==r?void 0:r.divider)?this.$_isDividerOn(t):e(null==r?void 0:r.divider)&&void 0!==r.divider[s]?!1!==r.divider[s]:this.$_isDividerOn(t)}isLevelVisible(t){var e,s;const i=this._categoryTreeOp;return null==i||!1!==(null===(s=null===(e=i.levels)||void 0===e?void 0:e[t])||void 0===s?void 0:s.visible)}getLevelRotation(t){var e,s,i;const r=this._categoryTreeOp,n=null===(i=null===(s=null===(e=null==r?void 0:r.levels)||void 0===e?void 0:e[t])||void 0===s?void 0:s.label)||void 0===i?void 0:i.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":n(t)?+t%360:void 0}getLevelStyle(t){var e,s,i,r;return null===(r=null===(i=null===(s=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===s?void 0:s[t])||void 0===i?void 0:i.label)||void 0===r?void 0:r.style}getLevelAlign(t){var e,s,i,r;const n=null===(r=null===(i=null===(s=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===s?void 0:s[t])||void 0===i?void 0:i.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 s=t.divider;return!1!==s&&(!0===s||null==s||(!e(s)||!1!==s.visible&&!1!==s.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(r(t))return t;if(e(t)&&Object.keys(t).length>0)return t;const s=this.line._style;return r(s)||e(s)&&Object.keys(s).length>0?s:"rct-axis-tree-divider"}$_dividerStyleOf(t){if(e(t))return t.style}getDividerStyle(t){var e,s;if(null!=t){if(!this.isDividerBetween(t)&&!this.isDividerEdge(t)&&!this.isDividerBelow(t))return;const s=this._categoryTreeOp,i=null===(e=null==s?void 0:s.levels)||void 0===e?void 0:e[t],r=this.$_dividerStyleOf(null==i?void 0:i.divider),n=this.$_dividerStyleOf(null==s?void 0:s.divider),o=void 0!==r?r:n;return this.$_resolveDividerStyle(o)}return this.$_resolveDividerStyle(this.$_dividerStyleOf(null===(s=this._categoryTreeOp)||void 0===s?void 0:s.divider))}$_isBandEnabled(){const t=this._categoryTreeOp;return null!=t&&(!1!==t.band&&(!0===t.band||!!e(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 i=e(null==t?void 0:t.band)?t.band.colors:null;return s(i)&&i.length>0?i:["var(--rct-axis-tree-band-0-fill)","var(--rct-axis-tree-band-1-fill)"]}getCategoryTreeSpan(t,e,s){return this.$_getSpanFromPts(t,e,s)}getDividerPos(t,e){return this.$_getDividerPosFromPts(t,e)}getDividerLinePositions(t){const e=this._categories.length;if(0===e)return[];const s=[this.$_getCategoryEdgePos(0,t,"left")];for(const e of this._categoryTreeDividerEnds)s.push(this.getDividerPos(e,t));return s.push(this.$_getCategoryEdgePos(e-1,t,"right")),s}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 s=A(this._prevRate,1);return this.prev(e)+(this.prop("reversed")?t*(1-s):0)}_type(){return"category"}unitPad(){return this._catPad}isNumericScale(){return this._numericScale}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new Es(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new Ki(this)}_createTickModel(){return new Zi(this)}_createLabel(){return new qi(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=nt.makeIntArray(0,this._categories.length):super.collectValues(),this.$_resolveNumericScale()}getStartAngle(){let t=super.getStartAngle(),e=+this.prop("startOffset");return e>0&&(t-=p(e,1)*this.getWeight(0)*b/this._catLen),t}_doPrepareRender(){this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=Ot(this.prop("minPadding"),this.prop("padding"),0),this._maxPad=Ot(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,s,i){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 s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/l),s+=this.getWeight(i);_.push(s/l),_.push((s+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 s=g;s<_.length-2;s+=a){const i=t+(s-1),n=this._categories[i/u-d];this.getWeight(i)<=0||(i===t&&(f=!0),i===e&&(m=!0),h.push({index:s-1,pos:NaN,value:i,label:r.getTick(s-1,n?n.t:i)}))}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 s=e-t,i=this._categories[e/u-d];h.push({index:s,pos:NaN,value:e,label:r.getTick(s,i?i.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 s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this.getTotalAngle();if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/t*e}}else this.$_updateMarkPoints()}$_scaleNumericPts(t){const e=this._minPad+1+this._maxPad,s=Math.max(0,t),i=this._pts=[0,this._minPad/e,(this._minPad+1)/e,1];for(let t=0;t<i.length;t++)i[t]*=s}$_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 s=0;s<t.length;s++)e[s]=t[s].pos}else{const t=this._pts,s=t.length-2;e.length=s;for(let i=0;i<s;i++)e[i]=t[i+1]}}getPos(t,e){if(this._numericScale)return this.$_getNumericPos(t,e);const s=this._pts,i=this.$_slotIndex(e);if(i<0||i+2>=s.length)return NaN;const r=s[i+1];let n=r+(s[i+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 s=this._pts;this.prop("reversed")&&(e=t-e);const i=s.length;if(i<3)return;let r=1,n=i-2,o=-1;for(;r<=n;){const t=r+n>>>1;e>=s[t]&&s[t+1]>=e?(o=t,n=t-1):e<s[t]?n=t-1:r=t+1}if(o>=0){const t=s[o],i=s[o+1];return this._catMin+o-(1-(e-t)/(i-t))}}getUnitLen(t,e){if(this._numericScale)return this.getLabelLength(t,e);const s=this.$_slotIndex(e),i=this._pts;if(s<0||s+2>=i.length)return NaN;let r;return r=this._ani?this._ani.getPos(i[s+2],this.prop("reversed"))-this._ani.getPos(i[s+1],this.prop("reversed")):i[s+2]-i[s+1],f(r)}getLabelLength(t,e){if(this._numericScale){const e=this._ticks.length;return e<2?NaN:Math.floor(t/e)}const s=this.$_slotIndex(e),i=this._pts;return s<0||s+2>=i.length?NaN:s>this._tstep?i[s+2]-i[s+2-this._tstep]:i[s+2+this._tstep-1]-i[s+1]}getValue(t){if(n(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:s}=super._doCalculateRange(t);return this._isX||(e=p(0,e),s=g(0,s)),this.$_applyRangeOptions(e,s)}$_hasExplicitCategories(){const t=this.prop("categories");return s(t)&&t.length>0}$_hasDefinedTickRange(){const t=this._op;return n(t.minValue)&&!isNaN(t.minValue)&&n(t.maxValue)&&!isNaN(t.maxValue)}$_applyRangeOptions(t,e){const s=this._op,i=s.minValue,r=s.maxValue,o=n(i)&&!isNaN(i),a=n(r)&&!isNaN(r);return o&&a?this._numericScale?{min:p(i,t),max:g(r,e)}:{min:i,max:r}:(o&&i<t&&(t=i),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 s=0;for(const e of t)if(isFinite(e)){if(!Number.isInteger(e))return!0;s=g(s,f(e))}return s>g(2*e,Qi.NUMERIC_SCALE_SPAN_THRESHOLD)}$_shouldUseNumericScale(t,e){const s=e-t+1,i=this._values;if(0===i.length||!isFinite(s)||s<=0)return!1;const r=new Set;for(const t of i)isFinite(t)&&r.add(t);const n=r.size;return 0!==n&&(s>Qi.NUMERIC_SCALE_SPAN_THRESHOLD&&s>n*Qi.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:p(0,t.min),s=this._isX?t.max:g(0,t.max);({min:e,max:s}=this.$_applyRangeOptions(e,s)),this.$_shouldUseNumericScale(Math.floor(e),Math.ceil(s))&&(this._numericScale=!0)}$_doBuildNumericTicks(t,e){const s=this._label;this._catMin=t,this._catMax=e,this._catLen=e-t;const i=this.$_buildNumericTickValues(t,e),r=[];for(let t=0;t<i.length;t++){const e=i[t],n=this.$_hasExplicitCategories()&&this.$_isValidCategoryIndex(e)?this.getXLabel(e):String(e);r.push({index:t,pos:NaN,value:e,label:s.getTick(t,n)})}return this._setMinMax(t,e),r}$_buildNumericTickValues(t,e){const s=e-t;if(!isFinite(s)||s<=0)return[t];let i=s/10;if(i<=0||!isFinite(i))return[t,e];const r=Math.pow(10,Math.floor(Math.log10(i))),n=i/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 s=this._catMin,i=this._catMax-s,r=this._pts;if(!isFinite(e)||i<=0||r.length<3)return i<=0?t/2:NaN;const n=r[1];let o=n+(r[r.length-2]-n)*((e-s)/i);this.prop("reversed")&&(o=t-o);const a=bt(o);return this._ani?this._ani.getPos(a,this.prop("reversed")):a}$_numericValueAt(t,e){const s=this._pts;if(s.length<3)return;this.prop("reversed")&&(e=t-e);const i=s[1],r=s[s.length-2],n=this._catMax-this._catMin;if(r===i||n<=0)return this._catMin;const o=(e-i)/(r-i);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,s){const i=this._pts,r=this._catMin,n=this._catMax,o=A(s,this._vlen),a=g(t,r),h=p(e,n);if(a>h||!i.length)return{center:NaN,size:0};let l=i[a-r+1],c=i[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,s){const i=this._pts,r=this._catMin,n=this._catMax,o=A(e,this._vlen),a="left"===s?1:2;let h=i[g(p(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,s){const i=this.$_parseCategoryLevels(t),r=this._categories;(null==i?void 0:i.length)&&(e=i[i.length-1]),r.push({c:t,t:e,i:s,levels:i})}$_buildCategoryTree(){var t,e,s,i;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===(s=r[n].levels)||void 0===s?void 0:s[t];let a=n+1;for(;a<r.length&&(null===(i=r[a].levels)||void 0===i?void 0:i[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 i,n;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 s=null==t?1:g(A(t.weight,1),0),i=t&&t.icon;let r,n;null==t?n=r=null:e(t)?(r=P(t.name,t.label),n=P(t.label,t.name)):n=r=String(t),this._len+=s,this.$_pushCategory(r,n,i),l.set(l.size,s)});else{const e=this.chart.seriesByName(o.categorySeries),a=this.chart.seriesByName(o.weightSeries)||e,h=o.weightField,c=null==a?void 0:a.data,_=o.weightByFrequency;e&&(t=[e]);const d=new Map;for(const e of t){const t=e.collectCategories(this);for(let e=0,s=t.length;e<s;e++){const s=t[e];d.has(s)||(d.set(s,d.size),this.$_pushCategory(s,s))}}if(h&&s(c)&&c.length>0){const t=a.getPoints();let e=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=g(null!==(i=o[h])&&void 0!==i?i:1,0);if(r(u)){const t=d.get(u);if(void 0===t){e=null;continue}if(!l.has(t)){l.set(t,p),e=u,this._len+=p;continue}_&&e===u&&(l.set(t,g((null!==(n=l.get(t))&&void 0!==n?n:0)+p,0)),this._len+=p)}else Number.isInteger(u)?(l.has(u)||(l.set(u,p),this._len+=p),e=null):e=null}}else if(s(t)&&t.length>0){const e=new Set;for(const s of t){const t=s.collectCategories(this),i=t.length;if(0===i)continue;let r=t[0],n=1;for(let s=1;s<i;s++){const i=t[s],o=d.get(r);i!==r?(void 0===o||e.has(r)||(e.add(r),l.set(o,_?n:1)),r=i,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 s=t.v=e;null!=t.c&&(this._map[t.c]=s)})}}Qi.type="category",Qi.categoryTreeDividerDefaults={visible:!0,edge:!0,between:!0,below:!0},Qi.categoryTreeDefaults={visible:!0,divider:{...Qi.categoryTreeDividerDefaults},band:!1},Qi.defaults=is(Os.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+",categoryTree:!1}),Qi.NUMERIC_SCALE_SPAN_THRESHOLD=1e3,Qi.NUMERIC_SCALE_SPAN_FACTOR=10;class Ji extends os{}Ji.defaults=is(os.defaults,{visible:!1});class tr extends ls{getAlign(t,e,s,i){let r=this._align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this.prop("offsetX");return isNaN(e)?"center"===t?0:tr.OFFSET:e}getOffsetY(t){const e=this.prop("offsetY");return isNaN(e)?"middle"===t?0:tr.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=p(1,g(0,this.num("position",1)));const e=this.prop("align");this._align="left"===e||"center"===e||"right"===e?e:"auto";const s=this.prop("verticalAlign");this._verticalAlign="top"===s||"middle"===s||"bottom"===s?s:"auto"}prop(t,e){return"position"===t?this._position:"align"===t?this._align:"verticalAlign"===t?this._verticalAlign:super.prop(t,e)}}tr.OFFSET=4,tr.defaults=is(ls.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class er extends os{getRadius(){return g(0,A(this.prop("radius"),4))}}er.defaults=is(os.defaults,{visible:!1,radius:4});class sr extends os{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 Ji(this.chart)),this._fixedArea=this._addChild("fixedArea",new Ji(this.chart)),this._label=this._addChild("label",new tr(this.chart)),this._marker=this._addChild("marker",new er(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,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){this._label._prepareRender();const e=this.prop("type"),s=this.owner,i=this._res=Math.max(1,(s._visPoints.length-1)*Math.max(1,+this.prop("resolution")||5)),r=this._minX>0?0:(this._maxX-this._minX)/i-this._minX,n=this._minY>0?0:(this._maxY-this._minY)/i-this._minY,o=s._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,s=o[o.length-1].x,i=this._forward>0?this._forward:0;let r=t-(this._backward>0?this._backward:0),n=s+i;if("logarithmic"===e||"power"===e){const t=Number.EPSILON||1e-12;r<=0&&(r=t)}const h=s-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,s=a.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}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,s=this._backward>0?this._backward:0,i=a.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===t;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),e>0){const t=Math.max(2,Math.ceil(this._res*e/o)),s=e/t;if(a){const e=n.y;for(let i=1;i<=t;i++)this._points.push({x:n.x+s*i,y:e})}else if(i.length>=2){const e=i[i.length-1],r=i[i.length-2],o=(e.y-r.y)/(e.x-r.x);for(let i=1;i<=t;i++){const t=n.x+s*i,r=e.y+o*(t-e.x);this._points.push({x:t,y:r})}}else{const e=n.y;for(let i=1;i<=t;i++)this._points.push({x:n.x+s*i,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=g(0,this.num("forward",0)),this._backward=g(0,this.num("backward",0)),this._formatter=zt.getFormatter(this.prop("numberFormat")||"0.####")}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach(t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x});const o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map(t=>({x:Math.log(t.x),y:A(t.y,0)})),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(f(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map(t=>({x:Math.log(t.x),y:Math.log(t.y)})),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,s=0,i=0,r=0,n=0,o=0;t.forEach(t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),o+=t.x*t.y});const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,a:h}}_exponential(t,e){if(e.length>1){const s=e.map(t=>({x:t.x,y:t.y})),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+i);h.push(o),o=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)f(s[t][r])>f(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,a),l=t=>h.reduce((e,s,i)=>e+s*t**i,0);return{expr:"y = "+(h.map((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`}).filter(t=>t).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=g(1,p(s-1,this.prop("movingInterval"))),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce((t,e)=>t+A(e.y,0),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var ir;sr.defaults=is(os.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const rr={},nr={},or=/\$\{detail\}/g;class ar extends os{}ar.defaults=is(os.defaults,{visible:!1});class hr extends ls{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){const s=this.prop("textField");if(s){const e=t.getProp(s);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return nt.isValidNum(t)?this._getText(null,t,f(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 g(-90,p(90,this.num("rotation",0)))}_isVisible(){return this.prop("visible")||i(this.prop("visibleCallback"))}_doSetSimple(t,e){return i(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}}ir=hr,hr.OFFSET=4,hr.defaults=is(ls.defaults,{visible:void 0,position:"default",offset:ir.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class lr extends ls{_doInit(t){super._doInit(t),this._args={}}getText(t){return nt.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return this.num("offset",0)}getGap(){return this.num("gap",lr.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,s,i){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=s,r.negativeTotal=i,r.total=s+i,r}isStackLabelVisible(t){const e=this.prop("visibleCallback");return e?e(t):this.visible}getStackLabelText(t,e){const s=this.prop("textCallback");if(i(s)){const e=s(t);if(r(e))return e}return this.getText(e)}getRotation(){return g(-90,p(90,this.num("rotation",0)))}getStackLabelStyle(t){const e=this.prop("styleCallback");if(i(e))return e(t)}_isVisible(){return this.prop("visible")||i(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")}}lr.OFFSET=4,lr.defaults=is(ls.defaults,{visible:!1,align:"center",gap:lr.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const cr={x:"xValue",y:"yValue",z:"zValue"};class _r extends me{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class dr extends me{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach(t=>{t.points.forEach(t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)})})),e.forEach(t=>{t._setDeleted()}),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach(e=>{e.points.forEach(e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))})}),this.points.forEach(e=>{e._vr=1-t}),this.series._changed(),!0}}class ur extends me{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach(t=>{this.addPoint(t)}),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort((t,e)=>t.xValue-e.xValue),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class pr extends Wi{}const gr=12;class fr extends os{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach(t=>{rr[t.type]=t})}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new Yi(this),this._pointArgs={},this._paletteColors=Array(gr).fill(0).map((t,e)=>e);this.chart.general.prop("paletteMode")==wt&&nt.shuffle(this._paletteColors),this._pointLabel=this._addChild("pointLabel",this._createLabel(this.chart))}onDataValueChanged(t,e,s,i,r){nt.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){nt.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){nt.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){nt.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){let e;const s=this.prop("tooltipDetailCallback");if(s){this._getPointCallbackArgs(this._pointArgs,t);const i=s(this._pointArgs);e=r(i)?i:""}if(void 0===e){const t=this.prop("tooltipDetail");e=r(t)?t:""}return e}getTooltipText(t,e){let s;const i=this.prop("tooltipCallback");if(i){this._getPointCallbackArgs(this._pointArgs,e);const t=i(this._pointArgs);r(t)&&(s=t)}if(void 0===s){const t=this.prop("tooltipText");s=r(t)?t:"",s&&(s=s.replace(or,this.getTooltipDetail(e)))}return s}getTooltipParam(t,e,s){return fr.getPointTooltipParam(t,e,s)}getTooltipHeaderColor(t){return null}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}get isWidget(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach(i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)}),s}_getVisiblePoints(){return this._points.getRunPoints(this._xAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}isXY(){return!1}displayName(){return this.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,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.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")),s=isNaN(e)?t.getValue(this.chart.general.getXStart(t)):e;return A(s,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 Qi)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.prop("categoryField");if(null!=e){if(s(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter(t=>r(t.getProp(e[s]))).map(t=>e.map(e=>t.getProp(e)).join(i))}return this._points.getProps(e).filter(t=>r(t))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter(t=>r(t))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);r(i)&&(i=i.trim());const n=r(i)?NaN:nt.getNumber(i);this._points.forEach((e,o)=>{let a=t.getValue(e.x);isFinite(a)||(a=s,isFinite(n)?s+=n:r(i)&&(s=t.incStep(s,i))),e.xValue=a}),e&&this._runPoints.forEach(t=>{!1!==t.visible&&e.push(t.xValue)})}else{const s=this.hasZ();this._points.forEach((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}}),this._runPoints.forEach(t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)})}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,c=r?n.zValue:null,_=c;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(_)&&!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||[],s=e.map(t=>t.y).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e),i=e.map(t=>t.x).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e);s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=c,e.zMax=this._maxZ=_)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return this.num("paddingRate")}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=xt(this.prop("viewRanges"),s,i,!1,!1,!0,this._runColor))?t.forEach((t,s)=>{this._setViewRange(t,e)}):t.forEach((t,e)=>{t.range=gt})}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)),hr.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=Et(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,s){let n;return i(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),n=this._pointLabelCallback(this._pointArgs),r(n))?n:(n=t.getPointText(e),null!=n?n:s)}getPointStyle(t){const e=this.prop("pointStyleCallback");if(i(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}getPointLabelStyle(t){if(i(this._pointLabel.prop("styleCallback")))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.prop("styleCallback")(this._pointArgs)}pointClicked(t){const e=this.prop("onPointClick");if(i(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}pointHovered(t){const e=this.prop("onPointHover");i(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 s=this._pointLabel;return!1!==s.visible&&(s.prop("visibleCallback")?(this._getPointCallbackArgs(this._pointArgs,t),s.prop("visibleCallback")(this._pointArgs)):!0===s.visible)}getPointAt(t,e){return r(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:gt}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof Wi||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new _r(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new _r(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}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 _r(this,t,this._points.count>1),e.ani.start()}),this._dataPointsChanged()),i}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof Wi||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Wi&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new dr(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new ur(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(s(t)){const s=t.map(t=>this._points.get(t)).filter(t=>null!=t);return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(s(t)){let i=[];if(t.forEach(t=>{t instanceof Wi||(this.hasZ()?s(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Wi&&this._points.contains(t)&&i.indexOf(t)<0&&i.push(t)}),i.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new dr(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 ur(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=g(0,this.num("decayDuration",300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new hr(t)}_createPoint(t){return new pr(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return bi.create(t,fr.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 i(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach(e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])})}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(s(t))return t;if(t){let s;if(t._obj instanceof dt)s=t._obj;else if(t instanceof dt)s=t;else if(Number.isFinite(t)||e(t)||o(t))return[t];if(s)return s!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=s,this._cdata&&this._cdata._addListener(this)),s._internalValues()}}_loadPoints(t){this._doLoadPoints(t);const e=this.prop("onPointsLoaded");return i(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=n(e)?`var(--color-${Math.max(1,(Math.floor(e)-1)%gr+1)})`:e;let o,a;s(t)?o=t:r(t)?t.endsWith("@pal")||t.endsWith("@palette")?o=this.chart.getPaletteColors(t.split("@")[0]):a=this.chart._assets.get(t):this._colorByPoint()&&(o=this.chart.general.prop("colors")),a instanceof Je?this._runPoints.forEach((t,e)=>{t.color=t.color||a.getAt(e)||i}):s(o)?this._runPoints.forEach((t,e)=>{t.color=t.color||o[e%o.length]||i}):this._runPoints.forEach((t,e)=>{t.color=t.color||i}),this._preparePointArgs(this._pointArgs),this._labelPosCallback=Et(this._pointLabel.prop("position")),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=Et(this._pointLabel.prop("offset")),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[cr[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=gt}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}fr.LEGEND_MARKER="rct-legend-item-marker",fr.defaults=is(os.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 mr extends as{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find(e=>!e.isEmpty(t))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}_internalSeries(){return this._series}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find(t=>t.needAxes())||0===this._visibleSeries.length}canDepth(){return this._visibleSeries.every(t=>t.canDepth())}_clear(){}get(t){return this._items[t]}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter(s=>t===s.row&&e===s.col)}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof Tr&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach(i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)}),s}canPolar(){return this._series.length>0&&this._series.every(t=>t&&t.canPolar)}load(t){const i=this.chart,r=this._items=[],n=this._series=[];s(t)?t.forEach((t,e)=>{r.push(this.$_loadItem(i,t,e))}):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach(t=>{t instanceof Tr?n.push(...t.series):t instanceof fr&&n.push(t)}),this._map={},this._widget=!0,n.forEach(t=>this.$_add(t)),i._op.series=this._items.map(t=>t.options)}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof fr?e=t:r(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),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(s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(fi[e++%fi.length]),i||(s._valid=!0))}}),this._visibleSeries=t.sort((t,e)=>{let s=+(t._group?t._group.prop("zOrder"):t.prop("zOrder"))||0,i=+(e._group?e._group.prop("zOrder"):e.prop("zOrder"))||0;return s===i&&t._group&&t._group===e._group?(+t.prop("zOrder")||0)-(+e.prop("zOrder")||0):s-i});const s=1===this._visibleSeries.filter(t=>t.isClusterable()).length;this._visibleSeries.forEach((t,e)=>{t instanceof Ar&&(t._single=s)}),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 Tr)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 fr){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 Tr?t.push(...e.series):e instanceof fr&&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 fr._loadSeries(t,i,e)}$_add(t){!this._widget||t instanceof Vr||(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 yr extends fr{_doInit(t){super._doInit(t),this._trendline=this._addChild("trendline",new sr(this))}get trendline(){return this._trendline}connectable(t){return!0}}yr.defaults=is(fr.defaults,{});class br extends os{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 r(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}}br.defaults=is(os.defaults,{radius:3});class xr extends Wi{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 wr extends os{_doSetSimple(t,e){return r(e)?(this.setStyle("stroke",e,!1),!0):super._doSetSimple(t,e)}}wr.defaults=is(os.defaults,{curved:!0});class vr extends hr{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),this._connector=this._addChild("connector",new wr(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")}}vr.defaults=is(hr.defaults,{visible:!0,convergent:!0,align:Vi,dedupeMode:Ai});class Sr extends os{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this._save;let s,i=this.num("maxCount");return s=this._minDim?R(this._minDim,Wi.getSum(t)):+this.prop("minValue"),isNaN(i)&&isNaN(s)&&(i=Sr.DEF_COUNT),(this._dirty=!e||e.value!==s||e.count!==i)&&(isNaN(s)||(t=t.filter(t=>t.y>=s)),i>0&&t.length>i&&(i>1&&i--,t=t.slice(0,i)),this._save={count:i,value:s}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=Lt(this.prop("minValue"),!0)}}Sr.DEF_COUNT=10,Sr.defaults=is(os.defaults,{visible:!1,x:"기타"});class Vr extends fr{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),this._othersGroup=this._addChild("othersGroup",new Sr(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 s,i;super._doApply(t),s=this.prop("centerX"),i=this.prop("centerY"),s!==e._centerX&&(e._centerX=s,e._centerXDim=Lt(k(s,e.prop("center"),Vr.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Lt(k(i,e.prop("center"),Vr.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach(t=>this._sum+=t.yValue);const s=this.getSum();this._runPoints.forEach(t=>t._percent=100*t.yValue/s)}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this.prop("legendKey"),s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({x:s.prop("x"),maxCount:s.prop("maxCount"),minValue:s.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,s)=>(t.vindex=s,t._legendKey=t[e],t))}}Vr.DEF_CENTER="50%",Vr.defaults=is(fr.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Vr.DEF_CENTER,centerY:Vr.DEF_CENTER});class Cr extends Vr{getRadius(t,e){return R(this._radiusDim,p(t,e))}_doApply(t){var e,s;super._doApply(t),e=this,(s=this.prop("radius"))!==e._radius&&(e._radiusDim=Lt(P(e._radius=s,Cr.defaults.radius),!0))}}Cr.defaults=is(Vr.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Ar extends yr{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 s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.prop("groupPadding"),i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,g(e,i)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.prop("groupPadding"),s-=s*e.prop("groupPadding")*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}isClusterable(){return!1!==this.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)}}Ar.defaults=is(fr.defaults,{pointWidth:1,minPointWidth:0});class Pr extends hr{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 ar(this.chart))}}Pr.defaults=is(hr.defaults,{align:"center",alignOffset:0});class kr extends Ar{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=g(0,Ot(this.prop("depth"),t.getDepth(),kr.DEPTH)),this._distance=t.getDistance()+A(this.prop("distance"),0)):(this._depth=g(0,A(this.prop("depth"),kr.DEPTH)),this._distance=A(this.prop("distance"),kr.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 s=this._group;return"default"===e&&s&&s._stacked&&s.stackLabel&&s.stackLabel.visible?"inside":e}}kr.DEPTH=10,kr.DISTANCE=5,kr.defaults=is(Ar.defaults,{nullAsBase:!1});class Lr extends Ar{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach(t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}})}}class Nr extends Lr{}class Tr extends os{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach(t=>{nr[t.type]=t})}static registerSeries(...t){t.forEach(t=>{nr[t.seriesType]=t})}static collectTooltipText(t,e,i,r,n){function o(t,e,s,i){let r=e.replace(or,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),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,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),fr.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return Tr.collectTooltipText({tooltipHeader:this.prop("tooltipHeader"),tooltipRow:this.prop("tooltipRow"),tooltipListRow:this.prop("tooltipListRow"),tooltipFooter:this.prop("tooltipFooter")},this._visibles,t,e,s)}getTooltipParam(t,e,s){return Tr.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach(e=>e.setCol(t)))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach(e=>e.setRow(t)))}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}get stackLabel(){return this._stackLabel}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}connectable(t){return!0}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.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(s=>{s.collectRanges(t,e)})}prepareReferents(t){this._series.forEach(e=>e.prepareReferents(t))}collectCategories(t){let e=[];return this._visibles.forEach(s=>e=e.concat(s.collectCategories(t))),e}getLegendSources(t){var e;if(!1!==this.prop("visibleInLegend")&&this.visible){const s=this._series,i=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.prop("reversed"))||"fill"!==this.prop("layout")&&"stack"!==this.prop("layout"))s.forEach(t=>t.getLegendSources(i));else for(let t=s.length-1;t>=0;t--)s[t].getLegendSources(i);this.prop("reversedInLegend")&&i.reverse(),t.push(...i)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach((t,e)=>{t._setIndex(e)}),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach(e=>t.push(...e._getVisiblePoints())),t}getLayoutMax(){const t=this.num("layoutMax",Tr.LAYOUT_MAX);return t>0?t:Tr.LAYOUT_MAX}_doInit(t){super._doInit(t),this._stackLabel=this._addChild("stackLabel",new lr(this.chart))}_doLoad(e,s){super._doLoad(e,s),t.call(s,"children")&&this._syncChildren(s.children)}updateOptions(e,s=!0){return e&&t.call(e,"children")?(super.updateOptions(e,!1),this._syncChildren(e.children),s&&this._changed(),this):super.updateOptions(e,s)}_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=!nt.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 i=this.chart,r=this._seriesType(),n=this._series,o=[],a=(t,e)=>{const s=t.type||r;let a=n[e];a&&a._type()===s?(a._setIndex(e),a._load(t),o.push(a)):(a=fr._loadSeries(i,e,t,r),a._group=this,o.push(a))};s(t)?t.forEach((t,e)=>a(t,e)):e(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(s=>{s.collectValues(t,e)})}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach(e=>{e.collectValues(t,null)}),e[0]._runPoints.forEach(t=>{s.set(t.xValue,[t])});for(let t=1;t<e.length;t++)e[t]._runPoints.forEach(t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])});return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t),r=this._stackTotals=new Map;if(isNaN(s))for(const[t,s]of i.entries()){s[0].yGroup=s[0].yValue||0;for(let t=1;t<s.length;t++)s[t].yGroup=s[t-1].yGroup+(s[t].yValue||0);const i=s[s.length-1].yGroup;r.set(t,{x:s[0].xValue,positiveTotal:i>=0?i:0,negativeTotal:i<0?i:0}),e.push(i)}else for(const[t,n]of i.entries()){let i=n[0].yValue||0,o=i>=s?0:-1,a=i<s?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)i=n[t].yValue||0,i>=s?(o>=0&&(n[t].yGroup=n[o].yGroup+i*(i<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+i*(i>=0?-1:1)),a=t);const h=o>=0?n[o].yGroup:0,l=a>=0?n[a].yGroup:0;r.set(t,{x:n[0].xValue,positiveTotal:h,negativeTotal:l}),o>=0&&e.push(n[o].yGroup),a>=0&&e.push(n[a].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce((t,e)=>t+(e.yValue||0),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce((t,e)=>t+(f(e.yValue)||0),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}Tr.LAYOUT_MAX=100,Tr.defaults=is(os.defaults,{layout:"default",layoutMax:Tr.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class Mr extends Tr{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Er extends Tr{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}}Er.defaults=is(Tr.defaults,{groupWidth:1,groupPadding:.1});class Br extends yr{isMarker(){return!0}isXY(){return!0}}Br.defaults=is(fr.defaults,{colorByPoint:!1});class Or extends os{}class Dr extends os{}const Rr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},$r={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Fr={minPadding:0,maxPadding:0};class Ir extends os{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;this._handle=this._addChild("handle",new Or(e)),this._mask=this._addChild("mask",new Dr(e)),this._borderLine=this._addChild("borderLine",new os(e))}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return Math.max(0,this.num("thickness",Ir.defaults.thickness))}getGap(){return Math.max(0,this.num("gap",Ir.defaults.gap))}getGapFar(){return Math.max(0,this.num("gapFar",Ir.defaults.gapFar))}getHandleOverflow(){return Ir.HANDLE_TRACK_OFFSET+Ir.HANDLE_RADIUS}getSize(){const t=g(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,s){super._doLoad(t,s);const i={};if(e(s.series)){let t=s.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=h({},s.series,Rr[t]())}else i.series=Rr.area();e(s.xAxis)?i.xAxis=h({},s.xAxis,($r[s.xAxis.type]||$r.linear)(),Fr):i.xAxis=h({},Fr),e(s.yAxis)?i.yAxis=h({},s.yAxis,($r[s.yAxis.type]||$r.linear)(),Fr):i.yAxis=h($r.linear(),Fr),this._chartConfig=i,this._axisType=i.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()}}Ir.HANDLE_RADIUS=9.75,Ir.HANDLE_TRACK_HEIGHT=6,Ir.HANDLE_TRACK_OFFSET=Ir.HANDLE_TRACK_HEIGHT/2,Ir.defaults=is(os.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class zr extends os{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)?zr.defaults.gap:e}_isVisible(){return this.bool("visible")&&!T(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}zr.defaults=is(os.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class Hr extends zr{}Hr.defaults=is(zr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Gr extends os{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o=!!r.axis;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=P(this.prop("scope"),"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this.prop("noClip");return!!o(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:g(this.num("headerHeight"),0)}getTailSize(){return this.bool("simpleMode")?0:g(this.num("tailSize"),0)}getBorderRadius(){return this.bool("simpleMode")?0:g(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 r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=this.prop("numberFormat"))!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?zt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?re.getFormatter(e._timeFormat):void 0)}(this.prop("timeFormat"))}}Gr.defaults=is(os.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 jr="vline",Wr="hline",Yr="line",Xr="arrow";class Ur extends ds{getImageUrl(){const t=this.prop("imageUrl");if(!r(t))return t;const e=t.indexOf("::");if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2),r=Number.isFinite(+i)?+i:i;return s instanceof ts?s.getImage(r):i}return t}_isVisible(){return this.prop("visible")&&!T(this.prop("imageUrl"))}_doSetSimple(t,e){return r(e)?(this._op.imageUrl=e,!0):super._doSetSimple(t,e)}}Ur.type="image";class Zr extends ds{getShape(){return this.prop("shape")||Zr.defaults.shape}hasCustomPath(){return r(this.prop("path"))&&this.prop("path").length>0}getHeadSize(){return this.getShape()!==Xr?Zr.defaults.headSize:this._headSize}_doApply(t){if(super._doApply(t),this.getShape()!==Xr)return;const e=Zr.defaults;this._headSize=g(1,this.num("headSize",e.headSize)),this._style=this.$_resolveArrowStyle()}_doSetSimple(t,e){return r(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}$_resolveArrowStyle(){const t=this._style;if(r(t))return t;const s=e(t)?{...t}:{},i=this.prop("lineWidth");return null!=i?s.strokeWidth=`${g(1,A(i,1))}px`:s.strokeWidth||s["stroke-width"]||(s.strokeWidth="1px"),s.stroke||(s.stroke="#555"),s.fill||(s.fill=s.stroke),s}}Zr.type="shape",Zr.defaults=is(ds.defaults,{width:64,height:64,shape:"square",headSize:12});class qr extends ds{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this.prop("textOrientation")||"upright"}_isVisible(){return this.prop("visible")&&!T(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=this.prop("numberFormat"))!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?zt.getFormatter(s):gt),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?re.getFormatter(t):gt)}(this.prop("timeFormat"))}}qr.type="text",qr.defaults=is(ds.defaults,{text:"Text"});class Kr extends Ss{_doInit(t){super._doInit(t),this._minorGrid=this._addChild("minorGrid",new Ns(this.axis))}get minorGrid(){return this._minorGrid}getPositions(t,e){return t.hasBreak()?t._ticks.filter(e=>!t.isBreak(e.value)).map(s=>t.getPos(e,s.value)):t._ticks.map(s=>t.getPos(e,s.value))}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 s=[];return t._minorValues.forEach(i=>{const r=t.getPos(e,i);isFinite(r)&&s.push(r)}),s}}class Qr extends ks{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,r,n){if(i(e)){const i=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:r,max:n});isNaN(i)||(e=i)}return e>0?e:void 0}buildSteps(t,e,r,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),r,n,o,l):s(h.steps)||i(h.steps)||i(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof rn&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,r,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,r,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,r,n,o):c>0?this._getStepsByPixels(e,c,r,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?g(8,c(t/(.9*e))+1):A(this.prop("maxCount"),1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(e){super._doApply(e);const r=!i(this.prop("stepPixels"))&&nt.parseTuples(this.prop("stepPixels"));let n;if(this._stepPixels=r&&r.every(([,t])=>t>0)?r:void 0,t.call(this._op,"stepMultiples")){const t=this.prop("stepMultiples");if(i(t))n=t;else{let e;if(s(t)){let s=Number.MIN_SAFE_INTEGER;e=[],t.forEach(t=>{!isNaN(+t)&&t>s&&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 s=this._stepPixels;if(i(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?Qr.STEP_PIXELS_P:t._isX?Qr.STEP_PIXELS_X:Qr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return g(1,s[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 rn&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>l(t/e)*e?t=l(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),t}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),_=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h===2.5&&l(t*o/a)==t*o/a?this._step=a:a=this._step=c(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new $(e)}(s<e&&i>e,"base error"),t=g(3,t);;){if(!(c((e-s)/a)+c((i-e)/a)+1>t))break;a+=h}s=e-c((e-s)/a)*a}else s=n._fixedMin;_.push(yt(s));for(let e=1;e<t;e++)_.push(yt(_[e-1]+a));return _}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=yt(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=yt(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=yt(n-t));for(n=e;n<i;)r.push(n=yt(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=i(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this.prop("fineStep"))?Qr.STEP_MULTIPLES[2]:this.prop("enableDecimals")&&1===t?Qr.STEP_MULTIPLES[0]:Qr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,r){const n=this._op,o=i(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,r),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?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort((t,e)=>t-e),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=g(1,l(t/e))+1,_=o/(h-1);const d=function(t){return Math.pow(10,t)}(l(u(_))),p=this._getStepMultiples(d,n),f=[];let m,y=0;if(_/=d,p)if(_>p[y]){for(;y<p.length-1;y++)if(_>p[y]&&_<p[y+1]){_=_<=p[y]+(p[y+1]-p[y])/2?p[y]:p[y+1];break}}else _=p[y];for(;;){for(_*=d,(_<=0||!isFinite(_))&&(_=o/h),i=isNaN(s)?this._normalizeMin(i,_):s-c((s-i)/_)*_,this._step=_,f.push(yt(m=i));m<r;)f.push(yt(m+=_));if(!p||y>p.length-2||f.length<=a)break;_=p[++y],f.length=0}return f}}Qr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],Qr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],Qr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],Qr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],Qr.defaults=is(ks.defaults,{baseRange:!1,enableDecimals:!0});class Jr extends Ts{}Jr.defaults=is(Ts.defaults,{numberFormat:"0.##"});class tn extends Jr{getTick(t,e){return this._getText(null,e,"*"===this.prop("useSymbols")||this.prop("useSymbols")&&this.axis.tick.canUseNumSymbols(),!1)}}tn.defaults=is(Jr.defaults,{useSymbols:!0});class en extends ys{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=Lt(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)}}en.defaults=is(ys.defaults,{size:"30%",space:16,gridVisible:!0});class sn extends bs{_isVisible(){return this.prop("visible")}}sn.defaults=is(bs.defaults,{visible:!1});class rn extends Os{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),this._baseLine=this._addChild("baseLine",new sn(this)),this._minorTick=this._addChild("minorTick",new Ls(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,s){if(!t){if(this._isX&&this._isPolar)return 0;t=rn.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(e){var s,i;super._doApply(e);const n=null!==(s=this.prop("minPadding"))&&void 0!==s?s:this.prop("padding"),o=null!==(i=this.prop("maxPadding"))&&void 0!==i?i:this.prop("padding");let a;this._minPadPixels=NaN,r(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,r(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=nt.parseTuples(n)),isNaN(this._maxPadPixels)&&(this._maxPaddings=nt.parseTuples(o)),this._baseVal=+this.prop("baseValue"),this._strictMin=Lt(this.prop("strictMin"),!0),this._strictMax=Lt(this.prop("strictMax"),!0),t.call(this._op,"break")&&this.$_loadBreaks(this.prop("break"))}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Kr(this)}_createTickModel(){return new Qr(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,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof rn&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.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=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,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,s,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,s,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,s,a,h,i);if(_&&p.length>1){const t=this._isPolar;let e=!1;const s=c;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(yt(h-t)>yt(t-s)))break;{const r=this._createTick(0,i+yt(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach((t,e)=>t.index=e)}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}$_buildMinorValues(t){if(!isFinite(t)||t<1||this._ticks.length<2)return[];const e=this._ticks,s=[];for(let i=0;i<e.length-1;i++){const r=e[i].value,n=e[i+1].value;if(this._canInterpolateMinorSegment(r,n)&&(!this.hasBreak()||!this.isBreak(r)&&!this.isBreak(n)))for(let e=1;e<=t;e++){const i=this._interpolateMinorValue(r,n,e,t);isFinite(i)&&s.push(i)}}return s}_canInterpolateMinorSegment(t,e){return t!==e&&isFinite(t)&&isFinite(e)}_interpolateMinorValue(t,e,s,i){return yt(t+(e-t)*s/(i+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()),s=[],i=[];e.forEach(e=>{const r=this.getPos(t,e);isFinite(r)&&(s.push(e),i.push(r))}),this._minorValues=s,this._minorMarkPoints=i}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce((t,e)=>t+e.prop("space"),0);t.forEach(t=>{const e=t.getSize(h),s=Math.max(0,t.prop("space")),i={from:n,to:t.prop("from"),pos:r,len:e};r+=e,a.push(i,t._sect={from:t.prop("from"),to:t.prop("to"),pos:r,len:s}),r+=s;this.$_buildBrokenSteps(i).forEach(t=>{t>i.from&&t<=i.to&&o.push(t)}),s>0&&o.push(t.prop("to"))});const l=t[t.length-1];if(i>l.prop("to")){const t={from:l.prop("to"),to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach(e=>{e>t.from&&o.push(e)})}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find(t=>e<t.to)||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this.prop("reversed")?bt(t-r-i.pos):bt(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this.prop("reversed")&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=bt(i)}return this._ani?this._ani.getPos(s,this.prop("reversed")):s}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 s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_isLog(){return!1}$_resolveFit(t){return"tick"===t||"value"===t?t:this._isX&&!this._isPolar?"value":"tick"}$_getStartFit(){return this.$_resolveFit(this.prop("startFit"))}$_getEndFit(){return this.$_resolveFit(this.prop("endFit"))}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-R(t,s):e+R(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,o=this.isZoomed(),a=this.isZoomed(),h=!0,c=!0,_=NaN,d=NaN,u=1;if(this._series.length>0){let t,l=0;this._series.forEach(t=>{isNaN(t._sBase=t.getBaseValue(this))||l++,u=g(u,t.getAxisPadRate())}),!this._isX&&l>0&&l<this._series.length&&(r={},this._series.forEach(t=>{const e=t._type();r[e]?r[e]=[p(t._yMin,r[e][0]),g(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]})),this._series.forEach(r=>{let l=r._sBase;n(l)&&!isNaN(l)&&(l=yt(l),i?l>=0&&l<=e&&l<=s&&(e=t=l):l<=e?r.isBased(this)?e=t=l:_=A(p(_,l),l):l>=s&&(r.isBased(this)?s=t=l:d=A(g(d,l),l))),h&&!o&&(i||r.canMinPadding(this,e,t))&&(h=!1),c&&!a&&(i||r.canMaxPadding(this,s,t))&&(c=!1)})}else h=o,c=a;o||(o=h),a||(a=c),this._fixedMin=this._fixedMax=NaN;const f=g(0,s-e),m=this.$_calcStrict(this._strictMin,e,-f),y=this.$_calcStrict(this._strictMax,s,f);let b=NaN,x=NaN,w=0,v=0;isNaN(m)?o?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=s:isNaN(this._maxPadPixels)?v=this.$_getPadding(this._maxPaddings,t,u):x=this._maxPadPixels:this._fixedMax=s=y;let S=e,V=s;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-=f*w,V+=f*v;if(!isNaN(b)||!isNaN(x)){isNaN(b)&&(b=0),isNaN(x)&&(x=0);const e=Math.min(b+x,.9*t),s=f-l(f*(t-e)/t),i=Math.round(s*b/e);S-=i,V+=s-i}return!isNaN(_)&&_<=e&&S<_&&(S=this._fixedMin=_),!isNaN(d)&&d>=s&&V>d&&(V=this._fixedMax=d),V=g(V,S),{min:S,max:V}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach(t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)}),0===r&&this._series.forEach(t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())}),i.length>0){const r=i.map(t=>t.xValue).sort((t,e)=>t-e);for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:A(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=p(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:A(r,1),min:n}}}$_loadBreak(t){if(e(t)&&"from"in t&&"to"in t){const e=new en(this),s={...t};return s.from=this.getValue(s.from),s.to=this.getValue(s.to),!isNaN(s.from)&&!isNaN(s.to)&&s.from>s.to&&([s.from,s.to]=[s.to,s.from]),this._doApplyBreak(s),e.init(),e._load(s),isNaN(s.from)||isNaN(s.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 s=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,s.length>0){const i=this._mergedBreaks=[];i.push(new en(this)._initObject().loadOptions(s[0].options,!1));for(let r=1;r<s.length;r++){const n=i[i.length-1],o=s[r];t(n,o)?e(n,o):i.push(new en(this)._initObject().loadOptions(o.options,!1))}}}}rn.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],rn.defaults=is(Os.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class nn extends rn{get label(){return this._label}_createLabel(){return new tn(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Tr&&"fill"===r[0].prop("layout")&&(i.max=r[0].getLayoutMax()),i}}nn.type="linear";const on=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],an=[[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]],hn={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class ln extends Qr{getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this._scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_getValidInterval(t,e,s,n,o){if(i(e)){const i=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o});null!=i&&(e=i)}if(!isNaN(e))return+e>0?+e:NaN;if(r(e)&&hn.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>=on[e]/2&&t<on[e+1]/2)return this._scale=e,an[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/e)+1,c=g(1,Math.floor(o/(l-1)));const _=this._getStepMultiples(c),d=on[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(i),p=a.date(r);let f,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(),s=m.getDate();const i=5===this._scale?7:1;this._step=c=Math.ceil(c),m=new Date(t,e,s),m<h&&new Date(t,e,s+i*c)>h&&(s=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+m),m.setDate(m.getDate()+c*i)}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)}f=m.getTime();const t=h.getTime();f<t&&f+c>t&&(f=t);do{n.push(f),f+=c}while(f<=r)}return n}_getStepsByInterval(t,e,s,i){if(r(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=hn[a],t=on[this._scale];let _=new Date(s);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 s=5===this._scale?7:1;_.setHours(0,0,0,0),c=new Date(_),c.setDate(c.getDate()+h*s),_<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,s=+_,isNaN(e))for(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}_getStepsBySteps(t,e,s){const i=super._getStepsBySteps(t,e,s);if(i.length>=2){const t=(i[i.length-1]-i[0])/(i.length-1);this._getStepMultiples(t)}else this._getStepMultiples(on[4]);return i}buildSteps(t,e,s,i,r,n=!1){const o=super.buildSteps(t,e,s,i,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 cn=[{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 _n extends Jr{_doApply(t){super._doApply(t);const i=r(this.prop("timeFormat"))?this.prop("timeFormat"):void 0,n=r(this.prop("beginningFormat"))?this.prop("beginningFormat"):void 0,o=this.prop("timeFormats"),a=this.prop("useBeginningFormat");if(this._formats=cn.map(t=>h(t)),i&&this._formats.forEach(t=>{t.format=t.beginningFormat=i}),a&&n&&this._formats.forEach(t=>{t.beginningFormat=n}),s(o))for(let t=0;t<o.length;t++){const s=this._formats[t],i=o[t];Bt(i)?s.format=i:e(i)&&(Bt(i.format)&&(s.format=i.format),a&&Bt(i.beginningFormat)&&(s.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,s.startOfWeek);else{const e=this._formats,o=i.tick._scale,a=re.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,s.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek)}}return this._getText(n,null,!1,!1)}}_n.defaults=is(Jr.defaults,{useBeginningFormat:!0});class dn extends rn{get label(){return this._label}_createTickModel(){return new ln(this)}_createLabel(){return new _n(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,s,i){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,s,i)}collectValues(){this._offset=60*A(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this.prop("baseValue");return n(t)?t:r(t)?new Date(t).getTime()+A(this._offset,0):NaN}getValue(t){return n(t)?t:t instanceof this._dateClass?t.getTime():r(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(r(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.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}}dn.type="time",dn.subtype="date",dn.defaults=is(rn.defaults,{baseValue:NaN});class un extends Ui{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class pn extends Nr{pointLabelCount(){return 2}_createLegendMarker(t,e){return bi.create(t,fr.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new un(t)}_getBottomValue(t){return t.lowValue}}pn.type="barrange",pn.defaults=is(Nr.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class gn extends Wi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class fn extends kr{canCategorized(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createPoint(t){return new gn(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}fn.defaults=is(kr.defaults,{colorByPoint:!1,pointOffset:0});class mn extends fn{canDepth(){return!0}_createLegendMarker(t,e){return bi.create(t,fr.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}mn.type="bar";class yn extends Er{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=g(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 s=0;t.forEach(t=>{t._childWidth=t.prop("pointWidth")/e,t._childPos=s,s+=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})}}yn.defaults=is(Er.defaults,{depth:10,distance:5});class bn extends yn{_canContain(t){return t instanceof mn}}bn.type="bargroup",bn.seriesType="bar";class xn extends Ve{constructor(t){super(t,fr.LEGEND_MARKER),this.add(this._back=new bi(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new Ne(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){yi.setShape(this._marker,this._shape,t,t)}}class wn extends xn{constructor(t){super(t),this.insertFirst(this._line=new Ne(t)),this.insertFirst(this._area=new Ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class vn extends xn{constructor(t){super(t),this.insertFirst(this._line=new Ne(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Ne(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Sn extends Ne{constructor(t,e=gt,s=gt){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){n(t)?this.setPath(yi.line(t,e,s,i)):t&&this.setPath(yi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(yi.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(yi.line(t,e,t,s))}setHLine(t,e,s){this.setPath(yi.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(yi.line(e,t,s,t))}}class Vn extends xn{constructor(t){super(t),this.insertFirst(this._line=new Sn(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Cn extends Wi{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class An extends br{}An.defaults=is(br.defaults,{radius:4,hoverScale:1.75});class Pn extends br{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 Ot(NaN,this.prop("radius"),Pn.defaults.radius)}getRotation(){return P(this.prop("rotation"),Pn.defaults.rotation)}getArrowStyleOverrides(t){const s=Pn.STYLE_ISOLATION,i={};return r(t)?(i.stroke=s.stroke,i.strokeWidth=s.strokeWidth,i):(e(t)&&null==t.strokeDasharray&&(i.strokeDasharray=s.strokeDasharray),i)}getArrowStyle(t){const s=t&&this.getMarkerStyle(t);return s?e(s)?this.$_applyStyleIsolation(h({},s)):s:this._runStyle||this.$_buildRunStyle()}buildArrowSlots(t){if(!this.visible||t.length<2)return[];let e=-1,s=-1;for(let i=0;i<t.length;i++)t[i].isNull||(e<0&&(e=i),s=i);if(e<0||s<0||e===s)return[];switch(this.getPosition()){case"start":return[{index:e,at:"start"}];case"both":return[{index:e,at:"start"},{index:s,at:"end"}];default:return[{index:s,at:"end"}]}}calcAutoAngle(t,e,s){const i=this.series.getLineType(),r=P(this.series.prop("stepDir"),"forward"),n=this.$_neighborIndex(t,e,-1),o=this.$_neighborIndex(t,e,1);return"end"===s?n<0?0:this.calcSegmentAngle(t[n],t[e],i,r,"end"):o<0?0:this.calcSegmentAngle(t[e],t[o],i,r,"start")}calcSegmentAngle(t,e,s,i,r){let n=0,o=0;if("step"===s)switch(i){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,s){const i=this.getRotation();if("auto"===i||"auto-reverse"===i){let r=this.calcAutoAngle(t,e,s);return"auto-reverse"===i&&(r+=180),r}return A(+i,0)}_doPrepareRender(t){this._runStyle=this.$_buildRunStyle()}$_buildRunStyle(){const t=this.prop("style");if(r(t))return t;const s=h({},e(t)?t:{});return s.fill||(s.fill=this.series._runColor),this.$_applyStyleIsolation(s)}$_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,s){for(let i=e+s;i>=0&&i<t.length;i+=s)if(!t[i].isNull)return i;return-1}}Pn.defaults=is(br.defaults,{visible:!1,shape:"triangle",radius:6,rotation:"auto",position:"end"}),Pn.STYLE_ISOLATION={stroke:"none",strokeDasharray:"",strokeWidth:""};class kn extends hr{getAlignOffset(){const t=+this.prop("alignOffset");return isNaN(t)?"left"===this.prop("align")||"right"===this.prop("align")?kn.ALIGN_GAP:0:t}getPosition(){return P(this.prop("position"),"default")}}kn.ALIGN_GAP=4,kn.defaults=is(hr.defaults,{align:"center"});class Ln extends yr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new An(this))}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return Ot(t.radius,this.marker.prop("radius"),An.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 kn(t)}_createPoint(t){return new Cn(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.prop("shape")||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Vn(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),p(e/2,this.marker.prop("radius"))),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach(e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)}),t.length>0&&(t.sort((t,e)=>t.xValue-e.xValue),i[0].unshift(...t)),s.length>0&&(s.sort((t,e)=>e.xValue-t.xValue),i[i.length-1].push(...s))}return i}}Ln.defaults=is(fr.defaults,{nullAsBase:!1});class Nn extends ls{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"}}Nn.defaults=is(ls.defaults,{visible:!1,offset:8});class Tn extends Ln{_doInit(t){super._doInit(t),this._flag=this._addChild("flag",new Nn(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(o(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 $n||this._group instanceof Fn?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")}}Tn.type=Li,Tn.defaults=is(Ln.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Mn extends Tn{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Mn.type="spline";class En extends Cn{}class Bn extends Tn{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=A(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach(e=>{const s=e.slice(0);i.push(s),i.push(t(s))})}_createLegendMarker(t,e){return new wn(t)}_createPoint(t){return new En(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doBuildLines(t,e)}}Bn.type=Ni,Bn.defaults=is(Ln.defaults,{});class On extends En{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 h(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[A(s.lowField,0+i)],this.y=e[A(s.yField,1+i)],i>0&&(this.x=e[A(s.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 Dn extends kn{getPosition(){return"default"===this.prop("position")||null==this.prop("position")?"foot":this.prop("position")}}class Rn extends Ln{pointLabelCount(){return 2}_createLabel(t){return new Dn(t)}_createLegendMarker(t,e){return new vn(t)}_createPoint(t){return new On(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 s=super._doBuildLines(t,e),i=[];return s.forEach(t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}i.push(t,e)}),i}}Rn.type="arearange",Rn.defaults=is(Ln.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class $n extends Tr{_canContain(t){return t instanceof Tn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}$n.type="linegroup",$n.seriesType=Li,$n.defaults=is(Tr.defaults,{lineType:"default"});class Fn extends Tr{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this.prop("layout")}}}_canContain(t){return t instanceof Bn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}Fn.type="areagroup",Fn.seriesType=Ni,Fn.defaults=is(Tr.defaults,{lineType:"default"});class In extends En{}class zn extends Bn{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new In(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)),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=t.reduce((t,e)=>t+e,0)/s,r=Math.sqrt(t.reduce((t,e)=>t+Math.pow(e-i,2))/(s-1)),n=r/this.num("pointsInSigma"),o=i-this.num("sigmas")*r,a=i+this.num("sigmas")*r;let h=i;const l=[];for(l.push(e(i,r,h));h>o;)h-=n,l.unshift(e(i,r,h));for(h=i;h<a;)h+=n,l.push(e(i,r,h));return l}}zn.type="bellcurve",zn.defaults=is(Bn.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Hn extends Wi{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 h(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[A(s.xField,0)]),this.min=e[A(s.minField,0+i)],this.low=e[A(s.lowField,1+i)],this.mid=e[A(s.midField,2+i)],this.high=e[A(s.highField,3+i)],this.y=e[Ot(s.maxField,t.prop("yField"),4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=P(e[s.minField],e.min),this.low=P(e[s.lowField],e.low),this.mid=P(e[s.midField],e.mid),this.high=P(e[s.highField],e.high),this.y=P(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=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 Gn extends Nr{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Hn(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return bi.create(t,fr.LEGEND_MARKER,0,0,e,e,2)}}Gn.type="boxplot",Gn.defaults=is(Nr.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 jn extends Ne{constructor(t,e,s){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return yi.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 yi.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 Wn=2*Math.PI,Yn=-Math.PI/2;class Xn extends Ve{constructor(t){super(t,fr.LEGEND_MARKER),this._sectors=[],this.add(this._back=new bi(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,s){if(this._size===t&&this._sectors.length===e)return void this._applyColors(s);this._size=t;const i=t/2,r=i,n=i;this._back.setBounds(0,0,t,t),this._sectors.forEach(t=>t.remove()),this._sectors=[];const o=Wn/e;let a=Yn;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:i,ry:i,start:a,angle:o,clockwise:!0},e=new jn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(s)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const s=t&&t[e]||"#ccc";this._sectors[e].setFill(s)}}}class Un{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)%gr+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 Zn{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 qn extends Xi{}class Kn extends os{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 s=0;for(const i of e){if(i===t)break;i instanceof Qn&&i.pie&&i.pie.fields.length>0&&(s+=i.pie.fields.length)}return s}getLegendSources(){return this._legendSources}isFieldVisible(t){const e=this._legendSources;return!e||!e[t]||!1!==e[t].visible}calcSlices(t){const e=this._fields;if(!e||0===e.length||!t)return null;const s=[];for(let i=0;i<e.length;i++){if(!this.isFieldVisible(i))continue;const r=this._getFieldValue(t,e[i]),o=n(r)&&r>0?r:0;o>0&&s.push({index:i,value:o})}if(0===s.length)return null;const i=s.reduce((t,e)=>t+e.value,0);if(i<=0)return null;const r=this._sliceColors,o=this._clockwise?1:-1,a=this._totalRad;let h=this._startRad;const l=[];for(let t=0;t<s.length;t++){const e=s[t],n=o*(e.value/i)*a,c=this._legendSources[e.index];if(c){const t=new Zn;t.source=c,t.value=e.value,t.percent=Math.round(e.value/i*1e4)/100,t.startAngle=h,t.angle=n,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=n}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let s=0;s<t.length;s++)t[s].color=`var(--color-${(e+t[s].index)%gr+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,s=[],i=this._paletteOffset;for(let r=0;r<t;r++)s.push(e.length>0?e[r%e.length]:`var(--color-${(i+r)%gr+1})`);return s}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t,e){return o(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:r(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*g(0,p(360,i<=0?360:i)),this._clockwise=this.bool("clockwise"),this.prop("innerRadius")?this._innerRadiusDim=Lt(this.prop("innerRadius"),!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,s=this._sliceColors,i=this._categories,r=e.length;this._legendSources=e.map((e,n)=>{const o=s.length>0?s[n%s.length]:null,a=null==t?void 0:t.find(t=>t.legendKey()===this.hash+":"+e),h=new Un;return h._pie=this,h.field=e,h.label=i[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h})}_getFieldValue(t,e){if(t)return t[s(t)?+e:e]}}Kn.defaults=is(os.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class Qn extends Br{_doInit(t){super._doInit(t),this._pie=this._addChild("pie",new Kn(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,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this.prop("sizeMode")&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getTooltipText(t,e){const s=this._hoveredSlice;if(s&&this._pie){let t;const i=this._pie.prop("tooltipCallback");return i&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=s,t=i(this._pointArgs)),void 0===t&&(t=this._pie.prop("tooltipText")||"${label}: ${value} (${percent}%)"),t}return super.getTooltipText(t,e)}getTooltipParam(t,e,s){var i;const r=this._hoveredSlice;return r&&null!==(i=r.getParam(s))&&void 0!==i?i:super.getTooltipParam(t,e,s)}getTooltipHeaderColor(t){var e,s;return null!==(s=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==s?s:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new qn(t)}_getNoClip(t){const e=super._getNoClip(t);return!o(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createLegendMarker(t,e){const s=this._pie;if(s&&s.visible&&s.fields.length>0){const i=new Xn(t);return i.render(e,s.fields.length,[]),i.setColorResolver(()=>s.getLegendSliceColors()),i}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,s=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,i=s?this.prop("legendMode")||"both":null;"slice"!==i&&super.getLegendSources(t),s&&"series"!==i&&e.getLegendSources().forEach(e=>t.push(e))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach(s=>{s.isNull||isNaN(s.zValue)||(t=p(t,s.zValue),e=g(e,s.zValue))}),this._noSize=(this._zMin=t)===(this._zMax=e),this._pie&&this._pie.visible&&this._pie.fields.length>0&&this._visPoints.forEach(t=>{t.isNull||(t.pieSlices=this._pie.calcSlices(t.source))})}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){r(t)&&(t=this._xAxisObj.getValue(t)),r(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}Qn.type="bubble",Qn.defaults=is(Br.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 Jn extends Mr{_canContain(t){return t instanceof Tn}_doConstraintYValues(t){const e={};t.forEach(t=>{t._visPoints.forEach(t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}})});for(const t in e)e[t].sort((t,e)=>t.yValue-e.yValue).forEach((t,e)=>{t.yLabel=P(t.yLabel,t.yValue),t.yValue=t.yGroup=e});return nt.makeIntArray(0,t.length)}}Jn.type="bump",Jn.seriesType=Li;class to extends Wi{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[A(s.xField,0)]),this.low=e[A(s.lowField,0+i)],this.close=e[A(s.closeField,1+i)],this.open=e[A(s.openField,2+i)],this.y=e[Ot(s.highField,t.prop("yField"),3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=P(e[s.lowField],e.low),this.open=P(e[s.openField],e.open),this.close=P(e[s.closeField],e.close),this.y=k(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=L(t.lowValue,this.lowValue,e),this.openValue=L(t.openValue,this.openValue,e),this.closeValue=L(t.closeValue,this.closeValue,e)}}class eo extends Nr{canCategorized(){return!0}_createPoint(t){return new to(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new we;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Ne(t,fr.LEGEND_MARKER).setPath(s.end())}}eo.type="candlestick",eo.defaults=is(Nr.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class so extends Pr{}so.defaults=is(hr.defaults,{position:"inside"});class io extends fn{get pointLabel(){return this._pointLabel}_createLabel(t){return new so(t)}}io.type=Ti;class ro extends yn{_canContain(t){return t instanceof io}}ro.type="circlebargroup",ro.seriesType=Ti;class no extends Ui{}class oo extends br{}oo.defaults=is(br.defaults,{radius:4,shape:"circle"});class ao extends hr{}ao.defaults=is(hr.defaults,{highVisible:!0,lowVisible:!0});class ho extends Nr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new oo(this)),this._lowMarker=this._addChild("lowMarker",new oo(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)+g(0,this.marker.prop("radius"))}_createLabel(t){return new ao(t)}_createPoint(t){return new no(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"),s=A(this.lowMarker.prop("radius"),t),i=this.lowMarker.prop("shape")||e;this._visPoints.forEach(r=>{r.radius=t,r.shape=e,r.lowRadius=s,r.lowShape=i}),super.prepareAfter()}}ho.type="dumbbell";class lo extends Wi{}class co extends kr{getSegmentSize(t){return R(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new lo(t)}_createLegendMarker(t,e){const s=new we;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Ne(t,fr.LEGEND_MARKER).setPath(s.end())}}co.type="equalizer",co.defaults=is(kr.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class _o extends Nr{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Ui(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new we).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Ne(t,fr.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}_o.type="errorbar",_o.defaults=is(Nr.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class uo extends xr{}class po extends uo{constructor(t,e){super(t),this.points=e}}class go extends vr{getDistance(){return isNaN(this.prop("distance"))?"far"===this.prop("align")?go.ENDED_DIST:go.OUTSIDE_DIST:this.prop("distance")||0}}go.OUTSIDE_DIST=25,go.ENDED_DIST=10;class fo extends Vr{getSize(t,e){return{width:g(.1*t,R(this._widthDim,t)),height:g(.1*e,R(this._heightDim,e))}}getNeckSize(t,e){return{width:nt.clamp(R(this._neckWidthDim,t),this._minNeckWidth,t),height:nt.clamp(R(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new go(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){const e=this;var s;super._doApply(t),(s=this.prop("width"))!==e._width&&(e._width=s,e._widthDim=Nt(e._width,fo.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Nt(e._height,fo.defaults.height))}(this.prop("height")),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Nt(e._neckWidth,fo.defaults.neckWidth))}(this.prop("neckWidth")),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Nt(e._neckHeight,fo.defaults.neckHeight))}(this.prop("neckHeight")),this._minNeckWidth=Math.max(0,+this.num("minNeckWidth"))}}fo.type="funnel",fo.defaults=is(Vr.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class mo extends Wi{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return h(super._assignTo(t),{min:this.min,max:this.max})}}const yo={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 bo extends yr{getBinCount(t){const e=A(this.prop("binWidth"),0);if(e>0)return t/e;return A(this.prop("binsNumber"),0)<1?yo[this.prop("binsNumber")||"squreRoot"](t):void 0}_createPoint(t){return new mo(t)}_doLoadPoints(t){function i(t){let i;return i=s(t)?t[A(this.yField,0)]:e(t)?k(t[this.yField],t.y,t.value):t,parseFloat(i)}const r=[];let n=[];for(let e=0;e<t.length;e++){const s=i(t[e]);isNaN(s)||n.push(s)}if(n.length>0){n=n.sort((t,e)=>t-e);const t=this.num("minValue"),e=this.num("maxValue");t<n[0]&&n.unshift(t),e>n[n.length-1]&&n.push(e);const s=n.length,i=n[0],o=n[s-1],a=this.getBinCount(s),h=this._binInterval=(o-i)/a;let l=0,c=i,_=c+h;for(let t=0;t<a;t++){let e=0;if(t==a-1)e=s-l;else for(;l<s&&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=Ot(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 bi.create(t,fr.LEGEND_MARKER,0,0,e,e,2)}}bo.type="histogram",bo.defaults=is(fr.defaults,{baseValue:0,binsNumber:"squreRoot"});class xo extends br{}xo.defaults=is(br.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class wo extends Wi{_assignTo(t){return h(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.prop("colorField"),i=+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(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=P(e[t.prop("radiusField")],e.radius)}}class vo extends kr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new xo(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 wo(t)}prepareAfter(){const t=this.marker,e=t.prop("radius"),s=t.prop("shape"),i=this.prop("radiusField"),r=g(t.num("minRadius"),0),n=g(t.num("maxRadius"),r);if(i){const t=this._runPoints.map(t=>t.radius).filter(t=>"number"==typeof t&&!Number.isNaN(t)),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach(t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s})}else this._runPoints.forEach(t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s});super.prepareAfter()}}vo.type="lollipop";class So extends to{}class Vo extends eo{_createPoint(t){return new So(t)}_createLegendMarker(t,e){const s=new we;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Ne(t,fr.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}Vo.type="ohlc";class Co extends Cn{}class Ao extends Ln{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 s=[],i=t.reduce((t,e)=>t+A(e.yValue,0),0);let r=0;t.forEach(t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})}),e._doLoadPoints(s),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Ao.type="pareto",Ao.defaults=is(Ln.defaults,{curved:!1});class Po extends xr{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 h(super._assignTo(t),{sliced:this.sliced})}}class ko extends Po{constructor(t,e){super(t),this.points=e}}class Lo extends ls{getDefaultIconPos(){return"left"}}class No extends vr{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?R(this._distanceDim,e,0):t?R(s?No.INNER_DIST:No.INSIDE_DIST,e):"far"===this.prop("align")?No.ENDED_DIST:No.OUTSIDE_DIST}}No.INSIDE_DIST=Lt("30%",!1),No.INNER_DIST=Lt("50%",!1),No.OUTSIDE_DIST=25,No.ENDED_DIST=10,No.defaults=is(vr.defaults,{radius:.7,rotationMode:"arc"});class To extends os{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 n(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._runLength=g(0,this.num("length")),this._runRatio=g(.3,p(.8,this.num("ratio",To.DEPTH_RATIO)))}}To.DEPTH_RATIO=.6,To.defaults=is(os.defaults,{visible:!1,length:25,ratio:To.DEPTH_RATIO});class Mo extends Cr{_doInit(t){super._doInit(t),this._innerText=this._addChild("innerText",new Lo(this.chart)),this._depth=this._addChild("depth",new To(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 No(t)}_createPoint(t){return new Po(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new ko(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*g(0,p(360,t)),this._groupPos=NaN}}Mo.type="pie",Mo.defaults=is(Cr.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Eo extends Tr{getPolarSize(t,e){return R(this._polarDim,p(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=this.prop("polarSize"))!==e._polarSize&&(e._polarSize=s,e._polarDim=Lt(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Lt(t,!0))}(this.prop("innerSize"))}needAxes(){return!1}_canContain(t){return t instanceof Mo}_doPrepareSeries(t){const e=t.map(t=>t.prop("groupSize")).reduce((t,e)=>t+A(e,1),0);let s=0;t.forEach(t=>{t._groupPos=s,s+=t._groupSize=A(t.prop("groupSize"),1)/e})}}Eo.type="piegroup",Eo.seriesType="pie",Eo.defaults=is(Tr.defaults,{polarSize:"80%",innerSize:0});class Bo extends Wi{}class Oo extends Br{_createPoint(t){return new Bo(t)}_getNoClip(t){const e=super._getNoClip(t);return!o(e)||e}_createLegendMarker(t,e){return new xn(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 s=super.legendMarker(t,e);return s.render(this.getShape(null),p(e/2,this.prop("radius"))),s}}Oo.type="scatter",Oo.defaults=is(Br.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Do extends Wi{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 Ro extends hr{}Ro.defaults=is(hr.defaults,{offset:0});class $o extends Lr{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Ro(t)}_createPoint(t){return new Do(t)}_createLegendMarker(t,e){return bi.create(t,fr.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let c=1,_=t.length;c<_;c++){s=t[c];if(!0===s._isMid&&c<_)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}$o.type="waterfall",$o.defaults=is(Lr.defaults,{tooltipDetail:"<b>${y}</b>"});class Fo extends Qr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let _=[],d=g(1,l(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(d-1);const e=o(Math.floor(n(t))),l=this._getStepMultiples(e);if(t/=e,l&&l.length>0)if(t>l[0]){for(let e=0;e<l.length-1;e++)if(t>l[e]&&t<l[e+1]){t=t<=l[e]+(l[e+1]-l[e])/2?l[e]:l[e+1];break}}else t=l[0];t*=e,(t<=0||!isFinite(t))&&(t=h/d),i=isNaN(s)?this._normalizeMin(i,t):s-c((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let f=i,m=a(f);for(_.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>_[_.length-1]&&(m<r&&(1==_.length&&m-_[_.length-1]<t||_.length>1&&m-_[_.length-1]<(_[_.length-1]-_[_.length-2])*g)&&_.pop(),_.push(m))}else{i=o(i);const t=(r=o(r))-i;let e=t/(d-1);const s=o(l(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/d);const h=1e-10*e;let c=l(i/e)*e;for(c<i&&(c+=e),_.push(n(c));c<=r+h;)c+=e,c>0&&_.push(n(c))}return _}}Fo.defaults=is(Qr.defaults,{arrangeDecimals:!0});class Io extends rn{_isLog(){return!0}_createLabel(){return new tn(this)}_createTickModel(){return new Fo(this)}_doApply(t){super._doApply(t);const e=this._logBase=g(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 s=>{const i=l(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}contains(t){return t>0&&super.contains(this._log(t))}trimRange(t,e){const s=t>0?this._log(t):NaN,i=e>0?this._log(e):NaN,[r,n]=super.trimRange(s,i);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,yt(this._pow(e)))}_interpolateMinorValue(t,e,s,i){if(t<=0||e<=0)return NaN;const r=this._log(t),n=this._log(e);return isFinite(r)&&isFinite(n)?yt(this._pow(r+(n-r)*s/(i+1))):NaN}_canInterpolateMinorSegment(t,e){return super._canInterpolateMinorSegment(t,e)&&t>0&&e>0}_calcUnitLen(t,e,s,i){if((t=t.filter(t=>t>0)).length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=p(n,r(t[e])-r(t[e-1]));if(!isFinite(n)||n<=0)return super._calcUnitLen(t,e,s,i);const o=i-s,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)}}Io.type="log",Io.defaults=is(rn.defaults,{logBase:10,roundThrrehold:500});class zo extends os{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})}}}zo.defaults=is(os.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Ho extends as{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 s=new zo(t);return s.init(),s._load(e),s}}const Go="$ctrl";class jo extends os{isFloating(){return this.prop("floating")||"middle"===this.prop("verticalAlign")&&"center"===this.prop("align")}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}jo.defaults=is(os.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Wo extends os{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"}}Wo.defaults=is(os.defaults,{scope:"auto"});class Yo extends os{_doInit(t){this._pointHovering=this._addChild("pointHovering",new Wo(this.chart))}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this.prop("xStart"))&&void 0!==e?e:t.getXStart()}}var Xo;Yo.defaults=is(os.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"}(Xo||(Xo={}));class Uo extends ct{static registerSplitClass(t){this.split_class=t}constructor(t,s){super(),this._data=new ut,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=s,this._assets=new es,(this._general=new Yo(this)).init(),(this._title=new zr(this)).init(),(this._subtitle=new Hr(this)).init(),(this._legend=new pi(this)).init(),(this._credits=new jo(this)).init(),(this._tooltip=new Gr(this)).init(),this._buttons=new Ho(this),Uo.split_class&&(this._split=new Uo.split_class(this)).init(),(this._body=new _i(this)).init(),(this._navigator=new Ir(this)).init(),(this._exporter=new di(this)).init(),this._series=new mr(this),this._xAxes=new Ds(this,!0),this._yAxes=new Ds(this,!1),this._gauges=new js(this),this._annotations=new us(this),e(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},Uo.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Go]).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 Uo(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,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter(t=>t.needAxes())}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return Tr.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,s)}getTooltipParam(t,e,s){return Tr.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._general.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof Is?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(s=>s.col===t&&(!e||s.checkVisible())):this._xAxes._internalItems().filter(t=>!e||t.checkVisible())}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter(s=>s.row===t&&(!e||s.checkVisible())):this._yAxes._internalItems().filter(t=>!e||t.checkVisible())}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter(i=>i.col===t&&i.row===e&&(!s||i.checkVisible())):this._xAxes._internalItems().filter(t=>!s||t.checkVisible())}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter(i=>i.col===t&&i.row===e&&(!s||i.checkVisible())):this._yAxes._internalItems().filter(t=>!s||t.checkVisible())}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case Xo.LEFT:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Xo.RIGHT:r=s.filter(t=>t._isOpposite);break;case Xo.BOTTOM:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Xo.TOP:r=i.filter(t=>t._isOpposite)}else switch(t){case Xo.LEFT:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Xo.RIGHT:r=i.filter(t=>t._isOpposite);break;case Xo.BOTTOM:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Xo.TOP:r=s.filter(t=>t._isOpposite)}return r?e?r.filter(t=>t.checkVisible()):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in Uo.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,s,i){const r=this._bases[s];let n;return e(r.base)&&ns(n={},r.base),e(r[i])&&(n||(n={}),ns(n,r[i])),n?ns(n,t):t}_load(t){var s,i;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)),e(t.general)?this._credits._load(t.general.credits):e(t.chart)?this._credits._load(t.chart.credits):e(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===(s=this._gauges)||void 0===s||s.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===(i=this._split)||void 0===i||i._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,s){if(e(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof os||s instanceof as||s instanceof es)&&s.updateOptions(t[e],!1)}s&&this._modelChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;return[e,s].forEach(t=>{t.count<1&&!this._gaugeOnly&&t.load({})}),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach(t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)}),r=s?t:e,this._yAxes.forEach(t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t,e);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=gr;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const i=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(e(t)){const n=this._templates={};for(const s in t){const i=t[s];e(i)&&(n[s]=h({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach(s=>{t.hasOwnProperty(s)&&e(t[s])&&(i[s.substring(1)]=t[s])}),this.assignTemplates=t=>{const e=t.template;if(r(e)){let s=this._templates[e];if(s)return ns(ns({},s),t)}else s(e)&&e.forEach(e=>{let s=this._templates[e];return s?ns(ns({},s),t):s});return t}}else this.assignTemplates=void 0}_getGroupType(t){return r(t)&&nr[t.toLowerCase()]}_getSeriesType(t){return r(t)&&rr[t.toLowerCase()]}_getAxisType(t){return r(t)&&ms[t.toLowerCase()]}_getGaugeType(t){return r(t)&&$s[t.toLowerCase()]}_getGaugeGroupType(t){return r(t)&&Fs[t.toLowerCase()]}_getAnnotationType(t){return r(t)&&_s[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)}}Uo.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Os.register(Qi,nn,Io,dn),fr.register(Bn,Rn,pn,mn,zn,Gn,Qn,eo,io,ho,co,_o,fo,bo,Tn,Mn,vo,Vo,Ao,Mo,Oo,$o),Tr.register(Fn,bn,Jn,ro,$n,Eo),Tr.registerSeries(Fn,bn,ro,$n,Eo),ds.register(Ur,Zr,qr);class Zo{constructor(t,s){this._modelCallback=s,this._obj=new Uo(t,this),this._loaded=e(t),null==s||s(this._obj,null)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[Go]=null===(t=this[Go])||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 r(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,s=!1,i){var r;if(e(t)){const e="load chart";nt.LOGGING&&console.time(e);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new Uo(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=s,this._loadCallback=i,nt.log("chart-items:",ss),nt.LOGGING&&console.timeEnd(e),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[Go].refresh()}}class qo{constructor(t,e){this._obj=new dt(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Ko extends q{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_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,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach(t=>this._owner.appendDom(t.dom)),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach(t=>this._owner.appendDom(t.dom)),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}class Qo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Qo(t,t,t,t):new Qo(t,t,e,e):new Qo(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map(t=>+t))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new Qo(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}}}Qo.Empty=Object.freeze(new Qo),Qo.Temp=new Qo;class Jo extends Ve{constructor(t,e=gt){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Jo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Jo.IGNORE_ATTRS={width:"",height:""};class ta extends Ve{constructor(t,e=gt){super(t,e,"g"),Ve.DEBUGGING&&(this.add(this._debugRect=new bi(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),Ve.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new bi(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class ea extends ta{constructor(t,e,s){super(t,e),this._margins=new Qo,this._paddings=new Qo,this.add(this._background=new bi(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class sa extends Jo{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class ia extends ta{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class ra extends Ve{constructor(t,e,s){super(t,s,"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&&!rt||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout(()=>{this.onloadProxy()},0)},this._proxy.onerror=()=>{this.onerrorProxy(),this.invalidate()})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return t||(t=NaN),e||(e=NaN),i&&(T(t)||T(e))&&(t>0&&T(e)?e=t/i.width*i.height:e>0&&T(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class na extends Jo{constructor(t,e=gt){super(t),this.add(this._text=new $e(t,e)),this._text.anchor=Oe.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.prop("effect");return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),this._text.stain(),this._text.layoutText(),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new bi(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()),s&&s!==this._failedIconUrl?(this._icon||this.add(this._icon=new ra(t,!1)),this._icon.setImage(s,+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 s=this._back&&this._back.parent?this._back.dom:t;s&&this._text.setContrast(s,e.prop("darkStyle")||"rct-label-dark",e.prop("lightStyle")||"rct-label-light")}if(this._outline&&this._outline.parent){const t=ne.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,s=this._outline,i=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,c=0,_=0,d=0,u=0;if(this._box=void 0,i){const t=i.getBBox();r=this._model.num("iconGap");const e=this._model.num("iconWidth"),s=this._model.num("iconHeight");switch(c=t.width||e||s,_=t.height||s||e,this._model.getIconPos()){case"left":case"right":h+=r+c,l=Math.max(_,a);break;default:l+=r+_,h=Math.max(c,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(i)switch(this._model.getIconPos()){case"left":i.trans(d,(l-_)/2),d+=c+r,h-=c+r;break;case"right":i.trans(d+h-c,(l-_)/2),h-=c+r;break;case"top":i.trans((h-c)/2,u),u+=_+r;break;case"bottom":i.trans((h-c)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=Oe.MIDDLE;break;case"right":d+=h,e.anchor=Oe.END;break;default:e.anchor=Oe.START}return e.trans(d,u),s&&(s.anchor=e.anchor,s.setAttr("y",e.getAttr("y")),s.trans(e.tx,e.ty)),this._iconBox=i?{x:i.tx,y:i.ty,width:c,height:_}:null,this}getLayoutBox(){const t=this.getBBox(),e=this._iconBox;if(!e)return t;const s=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:s,y:i,width:Math.max(t.x+t.width,e.x+e.width)-s,height:Math.max(t.y+t.height,e.y+e.height)-i}}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 oa extends ea{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new $e(t)),this._richText=new Xe}rotatedWidth(){const t=this.model.getRotation()*w,e=this.getBBox();return f(d(t)*e.height)+f(_(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*w,e=this.getBBox();return f(_(t)*e.height)+f(d(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,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,s,i,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(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===St||s===Vt;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=Oe.START,i||(n-=this.width/2);break;case"right":e.anchor=Oe.END,i?r+=this.height:n+=this.width/2;break;default:e.anchor=Oe.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class aa extends ea{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new $e(t)),this._textView.anchor=Oe.START,this._richText=new Xe}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,s,i,null,null),X(this._textView.getBBox())}_doLayout(t){const e=this._textView;let s=this._margins.top+this._paddings.top,i=0;switch(this.textAlign()){case"left":e.anchor=Oe.START,i-=this.width/2;break;case"right":e.anchor=Oe.END,i+=this.width/2;break;default:e.anchor=Oe.MIDDLE}e.trans(i,s)}}class ha extends ta{constructor(t,e=ua.TICK_CLASS){super(t,e),this.add(this._lineView=new Sn(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class la extends na{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,s,i,r,n){i?(t.prepareRich(i),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(s)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),t.buildSvg(this._text,this._outline,r,n,t,t._domain))}applyBackgroundCallback(t,e){const s=t.prop("backgroundStyleCallback");if("background"===t.prop("effect")&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*w,e=this.getBBox();return f(d(t)*e.height)+f(_(t)*e.width)}rotatedHeight(){const t=this.rotation*w,e=this.getBBox();return f(_(t)*e.height)+f(d(t)*e.width)}invalidateBackPad(){this._backPad=null,this._backPadDom=null}resizeBackBySpan(t,e,s=!0){const i=this._back;if(!i)return;const r=this.getBBox();let n=this._backPad;if(!n||this._backPadDom!==i.dom){const t=getComputedStyle(i.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=i.dom}const{l:o,t:a,r:h,b:l}=n;i.transX(0),i.transY(0),s?i.setBounds((t-r.width)/-2-e-o,-a,t-1+o+h,r.height+a+l):i.setBounds(-o,(t-r.height)/-2-e-a,r.width+o+h,t-1+a+l)}resizeBackByWeight(t,e,s,i,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:s?n:l-o;c.transX(_-this.tx),c.transY((r-t.height)/-2-h),e?c.resize(i-l-2*(n+o),r-1):c.resize(i-n-l+o,r-1)}}}class ca extends Ve{constructor(t){super(t,void 0),this.add(this._back=new Ne(t,"rct-crosshair-flag")),this.add(this._text=new $e(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.flag;this._text.text=(s.prop("prefix")||"")+e+(s.prop("suffix")||"");const i=this._text.getBBox(),r=new we,n=g(s.num("minWidth"),i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.prop("textStyles"))}}class _a extends ta{static isThumb(t){return t.classList.contains(_a.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new bi(t,_a.TRACK_CLASS)),this.add(this._thumbView=new bi(t,_a.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=g(0,e),this._page=p(s,e),this._pos=p(t.min+e-s,g(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.prop("reversed"),(t=g(0,p(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=A(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let c=this.width,_=this.height;if(this._vertical){c-=l,this._trackView.setBounds(h,0,c,_),_-=i;const t=(n||o===r?_:_*o/r)+i;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-=i;const t=(n||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:c*a/r,h+1,t,_-2)}}}_a.CLASS_NAME="rct-axis-scrollbar",_a.TRACK_CLASS="rct-axis-scrollbar-track",_a.THUMB_CLASS="rct-axis-scrollbar-thumb";const da=/\${label}.*?/g;class ua extends ta{constructor(t){super(t,ua.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._minorMarkViews=[],this._categoryTreeLevelSizes=[],this._categoryTreeLevelOffsets=[],this._categoryTreeExtraSize=0,this.add(this._lineView=new Sn(t,ua.LINE_CLASS)),this.add(this._titleView=new oa(t)),this.add(this._markContainer=new Ve(t,"rct-axis-ticks")),this.add(this._minorMarkContainer=new Ve(t,"rct-axis-minor-ticks")),this.add(this._labelContainer=new Ve(t,"rct-axis-labels")),this.add(this._unitView=new aa(t)),this._labelViews=new Ko(this._labelContainer,la,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new _a(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=i.tick._inside?g(0,i.tick._getGap()):g(0,i.tick._getLength())+g(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.getGap()),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=i.tick._inside?g(0,i.tick._getGap()):g(0,i.tick._getLength())+g(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.getGap()),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach((i,r)=>{const n=this.model.guides.filter(t=>t.prop("front")==(1===r)&&t.canConstainedTo(e,s));i.setAll(t,n,!1)})}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new ca(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?p(0,this.width-n.width):g(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}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,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.prop("animatable")&&s.checkExtents(t,e)}}this._prevModel=s}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,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 Sn(t,ua.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,s,i,r)),e instanceof rn?(this._minorMarkLen=e.minorTick._getLength(),this.$_prepareMinorTickMarks(t,e)&&this._minorMarkViews.forEach(n=>n.measure(t,e.minorTick,s,i,r))):this._minorMarkContainer.setVis(!1),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,_.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(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?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t.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(s?u:0,0,d):this._lineView.setVLine(s?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,s,n,d,u),t instanceof rn&&this._minorMarkContainer.visible&&this.$_layoutTickMarkViews(this._minorMarkViews,t._minorMarkPoints,this._minorMarkLen,t,e,s,n,d,u);const p=(r===n?c:0)+_,g=t instanceof Qi?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&&nt.warn("labelViews.count < ticks.length",h.count,o.length),e?(this.$_layoutLabelsHorz(h,o,r,i,s,d,u,p),this.$_layoutCategoryTreeHorz(t,r,s,d,u,p)):(this.$_layoutLabelsVert(h,o,r,i,s,d,u,p),this.$_layoutCategoryTreeVert(t,r,s,d,u,p))):e?this.$_layoutCategoryTreeHorz(t,r,s,d,u,p):this.$_layoutCategoryTreeVert(t,r,s,d,u,p),l.visible&&(e?this.$_layoutUnitHorz(l,h,s,d,u,p):this.$_layoutUnitVert(l,h,s,d,u,p)),!this._simpleMode){const i=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=+i.prop("offset")||0,n=i.getGap();if(o.resizeByMeasured().layout(e),e){if(f+=s?0:l+n,t.prop("reversed"))switch(i.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(i.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=s?l+n+t/2:d-l-n-t/2,this._reversed)if(0===o._angle)switch(i.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(i.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(i.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(i.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+=s?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,s,i,r=ua.TICK_CLASS){for(;s.length<i;){const i=new ha(t,r);e.add(i),s.push(i)}for(;s.length>i;)s.pop().remove()}$_prepareTickMarkViews(t,e,s,i,r,n=ua.TICK_CLASS){return!!(e.visible=i)&&(this.$_syncTickMarkViews(t,e,s,r,n),!0)}$_layoutTickMarkViews(t,e,s,i,r,n,o,a,h){r?t.forEach((t,r)=>{t.resize(1,s),t.layout().trans(i.prev(e[r]),n?o?h:h-s:o?-s:0)}):t.forEach((t,r)=>{t.resize(s,1),t.layout().trans(n?o?-s:0:o?a:a-s,h-i.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,ua.MINOR_TICK_CLASS)}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),o=e.label,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(da)?t.setLabel(s,a,e,n.replace(da,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,s.getIconUrl(s.getIcon(e)),a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_resolveCategoryTreeRotation(t,e,s,i,r){const n=t.getLevelRotation(e.level);if("auto"!==n)return n;if(!s)return 0;const o=t.getCategoryTreeSpan(e.start,e.end,i);return isNaN(o.size)||o.size<=0?0:r._text.getBBox().width>o.size?-90:0}$_prepareCategoryTreeLabel(t,e,s,i,r,n,o,a){const h=i.getLevelStyle(s.level);if(!(!n&&t.index===r&&t.groupLevel===s.level&&t.value===s.start&&t.col===s.end&&t.categoryTreeLabel===s.label&&this.$_equalSVGStyleOrClass(t.categoryTreeStyle,h))){t.index=r,t.groupLevel=s.level,t.value=s.start,t.col=s.end,t.categoryTreeLabel=s.label,t.categoryTreeStyle=h,t.invalidateBackPad(),e.prepareRich(s.label),t.setModel(this.doc,e,null,h),e.buildSvg(t._text,t._outline,NaN,NaN,e,e._domain);const n=i._ticks[s.start];n&&t.applyBackgroundCallback(e,n),t.setContrast(null).layout(i.getLevelAlign(s.level))}t.rotation=this.$_resolveCategoryTreeRotation(i,s,o,a,t)}$_isCategoryTreeSpanVisible(t){return!isNaN(t.center)&&!isNaN(t.size)}$_equalSVGStyleOrClass(t,s){if(t===s)return!0;if(null==t||null==s)return t==s;if(r(t)||r(s))return t===s;if(!e(t)||!e(s))return!1;const i=Object.keys(t);if(i.length!==Object.keys(s).length)return!1;for(const e of i)if(t[e]!==s[e])return!1;return!0}$_applyLabelRotationVert(t,e,s,i,r){const n=e.x+e.width/2,o=e.y+e.height/2;return t.setRotation(n,o,s),{x:r-n,y:i-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,s,i,r,n,o,a){const h=t.label,l=g(0,p(i-1,h.prop("startStep")||0)),c=t._ticks,d=c.length,u=(i=g(1,i))*(r=p(g(1,r),c.length)),m=n||0,y=f(m)*w,b=y<35*w;let x,v=!1,S=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<d;r+=u){let i=0;for(let e=r;e<r+u&&e<d;e++)i+=t.getLabelLength(s,c[e].value);if(r+u<d){x=e.pull(S++),x.rotation=m,x.row=n,x.index=r,this._prepareLabel(x,c[r],h,d,a),x.setVis(!0);const t=i;if(0===m&&x.getBBox().width>=t){v=!0;break}if(b&&x.getBBox().width*_(y)>=t){v=!0;break}if(0!==m&&x.getBBox().height>=t){v=!0;break}}}if(v)return!0;{const t=r-u;0<=t&&t<d&&(x=e.pull(S++),x.row=n,x.rotation=m,x.index=t,this._prepareLabel(x,c[t],h,d,a),x.setVis(!0))}}!o&&e.freeFrom(S)}$_applyStep(t,e,s){const i=t.label,r=g(0,p(s-1,i.prop("startStep")||0));e.forEach(t=>t.index=-1);for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach(t=>t.setVis(t.index>=0)),e.filter(t=>t.visible)}$_measureLabelsHorz(t,e,s=!1){const i=t.prop("reversed"),r=t.label,n=t instanceof Qi?t:null;if(null==n?void 0:n.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(n,!0,s,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,s),d=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===r.prop("autoArrange"))this._labelViews.prepare(t._ticks.length,(e,i,n)=>{e.rotation=c,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),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 i=t._ticks.length;for(;o<=i&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++}else if(a>1){const i=h>1?h:g(1,+r.prop("maxRows")|0);a=p(h>1?h:a,i);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,s)){n=!0;break}if(a>=i)break;a++}if(n)this._labelRowPts=[];else{a=1,o=2;const i=t._ticks.length;for(;o<=i&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++}}else if((isNaN(c)||Math.abs(Math.tan(c*w))<1)&&(c=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,s)){o=2;const i=t._ticks.length;for(;o<=i;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,c,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,s)&&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(s=>{e[s.row]=g(e[s.row],t?s.rotatedHeight():s.getBBox().height)}),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(c)||0==c){l=d[0].getBBox().height;for(let t=1;t<d.length;t++)l=g(l,d[t].getBBox().height);if(d.length>1){const e=t._ticks;let s=i?r.prop("lastOverflow"):r.prop("firstOverflow");if("hidden"===s){const t=d[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<d.length;t++)r=g(r,d[t].getBBox().height);(i+s>d[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(l=r,t.hidden=!0):t.hidden=!1}if(s=i?r.prop("firstOverflow"):r.prop("lastOverflow"),"hidden"===s){const t=d[d.length-1],s=t.rotatedWidth(),i=d[d.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,o=0;for(let t=0;t<d.length-1;t++)o=g(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=g(l,d[t].rotatedHeight())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),l}return 0}$_checkOverlappedVert2(t,e,s,i,r,n){const o=t.label,a=t._ticks,h=a.length,l=g(1,i);let c,_=o.prop("startStep")||0,d=0;for(;_<h;_+=l){let i=0;for(let e=_;e<_+l&&e<h;e++)i+=t.getLabelLength(s,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>=i))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,s=!1,i=0){if(i>1&&t instanceof rn)return this._prevWidth;const r=t instanceof Qi?t:null;if(null==r?void 0:r.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(r,!1,s,e);const n=t.label,o=+n.prop("rotation")%360;let a=g(1,+n.prop("step")|0);const h=this.$_checkOverlappedVert2(t,this._labelViews,e,a,o,s);let l=this._labelViews._internalItems();if(h)if("none"===n.prop("autoArrange"))this._labelViews.prepare(t._ticks.length,(e,i,r)=>{e.rotation=o,e.index=i,this._prepareLabel(e,t._ticks[i],n,r,s),e.setVis(!0)}),l=this.$_applyStep(t,l,a||1);else{const i=t._ticks.length;for(;a<=i&&this.$_checkOverlappedVert2(t,this._labelViews,e,++a,o,s););}else;if(this._labelViews.freeHiddens(),l=this._labelViews._internalItems(),l.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;if(isNaN(o)||0===o){l[0].setContrast(null).layout(s),i=l[0].getBBox().width;for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(s),i=g(i,l[t].getBBox().width)}else{l[0].setContrast(null).layout(s),i=l[0].rotatedWidth();for(let t=1;t<l.length;t++)l[t].setContrast(null).layout(s),i=g(i,l[t].rotatedWidth())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),this._prevWidth=i}return 0}$_ensureCategoryTreeViews(){this._categoryTreeBandContainer||(this.add(this._categoryTreeBandContainer=new Ve(this.doc,"rct-axis-tree-bands")),this._categoryTreeBandViews=new Ko(this._categoryTreeBandContainer,bi,"rct-axis-tree-band")),this._categoryTreeLabelContainer||(this.add(this._categoryTreeLabelContainer=new Ve(this.doc,"rct-axis-tree-labels")),this._categoryTreeLabelViews=new Ko(this._categoryTreeLabelContainer,la,"rct-axis-tree-label")),this._categoryTreeDividerContainer||(this.add(this._categoryTreeDividerContainer=new Ve(this.doc,"rct-axis-tree-dividers")),this._categoryTreeDividerViews=new Ko(this._categoryTreeDividerContainer,Sn,"rct-axis-tree-divider"))}$_hideCategoryTreeViews(){var t,e,s;null===(t=this._categoryTreeLabelContainer)||void 0===t||t.setVis(!1),null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null===(s=this._categoryTreeDividerContainer)||void 0===s||s.setVis(!1)}$_measureCategoryTree(t,e,s,i){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=ua.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,s,e,i),n.setVis(_),_){const t=e?n.rotatedHeight():n.rotatedWidth();let s=g(h[c.level]||0,t);null!=(null==a?void 0:a[c.level])&&(s=g(s,a[c.level])),h[c.level]=s}});for(let e=0;e<n;e++)l[e]=_,t.isLevelVisible(e)&&(_+=(h[e]||0)+c);return this._categoryTreeExtraSize=_,_}$_syncCategoryTreeMeasure(t,e,s){t._ani&&this.$_measureCategoryTree(t,e,!1,s)}$_layoutCategoryTreeHorz(t,e,s,i,r,n){const o=t instanceof Qi?t:null;if(!(null==o?void 0:o.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const a=o._isHorz?i: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,s,r,d,u);const p=l.prop("fillToCategory"),g="background"===l.prop("effect");c.forEach((t,i)=>{const n=h[i];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?s?r+d+_[n.level]+w/2:-d-_[n.level]-w/2:s?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,s,i,r,n,0,u,0)}$_getBandY(t,e,s,i,r){const n=i+r,o=t?e?s:-n:e?s-n:0,a=t?e?s+n:0:e?s:n;return{yMin:p(o,a),yMax:g(o,a)}}$_getLevelBoundaryY(t,e,s,i,r,n){const o=this._categoryTreeLevelOffsets,a=t>=o.length?s:o[t];return i?r?n+e+a:-e-a:r?n-e-a:e+a}$_getLevelBoundaryX(t,e,s,i,r,n,o,a){const h=this._categoryTreeLevelOffsets,l=t>=h.length?s:h[t];return i?r?-e-l:n+e+l:r?o+a+l:n-e-l}$_getLevelColumnCenterX(t,e,s,i,r,n,o,a,h){const{x0:l,x1:c}=this.$_getLevelRowXRange(t,e,s,i,r,n,o,a,h);return(l+c)/2}$_getLevelRowYRange(t,e,s,i,r,n,o){const{yMin:a,yMax:h}=this.$_getBandY(s,i,r,n,o),l=0===t?a:this.$_getLevelBoundaryY(t,n,o,s,i,r),c=t===e-1?h:this.$_getLevelBoundaryY(t+1,n,o,s,i,r);return{y0:p(l,c),y1:g(l,c)}}$_getLevelRowXRange(t,e,s,i,r,n,o,a,h){const l=this.$_getLevelBoundaryX(t,n,o,s,i,r,a,h),c=this.$_getLevelBoundaryX(t+1,n,o,s,i,r,a,h);return{x0:p(l,c),x1:g(l,c)}}$_countCategoryTreeDividerLines(t,e=!0){const s=t.getCategoryTreeDepth();let i=0;e&&t.isDividerTopCap()&&(i+=1);for(let e=0;e<s;e++)t.isDividerEdge(e)&&(i+=2),t.isDividerBetween(e)&&(i+=t.getDividerEnds(e).length),t.isDividerBelow(e)&&(i+=1);return i}$_prepareCategoryTreeBands(t){var e,s;if(!t.isBandVisible())return null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null;const i=t.getBandGroups();return i.length?(this._categoryTreeBandContainer.setVis(!0),i):(null===(s=this._categoryTreeBandContainer)||void 0===s||s.setVis(!1),null)}$_getCategoryTreeLabelXBounds(t,e,s,i,r,n,o){const a=i+r,h=t?e?-n-a:s:e?0:o-r,l=t?e?0:s+a+n:e?o+a+n:s;return{xMin:p(h,l),xMax:g(h,l)}}$_getCategoryTreeEdgeYBounds(t,e){const s=t.getDividerLinePositions(e),i=t.getLabelY(e,s[0]),r=t.getLabelY(e,s[s.length-1]);return{yMin:p(i,r),yMax:g(i,r)}}$_applyCategoryTreeDividerLine(t,e,s){const i=e.getDividerStyle(s);null!=i?(t.setStyleOrClass(i),t.setVis(!0)):t.setVis(!1)}$_layoutCategoryTreeBandsHorz(t,e,s,i,r,n,o){const a=this.$_prepareCategoryTreeBands(t);if(!a)return;const{yMin:h,yMax:l}=this.$_getBandY(s,i,r,n,o),c=f(l-h);this._categoryTreeBandViews.prepare(a.length,(s,i)=>{const r=a[i],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void s.setVis(!1);const o=t.getLabelX(e,n.center)-n.size/2;s.setStyleOrClass("rct-axis-tree-band-"+i%2),s.setFill(t.getBandColor(i)),s.rect={x:o,y:p(h,l),width:n.size,height:c},s.setVis(!0)})}$_layoutCategoryTreeBandsVert(t,e,s,i,r,n,o,a,h){const l=this.$_prepareCategoryTreeBands(t);if(!l)return;const{xMin:c,xMax:_}=this.$_getCategoryTreeLabelXBounds(s,i,r,n,o,a,h),d=f(_-c);this._categoryTreeBandViews.prepare(l.length,(s,i)=>{const r=l[i],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void s.setVis(!1);const o=t.getLabelY(e,n.center)-n.size/2;s.setStyleOrClass("rct-axis-tree-band-"+i%2),s.setFill(t.getBandColor(i)),s.rect={x:c,y:o,width:d,height:n.size},s.setVis(!0)})}$_layoutCategoryTreeDividers(t,e,s,i,r,n,o,a,h,l,c){var _,d,u;if(!t.isDividerVisible())return void(null===(_=this._categoryTreeDividerContainer)||void 0===_||_.setVis(!1));const f=t.getDividerLinePositions(e);if(f.length<2)return void(null===(d=this._categoryTreeDividerContainer)||void 0===d||d.setVis(!1));const m=this.$_countCategoryTreeDividerLines(t,s);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(s){const s=a,{yMin:n}=this.$_getBandY(i,r,o,s,l),h=t.getLabelX(e,f[0]),c=t.getLabelX(e,f[f.length-1]),_=p(h,c),d=g(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,i,r,o,s,l);if(t.isDividerEdge(n)&&[f[0],f[f.length-1]].forEach(s=>{const i=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,s);this.$_applyCategoryTreeDividerLine(i,t,n),i.setVLine(r,a,h)}),t.isDividerBetween(n)&&t.getDividerEnds(n).forEach(s=>{const i=this._categoryTreeDividerViews.get(b++),r=t.getLabelX(e,t.getDividerPos(s,e));this.$_applyCategoryTreeDividerLine(i,t,n),i.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:s,yMax:o}=this.$_getCategoryTreeEdgeYBounds(t,e);for(let _=0;_<y;_++){const{x0:d,x1:u}=this.$_getLevelRowXRange(_,y,i,r,n,a,l,c,h);if(t.isDividerEdge(_)&&[f[0],f[f.length-1]].forEach(s=>{const i=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,s);this.$_applyCategoryTreeDividerLine(i,t,_),i.setHLine(r,d,u)}),t.isDividerBetween(_)&&t.getDividerEnds(_).forEach(s=>{const i=this._categoryTreeDividerViews.get(b++),r=t.getLabelY(e,t.getDividerPos(s,e));this.$_applyCategoryTreeDividerLine(i,t,_),i.setHLine(r,d,u)}),t.isDividerBelow(_)){const e=this._categoryTreeDividerViews.get(b++);this.$_applyCategoryTreeDividerLine(e,t,_),e.setVLine(u,s,o)}}}}$_layoutCategoryTreeVert(t,e,s,i,r,n){var o,a;const h=t instanceof Qi?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,s,i,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,s,i,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,s,i,r,n,f,u,g)}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h instanceof Qi,c=l&&h.label.prop("fillToCategory"),_=h.label,u=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=s?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?s?r?(C+=d(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=d(m)*S.height/2,t.setRotation(0,S.height/2,f)):r?(V-=S.width,C-=d(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=d(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):f>15&&f<=90?s?r?(V+=S.width,C-=d(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=d(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):r?(C+=d(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=d(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),s=v.label.prop("align")||"center",h="left"===s?(e-S.width)/-2:"right"===s?(e-S.width)/2:0;t.transX(t.tx+h),t.resizeBackByWeight(v,i,r,n,o,a,0,e,h)}}),!c&&!b&&y<2&&x>1){let e=t.get(u?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=_.num("overflowGap");let r=!0;const n=e.rotatedWidth(),o=u?_.prop("lastOverflow"):_.prop("firstOverflow");let a,h=e.tx;h+n>=s.tx?"pull"===o?h=s?s.tx-n-i:0:r="hidden"!==o:(a=e.elementToSvg(0,0).x)<0&&("pull"===o?h=Math.min(s.tx-i,a+4):r="hidden"!==o),r?e.transX(h):e.setVis(!1)}(0,e,t.get(u?x-2:1)),e=t.get(u?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=_.num("overflowGap"),r=s.tx+s.rotatedWidth();let o=!0,a=e.tx;const h=e.rotatedWidth(),l=u?_.prop("firstOverflow"):_.prop("lastOverflow");let c,d;a<=r?"pull"===l?a=Math.max(r+i,n-h):o="hidden"!==l:(c=e.elementToSvg(e.getBBox().width,0).x)>(d=t.control.getBounds().width)&&("pull"===l?a=Math.max(r+i,a-(c-d+4)):o="hidden"!==l),o?e.transX(a):e.setVis(!1)}(this,e,t.get(u?1:x-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h,l;const c=this.model,_=c instanceof Qi,d=_&&c.label.prop("fillToCategory"),u=r?s?"right":"left":i?"center":s?"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(s)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&&i?(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&&i?(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 s=w.getUnitLen(o,l.value),h="top"===p?(s-e.height)/-2:"bottom"===p?(s-e.height)/2:0;t.shiftY(h),t.resizeBackByWeight(w,i,r,n,o,a,b,s,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,s,i,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,i-l.width)):h?(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)),t.resizeByMeasured().layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,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=s?n:i-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)}}ua.AXIS_CLASS="rct-axis",ua.LINE_CLASS="rct-axis-line",ua.TICK_CLASS="rct-axis-tick",ua.HIERARCHY_ROW_GAP=2,ua.MINOR_TICK_CLASS="rct-axis-minor-tick";class pa extends Ve{constructor(t,e,s){super(t,pa.STYLE),this.add(this._back=new bi(t,pa.BACK_STYLE)),this.add(this._textView=new $e(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new Qo).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom,rx:A(parseFloat(e.rx),0),ry:A(parseFloat(e.ry),0)},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}pa.STYLE="rct-button",pa.BACK_STYLE="rct-button-background";class ga extends Ve{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class fa extends Ne{setArc(t,e,s,i,r,n){this.setPath(yi.arc(t,e,s,s,i,close?i+r:i-r,n))}}class ma extends fa{setPolyline(t){this.setPath(yi.polygon(...t))}}const ya={};class ba extends ea{static register(...t){t.forEach(t=>{ya[t[0].type]=t[1]})}constructor(t,e){super(t,ba.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Ve(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.model.prop("align")){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.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,s){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.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)}}ba.CLASS_NAME="rct-annotation";const xa={};class wa extends ia{static register(...t){t.forEach(t=>{xa[t[0].type]=t[1]})}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new bi(t,wa.PANE_CLASS)),this.add(this._contentContainer=new Ae(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return wa.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.prop("backgroundStyle"))}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=h(oe.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Aa)return t;t=t.parent}}}wa.GAUGE_CLASS="rct-gauge",wa.PANE_CLASS="rct-gauge-pane";class va extends me{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class Sa extends wa{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return n(i)?zt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.prop("animatable")&&t.prop("value")!==t._prevValue&&(this._ani=new va(this).start(()=>{t._runValue=NaN,t._prevValue=t.prop("value")}))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class Va extends na{}class Ca extends ta{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Ae(t,"rct-gauge-scale-ticks")),this._ticks=new Ko(this._tickContainer,Sn),this.add(this._labelContainer=new Ae(t,"rct-gauge-scale-tick-labels")),this._labels=new Ko(this._labelContainer,Va)}}class Aa extends wa{_defaultCalss(){return Aa.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Ae(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach(i=>i._setChartOptions(t,e,s))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach((s,i)=>{s.prepareGauge(t,e.getVisible(i))})}}Aa.GAUGE_GROUP_CLASS="rct-gauge-group";const Pa=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map(([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))])},ka=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},La=function(t,e){const s=t.map(([t,s])=>t*e[0]+s*e[1]);return[Math.min(...s),Math.max(...s)]},Na=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},Ta=function(t,e){const s=Pa(t),i=Pa(e),r=ka(s),n=ka(i);for(const t of[...r,...n]){const e=La(s,t),r=La(i,t);if(!Na(e,r))return!1}return!0},Ma=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 Ea{static reveal(t,e){new Da(t,e)}static grow(t,e){new $a(t,e)}static spread(t,e){new Fa(t,e)}static fadeIn(t){new Ba(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);nt.isAnimation(s)&&(s.addEventListener("finish",()=>{t._animationFinished(s)}),t._animationStarted(s))}}class Ba extends Ea{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:me.DURATION,fill:"none"})}}class Oa extends Ea{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=Oa.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",()=>{s.dom.remove()}),i}$_aniOptions(t){return{duration:me.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 Da extends me{constructor(t,e){super(),this._series=t,this._cr=Oa.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof Ve}_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 Ra extends me{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Ve}_stop(t){super._stop(t),this._series=null}}class $a extends Ra{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Fa extends Ra{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Ia extends na{constructor(t){super(t,"rct-series-trendline-label")}}class za extends Ae{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new Ne(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new Ne(t,"rct-series-trendline-variable")),this.add(this._line=new Ne(t)),this.add(this._label=new Ia(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.prop("reversed"),a=e.owner._yAxisObj.prop("reversed"),h=this.$_getPoints(e,s);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(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new Ne(t,"rct-series-trendline-marker")),this.add(this._endMarker=new Ne(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,e.label.getIconUrl(),e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map(t=>{const s=e.start+r.getPos(a,t.x),i=ni(e,n,t.y);return{x:e.cx+i*_(s),y:e.cy+i*d(s),a:s}}):t._points.map(t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}}),h}$_getLine(t,e){const s=new we;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new we,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new we,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=yi.getDrawer(t.marker.prop("shape"));this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,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),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(d):0,p=t?h.getAlignPolar(u):h.getAlign(s,i,r,d),g=t?h.getVerticalAlignPolar(u):h.getVerticalAlign(s,i,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 Ha extends me{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(Ja.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(Ja.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Ga extends na{constructor(t){super(t,"rct-point-label")}}class ja extends Ae{constructor(t){super(t,"rct-point-labels"),this._labels=[new Ko(this,Ga),new Ko(this,Ga)],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=g(e,t.getBBox().width)),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.prop("text"));e.point=i,e.setModel(t,n,n.getIconUrl(i.icon),r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.stopAni().setVis(e.isPointLabelVisible(r,h))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}}),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(Ma(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Pi)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(Ta(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});Ta(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(Ta(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});Ta(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort((t,e)=>t.ty-e.ty);const h=t.getBBox(),l=h.y+h.height/2;let c=Number.MAX_SAFE_INTEGER,_=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<c&&(c=i,_=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<_;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,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[_];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<_?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,_-1),n.ty<e[_-1].tbottom&&s(_,0),o=0;for(let t=0;t<_;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=_;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,_+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),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=_;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===ki&&e.forEach((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))}),1}}class Wa extends Jo{constructor(t){super(t),this.add(this._line=new Ne(t))}setLine(t){this._line.setPath(t)}}class Ya extends Jo{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Ko(this,Wa)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t}):e.prepare(0)}get(t){return this._map[t.pid]}}class Xa extends Ae{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 Ua extends na{constructor(t){super(t,"rct-stack-label")}}class Za extends Ae{constructor(t){super(t,"rct-stack-labels"),this._labels=new Ko(this,Ua),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 qa={},Ka="rct-point-hover",Qa="rct-point-unhover";class Ja extends ia{static register(...t){t.forEach(t=>{qa[t[0].type]=t[1]})}static isPointDom(t){for(;oe.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 Xa(t,"rct-series-points")),this._labelContainer=new ja(t),this._stackLabelContainer=new Za(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,s,i){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%gr),this.setData("pointcolors",this._colorByPoint?this._getPointColors():gt),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,s,i)}_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(Ka).addClass(Qa)})):this._getPointPool().forEach(t=>{t.containsClass(Qa)&&t.removeClass(Qa).addClass(Ka)})}_clearHoverClasses(t){t instanceof Ve&&t.removeClass(Ka).removeClass(Qa)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.prop("hoverEffect"),s=this._hoverAnis,i=this._hoverPts,r=[],n=[];!1!==this.model.prop("interactive")&&e&&(i.forEach(e=>{if(e instanceof Ve&&(!t||t.indexOf(e)<0)){const t=s.find(t=>t._marker===e);t&&t.cancel(),e.setBoolData(Ja.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof ch&&r.push(new Ha(this,e,!1,()=>{e.endHover(this,!1)}))}}),t&&t.forEach(t=>{if(t&&!t.point.isNull){const e=s.find(e=>e._marker===t);e&&e.cancel(),t instanceof Ve&&(t.setBoolData(Ja.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof ch?r.push(new Ha(this,t,!0,()=>{t.endHover(this,!0)})):this instanceof uh&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}})),s&&s.forEach((t,e)=>{t._started&&r.push(t)}),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.prop("autoRotation"))return;const{width:r,height:n}=t.getBBox(),o=e/s*((null!=i?i:s?s*v:360)||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&fe(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof yr&&e.trendline.visible?(this._trendView||this.add(this._trendView=new za(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.prop("overlapOutline"),contrast:i.prop("overlapContrast")},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.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 s=e.stackLabel;if(!s||!s.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const i=e._stackTotals,r=e._stackPoints;i&&0!==i.size&&r&&0!==r.size?this._doLayoutStackLabel(s,i,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,s){var i;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),c=t.getOffset(),u=t.prop("align"),p=this._labelContainer,g=p&&p.visible,m=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=m?h.getTotalAngle():0,k=y?b:x,L=y?x:b,N=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++),T=t.getCallbackArgs(o,b.x,b.positiveTotal,b.negativeTotal);if(e.setVis(t.isStackLabelVisible(T))){const o=t.getStackLabelText(T,x),b=t.getStackLabelStyle(T);e.xValue=n,e.setModel(r,t,null,b),e.setText(o),e.layout(u);const V=y?0:t.getRotation(),{width:C,height:M}=e.getBBox(),E=V*w,B=0!==V?M*f(_(E))+C*f(d(E)):M,O=0!==V?C*f(_(E))+M*f(d(E)):C;let D,R;const $=s.get(n),F=$&&null!==(i=$.find(t=>t.yGroup===x))&&void 0!==i?i:null;if(m){const t=A(null==F?void 0:F.xPos,m.cx+m.rd*_(m.start+h.getPos(P,n))),s=A(null==F?void 0:F.yPos,m.cy+m.rd*d(m.start+h.getPos(P,n))),i=Math.atan2(s-m.cy,t-m.cx),r=ni(m,a,x)+(S!==v?-1:1)*(M/2+l);let o=0;"left"===u?o=-(C/2+c):"right"===u&&(o=C/2+c),D=m.cx+r*_(i)+-d(i)*o,R=m.cy+r*d(i)+_(i)*o,e.trans(D-C/2,R-M/2),0!==V&&e.setRotation(C/2,M/2,V)}else{const s=a.getPos(k,x),i=g&&F?p.get(F,0):null,r=i&&i.visible?i.getBBoxEx():null,o=$?$[$.length-1]:null,_=o?this.getPointView(o):null,d=(null==_?void 0:_.wPoint)||0;if(y){const i=S!==v?-1:1;if(D=N+s+i*(l+O/2)-C/2,r)if(i>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==F?void 0:F.yPos,L-h.getPos(L,n)),a=v?"left"===u?"right":"right"===u?"left":u:u;R="left"===a?o-d/2-B/2-M/2-c:"right"===a?o+d/2+B/2-M/2+c:o-M/2+c,R+=M*t._vertAdjust;const _=this._applyOverflowFit(t._overflowFit,D,C,k);if(null===_){e.setVis(!1);continue}D=_}else{const i=S!==v?1:-1;if(R=N-s+i*(l+B/2)-M/2,r)if(i<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==F?void 0:F.xPos,h.getPos(L,n));D="left"===u?o-d/2-O/2-C/2-c:"right"===u?o+d/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 s=this._randomPalette?Math.floor(nt.randomLike(e.index)*gr):e.index%gr;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),i&&i.forEach(e=>e&&t.internalSetStyleOrClass(e)),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return 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,s,i){const r=this.model;r instanceof yr&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const 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 s=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===s?o-=e.wPoint/2+_.height-_.height*t._vertAdjust+p:"right"===s?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:s-_.width-l:c?(n-=e.base,o=i-_.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,s,i){if(isFinite(t)||t===1/0){if(e+s>=i)return t===1/0?null:i+t-s;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const c=this._labelOverlap;let _=!1;if(!h){const i=c.fit;if(isFinite(i)||i===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(i,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(_=p?g<s+u:g+l>s-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,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.prop("reversed"),l=a.getPos(o?t:e,g(a.axisMin(),i.fromValue)),c=a.getPos(o?t:e,p(a.axisMax(),i.toValue));n?o?h?r.setBounds(c,-e,f(c-l),e):r.setBounds(l,-e,f(c-l),e):r.setBounds(0,-g(l,c),t,f(c-l)):o?h?r.setBounds(c,0,f(c-l),e):r.setBounds(l,0,f(c-l),e):r.setBounds(0,e-g(l,c),t,f(c-l))}_setFill(t,s){e(s)&&s[Ct]?t.internalSetStyle(Ct,s[Ct]):r(s)&&t.dom.classList.add(s)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=A(e.fit,0),l=this.model._yAxisObj.prop("reversed"),c=this.model.chart.isInverted(),_=n.prop("position");let d=this._getRotatedLabelDisplacement(o,s);if(!c&&_!==Si)if(l?_!==vi&&_!==wi||(d*=-1):_===wi&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}Ja.POINT_CLASS="rct-point",Ja.DATA_FOCUS="focus",Ja.DATA_UNFOCUS="unfocus",Ja.DATA_UNHOVER="unhover",Ja.LEGEND_MARKER="rct-legend-item-marker";class th extends Ne{constructor(t){super(t,Ja.POINT_CLASS)}savePrevs(){}}class eh extends th{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class sh extends Ve{constructor(t){super(t,Ja.POINT_CLASS)}savePrevs(){}}class ih extends sh{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let rh=class extends eh{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(yi.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class nh extends ih{constructor(t){super(t),this.add(this._topView=new Ne(t)),this.add(this._frontView=new Ne(t)),this.add(this._sideView=new Ne(t))}layout(t,e,s,i,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(rt&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(yi.rectangle(t-r,e+n,a,-h)),this._topView.setPath(yi.polygon(t,c,t+a,c,t+a-r,c+n,t-r,c+n)),this._topView.setStyle("fill",ne.interpolate(o?ne.BLACK:ne.WHITE,l,.2)),this._sideView.setPath(yi.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",ne.interpolate(o?ne.WHITE:ne.BLACK,l,.2))}}class oh extends Jo{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class ah extends Ja{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Ea.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach(t=>t.savePrevs())}getPointsAt(t,e){return[]}}class hh extends ah{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Ya(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.prop("angle")*w,this._base=_(this._depthAngle)*e.depth,this._side=d(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),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 s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,l=this._labelViews(),c=this._labelLineContainer,u=i._xAxisObj,p=i._yAxisObj,f=this._yReversed,m=this._depthExt,y=i._group?i._groupDistance:i.distance,b=m?y*(r?d(this._depthAngle):_(this._depthAngle)):0,x=m?y*(r?_(this._depthAngle):d(this._depthAngle)):0,w=2*u.unitPad(),v=A(i.prop("minPointWidth"),0),S=this._yLen=r?t:e,V=r?e:t,C=t=>p.getPos(S,t),P=t=>u.getPos(V,t),k=r?0:e,L=p.valueMin(),N=C(L),T=this._baseVal=i.getBaseValue(p),M=!isNaN(T),E=this._yBase=A(C(g(L,A(T,N))),N),B=this._pointOff,O=l&&h(this._labelInfo,{inverted:r,reversed:f,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:x,side:this._side,base:this._base});l&&c.setVis(i.pointLabel.line.visible)&&(c.internalClearStyleAndClass(),c.internalSetStyleOrClass(i.pointLabel.line._style),c.prepare(i),O.pb=new we),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach(t=>{this._shrinkPoint(t)}),this._getPointPool().forEach((s,h)=>{const c=s.point;if(s.setVis(!c.isNull)){const _=u.getUnitLen(V,c.xValue)*(1-w);let d=i.getPointWidth(_,v),p=C(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=T>c.yGroup,e=c.yGroup<0,s=c.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=c.yGroup-c.yValue*(i?-1:1);g=C(r)}const f=(p-g)*n;let m=P(c.xValue)-_/2,y=k-p;isNaN(o+s.wSave)||(d=s.wSave+(d-s.wSave)*o),m+=i.getPointPos(_)+d/2,isNaN(o+s.xSave)||(m=s.xSave+(m-s.xSave)*o),c.xPos=m+=d*B,c.yPos=y,this._layoutPoint(s,h,m-b,k-E*(1-n)-g*n+x,d,f),r&&(y=V-P(c.xValue)+_/2,m=k,c.yPos=y-=i.getPointPos(_)+d/2+d*B,c.xPos=m+=M?C(c.yGroup)*n:C(c.yGroup*n)),O&&(O.labelView=l.get(c,0))&&(O.pointView=s,O.x=m,O.y=y,O.wPoint=d,O.hPoint=f,this._layoutLabel(a,O,t,e))}})}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class lh extends ah{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._pointOff=+e.prop("pointOffset")||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,_=2*l.unitPad(),d=A(s.prop("minPointWidth"),0),u=i?t:e,p=i?e:t,g=i?0:e,f=this._pointOff,m=a&&h(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach((h,y)=>{const b=h.point;if(h.setVis(!b.isNull)){const x=l.getUnitLen(p,b.xValue)*(1-_);let w=s.getPointWidth(x,d);const v=(c.getPos(u,this._getHighValue(b))-c.getPos(u,this._getLowValue(b)))*r;let S=l.getPos(p,b.xValue)-x/2,V=g-c.getPos(u,this._getHighValue(b))*r;isNaN(n+h.wSave)||(w=h.wSave+(w-h.wSave)*n),S+=s.getPointPos(x)+w/2,isNaN(n+h.xSave)||(S=h.xSave+(S-h.xSave)*n),b.xPos=S+=w*f,b.yPos=V,this._layoutPoint(h,y,S,V,w,v),i&&(V=p-l.getPos(p,b.xValue)+x/2,S=g,b.yPos=V-=s.getPointPos(x)+w/2+w*f,b.xPos=S+=c.getPos(u,this._getHighValue(b))*r),a&&(m.pointView=h,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))&&(i?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}})}}class ch extends th{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class _h extends Ja{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,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.prop("position");let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==Si){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class dh extends me{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 uh extends Ja{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 s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new dh(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return bi.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s.legendMarker()||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class ph extends ba{constructor(t){super(t,ph.CLASS_NAME),this.addToTransform(this._imageView=new ra(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.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)}}ph.CLASS_NAME="rct-image-annotation";class gh extends ba{constructor(t){super(t,gh.CLASS_NAME),this.addToTransform(this._shapeView=new Ne(t))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i),o=e.chart.getAxisOf(e,!0),a=e.chart.getAxisOf(e,!1),h=null==o?void 0:o.getPos(s,e.prop("x1")),l=null==o?void 0:o.getPos(s,e.prop("x2")),c=null==a?void 0:a.getPos(i,e.prop("y1")),_=null==a?void 0:a.getPos(i,e.prop("y2")),d=e.getShape();if(this.$_resetHeadView(),e.hasCustomPath())this._shapeView.setPath(e.prop("path"));else{let s=0,r=0;switch(d){case Wr:!Number.isNaN(l)&&Number.isNaN(h)&&(s=l),Number.isNaN(_)||(r=Number.isNaN(c)?i-_:n.height/2),this._shapeView.setPath(yi.line(s,r,s+n.width,r));break;case jr:Number.isNaN(l)||(s=Number.isNaN(h)?l:n.width/2),!Number.isNaN(_)&&Number.isNaN(c)&&(r=i-_),this._shapeView.setPath(yi.line(s,r,s,r+n.height));break;case Yr:{const t=this.$_lineEndpoints(h,l,c,_,i,n);this._shapeView.setPath(yi.line(t.xStart,t.yStart,t.xEnd,t.yEnd));break}case Xr:{const s=this.$_lineEndpoints(h,l,c,_,i,n),r=yi.arrowParts(s.xStart,s.yStart,s.xEnd,s.yEnd,e.getHeadSize()),o=this.$_headView(t);this._shapeView.setPath(r.body),o.setPath(r.head),o.setVis(r.head.length>0);break}default:yi.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 Ne(t)),this._headView}$_resetHeadView(){this._headView&&(this._headView.setVis(!1),this._headView.setPath([]))}$_lineEndpoints(t,e,s,i,r,n){let o=0,a=0;return Number.isNaN(e)||(o=Number.isNaN(t)?e:t>e?n.width:0),Number.isNaN(i)||(a=Number.isNaN(s)?r-i:s<i?n.height:0),{xStart:o,yStart:a,xEnd:t>e?o-n.width:o+n.width,yEnd:s<i?a-n.height:a+n.height}}}gh.CLASS_NAME="rct-shape-annotation";class fh extends ba{constructor(t){super(t,fh.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new $e(t)),this._textView.anchor=Oe.START,this._richText=new Xe}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);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,s,i,null,e._domain);const h=X(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,s=this.width-e.left-e.right,i=this.height-e.top-e.bottom,r=this._textView.getBBox();this._hasExplicitWidth&&r.width>s+.5?(this.isClip(this._textClip)||(this._textClip=this.control.clipBounds(),this._textView.setClip(this._textClip)),this._textClip.setBounds(e.left,e.top,s,i)):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()}}fh.CLASS_NAME="rct-text-annotation";class mh extends Ko{freeOrphans(){const t=this.getOrphans();return t&&t.forEach(t=>{t.point._vr>=1&&this.freeOrphan(t.point)}),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach(t=>{let s=e.get(t);s||(s=this.find(e=>e.point===t),s&&this.addOrphan(t,s))})}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class yh extends ch{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;yi.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.prop("hoverScale")||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),yi.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((i-e)**2+(r-s)**2)-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull||!this.visible?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class bh extends Xa{}class xh extends Ja{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new bh(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Ne(t,"rct-line-series-line")),this._markers=new mh(this._pointContainer,yh),this.add(this._tester=new Ne(t)),this._tester.setFill("#ff000010"),this._arrowViews=new Ko(this._pointContainer,Ne,"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),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_computeNeedBelow(t){return this._based&&!!t.prop("belowStyle")}_prepareSeries(t,e,s){e instanceof Tn&&(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&&Ea.grow(this):t&&Ea.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 s=this.model.marker.prop("radius"),i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r);return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.prop("radius"),r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n);return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.prop("hintDistance")}canHover(t,e,s){return t<=this.model.marker.prop("radius")+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new Ne(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Ko(this._lineContainer,Ne)),i.prepare(e.length);s.length<e.length;){const t=new Le(this.doc);this.control.addClip(t),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach(t=>t.remove()),s.length=0)}$_resetClips(t,e,s,i){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:e,rd:i,rdInner:r,min:o,max:a,cyclic:h}=this._polar;if(null==o||null==a)return;const l=yt(g(0,p((b-f(o-a))/2,.2))),c=n?1:this._getGrowRate(),_=i-r,d=r+(g(s,r)-r)*c,u=r+_*c,m=u>0?d/u:0;this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(yi.donut(t,e,u,d)),this._outerLineClip.setPath(this._outerClip.getPath())):r>0?(this._outerClip.setPath(yi.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(yi.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(yi.circle(t,e,d)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(yi.sector(t,e,u,u,m,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():yi.sector(t,e,u,u,m,o-l,a+l,!0))):r>0?(this._outerClip.setPath(yi.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(yi.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(yi.sector(t,e,d,d,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():yi.sector(t,e,d,d,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof Tn&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.prop("belowStyle"),a=e.length;this._markers.prepare(a*s,(s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1})}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),yi.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,c=r.prop("firstVisible"),u=r.prop("lastVisible"),f=r.prop("maxVisible"),m=r.prop("minVisible"),y=i.pointLabel,b=y.prop("align"),x=y.getAlignOffset(),w=y.getOffset(),v=y.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),C=i._xAxisObj,A=i._yAxisObj,P=this._polar=i.chart._body.getPolar(C),k=!!P,{cx:L,cy:N,rd:T,rdInner:M,start:E,total:B}=P||{},O=o?e:s,D=P?B:o?s:e,R=o?0:s,$=t.length,F=this._yReversed,I=A instanceof nn?i.getBaseValue(A):NaN,z=I>A.axisMin(),H=k?z?ni(P,A,I):M:z?A.getPos(O,I):0;this._pointContainer.visible&&this._shrinkPoints(i),t.forEach((t,y)=>{let G,j,W,Y;P?(W=E+C.getPos(D,t.xValue),P.min=null==P.min?W:p(P.min,W),P.max=null==P.max?W:g(P.max,W),Y=F?isNaN(t.yGroup)?z?H:T:z?H+(ni(P,A,t.yGroup)-H)*h:oi(P,A,t.yGroup,h):isNaN(t.yGroup)?z?H:M:z?H+(ni(P,A,t.yGroup)-H)*h:oi(P,A,t.yGroup,h),G=t.px=L+Y*_(W),j=t.py=N+Y*d(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=s-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<=s))){this._prepareMakrer(Z),this._layoutMarker(Z,n,G,j);const e=r.getMarkerStyle(t);e&&Z.internalSetStyleOrClass(e),i._maxY,t.yGroup,i._minY,t.yGroup;const s=0==y&&null!=c?c:y==$-1&&null!=u?u:i._maxY==t.yGroup&&null!=f?f:i._minY==t.yGroup&&null!=m?m:l;if(Z.setStyle("opacity",s?"1":"0"),q){q.setContrast(null).layout(S);const e=q.getBBox(),s=Z._radius;if(q.visible=!0,P){switch(v){case"inside":F?t.yValue<I?Y-=w:Y+=w:t.yValue<I?Y+=w:Y-=w;break;case"foot":F?t.yValue<I?Y-=e.height/2+w:Y+=e.height/2+w:t.yValue<I?Y+=e.height/2+w:Y-=e.height/2+w;break;default:F?t.yValue<I?Y+=e.height/2+w:Y-=e.height/2+w:t.yValue<I?Y-=e.height/2+w:Y+=e.height/2+w}G=L+Y*_(W),j=N+Y*d(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?s:0);break;default:j-=e.height+w+(l?s:0)}switch(b){case"left":G-=e.width+(l?s:0)+x;break;case"right":G+=(l?s:0)+x;break;default:G-=e.width/2+x}this._checkLabelOverlap(q,e,X,U,s,s,G,j,!1,null),this._layoutLabelRotation(q,e,G,j)}}else q&&q.setVis(!1)})}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach(t=>{t.visible&&t.shrink()})}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0&&e._lines.some(t=>t.length>0)))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof Tn&&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),oe.setImportantStyle(t.dom.style,Ct,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)});else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),oe.setImportantStyle(t.dom.style,Ct,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);if(t){const e=!isNaN(l)&&l>h.axisMin()?ni(t,h,l):t.rdInner;this.$_resetClips(s,i/2,e,!0)}else r?this.$_resetClips(s,i,isNaN(l)?0:h.getPos(s,l),!0):this.$_resetClips(s,i,isNaN(l)?i:i-h.getPos(i,l),!1);a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.prop("belowStyle")),oe.setImportantStyle(a.dom.style,Ct,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Tn&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.prop("stepDir")):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new we;return"spline"===i?this._drawCurves(t,e,r):s instanceof Tn&&"step"===i?this._drawSteps(e,r,s.prop("stepDir")):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Tn&&this._model.prop("connectNullPoints");s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach(t=>this.$_drawLine(t,!1,e))}_drawStep(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach(t=>this._drawStep(t,!1,e,s))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rdInner:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof nn?a.getBaseValue(h):NaN,c=l>h.axisMin()?ni(t,h,l):this._yReversed?0:n,u=e[0],p=u.length;let g,f;o?(s.move(u[0].px,u[0].py),s.closedSpline(u,!0)):(g=i+c*_(u[0].angle),f=r+c*d(u[0].angle),s.move(g,f),s.line(u[0].xPos,u[0].yPos),s.closedSpline(u,!1),g=i+c*_(u[p-1].angle),f=r+c*d(u[p-1].angle),s.line(g,f))}else e.forEach(t=>this._drawCurve(t,!1,s))}_buildAreas(t,e,s){const i=new we;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.prop("hoverStyle"))}_doLayout(){super._doLayout(),this.$_layoutArrows()}$_layoutArrows(){const t=this.model;if(!(t instanceof Tn))return void this._arrowViews.prepare(0);const e=t.arrow,s=this._visPoints,i=e.buildArrowSlots(s);if(0===i.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(i.length,(t,r)=>{const _=i[r],d=s[_.index],u=d.px,p=d.py,g=e.calcArrowAngle(s,_.index,_.at),f=!d.isNull&&(c||!a||u>=0&&u<=h&&p>=0&&p<=l);if(t.setVis(f)){yi.setShape(t,n,o,o);const s=e.getArrowStyle(d);this.$_applyArrowStyle(t,e,s),t.trans(u-o,p-o),t.setRotation(o,o,g)}})}$_applyArrowStyle(t,e,s){t.internalClearStyleAndClass(),s&&t.internalSetStyleOrClass(s);const i=e.getArrowStyleOverrides(s);i&&t.internalSetStyles(i),r(s)&&this.$_isolateClassArrowStrokeDasharray(t,Pn.STYLE_ISOLATION.strokeDasharray)}$_isolateClassArrowStrokeDasharray(t,e){const s=getComputedStyle(t.dom).strokeDasharray,i=getComputedStyle(this.dom).strokeDasharray;s&&"none"!==s?i&&"none"!==i&&s===i&&t.internalSetStyle("strokeDasharray",e):t.internalSetStyle("strokeDasharray",e)}}class wh extends xh{constructor(t){super(t,wh.CLASS),this._flagView=new na(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.getIconUrl(),null),i.setContrast(null).layout("left");const o=s.prop("offset"),a=i.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}i.trans(h,l)}}}wh.CLASS="rct-line-series";class vh extends xh{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new bh(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Ne(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Ne(t,"rct-areanrange-series-line")),oe.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find(e=>e!==t&&e.point===t.point)]}getSibling(t){return t&&this._markers.find(e=>e!==t&&e.point===t.point)}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,c=a?e:s,u=a?0:s,p=this._labelViews(),g=this._labelContainer._textAlign,f=this._polar=i.chart._body.getPolar(h),m=i.pointLabel,y=m.prop("position"),b=m.prop("align"),x=m.getAlignOffset(),w=m.getOffset(),v=this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=u-l.getPos(c,s.lowValue)}const S=this._markers;for(let i=0,h=t.length;i<h;i++){const u=t[i],m=S.get(h+i),V=p&&p.get(u,1);let C,P,k,L;this._prepareMakrer(m),f?(k=A(u.angle,0),L=oi(f,l,u.lowValue,v),C=u.px2=f.cx+L*_(k),P=u.py2=f.cy+L*d(k)):a?(C=u.px2=l.getPos(c,u.lowValue),P=u.py2=S.get(i).ty+m._radius):(C=u.px2=u.xPos,P=u.py2=u.yLow);const N=C,T=P;if(m&&m.setVis(!u.isNull&&C>=0&&C<=e&&P>=0&&P<=s)){this._layoutMarker(m,n,C,P);const t=r.getMarkerStyle(u);if(t&&m.internalSetStyleOrClass(t),m.setStyle("opacity",o||0==i&&!0===r.prop("firstVisible")||i===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*_(k),P=f.cy+e*d(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,N,T,e,e,C,P,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.prop("areaStyle")&&e.internalSetStyleOrClass(s.prop("areaStyle"))}}class Sh extends xh{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new bh(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Ne(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 s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new Ne(this.doc,"rct-area-series-area")),t?this._yReversed&&this._needBelow?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new Ko(this._areaContainer,Ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<p(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new Le(s)));for(;i.length<e.length;)i.push(this.control.addClip(new Le(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.freeAll(),i.forEach(t=>t.remove()),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,o=i?0:s,a=this._polar;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(s.isNull)s.yLow=NaN;else if(a&&!isNaN(s.angle)){const t=ni(a,r,s.yGroup-s.yValue),e=s.angle;s.yLow=a.cy+t*d(e)}else s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model;if(!this._areaContainer.setVis(e._areas.length>0))return;const s=this.width,i=this.height,r=e.chart.isInverted(),n=this._needBelow?this._lowArea:void 0,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(s,i,e._runRangeValue,a,this._rangeAreaClips[n],r)}):(t.setPath(o),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Ct,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(Ct,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,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof nn?i.getBaseValue(o):NaN,l=this._polar,{cx:c,cy:u,rd:f,rdInner:m,cyclic:y}=l,x=new we,w=s.length;if(!r||"stack"!==r.prop("layout")&&"fill"!==r.prop("layout")){const r=h>o.axisMin(),v=r?ni(l,o,h):a?0:m,S=i.chart._body.prop("circular");let V,C,A,P,k=!1,L=!1;if("spline"===i.prop("lineType"))this._drawCurves(this._polar,i.buildLines(s),x);else{y?x.move(s[0].xPos,s[0].yPos):(V=c+v*_(s[0].angle),C=u+v*d(s[0].angle),x.move(V,C),x.line(s[0].xPos,s[0].yPos));for(let t=1;t<w;t++)x.line(s[t].xPos,s[t].yPos);y||(V=c+v*_(s[w-1].angle),C=u+v*d(s[w-1].angle),x.line(V,C))}const N=s.map(t=>t.angle),T=this._polar.min=p(...N),M=this._polar.max=g(...N),E=(new we).push(x.end());if(r)y?x.circle(c,u,v):a&&x.push(...yi.arc(c,u,v,v,T,M,!0)),A=x.end(),k=!0,y?E.circle(c,u,v):E.push(...yi.arc(c,u,v,v,T,M,!0)),P=E.end(),L=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;x.push("Z"),y?S?x.circle(c,u,f):x.polygon(...s.map(s=>({x:c+_(t+s.pos/f*e/b)*f,y:u+d(t+s.pos/f*e/b)*f}))):S?x.push(...yi.sector(c,u,f,f,0,T,M,!0)):x.polygon({x:c,y:u},...s.map(s=>({x:c+_(t+s.pos/f*e/b)*f,y:u+d(t+s.pos/f*e/b)*f}),{x:c,y:u})),m>0&&x.circle(c,u,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=ni(l,o,t.yGroup-t.yValue);return{x:c+e*_(t.angle),y:u+e*d(t.angle)}},i=e(s[0]);x.move(A(i.x,c),A(i.y,u)),x.line(A(s[0].xPos,c),A(s[0].yPos,u));for(let t=1;t<s.length;t++)x.line(A(s[t].xPos,c),A(s[t].yPos,u));const r=e(s[s.length-1]);x.line(A(r.x,c),A(r.y,u));for(let t=s.length-1;t>=0;t--){const i=e(s[t]);x.line(A(i.x,c),A(i.y,u))}t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),oe.setImportantStyle(t.dom.style,At,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.prop("belowStyle")),i.prop("belowAreaStyle")&&e.internalSetStyleOrClass(i.prop("belowAreaStyle")),oe.setImportantStyle(e.dom.style,At,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new Te(this.doc)));const t=m>0?m/f:0,e=yi.sector(c,u,f,f,t,l.start,l.start+l.total,!0);this._arcClip.setPath(e),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Vh extends lh{constructor(t){super(t,"rct-barrange-series"),this._bars=new mh(this._pointContainer,rh)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,s){this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*A(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Ch extends jn{constructor(t){super(t,Ja.POINT_CLASS)}savePrevs(){}}class Ah extends hh{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.prop("belowStyle")&&t.addStyleOrClass(e.prop("belowStyle"))}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new mh(this._pointContainer,Ch)),this._sectors.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.prop("reversed"),h=2*n.unitPad(),l=r.getPolar(n),{cx:c,cy:u,rd:g,rdInner:f}=l,m=o instanceof nn?t.getBaseValue(o):NaN,y=m>o.axisMin(),b=ni(l,o,m),x=this._pointOff,w=n.getTotalAngle();let v,S,V,C,A;i&&(v=this._labelInfo,S=t.getLabelPos(s),V=t.getLabelOff(s.getOffset()),C=this._labelContainer._textAlign),this._sectors.forEach((s,r)=>{const P=s.point;if(s.setVis(!P.isNull)){const r=oi(l,o,P.yGroup,e),k=n.getUnitLen(w,P.xValue)*(1-h),L=t.getPointWidth(k,0);let N,T,M=l.start+n.getPos(w,P.xValue)-k/2;M+=L*x,M+=t.getPointPos(k)+L/2;const E=ni(l,o,P.yGroup);if(a?y?(N=b+(E-b)*e,T=b):(N=g,T=r):y?(N=b+(E-b)*e,T=b):(N=r,T=f),s.setSector({cx:c,cy:u,rx:N,ry:N,innerRadius:N>0?T/N:0,start:M-L/2,angle:L,clockwise:!0}),M=s.start+s.angle/2,P.xPos=c+s.rx*_(M),P.yPos=u+s.ry*d(M),i&&(A=v.labelView=i.get(P,0))){A.layout(C);const{width:t,height:e}=A.getBBox(),i=s.ry,r=T;let n,o;n=a?y?P.yValue<m?"outside"===S?i+e/2+V:"head"===S?i-e/2-V:"foot"===S?b+e/2+V:i-(i-b)/2+V:"outside"===S?i-e/2-V:"head"===S?p(b,i+e/2+V):"foot"===S?b-e/2-V:b-(b-i)/2-V:"outside"===S?r-e/2-V:"head"===S?p(i,r+e/2+V):"foot"===S?i-e/2-V:i-(i-r)/2-V:y?P.yValue<m?"outside"===S?i-e/2-V:"head"===S?i+e/2+V:"foot"===S?b-e/2-V:b-(b-i)/2-V:"outside"===S?i+e/2+V:"head"===S?i-e/2-V:"foot"===S?b+e/2+V:i-(i-b)/2+V:"outside"===S?i+e/2+V:"head"===S?i-e/2-V:.7*i+V,o=u+n*d(M),n=c+n*_(M),"outside"!==S&&A.setContrast(s.dom),this.applyAutoRotation(A,M,l.total),A.trans(n-t/2,o-e/2)}}})}}class Ph extends Ah{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new mh(t,nh):new mh(t,rh)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rdTop=+e.prop("topRadius")||0,this._rdBottom=+e.prop("bottomRadius")||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*A(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof rh){const e=this.model._xAxisObj;t.shrink(e.prop("reversed"),e._vlen,this._rdTop,this._rdBottom)}}}class kh extends Sh{constructor(t){super(t,"rct-bellcurve-series")}}class Lh extends oh{constructor(t){super(t,Ja.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Sn(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Sn(t,"rct-boxplot-point-stem")),this.add(this._box=new bi(t,"rct-boxplot-point-box")),this.add(this._mid=new Sn(t,"rct-boxplot-point-mid")),this.add(this._min=new Sn(t,"rct-boxplot-point-min")),this.add(this._max=new Sn(t,"rct-boxplot-point-max"))}}class Nh extends lh{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new mh(this._pointContainer,Lh)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Th extends ch{}class Mh extends _h{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new Ae(t,"rct-bubble-pie"))}_createMarkers(t){return new mh(t,Th)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ea.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}pointByDom(t){const e=super.pointByDom(t);if(e)return this.model._hoveredSlice=null,e;if(this._sectorMap){let e=t;for(;e;){const t=this._sectorMap.get(e);if(t)return this.model._hoveredSlice=t.slice,t.pv;e=e.parentElement}}return this.model._hoveredSlice=null,null}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)})}$_preparePie(t,e,s){const i=e.pie,r=i&&i.visible&&i.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;s.forEach(t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)}),this._pieSectors||(this._pieSectors=new Ko(this._pieContainer,jn,Ja.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();i.getLegendSources().forEach(e=>{e.legendMarker()||e.setLegendMarker(bi.create(t,Ja.LEGEND_MARKER,0,0,r,r,r/2))})}else this._pieSectors&&this._pieSectors.prepare(0),this._sectorMap=null}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=this._inverted,n=i.needClip(!1),o=this._getGrowRate(),a=+i.prop("rotation")||0,h=i.pointLabel,l=h.prop("position"),c=h.getOffset(),u=this._labelContainer._textAlign,p=this._labelViews(),g=i._xAxisObj,f=i._yAxisObj,m=this._polar=i.chart._body.getPolar(g),y=r?t:e,b=r?e:t,x=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:w,max:v}=i.getPixelMinMax(x),S=r?0:e,V=yi.getDrawer(i.prop("shape")),C=i.pie,P=C&&C.visible&&C.fields.length>0;let k,L=0;null===(s=this._markers.getOrphans())||void 0===s||s.forEach(t=>{t.setPath(V(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))}),this._markers.forEach((s,h)=>{var x,N;const T=s.point,M=p&&(k=p.get(T,0));if(s.setVis(!T.isNull&&!isNaN(T.zValue))){const h=s._radius=i.getRadius(T.zValue,w,v),p=h*o*A(T._vr,1);let N,E;if(m){const t=m.start+g.getPos(b,T.xValue),e=ni(m,f,T.yValue);N=m.cx+e*_(t),E=m.cy+e*d(t)}else N=g.getPos(b,T.xValue),E=S-f.getPos(y,T.yValue),r&&(N=f.getPos(y,T.yValue),E=e-g.getPos(b,T.xValue));T.xPos=N,T.yPos=E;const B=!n||N>=0&&N<=t&&E>=0&&E<=e;if(P&&T.pieSlices)if(s.setVis(!1),B)C.resolveSliceColors(T.pieSlices),L=this.$_renderPieSectors(T,T.pieSlices,L,N,E,p,C.getInnerRadius(p),C.clockwise);else for(let t=0;t<T.pieSlices.length;t++)null===(x=this._pieSectors.get(L++))||void 0===x||x.setVis(!1);else s.setVis(B)&&s.setPath(V(p)).trans(N,E).rotate(a);B&&M?(k.setContrast(P&&T.pieSlices?null:s.dom),k.layout(u),this._layoutLabelView(k,l,c,h,N,E)):M&&M.setVis(!1)}else{if(P&&T.pieSlices)for(let t=0;t<T.pieSlices.length;t++)null===(N=this._pieSectors.get(L++))||void 0===N||N.setVis(!1);M&&M.setVis(!1)}})}$_renderPieSectors(t,e,s,i,r,n,o,a){let h=s;for(const s of e){const e=this._pieSectors.get(h++);if(e){const h={cx:i,cy:r,rx:n,ry:n,innerRadius:o,start:s.startAngle,angle:f(s.angle),clockwise:a};if(e.setSector(h),e.setFill(s.color),e.setVis(!0),this._sectorMap){const a=s.startAngle+s.angle/2,h=(n+o)/2,l=i+h*_(a),c=r+h*d(a),u={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:c}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:s,pv:u})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i);return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}let Eh=class extends oh{constructor(t){super(t,Ja.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(p(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(g(s.openValue,s.closeValue)-s.lowValue)/i),o=p(n,r),a=g(1,f(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,o,t,a),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Sn(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Sn(t,"rct-candlestick-point-wick")),this.add(this._body=new bi(t))}};class Bh extends lh{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new mh(this._pointContainer,Eh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}class Oh extends th{layout(t,e,s){const i=new we;i.circle(t,e,s),this.setPath(i.end())}}class Dh extends Ah{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new mh(t,Oh)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Rh=class extends oh{constructor(t){super(t,Ja.POINT_CLASS),this.add(this._line=new Sn(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Ne(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Ne(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let 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,i),yi.setShape(r,o.shape,a,a),yi.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class $h extends lh{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new mh(this._pointContainer,Rh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}let Fh=class extends Jo{constructor(t){super(t,Ja.POINT_CLASS),this._segments=new Ko(this,Ne),this._decimal=0,this.add(this._back=new Ne(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach((t,e)=>{})}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map(t=>-t)),this._back.setPath(yi.rectangle(e,s,i,-r)),this._segments.forEach((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(yi.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(yi.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))})}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class Ih extends hh{constructor(t){super(t,"rct-equalizer-series"),this._bars=new mh(this._pointContainer,Fh)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)})}$_buildSegments(t,e){const s=t._yAxisObj.axisMax(),i=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-_)/(s-_):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=!i&&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 zh=class extends oh{constructor(t){super(t,Ja.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Sn(t)),this.add(this._whiskerUp=new Sn(t)),this.add(this._whiskerDown=new Sn(t)),this.add(this._back=new bi(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Hh extends lh{constructor(t){super(t,"rct-errorbar-series"),this._bars=new mh(this._pointContainer,zh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}class Gh extends th{}class jh extends uh{constructor(t){super(t,"rct-funnel-series"),this._segments=new mh(this._pointContainer,Gh),this.add(this._lineContainer=new Ya(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&&Ea.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,s){this._segments.prepare(s.length,(i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)})}$_calcRates(t){const e=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach(t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)}),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=yt(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=yt(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?b+(V-b)*(w-t)/(w-C):b+(V-b)*(t-x)/(C-x)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.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=i.prop("reversed"),u=n.prop("opposite"),p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new we,y=i.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 we,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.prop("style")),this._segments.forEach(i=>{const n=i.point;if(i.setVis(!n.isNull)){const y=n.yPos*p.height,b=(n.yPos+n.height)*p.height,T=d?w-y:x+y,M=d?w-b:x+b,E=b<S;let B,O,D,R;if(N=null==_?void 0:_.get(n),y>=S?(B=V,O=B+g.width,m.move(B,T).lines(O,T,O,M,B,M),i.ny=i.nx1=NaN):E?(B=s(T),O=B+2*(v-B),D=s(M),R=D+2*(v-D),m.move(B,T).lines(O,T,R,M,D,M),i.ny=NaN,i.nx1=D-B,i.nx2=R-B):(B=s(T),O=B+2*(v-B),D=V,R=D+g.width,m.move(B,T).lines(O,T,R,C,R,M,D,M,D,C),i.nx1=D-B,i.nx2=R-B,i.ny=f(C-T),i.nx3=D,i.nx4=R),i.setPath(m.close(!0)),n.xPos=v,n.yPos=T+(M-T)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=E?(O-B+(R-D))/2:g.width;switch(!t&&L.layout(c||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,c,u,N,P,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,c,u,N,P,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,n,i,L,c,u,N,P,v,a,h);L.setContrast(o&&i.dom),A.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}});const T=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,T,M,E))&&this._segments.forEach(s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==_?void 0:_.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,c,u,N,P,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,c,u,N,P,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,c,u,N,P,v,a,h)))}))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,c,_){const d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let f=l;if(n?f-=h.width/2:f+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(f-g-_,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,i.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,c,_,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),f=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,s,h,n);let y;if(y=n?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,i.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,c){const _=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!_&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-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,i.trans(p,u-d.height/2))}}let Wh=class extends eh{layout(t,e){this.setPath(yi.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Yh extends ah{constructor(t){super(t,"rct-histogram-series"),this._bars=new mh(this._pointContainer,Wh)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,l=s._yAxisObj,c=i?t:e,_=i?e:t,d=l.getPos(c,s.getBaseValue(l)),u=i?0:e,p=o&&h(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach((s,h)=>{const g=s.point,f=a.getPos(_,g.min),m=a.getPos(_,g.max),y=l.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(s,h,w,v+x,b,x*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=_-w,w=u,g.yPos=v,g.xPos=w+=l.getPos(c,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=b,p.hPoint=x,this._layoutLabel(n,p,t,e))})}$_parepareBars(t,e,s){this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)})}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach((o,a)=>{const h=o.point,l=s.getPos(t,h.min),c=s.getPos(t,h.max),_=l+(c-l)/2,d=i.getPos(e,o.point.yValue)*n,u=g(1,c-l-1);h.xPos=_,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(_,r)})}}class Xh extends Jo{constructor(t){super(t,Ja.POINT_CLASS),this.add(this._line=new Sn(t,"rct-lollipop-point-bar")),this.add(this._marker=new Ne(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),yi.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class Uh extends hh{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.prop("styleCallback"),this._bars||(this._bars=new mh(this._pointContainer,Xh)),this._bars.prepare(s.length,(t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)})}}class Zh extends oh{constructor(t){super(t,Ja.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(p(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(g(s.openValue,s.closeValue)-s.lowValue)/i,a=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_doInitChildren(t){this.add(this._tickOpen=new Sn(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Sn(t,"rct-ohlc-point-tick")),this.add(this._bar=new Sn(t)),this.add(this._back=new bi(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class qh extends lh{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new mh(this._pointContainer,Zh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.prop("declineStyle")&&t.addStyleOrClass(e.prop("declineStyle"))}$_prepareSticks(t,e){this._sticks.prepare(e.length,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)})}}class Kh extends xh{constructor(t){super(t,"rct-pareto-series")}}class Qh extends Ne{setOff(t){return this.off=f(t),this}}class Jh extends jn{constructor(t){super(t,Ja.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class tl extends Ve{constructor(t){super(t,Ja.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new jn(t))}setSides(t,e,s,i,r){const n=this.point,o=yt(y),a=yt(((t?n.startAngle:n.startAngle+n.angle)+y/2+b)%b),h=yt(a+(t?n.angle:-n.angle)-1e-4+b)%b,l=o-(a+f(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=y/2&&!(h>=a&&h<y/2)||h>=3*y/2&&!(a<h&&a>3*y/2)?(this._outArcView=i.setOff(p(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*y/2&&h<=y/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=y/2&&h<=3*y/2?(this._outArcView=i.setOff(p(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=y&&this._outArcView.setOff(p(this._outArcView.off,this._side1View.off)),h>=y&&h<b&&this._outArcView.setOff(p(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=yi.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;rt&&(r=this.control.getIEColor(r)),this._outArcView.setPath(yi.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(yi.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(yi.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(yi.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(yi.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(yi.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",ne.interpolate("#000",r,.2)),this._side2View.setStyle("fill",ne.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",ne.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",ne.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(Ja.DATA_FOCUS,t),this._side2View.setBoolData(Ja.DATA_FOCUS,t),this._inArcView.setBoolData(Ja.DATA_FOCUS,t),this._outArcView.setBoolData(Ja.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class el extends uh{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new we,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 ga(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new na(t,"rct-pie-series-inner")),this._textView._text.anchor=Oe.MIDDLE,this._pointContainer.add(this._sideContainer=new Ae(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Ya(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.prop("ratio"):1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,s.getIconUrl(),null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,o=r-n;this._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&Ea.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 Jh||t instanceof tl)&&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 tl&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new mh(this._pointContainer,tl,null),n=this._sides=new Ko(this._sideContainer,Qh,"rct-pie-series-side")):this._sectors=new mh(this._pointContainer,Jh,null)),this._deep=i,n&&n.prepare(4*r,(t,e)=>t.index=e),this._sectors.prepare(r,(i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)})}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.prop("clockwise")?1:-1,n=t.filter(t=>(t.visible||t===e)&&!t.isNull).map(t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1)).reduce((t,e)=>t+e,0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%b;if(i>1||i>0&&!e)t.forEach(t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=yt(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)});else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.prop("clockwise"),n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rx,c=this._rxInner,u=this._depth,p=this._ratio,g=this._sides,m=i.pointLabel,y=m.connector.prop("curved"),b=this._labelViews(),x="inside"===i.getLabelPos(m),w=A(m.prop("radius"),.7),v=this._pb,S=m.getDistance(x,l,c),V=m.getWidgetAlign();let C=null==b?void 0:b.textAlign();const P=this._lineContainer.setVis(m.connector.visible)?this._lineContainer:null,k=this._slicedOff=i.getSliceOffset(l)*n,L=[],N=[],T=[],M=(null==b?void 0:b.getWidth(0))||0,E=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(m.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 m=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(m),m.isNull)t.setVis(!1),b&&(B=b.get(m,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=E>1&&m.sliced,g=m.startAngle,A=g+m.angle/2;let P=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(P+=_(A)*k,D+=d(A)*k),t.trans(P,D).setVis(!0),m.xPos=a+_(A)*(k+l*w),m.yPos=h+d(A)*(k+l*w),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:c,start:g,angle:f(m.angle),clockwise:r,depth:u}),b&&(B=b.get(m,0))){const r=i.getLabelOff2(m);let n;x?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,B,C,r,S,o?k:0)):(n=-1===V?this.$_layoutLabelAligned(!1,m,B,C,O,v,y,r,S,o?k:0):1==V?this.$_layoutLabelEnded(!1,m,B,C,O,v,y,r,S,o?k:0,M,e,s):this.$_layoutLabelOutside(!1,m,B,C,O,v,y,r,S,o?k:0),n?L.push(B):N.push(B),this._layoutLabelRotation(B)),B.setContrast(x&&t.dom).setVis(!0),T.push(B)}else null==O||O.setVis(!1)}}),g&&g.sortDom((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s});const D=m.prop("convergent"),R=m.prop("dedupeMode"),$=m.prop("overflow");b&&(x||0===V?"preserveOrder"!==R&&"largestFirst"!==R||b.dedupe(T,P,R):b.arrangeVertical(this,L,P,s,D,R,$)+b.arrangeVertical(this,N,P,s,D,R,$)>0&&this._sectors.forEach(t=>{const r=t.point;if(!r.isNull){const t=E>1&&r.sliced,n=i.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,s):this.$_layoutLabelOutside(!0,r,B,C,O,v,y,n,S,t?k:0))}}))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const c=s.isDomAnimating(),u=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+_(u)*y,w=g+d(u)*b,v=x<p;!t&&!c&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let C,A,P,k=g+d(u)*m;if(v?(C=p+_(Math.PI)*f-h,A=C-S.width-a,P=p+_(Math.PI)*y-h,S.width):(C=p+_(0)*f+h,A=C+a,P=p+_(0)*y+h),r&&r.setVis(y>0)){const e=t?s.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||(s.setPos(A,k-S.height/2),!c&&s.trans(A,k-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,c,u,p){const g=s.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+_(f)*w,V=y+d(f)*v;const C=S<m;!t&&!g&&s.layout(i||(C?"right":"left"));const A=s.getBBox(),P=V-A.height/2;let k,L,N,T=y+d(f)*x;if(C?(k=h+c+a,N=h+c-A.width,L=k):(k=u-h-c-a,N=u-h-c,L=k),r&&r.setVis(w>0)){const e=t?s.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,T),!g&&r.trans(L,V)}return t||(s.setPos(N,T-A.height/2),!g&&s.trans(N,T-A.height/2)),C}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const c=s.isDomAnimating();!t&&!c&&s.layout(i);const u=s.getBBox(),p=e.startAngle+e.angle/2,g=this._cx,f=this._cy,m=this._rx+.5*h,y=this._ry+.5*h,b=_(p)*l,x=d(p)*l,w=g+_(p)*this._rx,v=f+d(p)*this._ry,S=g+_(p)*m;let V=f+d(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-=u.width+a:P+=a,V-=u.height/2,s.setPos(P,V),!c&&s.trans(P+b,V+x)),C}$_layoutLabelInside(t,e,s,i,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(s||"center");const d=e.getBBox(),u=this._rx*this._rxInner,g=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=p(a.prop("totalAngle")||360,360);if("angle"===c){let i=g/t*s+90,r=(i+a.prop("startAngle"))%360;r+=_?0:360,i+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,g,t,s)}else this._layoutLabelRotation(e);const f=h.prop("align")===Ci?.3:h.prop("align")===Vi?.5:.7,m=u>0?u+(this._rx-u)/2:l?"angle"===c?this._rx*f+i:.8*this._rx+i:.7*this._rx+i,y=this._deep?m*this._ratio:m,b=Math.cos(g),x=Math.sin(g);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,s){if(e&&this._sectors.count<2)return;const i=this.model,r=this._labelViews(),n=i.pointLabel.getWidgetAlign(),o=this._slicedOff,a=i.prop("autoSlice")?i.prop("sliceDuration"):0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(_(l)*o,d(l)*o,a):t.transEx(0,0,a),!r)return;const c=i.pointLabel,u=this._lineContainer,p=c.connector.prop("curved"),g="inside"===i.getLabelPos(c),f=r.get(h,0),m=i.pointLabel.getDistance(g,this._rx,this._rxInner);if(f){const t=!g&&u.get(h);if(s){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,s=f.ty,i=t.tx,r=t.ty;(g||0===n)&&(f.trans(f.x,f.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(f.trans(f.tx,f.ty).transEx2(f.x,f.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class sl extends ch{setHoverRate(t,e,s){const i=this.point,r=yi.getDrawer(t.model.getShape(i)),n=(+t.model.prop("hoverScale")||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._hoverRadius}}class il extends _h{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new mh(t,sl)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ea.grow(this)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)})}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.needClip(!1),n=s._xAxisObj,o=s._yAxisObj,a=this._polar=s.chart._body.getPolar(n),h=this._getGrowRate(),l=this._radius=Math.max(0,s.num("radius"))*h,c=s.num("rotation"),u=s.num("jitterX"),p=s.num("jitterY"),g=s.pointLabel,f=g.prop("position"),m=g.getOffset(),y=this._labelViews(),b=i?t:e,x=a?a.total:i?e:t,w=i?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=yi.getDrawer(s.getShape(V)),S=nt.jitter(V.xValue,u),A=nt.jitter(V.yGroup,p);let P,k;if(a){const t=a.start+n.getPos(x,S),e=oi(a,o,A,h);P=a.cx+e*_(t),k=a.cy+e*d(t)}else P=n.getPos(x,S),k=w-o.getPos(b,A),i&&(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 s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.prop("radius"),r=s.reduce((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r);return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.prop("radius")+s}}class rl extends lh{constructor(t){super(t,"rct-waterfall-series"),this._bars=new mh(this._pointContainer,rh),this.add(this._lineContainer=new Ae(t,"rct-waterfall-series-lines")),this._lines=new Ko(this._lineContainer,Sn)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),this._rd=+e.prop("cornerRadius")||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this._setColorIndex(t,s),t.internalClearStyleAndClass(),e.prop("pointStyle")&&t.internalSetStyleOrClass(e.prop("pointStyle")),i&&i.forEach(e=>e&&t.internalSetStyleOrClass(e)),s._isSum&&e.prop("sumColor")?this._setPointColor(t,e.prop("sumColor")):s.y<0&&e.prop("negativeColor")?this._setPointColor(t,e.prop("negativeColor")):s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,s){this._bars.prepare(s.length,(t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)}),this._lines.prepare(s.length-1,(t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull})}}function nl(t,e){return new(ya[e._type()])(t)}function ol(t,e){return new(qa[e._viewType()])(t)}Ja.register([Bn,Sh],[Rn,vh],[mn,Ph],[pn,Vh],[zn,kh],[Gn,Nh],[Qn,Mh],[eo,Bh],[io,Dh],[ho,$h],[co,Ih],[_o,Hh],[fo,jh],[bo,Yh],[Tn,wh],[vo,Uh],[Vo,qh],[Ao,Kh],[Mo,el],[Oo,il],[$o,rl]),ba.register([qr,fh],[Ur,ph],[Zr,gh]);class al extends ta{constructor(t){super(t,"rct-axis-grid"),this._lines=new Ko(this,Sn),this.add(this._minorLineContainer=new Ve(t,"rct-axis-minor-grid")),this._minorLines=new Ko(this._minorLineContainer,Sn)}_prepareStyleOrClass(t){}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this.model,e=t.axis,s=e.prop("reversed"),i=this.width,r=this.height,n=e._isHorz?i:r;if(t instanceof Kr&&e instanceof rn){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,s,i,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,s)=>{t.setBoolData("first",0===s),t.setBoolData("last",o[s]===(e._isHorz?i:r))});const l=P(t.prop("firstVisible"),t.visible),c=P(t.prop("lastVisible"),t.visible);this.$_layoutGridLines(a,o,e,s,i,r,e=>0===e?l:e===h?c:t.visible)}$_layoutGridLines(t,e,s,i,r,n,o){const a=t.count-1;if(s._isHorz){const h=A(s._prevRate,1);t.forEach((t,l)=>{t.setVis(o(l,a))&&t.setVLine(s.prev(e[l])+(i?r*(1-h):0),0,n)})}else{const h=i?A(s._prevRate,1):1;t.forEach((t,i)=>{t.setVis(o(i,a))&&t.setHLine(n*h-s.prev(e[i]),0,r)})}}}class hl extends Ve{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Ne(t)),this._mask.setStroke("none"),this.add(this._upLine=new Ne(t)),this._upLine.setFill("none"),this.add(this._downLine=new Ne(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new we;if(s){let t=0,s=0,n=i/2,o=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(o,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class ll extends Ve{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new na(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 s=e.label.getText();e.label.prepareRich(s)}}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.setContrast(this._getContrastTarget()).layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}_getContrastTarget(){return null}}class cl extends ll{constructor(t,e){super(t),this.insertFirst(this._line=new(e?ma:Sn)(t,"rct-axis-guide-line"))}prepare(t,s){super.prepare(t,s),this.setVis(s.visible&&s.axis.contains(s.prop("value")))&&e(s._style)&&this._line.setStyles(s._style)}_doLayout(t,e){const s=this.model,i=s.prop("value"),r=s.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=s.axis.getPos(t,i),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-s.axis.getPos(e,i),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,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.prop("value"))&&i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=ri(s,i.axis),h=s.rdInner+i.axis.getPos(a,i.prop("value"));r.setArc(s.cx,s.cy,h,o,i.axis.getTotalAngle(),!1),r.setStyle(Ct,"none"),n&&n.trans(s.cx+h*_(s.start),s.cy+h*d(s.start))}}class _l extends ll{constructor(t,e){super(t),this.insertFirst(this._box=new(e?jn:xi)(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:s,endValue:i}={startValue:e.prop("startValue"),endValue:e.prop("endValue")},r=!a(s)&&!a(i);this._range=r?e.axis.trimRange(p(s,i),g(s,i)):[NaN,NaN],this.setVis(e.visible&&!isNaN(this._range[0])&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model,i=s.label,r=this._box,[n,o]=this._range,a=this._labelView.setVis(i.visible)?this._labelView:null,h=this._labelView.getBBox(),l=i.num("offsetX"),c=i.num("offsetY");if(this.vertical()){const _=s.axis.getPos(t,n),d=s.axis.getPos(t,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(d!==_);if(null==a||a.setVis(u),u){let s,n;switch(i.prop("align")){case"center":s=_+(d-_-h.width)/2+l;break;case"right":s=d-h.width-l;break;default:s=_+l}switch(i.prop("verticalAlign")){case"bottom":n="outside"!==i.prop("position")?e-h.height-c:e+c;break;case"middle":n=(e-h.height)/2-c;break;default:n="outside"!==i.prop("position")?c:-1*(h.height+c)}r.setBox(_,0,d,e),a&&a.trans(g(0,p(t,s)),n)}}else{const _=e-s.axis.getPos(e,n),d=e-s.axis.getPos(e,o),u=!isNaN(_)&&!isNaN(d)&&r.setVis(_!==d);if(null==a||a.setVis(u),u){let e,s;switch(i.prop("align")){case"center":e=(t-h.width)/2-l;break;case"right":e="outside"!==i.prop("position")?t-h.width-l:t+l;break;default:e="outside"!==i.prop("position")?l:-1*(h.width+l)}switch(i.prop("verticalAlign")){case"bottom":s=_-h.height-c;break;case"middle":s=d+(_-d-h.height)/2-c;break;default:s=d+c}a&&a.trans(e,s),r.setBox(0,d,t,_)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=ri(s,i.axis),h=s.rdInner+i.axis.getPos(a,this._range[0]),l=s.rdInner+i.axis.getPos(a,this._range[1]);if(r.setSector({cx:s.cx,cy:s.cy,rx:l,ry:l,innerRadius:h/l,start:o,angle:b,clockwise:!0}),n){const t=h+(l-h)/2;n.trans(s.cx+t*_(s.start),s.cy+t*d(s.start))}}}class dl extends Ae{constructor(){super(...arguments),this._views=new Ko(this,Ne)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach(t=>{s.push(...t.grid.rows.getRows())})}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.valueMin(),n.from),h=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const s=g(0,p(t,o.getPos(t,a))),r=g(0,p(t,o.getPos(t,h)));i.setPath(yi.rectangle(s,0,r-s,e))}else{const s=g(0,p(e,o.getPos(e,a))),r=g(0,p(e,o.getPos(e,h)));i.setPath(yi.rectangle(0,e-s,t,s-r))}i.internalClearStyleAndClass(),i.setFill("none"),i.setFill(n.color),n.style&&i.internalSetStyleOrClass(n.style)})}}class ul extends Ae{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof _l?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach(e=>{let i;e instanceof Ps?i=this._rangePool.pop()||new _l(t,s):e instanceof As&&(i=this._linePool.pop()||new cl(t,s)),this.add(i),i.prepare(t,e)})}add(t){return this._views.push(t),super.add(t)}}class pl extends Ne{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line")),this.setStyleOrClass(t._style)}layout(t,e,s,i,r,n=!1){const o=this.model.axis,a=o._isHorz,h=new we;if(this._bar){const c=o._isHorz?i:r;let _;if(t?_=t.point.xValue:(this.model.prop("showAlways")||n)&&(_=o.prop("reversed")?o.xValueAt(a?i-e:s):o.xValueAt(a?e:r-s)),o instanceof Qi&&(_=l(_)),!isNaN(_)){const t=o.getPos(c,_);let e=o.getUnitLen(c,_);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,i,e)}}else(t||this.model.prop("showAlways")||n)&&(a?h.vline(e,0,r):h.hline(s,0,i));this.setPath(h.end())}}class gl extends pa{constructor(t){super(t,"Reset Zoom",gl.CLASS_NAME),this.setVis(!1)}}gl.CLASS_NAME="rct-reset-zoom";class fl extends Ae{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new bi(t,"rct-empty-view-back")),this.add(this._labelView=new na(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.prop("effect")&&this._backView.setStyleOrClass(t.prop("backgroundStyle")),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class ml extends Ae{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Ko(this,Sn)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,c=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(c.length,(e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-c[i],r,n-h-c[i]):e.setLine(c[i]+l,0,c[i],n)})}}class yl extends Ae{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new Ne(t)),this.add(this._gridContainer=new Ae(t,"rct-body-depth-grids")),this.add(this._lineView=new Sn(t,"rct-body-depth-side-line")),this.add(this._endView=new Sn(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(yi.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(yi.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,c]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new ml(t),h.set(l,s),a.add(s)),s.layout(e,c,i,r,n,o)}}}class bl extends Ae{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new yl(t,!0)),this.add(this._ySideView=new yl(t,!1)),this.add(this._orgLineView=new Sn(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,c=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),c.setVis(s.ySide.visible)&&(e?c.setBounds(0,o-h,n,h):c.setBounds(0,0,a,o),c.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class xl extends ta{constructor(t,e){super(t,xl.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 bi(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Ne(t,"rct-body-background")),this.add(this._depthLayer=new bl(t)),this.add(this._image=new ra(t,!0,"rct-body-image")),this.add(this._emptyView=new fl(t)),this.add(this._gridRowContainer=new dl(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Ae(t,"rct-axis-grids")),this.add(this._baseContainer=new Ae(t,"rct-axis-bases")),this.add(this._guideContainer=new ul(t,"rct-axis-guides")),this.add(this._annotationContainer=new Ae(t,"rct-annotations")),this.add(this._seriesContainer=new Ae(t,"rct-series-container")),this.add(this._axisBreakContainer=new Ae(t,"rct-axis-breaks")),this.add(this._labelContainer=new Ae(t,"rct-label-container")),this.add(this._stackLabelContainer=new Ae(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new ul(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Ae(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Ae(t,"rct-feedbacks")),this.add(this._zoomButton=new gl(t)),this._crosshairViews=new Ko(this._feedbackContainer,pl)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Se._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,c;if(Ja.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,s,i)}),c)this.$_setFocused(l,c,t);else if(a>0){const e=this.chart().general.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,c=!n;for(const t of o)if(!(t.model instanceof Ln)){c=!1;break}if(l=null,c)if(a>1){const n=[];o.forEach(o=>{s=A(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})});const a=n.reduce((e,s)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s});l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=A(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach(r=>{if(r.getHintDistance&&(s=A(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}});h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=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 Br){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof Qn){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)});_=u.map(t=>i.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 s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,o&&this.$_focusSeries(t,!0),o&&r.general.prop("seriesHovering")&&this.$_hoverSeries(t))}this._focused&&o&&(this._focused!==h||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter(e=>e.model._group===t.model._group)):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach(e=>{e.setBoolData(Ja.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(Ja.DATA_UNHOVER,t&&e!==t)})}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach(t=>t.hoverPoint(null)),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach(t=>t.focusPoints(null)),this.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 s=e.model._xAxisObj,i=e.model._yAxisObj;s&&t.add(s),i&&t.add(i)}),Array.from(t)}showAxisCrosshair(t,e,s){const i=this.width,r=this.height;this._crosshairViews.forEach(n=>{n.model.axis===t?n.setVis(!0)&&n.layout(null,e,s,i,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,s,i){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.zoom(h,l)&&(this._zoomRequested=!0)}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find(e=>e.model===t)}removeFocus(){this._seriesViews.forEach(t=>{t._hoverPts.forEach(e=>{e instanceof ch&&e.endHover(t,!1),e.setBoolData(Ja.DATA_FOCUS,!1)}),t._hoverPts=[],t._hoverAnis.forEach(t=>{t.cancel()}),t._hoverAnis=[]}),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach((e,s)=>{e.measure(t,this._series[s],h,l,r)}),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach((e,s)=>{e.measure(t,this._gauges[s],h,l,r)}),this._annotationViews.forEach((e,s)=>{e.measure(t,this._annotations[s],h,l,r)}),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_renderBackground(t,e,s){t.setPath(yi.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.prop("url")))return e.setImage(t.prop("url"),s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach(t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()}),this._seriesViews.forEach(t=>{t.afterLayout()}),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach(t=>{const e=t._model,s=e.axis;t.setStyleOrClass(e._style),s._isHorz?s.prop("reversed")?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.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,s){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,s))}$_isEmptyVisible(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(xa[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof rn)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));if(s){const s=new Set,l=[],c=t=>{t&&!s.has(t)&&(s.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 s=e.grid;if(!r.has(e)&&(s.visible||s.prop("firstVisible")||s.prop("lastVisible"))){const s=new al(t);r.set(e,s),i.add(s)}if(e instanceof rn&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Sn(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}})}}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach(t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())}),a.length=0,s.forEach(e=>{const s=o.get(e)||ol(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)}),this._seriesContainer.sort(a),a.forEach(t=>{this._labelContainer.dom.appendChild(t._labelContainer.dom)}),a.forEach(t=>t._stackLabelContainer.remove());const l=new Map;for(const t of a){const e=t.model._group;e&&e._stacked&&e.isLastVisible(t.model)&&l.set(e,t)}l.forEach(t=>this._stackLabelContainer.add(t._stackLabelContainer))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach(t=>t.remove()),o.length=0,s.forEach(s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._setChartOptions(r,this._animatable,e.loadAnimatable())})}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach(e=>{const o=r.get(e)||nl(t,e);(e.prop("front")?i:s).add(o),r.set(e,o),n.push(o)})}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach(t=>t.forEach(t=>{t instanceof rn&&o.push(...t._getBreaks())}));i.length<o.length;){const e=new hl(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach((t,e)=>t.setModel(o[e]))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[],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(s,i,!0).forEach(o),t._getYAxesAtPane(s,i,!0).forEach(o)),e.prepare(r.length,(t,e)=>{t.setModel(r[e]),t.setClip(this._bodyClip)})}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach(r=>{r._layoutView(t,e,0,0,s,i),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)})}}xl.BODY_CLASS="rct-body";class wl extends Ve{constructor(t){super(t,vl.HANDLE_STYLE),this.add(this._back=new bi(t)),this.add(this._shape=new Ne(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){const i=2*Ir.HANDLE_RADIUS,r=new we;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2};const n=i/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=s}}}class vl extends ta{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(vl.HANDLE_STYLE)}static isMask(t){return t.classList.contains(vl.MASK_STYLE)}constructor(t){super(t,vl.CLASS_NAME),this.add(this._back=new bi(t,vl.BACK_STYLE)),this.add(this._container=new Ae(t,null)),this.add(this._mask=new bi(t,vl.MASK_STYLE)),this.add(this._trackView=new bi(t,vl.TRACK_CLASS)),this.add(this._thumbView=new bi(t,vl.THUMB_CLASS)),this.add(this._startHandle=new wl(t)),this.add(this._endHandle=new wl(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()})}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;let o,a,h=s,l=i;return e._vertical?(h=e.getSize(),o=e.getThickness(),a=i):(l=e.getSize(),o=s,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,s=e.axis()._zoom,i=e.mask,r=e.handle,n=this.width,o=this.height;if(this._back.resize(n,o),e._vertical);else{const t=s?(s.start-s.min)*n/s.total():0,e=s?(s.end-s.min)*n/s.total():n;this._mask.setVis(i.prop("visible"))&&(this._mask.setBounds(t,0,e-t,o),this._mask.setStyleOrClass(i._style));const a=Ir.HANDLE_TRACK_HEIGHT,h=Ir.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 s=2*Ir.HANDLE_RADIUS;this._startHandle.layout(s,s,!1),this._startHandle.trans(t,o+h),this._endHandle.layout(s,s,!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 s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=ol(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new ua(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new ua(t)),i._simpleMode=!0)}}vl.CLASS_NAME="rct-navigator",vl.BACK_STYLE="rct-navigator-back",vl.MASK_STYLE="rct-navigator-mask",vl.HANDLE_STYLE="rct-navigator-handle",vl.HANDLE_BACK_STYLE="rct-navigator-handle-back",vl.TRACK_CLASS="rct-navigator-track",vl.THUMB_CLASS="rct-navigator-thumb";class Sl extends Be{constructor(t){super(),this.chart=t}}class Vl extends Sl{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=g(0,e-(o.x-n.x)),this._yStart=g(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new bi(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=g(0,p(i.height,e-(i.y-s.y))),this._body.setZoom(0,p(g(0,this._yStart),e),this._body.width,g(p(this._yStart,i.height),e))):(t=g(0,p(i.width,t-(i.x-s.x))),this._body.setZoom(g(0,p(this._xStart,t)),0,g(p(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=g(0,p(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,p(this._yStart,r),this._body.width,f(this._yStart-r))):(i=g(0,p(o.width,i-(o.x-n.x))),this._feedback.setBounds(p(this._xStart,i),0,f(this._xStart-i),this._body.height)),!0}}class Cl extends Sl{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Al extends Sl{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,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 Sl{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=g(0,p(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class kl{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(f(this._clickX-i)>3||f(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),e.forceHideTooltip(),this._stopEvent(t)):t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):e.getButton(s)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;if(!this._chart.model.clickable())return;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,c;const _=this._chart.chart.exporter;if(_.isContextMenuVisible()&&_.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){const t=z.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach(t=>{if(t instanceof Wi){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof uh&&t.togglePointVisible(e)}}else t.visible=e}),i.bodyView().hoverSeries(e?a.source:null)}}else(h=i.seriesByDom(r))?h.clicked(r):(c=i.htmlButtonByDom(r))?c.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return _a.isThumb(t)?new Cl(this._chart,i.getScrollView(t)):vl.isHandle(t)?new Al(this._chart,i._navigatorView,t):vl.isMask(t)&&r&&r.model.isZoomed()?new Pl(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Vl(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class Ll extends Ae{constructor(t){super(t,Ll.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new $e(t,"rct-history-item");e.anchor=Oe.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new $e(t);e.anchor=Oe.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Ll.TITLE_CLASS="rct-history";class Nl extends ta{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new bi(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new $e(t,"rct-legend-item-label")),this._label.anchor=Oe.START}setMarker(t){return t===this._marker&&t.parent===this||(this._marker&&this._marker!==t&&this._marker.remove(),this.insertFirst(this._marker=t)),this._marker}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.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:g(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=A(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class Tl extends ea{constructor(t){super(t,Tl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Ko(this,Nl)}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,s,i,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?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,o,this._ipr,s,i)}_doLayout(){const t=this.model,e=this._rowViews,s=t.prop("useTextColor"),i=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,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")}),e.forEach((t,e)=>{l?(t.forEach(t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])}),p=_,"center"!==r&&"end"!==r||(d=t.map(t=>t.height).reduce((t,e)=>t+e)+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach(t=>{t.trans(u,p),p+=t.height+o}),u+=i[e]+n):(t.forEach(t=>{t.resizeByMeasured().layout(NaN)}),u=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+=i[e]+n)})}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,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,f,m,y;a.forEach((e,s)=>{e.setMarker(o[s].source.legendMarker(t,c)),e.measure(t,o[s],r,n,1)});let b=0,x=0;if(s){for(;b<_;)y=a.get(b),x%i===0?(d.push(m=[y]),f=y.mh,x++,b++):(f+=h+y.mh,f<=n?(m.push(y),x++,b++):x=0);this._wMarkers=[],p=f=0,d.forEach((t,e)=>{let s=0,i=0,r=0;t.forEach(t=>{i+=t.mh,s=g(s,t.mw),r=g(r,t._rMarker.width),t._col=e}),i+=h*(t.length-1),f=g(f,i),p+=s,u.push(s),this._wMarkers.push(r)}),p+=l*(d.length-1)}else{for(;b<_;)y=a.get(b),x%i===0?(d.push(m=[y]),p=y.mw,x++,b++):(p+=h+y.mw,p<=r?(m.push(y),x++,b++):x=0);p=f=0,d.forEach(t=>{let e=0,s=0;t.forEach(t=>{e+=t.mw,s=g(s,t.mh)}),e+=h*(t.length-1),p=g(p,e),f+=s,u.push(s)}),f+=l*(d.length-1)}return{width:p,height:f}}}Tl.LEGEND_CLASS="rct-legend";class Ml extends Ve{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new ga(t))}layout(){}}class El extends Ve{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Ae(t,"rct-polar-axis-markers")),this._markViews=new Ko(this._markContainer,Ml),this.add(this._gridContainer=new Ve(t,"rct-polar-axis-grids")),this._labelViews=new Ko(this._labelContainer=s,la,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(da)?t.setLabel(s,o,e,r.replace(da,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks;s.chart._body.getPolar(e),s.prop("rotation");const i=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(i,(e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)})}else this._labelViews.forEach(t=>t.setVis(!1))}prepareGuides(t,e,s){let i=this._model.guides.filter(t=>!t.prop("front"));e.setAll(t,i,!0),i=this._model.guides.filter(t=>t.prop("front")),s.setAll(t,i,!0)}}class Bl extends El{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Ko(this._gridContainer,Sn,Bl.GRID_CLASS),e.insertFirst(this._startView=new Sn(t,Bl.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Sn(t,Bl.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new ma(t,Bl.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle(),h=t.chart._body.getPolar(t).rdInner;if(r.forEach(t=>t.pos=t.pos/i*a/b),this._gridContainer.visible&&this._gridLines.forEach((n,a)=>{const l=r[a].pos,c=e+_(o+l)*i,u=s+d(o+l)*i,p=e+_(o+l)*h,g=s+d(o+l)*h;n.setFill("none"),n.setLine(p,g,c,u),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=i+t.tick._getLength(),l=this._labelContainer.textAlign()||"center",c=[],u=t.label.prop("rotation")||0,p="auto"===u;this._labelViews.forEach((t,i)=>{if(t.setVis(i%a===0)){t.layout(l);const n=r[i],a=t.getBBox(),g=t.angle=o+n.pos,f=(g*v%360+360)%360,m=f>90&&f<270;if(p){const i=e-a.width/2+_(g)*(h+a.width/2),r=s-a.height/2+d(g)*(h+a.width/2);t.trans(i,r),t.setRotation(a.width/2,a.height/2,m?g*v+180:g*v)}else{const i=e+_(g)*(h+a.width/2)-a.width/2,r=s+d(g)*(h+a.height/2)-a.height/2;t.trans(i,r),t.setRotation(a.width/2,a.height/2,u)}c.push(t)}});let g=0,f=c[g];for(let t=1;t<c.length;t++){const e=c[t],s=f.inflateBBox(-1,-1),i=e.inflateBBox(-1,-1),r=Object.assign(s,{rotation:f.rotation}),n=Object.assign(i,{rotation:e.rotation});if(Ta(r,n)?(e.setVis(!1),c.splice(t,1),--t):(f=e,g=t),t===c.length-1&&c.length>1){if(nt.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});Ta(t,e)&&(f.setVis(!1),c.splice(g,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+_(o)*i,s+d(o)*i),r.map(t=>{const r=t.pos;h.push(e+_(o+r)*i,s+d(o+r)*i)}),n&&r[r.length-1].pos<a&&h.push(e+_(o+a)*i,s+d(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e+_(o)*h,s+d(o)*h,e+_(o)*i,s+d(o)*i),this._endView.setLine(e+_(o+a)*h,s+d(o+a)*h,e+_(o+a)*i,s+d(o+a)*i))}}Bl.LINE_CLASS="rct-polar-xaxis-line",Bl.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Bl.GRID_CLASS="rct-polar-xaxis-grid-line";class Ol extends El{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new Ko(this._gridContainer,ma,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Sn(t,"rct-polar-yaxis-line")),e.add(this._baseView=new ma(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof rn&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){const o=t.chart._body.getPolar(t),a=o.rdInner,h=ri(o,t);function l(t,i){if(t.setFill("none"),c)t.setArc(e,s,i,g,f,!0);else{const r=[];p&&u[0].pos>0&&r.push(e+_(g)*i,s+d(g)*i),u.forEach(t=>{const n=t.pos;r.push(e+_(g+n)*i,s+d(g+n)*i)}),p&&u[u.length-1].pos<f&&r.push(e+_(g+f)*i,s+d(g+f)*i),t.setPolyline(r)}}const c=this._circular,u=n._ticks,p=n.isArced(),g=n.getStartAngle(),f=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach((e,s)=>{l(e,a+r[s].pos),e.setStyleOrClass(t.grid.prop("style"))}),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(p){const t=n.getStartAngle();this._labelViews.forEach((n,h)=>{const l=n.getBBox(),c=a+r[h].pos;n.setContrast(null).trans(e+_(t)*c-l.width*i+o,s+d(t)*c-l.height/2)})}else this._labelViews.forEach((t,n)=>{const h=t.getBBox();t.setContrast(null).trans(e-h.width*i+o,s-(a+r[n].pos)-h.height/2)})}this._lineView.visible&&(p?this._lineView.setLine(e+a*_(g),s+a*d(g),e+i*_(g),s+i*d(g)):this._lineView.setVLine(e,s-a,s-i)),this._baseView.visible&&l(this._baseView,a+t.getPos(h,t.getBaseValue()))}}class Dl extends xl{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._circular=this.model.prop("circular"),this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n,rdInner:o}=this.model.getPolar(null);t.setPath(o>0?yi.donut(i,r,n,o):yi.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n,rdInner:o}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._layoutInnerText(s,i,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(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()}),this._seriesViews.forEach(t=>{t.afterLayout()}),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach(t=>{t.layout(s.chart.xAxis,i,r,n)}),[this._guideContainer,this._frontGuideContainer].forEach(t=>{t._views.forEach(t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis)))}),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(s,t,e)}_prepareInnerText(t){this._innerTextView||(this.add(this._innerTextView=new na(t,"rct-polar-body-inner")),this._innerTextView._text.anchor=Oe.MIDDLE)}_layoutInnerText(t,e,s,i){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*i,2*i,t,null),this._innerTextView.layout("center"),this._innerTextView.setContrast(null);const o=this._innerTextView.getBBox();this._innerTextView.trans(e-o.x-o.width/2,s-o.y-o.height/2)}_prepareAxes(t,e,s,i,r){if(this._prepareInnerText(t),!this._xAxisContainer){const e=this._image,s=this._axisBreakContainer;this.insertAfter(this._xAxisLabelContainer=new Ae(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),s),this.insertAfter(this._yAxisLabelContainer=new Ae(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),s),this.insertAfter(this._lineContainer=new Ae(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new Ae(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new Ae(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new Ol(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)}),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Bl(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Rl extends ea{constructor(t,e){super(t,e?Rl.SUBTITLE_CLASS:Rl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new $e(t)),this._richText=new Xe}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,s,i,null,null),X(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Rl.TITLE_CLASS="rct-title",Rl.SUBTITLE_CLASS="rct-subtitle";class $l extends Ve{constructor(t){super(t,"rct-tooltip-row"),this._hasMarker=!0,this.add(this._marker=new Ne(t,"rct-tooltip-row-marker")),this.add(this._textView=new $e(t,"rct-tooltip-row-text")),this._textView.anchor=Oe.START,this.add(this._detailView=new $e(t,"rct-tooltip-row-detail")),this._detailView.anchor=Oe.START}layout(t,e,s,i,r){var n;const o=e.getMarkerSize(),a=o+e.getMarkerGap(),h=e.hasListMarker();if(this._hasMarker=h,h){const t=yi.getDrawer(e.prop("listMarkerShape")||"circle");this._marker.setVis(!0),this._marker.setPath(t(o/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||"")}else this._marker.setVis(!1);r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.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 Fl extends Ve{constructor(t){super(t,"rct-tooltip-list"),this.add(this._headerView=new $e(t)),this._headerView.anchor=Oe.START,this.add(this._rowLayer=new Ae(t,"")),this.add(this._footerView=new $e(t)),this._footerView.anchor=Oe.START,this._rows=new Ko(this._rowLayer,$l)}layout(t,e,s,i){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(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=g(l,(r.r=r.getBBox()).width)}),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach(t=>{t.alignDetail(l)})}}class Il extends Ve{constructor(t){super(t,Il.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Ne(t,"rct-tooltip-back")),this.add(this._top=new Ne(t,"rct-tooltip-top")),this.add(this._textView=new $e(t,"rct-tooltip-text")),this.add(this._listView=new Fl(t)),this._back.setAttr("filter","url(#"+Se.SHADOW_FILTER+")"),this._textView.anchor=Oe.START,this._richText=new Xe,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 f=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 kr&&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=g(l.num("minWidth"),V.width+16),A=g(l.num("minHeight"),V.height+12)+x;let k=t.getTooltipHeaderColor(h);null===k&&(k=t._calcedColor,t instanceof Vr?(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,N=l.num("offset")+w,T=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-g(0,p(o-A/2,m-A)),O=D?P?C+N>n:n+C+N>f:P?C+N>T.x-M.x+T.width:T.x-M.x-N>f-C,O&&(P=!P),B=P?"left":"right",this.$_drawTooltip(0,0,C,A,B,E),P?n-=C+N:n+=N,o-=A/2;else{E=n-C/2-g(0,p(n-C/2,f-C));const t=D?o-e.getRootDistance().y:T.y-M.y-e._padding.top,s=D?m-o:M.bottom-T.bottom;if(t>=A+N||s>=A+N){(P?s>=A+N:t>=A+N)?B=P?"bottom":"top":(B=P?"top":"bottom",P=!P),this.$_drawTooltip(0,0,C,A,B,E),n-=C/2,P?o+=N:o-=A+N}else{E=o-A/2-g(0,p(o-A/2,m-A));const t=T.x-M.x;B=f-t>=C+N||t<C+N?"right":"left",this.$_drawTooltip(0,0,C,A,B,E),"right"===B?n+=N:n-=C+N,o-=A/2}}return n=g(0,p(n,f-C)),o=g(0,p(o,m-A)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(g(0,n-20),g(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"):Gr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){fe(this.dom,"opacity",void 0,0,200,()=>{this.setStyle("visibility","hidden")})}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let c=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":c=c.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":c=c.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":c=c.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":c=c.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const _="bottom"===r,d=_?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(_?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(c)}}Il.CLASS_NAME="rct-tooltip";class zl extends Ce{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Il(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class Hl extends q{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,s=oe.isHoverAt(e),i=this._model=t;return oe.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.num("width"))?i.prop("autoWidth")?e.style.width="max-content":e.style.width="":e.style.width=Pt(i.prop("width")),isNaN(i.num("height"))?e.style.height="":e.style.height=Pt(i.prop("height")),"custom"===i.prop("hintMode")?(i.prop("hint")?e.dataset.hint=i.prop("hint"):delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.prop("hint")||""),i.prop("imageUrl")?oe.setStyles(this._img,{display:"",width:N(i.prop("imageWidth")),height:N(i.prop("imageHeight"))}):oe.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(rt?this._hovered:s),this._span.textContent=i.prop("text")||"",this}layout(t){const e=this._dom,s=e.style,i=this._model,r=i.prop("align"),n=i.prop("verticalAlign");s.left=N("left"===r?t.x+(i.prop("offsetX")||0):"right"===r?t.x+t.width-e.offsetWidth-(i.prop("offsetX")||0):t.x+(t.width-e.offsetWidth)/2+(i.prop("offsetX")||0)),s.top=N("top"===n?t.y+(i.prop("offsetY")||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.prop("offsetY")||0):t.y+(t.height-e.offsetHeight)/2+(i.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"),s=t.createElement("div");return e.className="rct-html-button",oe.setStyles(e,{position:"absolute",textAlign:"center"}),oe.setStyles(s,{display:rt?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",oe.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),oe.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),rt&&oe.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.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 Gl extends sa{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Rl(t,!1)),this.add(this.subtitleView=new Rl(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,c=0,_=0,d=this.titleView,u=s,p=0,f=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),_=this._hSub=a.height,c=this._wSub=a.width,f=o.num("titleGap")):d.setModel(o),o.prop("position")){case"leftSide":case"left":case"rightSide":case"right":p=g(l,_),u=h+f+c;break;default:p=l+f+_,u=g(u,h+c)}return p>0&&(p+=this.titleView.visible?n.getGap():o.getGap()),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.visible?this._wTitle>t.wPlot||"chart"===i.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||i&&"chart"===i.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,s)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},l=()=>{const e=g(this._hTitle,this._hSub);u=g(u,u+t(i,e,this._hTitle)),f=g(f,f+t(r,e,this._hSub))},c=(t,e,s)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},_=()=>{if(p=g(p,p+c(i,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=g(m,m+c(r,o,this._wSub))},d=r.num("titleGap");let u=0,p=a,f=0,m=h;switch(i.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=g(m,m+(o-this._wTitle-this._wSub)/2);break;case"right":m=g(m,h+o-this._wSub)}l();break;case"top":_(),u=f+this._hSub+d;break;default:_(),f=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=f+this._hSub+d;break;default:_(),f=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=f+this._hSub+d;break;default:_(),f=u+this._hTitle+d}}const y=A(i.prop("offset"),0),b=A(r.prop("offset"),0);0!==y&&(p+="right"===i.prop("align")?-y:y,"leftSide"!==r.prop("position")&&"rightSide"!==r.prop("position")||(m+="right"===i.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),s.resizeByMeasured().layout().trans(m,f)}else if(n>0||o>0){const t=n?i:r,l=n?e:s,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 jl extends sa{_doInitChildren(t){this.add(this._legendView=new Tl(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class Wl extends sa{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach((t,e)=>{t.prepare(i[e])}),this.setVis(o.length>0)){const t=o[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)})}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach(t=>{r+=t.checkHeight(e,s,i)}),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach(t=>{r+=t.checkWidth(e,s,i)}),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map(t=>t.model))}clean(){this.views.forEach(t=>t.clean())}_doMeasure(t,e,s,i,r){this._inverted;let n=0,o=0;return[this.views].forEach(e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,c=0;e.forEach(e=>{if(e.visible){const s=e.measure(t,e.model,a,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,c+=s.height}}),this.isHorz?c+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=g(n,l),o=g(o,c)}}),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach(e=>{if(e){let h=0;e.forEach(t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===Xo.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Xo.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}}),this.isHorz?o+=r+t:a+=n+t}});const h=i.length>0&&e.chart.body.prop("zoomCallback");h&&Promise.resolve().then(()=>{i.forEach(({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof Qi?Math.floor(e):e,to:t instanceof Qi?Math.floor(s):s})})})}}class Yl extends ta{constructor(t){super(t,"rct-credits"),this.add(this._textView=new $e(t)),this._textView.anchor=Oe.START}clicked(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.getBBox()}}class Xl extends Ae{}class Ul extends Ae{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 Ae(t,"rct-annotations")),this.add(this._plotContainer=new Ae(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new xl(t,this));for(const e in Xo){const s=new Wl(t,Xo[e]);this._plotContainer.add(s),this._axisSectionMap[Xo[e]]=s}Ul.pane_class&&this.add(this._paneContainer=new Ul.pane_class(t,this)),this.add(this._titleSectionView=new Gl(t)),this.add(this._legendSectionView=new jl(t)),this.add(this._frontAnnotationContainer=new Ae(t,"rct-front-annotations")),this.add(this._creditView=new Yl(t)),this.add(this._navigatorView=new vl(t)),this.add(this._historyView=new Ll(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,s,i,r){var n,o,a;const h=this._model=e,l=h.isPolar(),c=h._credits,_=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(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],s,i,r)})}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._credits,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,i-="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=s-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 N,T,M=0,E=0;if(L.visible)switch(L.resizeByMeasured().layout(),M=L.height,E=L.width,a._location){case"top":N=C+y,r-=M;break;case"bottom":r-=M,N=S-M,S-=M;break;case"right":i-=E,T=e-E;break;case"left":i-=E,v+=E,T=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(i,r),this._paneContainer.layout(),O=r,D=i,B=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Xo.LEFT,Xo.RIGHT].forEach(s=>{(e=t[s])&&e.visible&&(i-=e.mw)}),[Xo.TOP,Xo.BOTTOM].forEach(s=>{(e=t[s])&&e.visible&&(r-=e.mh)}),(e=t[Xo.LEFT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0),v+=e.mw),(e=t[Xo.RIGHT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0)),(e=t[Xo.BOTTOM])&&e.visible&&(e.resize(i-(g?g.base:0),e.mh),o||e.transX(v),e.layout(0),S-=e.mh),(e=t[Xo.TOP])&&e.visible&&(e.resize(i-(g?g.base:0),e.mh),o||e.transX(v),e.layout(0))),P.visible&&P.layout().transX(v);const s={x:v,y:S};this._plotWidth=i,this._plotHeight=r,o||((e=t[Xo.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[Xo.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[Xo.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[Xo.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;O=this._plotHeight-0,D=this._plotWidth-0,v=s.x,S=s.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(N)){const t=a.num("offsetY");if(v=T,"chart"===a.prop("alignBase")){switch(n){case"top":S=t;break;case"bottom":S=s-M-t;break;default:S=(s-M)/2+t}S+M>s&&(S=(s-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>s&&(S=(s-M)/2),S<0&&(S=0)}else{const s=a.num("offsetX");if(S=N,"chart"===a.prop("alignBase"))switch(t){case"left":v=s;break;case"right":v=e-E-s;break;default:v=(e-E)/2+s}else switch(t){case"left":v+=s;break;case"right":v=v+i-E-s;break;default:v+=(i-E)/2+s}v+E>e&&(v=(e-E)/2),v<0&&(v=0)}L.trans(v,S)}if(h.visible){let t,i;switch(h.layout(),d){case"top":i=f;break;case"middle":i=(s-h.height)/2+f;break;default:if(b>0){if(i=s-b+c,L.visible){const t=L.y+M+c;t>i&&(i=t)}}else i=s-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,i)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,B),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:c}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},_=i.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 zl(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new Il(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}forceHideTooltip(){var t,e;this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t||t.close(!0,!1):null===(e=this._tooltipView)||void 0===e||e.close(!0,!1)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new ua(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find(e=>e.dom.contains(t));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find(e=>e.dom.contains(t))}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i,r,n,o,a;if(!(null===(i=this._model)||void 0===i?void 0:i.hoverable()))return;const h=s,l=this._model&&this.bodyOf(s),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 i=l.controlToElement(t,e),r=l.pointerMoved(i,s);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 fr?l.hoverSeries(t):e.prop("pointHovering")&&t instanceof Wi&&l.hoverPoint(t)})}}if(d instanceof ui&&!(this._hoverItem instanceof ui)&&(l.hoverPoint(null),l.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return this.$_hideCrosshairs(),void l.removeFocus();if(null===(n=this._model)||void 0===n?void 0:n.isSplitted())this.$_updateSplitCrosshair(l,i,_);else for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>{this.$_axisFlagAndMoved(t,l,i,_)})}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(s)}pointerLeaved(t,e,s){var i,r;this.$_clearAnnotationHover(),this.$_hideCrosshairs(),(null===(i=this._model)||void 0===i?void 0:i.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,s,i){const r=t.model,n=r.crosshair,o=r._isHorz?e.width:e.height,a=r._isHorz?s.x:s.y,h=n.visible&&!i&&n.flag.visible&&!n.isBar()&&n.getFlag(o,a);if(h){if(t.showCrosshair(a,h),n.prop("onChange")){const t=[],i=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 On&&!i?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=r._isX?Math.abs(s.x-e):Math.abs(s.y-a);h<o&&(o=h,n=t)}),t.push(n)}),n.moved(a,h,t)}}else t.hideCrosshair()}$_updateSplitCrosshair(t,e,s){const i=this._paneContainer,r=t.getConnectedAxes(),n=r.find(t=>t._isX&&t.crosshair.visible);i.bodies.forEach(s=>{s!==t&&(n&&s.isConnected(n)?s.showAxisCrosshair(n,e.x,-1):s.hideCrosshairs())}),r.forEach(r=>{if(!r.crosshair.visible)return;const n=i.axisViewOf(r);n&&this.$_axisFlagAndMoved(n,t,e,s)})}$_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 s=null==t?void 0:t.axisViewOf(e);null==s||s.hideCrosshair()}))}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find(e=>e.model===t);if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Xo){const s=this._axisSectionMap[Xo[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find(e=>e.model===t);e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find(e=>e.model===t),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Dl(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach((e,i)=>{let r=this._htmlButtons[i];r||(r=new Hl(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)});for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].dispose();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)})}}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,this,e,e.getAxes(s,!0),i,r):a.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const o=n[e];r&&o.visible&&o.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),c=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,c,this._inverted,r),s-=n[Xo.LEFT].checkWidths(t,s,i),s-=n[Xo.RIGHT].checkWidths(t,s,i),i-=n[Xo.BOTTOM].checkHeights(t,s,i),i-=n[Xo.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),c=i-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,c,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Xo.LEFT||t===Xo.RIGHT?s-=e.mw:t!==Xo.BOTTOM&&t!==Xo.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),c=i-(h?h.side:0),e.layoutAxes(l,c,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,c,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Xo.LEFT||t===Xo.RIGHT?s-=e.mw:t!==Xo.BOTTOM&&t!==Xo.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),c=i-(h?h.side:0),e.axesLayouted(l,c,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body,o=n.getRadius(s,i),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,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach(e=>{const o=r.get(e)||nl(t,e);(e.prop("front")?i:s).add(o),r.set(e,o),n.push(o)})}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach(i=>{if("container"===i.model.prop("scope"))n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)})}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var Zl;!function(t){t.EXPORT="$$realchart_export"}(Zl||(Zl={}));class ql extends Se{static $_conf(t,e){!function(t,e){const s=ue(e);if(!t||!s)return;let i=de.get(t);i||de.set(t,i=new Set),i.add(s)}(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 Zo(null,(t,e)=>{this.$_changeModel(t,e)})}_createChartView(t){return new Ul(t)}_createPointerHandler(){return new kl(this)}_doDispose(){this.$_unbindContextMenuDismiss(),this.setPointerHandler(null),this._chart=null,super._doDispose()}onModelChanged(t,e,s){e instanceof ds&&s===os.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof Zo&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Zl.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 s=this.model,i=s._general,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.prop("theme"),!0),this.setData("palette",i.prop("palette")),this.setResizeDelay(i.prop("resizeDelay")),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),t.width>0&&t.height>0&&r.setVis(!1!==i.prop("visible"))&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout(()=>{t({chart:this.chart})},0),this._chart._loadCallback=void 0}}_doRenderBackground(t,s,i,r){if(this.model){const i=this.model._general._style;if(e(i))for(const e in i)e.startsWith("padding")?s.setStyle(e,i[e]):t.style[e]=i[e]}}_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,s;const i=null===(e=this.chart)||void 0===e?void 0:e.exporter;if(!(null==i?void 0:i.isCompose())||!i.isContextMenuVisible())return;const r=t.target;(null===(s=null==r?void 0:r.closest)||void 0===s?void 0:s.call(r,".rct-contextmenu-button"))||i.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 s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class Kl{static getVersion(){return he.version}static setLicenseKey(t){he.code=t}static setLocale(t,e){e&<(t,e),(t=>{t&&(ht=ot[at=t.substring(0,2)]),ht||(ht=ot[at="ko"])})(t)}static registerLocale(t,e){lt(t,e)}static setDebugging(t){Ve.DEBUGGING=t}static setLogging(t){nt.LOGGING=t}static setAnimatable(t){Se._animatable=t}static configure(t){return t}static createChart(t,s,i,r=!0,n){const o=new ql(t,s);return o.chart.load(e(i)?i:{},r,n),o.chart[Go]=o,o.chart}static createData(t,e){return new qo(t||{},e)}}class Ql{static empty(){return new Ql}static create(t=0,e=0){return new Ql(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const Jl="bullet",tc="bulletgroup",ec="circle",sc="circlegroup",ic="clock",rc="linear",nc="lineargroup";class oc{static empty(){return new oc}static create(t=0,e=0){return new oc(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const ac=Kl.getVersion,hc=Kl.setDebugging,lc=Kl.setLogging,cc=Kl.setAnimatable,_c=Kl.configure,dc=Kl.createChart,uc=Kl.createData,pc=Kl.setLicenseKey;export{ds as Annotation,ba as AnnotationView,fa as ArcElement,Rn as AreaRangeSeries,vh as AreaRangeSeriesView,Bn as AreaSeries,Fn as AreaSeriesGroup,Sh as AreaSeriesView,es as AssetCollection,Os as Axis,sn as AxisBaseLine,Ds as AxisCollection,Ss as AxisGrid,ys as AxisItem,Ts as AxisLabel,bs as AxisLine,Ms as AxisScrollBar,_a as AxisScrollView,Bs as AxisSectorLine,ks as AxisTick,xs as AxisTitle,ua as AxisView,pn as BarRangeSeries,Vh as BarRangeSeriesView,mn as BarSeries,fn as BarSeriesBase,bn as BarSeriesGroup,yn as BarSeriesGroupBase,gn as BarSeriesPoint,Ph as BarSeriesView,Ah as BarSeriesViewBase,kr as BasedSeries,hh as BasedSeriesView,zn as BellCurveSeries,kh as BellCurveSeriesView,_i as Body,ci as BodyDepth,xl as BodyView,Gn as BoxPlotSeries,Nh as BoxPlotSeriesView,ih as BoxPointElementEx,Kn as BubblePie,Qn as BubbleSeries,Mh as BubbleSeriesView,tc as BulletGaugeGroupType,Jl as BulletGaugeType,Jn as BumpSeriesGroup,eo as CandlestickSeries,Bh as CandlestickSeriesView,Qi as CategoryAxis,Ki as CategoryAxisGrid,qi as CategoryAxisLabel,Zi as CategoryAxisTick,Zo as Chart,ql as ChartControl,qo as ChartData,ut as ChartDataCollection,ta as ChartElement,os as ChartItem,Uo as ChartObject,kl as ChartPointerHandler,hs as ChartText,Ul as ChartView,so as CircelBarPointLabel,io as CircleBarSeries,ro as CircleBarSeriesGroup,Dh as CircleBarSeriesView,ga as CircleElement,sc as CircleGaugeGroupType,ec as CircleGaugeType,ti as CircularGauge,ei as CircularGaugeGroup,Qs as CircularGaugeLabel,ic as ClockGaugeType,Ar as ClusterableSeries,Er as ClusterableSeriesGroup,ne as Color,yr as ConnectableSeries,Mr as ConstraintSeriesGroup,ia as ContentView,rn as ContinuousAxis,jo as Credits,fs as Crosshair,Wi as DataPoint,Yi as DataPointCollection,hr as DataPointLabel,oe as Dom,ho as DumbbellSeries,$h as DumbbellSeriesView,Ko as ElementPool,co as EqualizerSeries,Ih as EqualizerSeriesView,_o as ErrorBarSeries,Hh as ErrorBarSeriesView,di as Exporter,fo as FunnelSeries,jh as FunnelSeriesView,Hs as Gauge,Is as GaugeBase,Gs as GaugeGroup,Aa as GaugeGroupView,zs as GaugeItem,Ks as GaugeLabel,qs as GaugeRangeBand,Zs as GaugeRangeLabel,Us as GaugeScale,wa as GaugeView,Ei as HeatmapSeriesType,bo as HistogramSeries,Yh as HistogramSeriesView,ls as IconedText,Ur as ImageAnnotation,ph as ImageAnnotationView,ra as ImageElement,Ae as LayerElement,pi as Legend,ui as LegendItem,Nl as LegendItemView,Tl as LegendView,Sn as LineElement,kn as LinePointLabel,Tn as LineSeries,Ln as LineSeriesBase,xh as LineSeriesBaseView,$n as LineSeriesGroup,Cn as LineSeriesPoint,wh as LineSeriesView,nn as LinearAxis,nc as LinearGaugeGroupType,rc as LinearGaugeType,Io as LogAxis,vo as LollipopSeries,Uh as LollipopSeriesView,Nr as LowRangedSeries,Br as MarkerSeries,ch as MarkerSeriesPointView,_h as MarkerSeriesView,Dr as NavigatorMask,Or as NavigiatorHandle,x as ORG_ANGLE,Vo as OhlcSeries,qh as OhlcSeriesView,Sr as OthersGroup,b as PI_2,Xl as PaneContainer,Ao as ParetoSeries,Kh as ParetoSeriesView,we as PathBuilder,Ne as PathElement,Di as PictogramSeriesType,Ri as PictorialBarSeriesType,$i as PictorialSeriesType,Mo as PieSeries,Eo as PieSeriesGroup,No as PieSeriesLabel,Lo as PieSeriesText,el as PieSeriesView,Ql as Point,th as PointElement,Wo as PointHovering,Ya as PointLabelLineContainer,Wa as PointLabelLineView,Ga as PointLabelView,mh as PointViewPool,v as RAD_DEG,q as RObject,Fi as RaceBarSeriesType,Ii as RaceLineSeriesType,Cr as RadialSeries,Lr as RangedSeries,me as RcAnimation,Se as RcControl,Ve as RcElement,q as RcObject,bi as RectElement,Mt as SVGNS,Ca as ScaleView,Oo as ScatterSeries,il as ScatterSeriesView,sa as SectionView,jn as SectorElement,fr as Series,Ea as SeriesAnimation,Tr as SeriesGroup,br as SeriesMarker,Ir as SeriesNavigator,Ja as SeriesView,Zr as ShapeAnnotation,gh as ShapeAnnotationView,oc as Size,Mn as SplineSeries,lr as StackLabel,Hr as Subtitle,yi as SvgShapes,Oe as TextAnchor,qr as TextAnnotation,fh as TextAnnotationView,$e as TextElement,De as TextLayout,dn as TimeAxis,zr as Title,Gr as Tooltip,Mi as TreemapSeriesType,Ji as TrendLineArea,tr as TrendLineLabel,sr as Trendline,nt as Utils,Ws as ValueGauge,Sa as ValueGaugeView,Bi as VectorSeriesType,$o as WaterfallSeries,rl as WaterfallSeriesView,Rs as Widget,Vr as WidgetSeries,wr as WidgetSeriesConnector,vr as WidgetSeriesLabel,xr as WidgetSeriesPoint,uh as WidgetSeriesView,Oi as WordCloudSeriesType,Xi as ZValuePoint,f as absv,h as assignObj,xt as buildValueRanges,R as calcPercent,_c as configure,m as copyObj,_ as cos,dc as createChart,uc as createData,Y as createRect,is as extend,yt as fixnum,ac as getVersion,L as incv,s as isArray,U as isEmptyRect,rt as isIE,n as isNumber,e as isObject,r as isString,g as maxv,p as minv,Lt as parsePercentSize,A as pickNum,P as pickProp,k as pickProp3,N as pixel,X as rectToSize,cc as setAnimatable,hc as setDebugging,pc as setLicenseKey,lc as setLogging,d as sin,kt as toStr};
|
|
7
|
+
const t=Object.prototype.hasOwnProperty,e=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,s=function(t){return"function"==typeof t},r=function(t){return"string"==typeof t},n=function(t){return"number"==typeof t},o=function(t){return"boolean"==typeof t},a=function(t){return null==t||isNaN(t)},h=Object.assign,l=Math.floor,c=Math.ceil,_=Math.cos,d=Math.sin,u=Math.log10,p=Math.min,g=Math.max,f=Math.abs,m=function(t){if(t&&"object"==typeof t&&!i(t))return h({},t)},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(p(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&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let 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=g(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=g(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 s=i(e)?[]:{};for(let i of Object.keys(e))s[i]=t.deepClone(e[i]);return s}}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 g(e,p(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=g(e,t)),isNaN(i)||(t=p(i,t)),t}static makeIntArray(t,e){const i=new Array(g(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=f(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=p(e,t[s]),i=g(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||i(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 r(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 X=Object.freeze({x:0,y:0,width:0,height:0}),W=function(t,e,i,s){return{x:t,y:e,width:i,height:s}};function U(t){return{width:t.width,height:t.height}}function Z(t){return t.width<=0||t.height<=0}let q=0;class K{constructor(){this._hash=++q,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 J=function(s,r){if(s===r)return!0;if(null==s||null==r)return!1;if(s instanceof Date&&r instanceof Date)return s.getTime()===r.getTime();if(i(s)&&i(r)){if(s.length!==r.length)return!1;for(let t=0;t<s.length;t++)if(!J(s[t],r[t]))return!1;return!0}if(e(s)&&e(r)){const e=Object.keys(s),i=Object.keys(r);if(e.length!==i.length)return!1;for(const i of e){if(!t.call(r,i))return!1;if(!J(s[i],r[i]))return!1}return!0}return!1},tt=function(s,r){const n=e(s)?s:{};for(const s in r)if(t.call(r,s)){let t=r[s];i(t)?n[s]=t.slice(0):t instanceof Date?n[s]=new Date(t):e(t)?n[s]=tt(n[s],t):n[s]=t}return n},et=class s extends K{_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,s=!1,r=!1,n=!1){const o={};let a,h,l;return i(t)?a=t:e(t)&&([a,h,l]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,s,r,h,n,l),o}saveTo(t,s,r=!1,n=!1,o=!1){let a,h,l;return i(s)?a=s:e(s)&&([a,h,l]=this.$_splitProps(s)),this._doSave(t,a,this.constructor.defaults,r,n,h,o,l),t}updateOptions(t,e=!0){const i=this._op,r=this._externals??s.EMPTY_MAP;let n,o;if(void 0!==t&&!this._doSetSimple(i,t)){const e={};let s;for(const i in t)r.has(i)?(this._doUpdateProp(i,t[i]),(o??=[]).push(i)):(s=this._findChild(i))?(s=this.$_recreateChild(i,s,t[i]),(n??=[]).push(i)):t[i]!==this.prop(i)&&(this.$_validateOptions(i,t[i]),e[i]=t[i],(o??=[]).push(i));tt(i,e)}return this._doApply(i),n?.forEach(e=>this._findChild(e).updateOptions(t[e])),e&&this._optionChanged(o),this}invertOptions(i){if(!e(i))return{};const s={},r={};let n=!1;for(const e in i){if(!t.call(i,e))continue;const o=this._findChild(e);o?s[e]=o.invertOptions(i[e]):(r[e]=i[e],n=!0)}return n&&this.saveTo(s,r,!0,!1,!0),s}updateOption(t,s,r=!0,n=!1){if(this._doUpdateProp(t,s))return this._doApply(this._op),r&&this._optionChanged(t),this;let o=this._findChild(t);if(o)o=this.$_recreateChild(t,o,s),o.updateOptions(s);else{const o=this._op;(n||s!==this.prop(t))&&(this.$_validateOptions(t,s),i(s)?s=s.slice(0):s instanceof Date?s=new Date(s):e(s)&&(s=tt({},s)),o[t]=s,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=!o(s)||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(e,i=!0){const s=this._op,r=this._findChild(e);return r?r.clearOptions(!0):this._externals?.has(e)?(this._doUpdateProp(e,void 0),this._externals.delete(e),this._doApply(s),i&&this._optionChanged(e)):t.call(s,e)&&(delete s[e],this._doApply(s),i&&this._optionChanged(e)),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))J(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||(i(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(s,r){for(const n in r)if(t.call(r,n)){let t,o=r[n];this._doLoadProp(n,o)?(this._externals??=new Map).set(n,o):void 0!==(t=this._findChild(n))?(t=this.$_recreateChild(n,t,o),t.$_load(o)):i(o)?s[n]=o.slice(0):o instanceof Date?s[n]=new Date(o):e(o)?s[n]=Object.assign({},o):s[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(e,r,n,o,a,h,l=!1,c){const _=this._op,d=this._children??s.EMPTY_MAP,u=this._externals??s.EMPTY_MAP,p=r&&r.length>0,g=l&&p,f=p?r:Object.keys(_);for(const s of f)if(!d.has(s)&&!u.has(s)){const r=t.call(_,s);if(!r&&!a&&!g)continue;const o=this._propBaseline(s,n),h=r?_[s]:o;(a||g||!J(h,o))&&(i(h)?e[s]=h.slice():void 0!==h?e[s]=h:g&&(e[s]=void 0))}if(u.size>0)if(p){if(c)for(const t in c)u.has(t)&&this._doSaveProp(e,t,c[t])}else u.forEach((t,i)=>this._doSaveProp(e,i,u.get(i)));d.forEach((i,s)=>{const n=null!=h&&t.call(h,s),c=p&&r.indexOf(s)>=0;if(p&&!n&&!c)return;const _=n||c;if(o||_){const t=n?h[s]:void 0,r=l&&_,o=i.saveOptions(t,!0,a,r);(r||a||Object.keys(o).length>0)&&(e[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){}};et.defaults={},et.EMPTY_MAP=new Map;let it=et;(class t extends it{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(r(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=r(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,s=!0,r=!1,n=!1){const o=this.keyProp;if(e(t)&&i(t.items)&&(t=t.items),i(t)){if(o){const i=[];for(const a of t){const t=this.$_findByKey(o,e(a)?a[o]:void 0);t&&i.push(this.$_saveItem(t,a,s,r,n,o))}return i}return this._items.map((e,i)=>e.saveOptions(t[i],s,r,n))}const a=e(t)?t:void 0;return this._items.map(t=>this.$_saveItem(t,a,s,r,n,o))}$_saveItem(t,i,s,r,n,o){const a=t.saveOptions(i,s,r,n);return o&&e(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:s,updateMode:r}=this.$_split(t);"*"===r?.remove&&this.$_clearItems(),s&&this.$_reconcile(this._normalizeOptions(s),{addMissing:r?.addMissing??this.addMissingOnUpdate,removeMissing:r?.removeMissing??this.removeMissingOnUpdate,reorder:r?.reorder??this.reorderOnUpdate});const n=r?.remove;return i(n)&&n.length&&this.$_removeKeys(n),this._doItemsChanged(this._items),e&&this._optionChanged(),this}invertOptions(t){const{items:s,updateMode:r}=this.$_split(t),n=this.keyProp,o=r?.addMissing??this.addMissingOnUpdate,a=r?.removeMissing??this.removeMissingOnUpdate,h=r?.reorder??this.reorderOnUpdate,l=i(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 s??[]){const i=e(t)?t[n]:void 0;if(void 0===i)continue;const s=this.$_findByKey(n,i);s?_.push(this.$_saveItem(s,t,!0,!1,!0,n)):o&&d.push(i)}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(i(t))return{items:t,updateMode:void 0};if(e(t)){const s=t;return{items:i(s.items)?s.items:void 0,updateMode:e(s.updateMode)?s.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,i){const{addMissing:s,removeMissing:r,reorder:n}=i,o=this._items,a=this.keyProp;if(a){if(r){const i=new Set;for(const s of t){const t=e(s)?s[a]:void 0;void 0!==t&&i.add(t)}for(let t=o.length-1;t>=0;t--)if(!i.has(o[t].getOption(a))){const e=o.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}for(const i of t){const t=this.$_findByKey(a,e(i)?i[a]:void 0);if(t)t.updateOptions(i,!1);else if(s){const t=this.$_newItem(i);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,i){const s=new Set,r=[];for(const n of t){const t=this.$_findByKey(i,e(n)?n[i]: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 st=class t extends K{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}};st.SHAPES=st._builtinShapes();const rt=(new Date).getTime(),nt="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class ot{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&&ot.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(i,ot.month_days[ot.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&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return h({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let 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()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=g(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=g(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(i(t)){const e=[];let s=-1/0;return t.forEach((r,n)=>{i(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>s&&(e.push([+r[0],+r[1]]),s=r[0]):isNaN(r)||n!==t.length-1||e.push([1/0,+r])}),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=i(t)?[]:{};for(let 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(),ot.log(t,+new Date-i+"ms")}static clamp(t,e,i){return g(e,p(i,t))}static makeIntArray(t,e){const i=new Array(g(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=f(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=f(t-e);return p(i,b-i)}}ot.LOGGING=!1,ot.week_days=["일","월","화","수","목","금","토"],ot.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ot.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]],ot.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const at={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 ht="ko",lt=at[ht]||at[ht="ko"];const ct=(t,i)=>{t&&e(i)&&(lt=at[t.substring(0,2)]=Object.assign(at.ko,at.en,i))};class _t extends K{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 dt=function(t){return t&&"object"==typeof t};class ut extends _t{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach(t=>this._rows.push(this.$_readRow(t)))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():r(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let i=0;i<this._fields.length;i++)e[this._fields[i]]=t[i];else dt(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,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)&&$(lt.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class pt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ut({},s):dt(s)&&i(s.values)&&(r=new ut(s.options,s.values)),this._map[e]=r}}}const gt="%".charCodeAt(0),ft=void 0,mt={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"},yt=function(t){const e=mt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return mt[t]=e,e}return e};function bt(t){return parseFloat(t.toPrecision(12))}function xt(t){return Math.floor(1e6*t)/1e6}const vt=function(t,s,n,o=!0,a=!0,l=!1,c){let _,d;if(o&&(s=-Number.MAX_VALUE,n=Number.MAX_VALUE),i(t))_=[],t.forEach(t=>{if(e(t)&&r(t.color)){const e={fromValue:P(t.fromValue,d?d.toValue:s),toValue:P(t.toValue,n),color:t.color,style:t.style?h({},t.style):ft};e.fromValue<e.toValue&&(_.push(e),d=e)}}),_=_.sort((t,e)=>t.fromValue-e.fromValue).filter(t=>t.toValue>=s&&t.fromValue<n),a&&_.forEach(t=>{t.fromValue=g(t.fromValue,s),t.toValue=p(t.toValue,n)});else if(e(t)&&i(t.colors)&&t.colors.length>0){const e=t.colors,r=i(t.styles)?t.styles:null;if(_=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;s<o[0]&&o.unshift(s),n>o[o.length-1]&&o.push(n);for(let t=0;t<o.length-1;t++)_.push({fromValue:o[t],toValue:o[t+1],color:e[p(t,e.length-1)],style:r?r[p(t,r.length-1)]:ft})}else{let i=P(t.fromValue,s);const o=P(t.toValue,n),a=(o-i)/e.length;let h=0;for(;i<o;)_.push({fromValue:i,toValue:i+=a,color:e[p(h,e.length-1)],style:r?r[p(h,r.length-1)]:ft}),h++}}if(l&&_&&_.length>0){let t=0,e=s;for(;t<_.length;)_[t].fromValue>e&&_.splice(t,0,{fromValue:e,toValue:_[t].fromValue,color:c}),e=_[t].toValue,t++;_[t-1].toValue<n&&_.push({fromValue:_[t-1].toValue,toValue:n,color:c})}return _},wt="shuffle",St="random",Vt="vertical-lr",Ct="vertical-rl",Pt="fill",At="stroke";function kt(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function Lt(t){return null==t?null:String(t)}function Tt(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)===gt?s=1===i.length?NaN:parseFloat(i):(s=parseFloat(i),r=!0),isNaN(s)){if(e)return null;Nt(lt.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 Mt(t,e){return Tt(t,!0)||Tt(e,!1)}const Nt=(t,e)=>{throw new Error(D(t,e))},Et="http://www.w3.org/2000/svg",Bt=function(t){return"function"==typeof t?t:null},Ot=function(t){return"string"==typeof t&&t.length>0},Dt=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):s):s},$t="0".charCodeAt(0),Rt="#".charCodeAt(0),It=",".charCodeAt(0),Ft="s".charCodeAt(0),zt="a".charCodeAt(0);class Ht{static getFormatter(t){let e=Ht.Formatters[t];return e||(Ht.Formatters[t]=e=new Ht(t)),e}static get Default(){return Ht.getFormatter(Ht.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)===$t;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Rt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===$t;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===It){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===Ft){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===zt){i.signDisplay="never";break}}return i.minimumIntegerDigits=g(1,i.minimumIntegerDigits),i}}}Ht.DEFAULT_FORMAT="",Ht.Formatters={};const Gt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],jt=[".","/","-",":"],Yt="Z".charCodeAt(0),Xt="z".charCodeAt(0),Wt="A".charCodeAt(0),Ut="a".charCodeAt(0),Zt="y".charCodeAt(0),qt="M".charCodeAt(0),Kt="m".charCodeAt(0),Qt="W".charCodeAt(0),Jt="w".charCodeAt(0),te="d".charCodeAt(0),ee="H".charCodeAt(0),ie="h".charCodeAt(0),se="S".charCodeAt(0),re="s".charCodeAt(0);class ne{static getFormatter(t){let e=ne.Formatters[t];return e||(ne.Formatters[t]=e=new ne(t)),e}static get Default(){return ne.getFormatter(lt.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||lt.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 Zt:s+=a>2?t.getFullYear():E(t.getFullYear()%100);break;case qt:s+=a>1?E(t.getMonth()+1):t.getMonth()+1;break;case te:s+=a>1?E(t.getDate()):t.getDate();break;case Qt:s+=a>1?E(H.weekOfYear(t,e)+1):H.weekOfMonth(t,e,!0)+1;break;case Jt:s+=a>1?H.long_week_days[t.getDay()]:H.week_days[t.getDay()];break;case ee:s+=a>1?E(t.getHours()):t.getHours();break;case ie: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 Kt:s+=a>1?E(t.getMinutes()):t.getMinutes();break;case re:s+=a>1?E(t.getSeconds()):t.getSeconds();break;case Ut:case Wt:t.getHours()<12?s+=lt.am:s+=lt.pm;break;case se: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(jt.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),Gt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Wt&&e<=Yt||e>=Ut&&e<=Xt)&&$(lt.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||lt.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ne.Formatters={};class oe{static isBright(t){return new oe(t).isBright()}static getContrast(t,e,i){return new oe(t).getContrast(e,i)}static interpolate(t,e,i){const s=new oe(t),r=new oe(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 nt?new oe(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 oe(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}}oe.BLACK="#000",oe.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class ae{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:ae.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(Et,"clipPath");return i.id=e,i.append(t.createElementNS(Et,"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 ae.isElement(t)&&t.namespaceURI===Et}static isSVGClipPathElement(t){return ae.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 he;ae.instanceOf=function(t,e){return ae.isElement(t)&&t.tagName===e.toUpperCase()},ae.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(he||(he={}));const le={name:"RealChart",version:"1.5.0",license:"enterprise",code:null};class ce{static decode(t){const e=ce.CHARS,i=ce.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}}ce.PAD="=",ce.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class _e{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=_e.xor,s=_e.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=_e.xor,s=_e.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=_e.kb,s=_e._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*_e.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=_e._decryptBlock;let s=_e._init(e),r=[],n=ce.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*_e.POW24|n[a+1]*_e.POW16|n[a+2]*_e.POW8|n[a+3],h.right=n[a+4]*_e.POW24|n[a+5]*_e.POW16|n[a+6]*_e.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)}}_e.POW2=Math.pow(2,2),_e.POW3=Math.pow(2,3),_e.POW4=Math.pow(2,4),_e.POW8=Math.pow(2,8),_e.POW16=Math.pow(2,16),_e.POW24=Math.pow(2,24),_e.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 de{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=_e.decrypt(t,"dkdl"+this._getLDKey(_e.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 ue=new Map;function pe(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const ge=function(t){const e=location.hostname;let i;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(i=le.code||window.realChartLic,!i)throw new Error(s)}catch(t){throw new Error(s)}const r=de.decrypt(i);if(!function(t,e){if("RealChart"===t)return!0;const i=pe(e),s=ue.get(t);return!!s&&s.has(i)}(r.name,t)||"RealChart"!==le.name)throw new Error(s);try{const t=r.server.toLowerCase(),i=location.pathname.toLowerCase();if(le.license!=he.Developer&&!de.includedDomains(t,e.toLowerCase(),i))throw new Error(s);const n=r.lic.toLowerCase();if(!Object.values(he).includes(n))throw new Error(s);if(le.license=r.lic,n==he.Evaluation||n==he.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},fe={linear:t=>t,inOutSine:t=>-(_(y*t)-1)/2},me=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 ye{constructor(){this.delay=0,this.duration=ye.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,i=t-this._started-this.delay;let s=p(1,g(0,bt(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,ye.DURATION),this.delay=e||0,this._easing=fe[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}}ye.DURATION=700,ye.SHORT_DURATION=300;class be extends ye{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 xe=function(t){return new be(t).start()},ve=function(t){return isNaN(t)?0:t};class we{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=>{n(t)||r(t)?this._path.push(t):this._path.push(t.x,t.y)}),this}move(t,e){return n(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return n(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return n(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,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 n(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(n(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",ve(t[e]),ve(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",ve(t[e].x),ve(t[e].y));return this}polygon(...t){return n(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,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 Se="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":Se};class Ce extends K{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=>{},ge(e),!t&&ae.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,i||Ce.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),ae.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(){ae.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(Pe.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(Et,"clipPath")).forEach(t=>t.remove())}clearTemporaryDefs(){this.$_clearDefs(Pe.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 Me(this.doc(),t,e,i,s,r,r))}clipCircle(){return this.addClip(new Be(this.doc()))}clipDonut(){return this.addClip(new Oe(this.doc()))}clipPath(){return this.addClip(new Ee(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(r(t))for(const e of Array.from(this._defs.children))if(ae.isElement(e)&&e.id===t){t=e;break}ae.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,Pe.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||$(lt.invalidOuterDiv,e),t=this._container.ownerDocument;const r=this._dom=t.createElement("div");h(r.style,Ve),r.className=i,this._container.appendChild(r);const n=this._svg=t.createElementNS(Et,"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"+le.version,n.appendChild(o);const a=this._defs=t.createElementNS(Et,"defs");this._initDefs(t,a),n.appendChild(a),r.appendChild(n),this._root=new Le(this),n.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),r.appendChild(this._htmlRoot),h(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),r.appendChild(this._tester),nt&&(this._canvas=t.createElement("canvas"))}_initDefs(t,e){let i=t.createElementNS(Et,"filter");i.setAttribute("id",Ce.SHADOW_FILTER);const s=t.createElementNS(Et,"feGaussianBlur");s.setAttribute("stdDeviation","1.5"),s.setAttribute("in","SourceAlpha"),i.appendChild(s);const r=t.createElementNS(Et,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),i.appendChild(r);const n=t.createElementNS(Et,"feFlood");n.setAttribute("flood-color","#000"),i.appendChild(n);const o=t.createElementNS(Et,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),i.appendChild(o);const a=t.createElementNS(Et,"feMerge"),h=t.createElementNS(Et,"feMergeNode"),l=t.createElementNS(Et,"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{ot.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)),h(this._htmlRoot.style,{left:T(e.left-t.left),top:T(e.top-t.top)});const n=this._container.firstElementChild;if(n.removeAttribute("style"),h(n.style,Ve),i>0&&s>0){this._doRenderBackground(n,this._root,i,s);const t=this._padding=ae.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(),ot.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||Se),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)||Se)}}Ce.CLASS_NAME="rct-control",Ce.SHADOW_FILTER="rr-chart-shadow-filter",Ce._animatable=!0;class Pe extends K{constructor(t,e,i=ft){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(Et,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(Et,e);return this._dom.appendChild(i),i}insertElement(t,e,i){const s=t.createElementNS(Et,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 nt&&(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 nt&&(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 be||!!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=ot.isValidNum(t)?t:this._tx,e=ot.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=ot.isValidNum(t)?t:this._tx,e=ot.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=ot.isValidNum(t)?t:this._tx,e=ot.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&&ot.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ot.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(yt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(yt(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(yt(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(r(t))t&&this._dom.classList.add(t);else if(e(t)){const e=this.dom.style;for(let i in t)e.setProperty(yt(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){r(t)?(this._resetClass(),t&&this.addClass(t)):e(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){r(t)?t&&this.addClass(t):e(t)&&this.internalSetStyles(t)}addStyleOrClass(t){r(t)?t&&this.addClass(t):e(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=xe({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=g(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=xe({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=g(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(Pe.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 Pe.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=[];(ot.isValidNum(e)||ot.isValidNum(i))&&(e=e||0,i=i||0,s.push("translate("+e+","+i+")")),this._rotation&&s.push("rotate("+this._rotation+" "+ot.pick(this._originX,t.getAttribute("x"),0)+" "+ot.pick(this._originY,t.getAttribute("y")||0)+")"),ot.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")");const r=ot.getNumber(this._scaleX,1),n=ot.getNumber(this._scaleY,1);return 1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length?s.join(" "):""}}Pe.DEBUGGING=!1,Pe.TESTING=!1,Pe.ASSET_KEY="_asset_",Pe.CLIP_KEY="_clip_",Pe.TEMP_KEY="_temp_";class Ae extends K{constructor(t,e,i=!1){super(),this._control=e,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(Et,"svg"),ae.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 ae.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 ke extends Pe{constructor(t,e){super(t,e,"g")}}class Le extends Pe{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Te extends Pe{constructor(t){super(t,ft,"clipPath");const e=this._id=ot.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Me extends Te{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Pe(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 Ne extends Pe{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=r(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Ee extends Te{constructor(t){super(t),this._path=new Ne(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class Be extends Te{constructor(t){super(t),this.add(this._circle=new Pe(t,null,"circle"))}setCircle(t,e,i){this._circle.setAttrs({cx:t,cy:e,r:i})}}class Oe extends Te{constructor(t){super(t),this.add(this._donut=new Ne(t))}setDonut(t,e,i,s){this._donut.setPath((new we).donut(t,e,i,s).end())}}class De{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 $e,Re,Ie;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}($e||($e={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Re||(Re={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ie||(Ie={}));class Fe extends Pe{constructor(t,e=void 0){super(t,e,"text"),this._layout=Re.TOP,this._overflow=Ie.WRAP,this._dirty=!0,this._text="",this.anchor=$e.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),i=this.getAscent(isNaN(t)?e.height:t);let s;switch(this._layout){case Re.MIDDLE:s=Math.floor(i/2);break;case Re.BOTTOM:s=0;break;default:s=Math.ceil(i)}this.y=s}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=g(0,t),(e=p(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(oe.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 ze="$_TH",He="$_TW";class Ge{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]?Ht.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]?ne.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),ft),0===this._literals[2].length&&(this._literals[2]=ft)}else this._literals.push(r,n,ft,ft);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class je extends Ge{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 Ye extends je{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 Xe={t:class extends je{tag(){return"</t>"}},b:class extends je{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-bold")}},i:class extends je{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-italic")}},a:Ye};class We{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 Ge).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 Xe){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 Xe[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 Ue=/<br.*?>|\r\n|\n/;class Ze{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=_===Vt||_===Ct;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[He]=o.width,i[ze]=o.height,d?(h=g(h,i[He]),_+=i[ze]):(h+=i[He],_=g(_,i[ze])),u||(u=i),e instanceof Ye){const s=n.createElementNS(Et,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}c.push(u),i[ze]=_*o,i[He]=h*o,l.push(0==e?i[He]/2:i[He])}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[He]-t.getAscent(e[He]))+t.getAscent(a[i][He])):r=e[ze]-t.getAscent(e[ze])+t.getAscent(a[i][ze]),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[He]=o.width,r[ze]=e[ze]=o.height,c[0]=r}switch(_){case Vt:c[i].setAttribute("dx",String(s)),c[i].setAttribute("y","0");break;case Ct: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[He];if(e)s.setAttribute("dx",String(_===Ct?i-r/2:r/2));else switch(_){case Vt:s.setAttribute("x",String((i-r)/-2));break;case Ct:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(a[0][ze])}}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[He]=o.width,i[ze]=o.height,p&&(i.textContent=" ",i[ze]*=.6,p=!1),h+=i[He],d=g(d,i[ze]),u||(u=i),e instanceof Ye){const s=n.createElementNS(Et,"a");s.setAttribute("href",e.url),s.setAttribute("target",e.target),s.appendChild(i),t.appendDom(s)}}_.push(u),i[ze]=d*o,i[He]=h*o,c=g(h,c),l.push(0==e?i[He]/2:i[He])}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[ze]-t.getAscent(e[ze])+t.getAscent(a[i][ze]))),e=a[i]);t.layoutText(a[0][ze])}}layout(t,e,i,s,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=$e.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=$e.END,a=n.height-r.bottom;break;default:t.anchor=$e.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=$e.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=$e.END,o=i-r.right;break;default:t.anchor=$e.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(Ue);for(let t of i)e.push((new We).parse(t))}}}class qe{constructor(t){this.source=t}hasDef(){return!0}}class Ke extends qe{_setStops(t,e){e.setAttribute("id",this.source.id);const s=this.source.color,r=null==this.source.opacity?1:this.source.opacity,n=i(s)?[...s]:[s,"white"],o=i(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(Et,"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 Qe extends Ke{getEelement(t,e){const i=t.createElementNS(Et,"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}}Qe.TYPE="lineargradient";class Je extends Ke{getEelement(t,e){const i=t.createElementNS(Et,"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}}Je.TYPE="radialgradient";class ti extends qe{prepare(){}getEelement(t,i){const s=t.createElementNS(Et,"pattern"),n=t.createElementNS(Et,"path");let o,a,l,c,_=!1;if(s.setAttribute("id",i.id),s.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+i.pattern>=0){const t=ti.STOCK[+i.pattern%ti.STOCK.length];o=t.path,a=t.style,_=!t.fill,l=t.width||20,c=t.height||20}else r(i.pattern)&&(o=i.pattern,l=i.width||i.height||20,c=i.height||i.width||20);s.setAttribute("width",String(l)),s.setAttribute("height",String(c)),n.setAttribute("d",o),a&&h(n.style,a),i.style&&h(n.style,i.style),_&&(n.style.fill="none");let d=i.backgroundStyle;if(r(d)||e(d)){const e=t.createElementNS(Et,"rect");s.append(e),e.style.fill=r(d)?d:d.fill,e.setAttribute("width",String(l)),e.setAttribute("height",String(c))}return s.append(n),s}}ti.TYPE="pattern",ti.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 ei extends qe{prepare(){const t=this.source;this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&ot.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(ot.randomLike(t)*e.length)]:e[t%e.length]}hasDef(){return!1}getEelement(t,e){this._colors=i(e.colors)?e.colors:[]}}ei.TYPE="colors";class ii extends qe{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach(e=>{if(r(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 r(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ii.SIZE,height:e.height||e.width||ii.SIZE})}}ii.TYPE="images",ii.SIZE=20;class si{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))return t.forEach(t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}),this._items.map(t=>t.source);if(e(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(Pe.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(e(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ti.TYPE:i(t.colors)?e=ei.TYPE:i(t.images)&&(e=ii.TYPE)),e)switch(e.toLowerCase()){case Qe.TYPE:return new Qe(t);case Je.TYPE:return new Je(t);case ti.TYPE:return new ti(t);case ei.TYPE:return new ei(t);case ii.TYPE:return new ii(t)}}}}let ri=0;const ni=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},oi=["__proto__","constructor","prototype"],ai=function(s,r){const n=e(s)?s:{};for(const s in r)if(t.call(r,s)&&!oi.includes(s)){const t=r[s];i(t)?n[s]=t.slice(0):e(t)?t._obj instanceof ut?n[s]=t:ot.isDate(t)?n[s]=new Date(t):n[s]=ai(n[s],t):n[s]=t}return n};class hi extends it{constructor(t){super(),this.chart=t,ri++}_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 Dt(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,i=!0){var s;const r=this.visible;if(e(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)),i&&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(e,i=!0){var s;const r=this.visible,n=this._findChild(e);let o=!1;return n?(n.clearOptions(!0,!1),o=!0):t.call(this._op,e)&&(super.removeOption(e,!1),o=!0),this.visible!==r&&(null===(s=this.chart)||void 0===s||s._visibleChanged(this)),o&&i&&this._optionChanged(e),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(e,i,s=!0){if(!e)return this;let r=this._op.style,n=!1;return null!==i&&""!==i||(i=void 0),void 0===i?r&&t.call(r,e)&&(delete r[e],n=!0):r&&r[e]==i||(r||(r=this._style=this._op.style={}),r[e]=String(i),n=!0),n&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,i=!1,s=!0){let r=!1,n=this._op.style;if(i&&n&&(delete this._op.style,r=!0,n=this._style=void 0),e(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(s,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(t.call(r,n)){let t=r[n];const o=this._findChild(n);this._doLoadProp(n,t)?s[n]=t:o?o._load(t):i(t)?s[n]=t.slice(0):e(t)?t._obj instanceof ut?s[n]=t._obj:ot.isDate(t)?s[n]=new Date(t):s[n]=h({},t):s[n]=t}}_doSetSimple(t,e){return o(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`]=Tt(this[i]=s,!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}hi.REFRESHED="refreshed",hi.defaults=ni(it.defaults,{visible:!0});class li{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 ci extends hi{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){const e=ot.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?Ht.getFormatter(t):null)}_setText(t){if(t!==this._text&&this.prepareRich(this._text=t),this._richTextImpl){const t=this.num("lineHeight");this._richTextImpl.lineHeight=ot.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 Ze),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return r(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(ot.isValidNum(t)){const s=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(s&&(t=s.toNum(t)),n=ot.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 n=r(t)?t:this._getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(n=o+n),a&&(n+=a),n}}ci.defaults=ni(hi.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class _i extends ci{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 ii&&(this._images=i)}this._root=this.prop("iconRoot")||""}getIconUrl(t){const e=this.prop("icon")||t;return r(e)?this.getUrl(e):null}getUrl(t){if(t){r(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 ii?i.getImage(r):s}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}_i.defaults=ni(ci.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class di extends hi{}const ui={};class pi extends hi{static register(...t){t.forEach(t=>{ui[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(hi.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(r(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){}}pi.defaults=ni(hi.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class gi extends li{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 pi)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t,s){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach((t,e)=>{n.push(this.$_loadItem(r,t,e,s?this.owner:void 0))}):e(t)&&n.push(this.$_loadItem(r,t,0,s?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")):ft})}$_loadItem(t,e,i,s){let n=e.type;n||(n=r(e.imageUrl)?"image":r(e.shape)?"shape":"text");const o=t._getAnnotationType(n);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 fi extends ye{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 mi extends hi{}mi.defaults=ni(hi.defaults,{minWidth:50});class yi extends hi{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=this._addChild("flag",new mi(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 ne.getFormatter(this.prop("timeFormat")).toStr(new Date(i),this.chart.startOfWeek)}catch{return ne.getFormatter(yi.defaults.timeFormat).toStr(new Date(i),this.chart.startOfWeek)}else try{return Ht.getFormatter(this.prop("numberFormat")).toStr(i)}catch{return Ht.getFormatter(yi.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 s(e)?(this._op.visible=!0,this._op.onChange=e,!0):super._doSetSimple(t,e)}}yi.defaults=ni(hi.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const bi={};class xi extends hi{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class vi extends xi{_isVisible(){const t=this.prop("visible");return null==t?this.axis._isX:t}_doSetSimple(t,e){return r(e)?(this._op.visible=!0,this._op.style={stroke:e},!0):super._doSetSimple(t,e)}}vi.defaults=ni(xi.defaults,{visible:void 0});class wi extends xi{getGap(){return this._gap}getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return nt?"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:wi.defaults.textOrientation}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return r(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)?wi.defaults.gap:i}}wi.defaults=ni(xi.defaults,{align:"middle",offset:0,gap:5,textOrientation:"upright"});class Si extends xi{_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}Si.defaults=ni(xi.defaults,{position:"end",gap:2});class Vi extends xi{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 r(e)?(this._op.colors=[e,null],!0):i(e)?(this._op.colors=e,!0):super._doSetSimple(t,e)}}class Ci extends xi{_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}}Ci.defaults=ni(xi.defaults,{visible:void 0,depthVisible:void 0});class Pi extends _i{getText(){const t=this.prop("text");return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}Pi.defaults=ni(_i.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Ai extends xi{_doInit(t){this._label=this._addChild("label",new Pi(this.axis.chart))}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Ai.defaults=ni(xi.defaults,{front:!1,zindex:0});class ki extends Ai{}class Li extends Ai{}class Ti extends xi{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 ot.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:Ti.defaults.length,this._gap=this.num("gap")}}Ti.defaults=ni(xi.defaults,{visible:!1,length:7,gap:3});class Mi extends xi{_getLength(){return this._length}_getCount(){return this._count}_doSetSimple(t,e){return ot.canNumber(e)?(this._op.length=+e,!0):super._doSetSimple(t,e)}_doPrepareRender(t){super._doPrepareRender(t),this._length=this.num("length"),this._count=g(1,l(this.num("count")))}}Mi.defaults=ni(xi.defaults,{visible:!1,count:4,length:4});class Ni extends xi{}Ni.defaults=ni(xi.defaults,{visible:!1});class Ei extends _i{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,i){const s=this._op,r=t.index;if(s.styleCallback){const i=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(e(i))return i}return 1==i?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==i-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}}Ei.defaults=ni(_i.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Bi extends xi{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"))}}Bi.defaults=ni(xi.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class Oi{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?ot.clamp(t,this.min,this.max):ot.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 Di extends vi{}class $i extends hi{static register(...t){t.forEach(t=>{bi[t.type]=t,t.subtype&&(bi[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 wi(this)),this._unitLabel=this._addChild("unitLabel",new Si(this)),this._line=this._addChild("line",new vi(this)),this._sectorLine=this._addChild("sectorLine",new Di(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 yi(this)),this._scrollBar=this._addChild("scrollBar",new Bi(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=p(...i),e._yMax=g(...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+ot.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[g(t,this._min),p(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Oi(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 fi(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(e){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach(t=>{let e;e="range"===t.type?new Li(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ki(s):new Li(s),e.init(),e._load(t),r.push(e)}))};super._doApply(e),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=g(0,p(360,this.num("totalAngle"))),t.call(this._op,"guide")?n(this.prop("guide")):t.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?bt(p(...t)||0):NaN,max:t.length>0?bt(g(...t)||0):NaN}}}$i.defaults=ni(hi.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 Ri extends li{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(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 r(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,o=e?s.xAxis:s.yAxis;let a;if(n(o)&&o>=0&&o<i.length?a=i.find(t=>t._index===o):r(o)&&(a=i.find(t=>t.prop("name")===o)),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,s){var r;let n=t._getAxisType(e.type);if(!n){let o;if(i(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.prop("xAxis")===e.name){o=void 0;break}if(t.prop("xAxis")===s){o=void 0;break}if(N(t.prop("xAxis"))&&0===s){o=void 0;break}}}}else o=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class Ii extends hi{_doPrepareRender(t){}}const Fi={},zi={};class Hi extends Ii{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")}}Hi.defaults=ni(Ii.defaults,{size:"100%"});class Gi extends hi{constructor(t){super(t.chart)}}class ji extends Hi{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach(t=>{Fi[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}}ji.defaults=ni(Hi.defaults,{duration:500});class Yi extends Hi{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach(t=>{zi[t.type]=t,zi[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(e){super._doApply(e),t.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,s){const r=this._gaugesType();i(s)?s.forEach((e,i)=>this.$_add(ji._loadGauge(t,e,r))):e(s)&&this.$_add(ji._loadGauge(t,s,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)}}Yi.defaults=ni(Hi.defaults,{minValue:0});class Xi extends li{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 ji)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t){const s=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach((t,e)=>{r.push(this.$_loadItem(s,t,e))}):e(t)&&r.push(this.$_loadItem(s,t,0)),r.forEach(t=>{if(t.name&&(n[t.name]=t),t instanceof Yi)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)}),s._op.gauge=this._gauges.map(t=>t.options)}prepareRender(){this._visibles=this._items.filter(t=>t.visible),this._visibles.forEach(t=>t._prepareRender())}$_loadItem(t,e,s){if(0===Object.keys(Fi).length&&0===Object.keys(zi).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class Wi extends ji{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 g(this.prop("minValue"),p(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")}}}Wi.defaults=ni(ji.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class Ui extends hi{constructor(t){super(t.chart),this.scale=t}}Ui.defaults=ni(hi.defaults,{reversed:!1,length:7});class Zi extends _i{getText(t){return ot.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class qi extends hi{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._line=this._addChild("line",new hi(e)),this._tick=this._addChild("tick",new Ui(this)),this._label=this._addChild("label",new Zi(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(p(e,i),g(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(g(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=p(t,e),this._max=g(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=p(...t)),isNaN(s)&&(s=g(...t)),this._min=p(i,s),this._max=g(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(bt(e));for(let e=1;e<t;e++)n.push(bt(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(bt(l=i));;){if(l+=o,l>=s){r.push(bt(s));break}r.push(bt(l))}return r}}qi.defaults=ni(hi.defaults,{position:"default",stepPixels:48,gap:8});class Ki extends hi{}Ki.defaults=ni(hi.defaults,{visible:!1});class Qi extends hi{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;this._rangeLabel=this._addChild("rangeLabel",new Ki(e)),this._tickLabel=this._addChild("tickLabel",new hi(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:Qi.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=vt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Qi.defaults=ni(hi.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ji extends ci{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ji.defaults=ni(ci.defaults,{animatable:!0});class ts extends Ji{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")}}ts.defaults=ni(Ji.defaults,{offsetX:0,offsetY:0});class es{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(is.DEF_CENTER),this.setCenterY(is.DEF_CENTER),this.setRadius(is.DEF_RADIUS),this.setInnerRadius(is.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Tt(A(t,is.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Tt(A(t,is.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Tt(A(t,is.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Tt(A(t,is.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Tt(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=p(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=g(0,p(360,P(e,360)));this._startRad=x+v*i,this._handRad=v*i,this._sweepRad=v*s}}class is extends Wi{_doInit(t){super._doInit(t),this._props=new es}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 ts(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 es)}_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"))}}is.DEF_CENTER="50%",is.DEF_RADIUS="40%",is.DEF_INNER="80%",is.defaults=ni(Wi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class ss extends Yi{_doInit(t){this._props=new es,this._label=this._addChild("label",new ts(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"))}}ss.defaults=ni(Yi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let rs=class extends hi{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))}};rs.defaults=ni(hi.defaults,{visible:void 0});class ns extends ci{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this.prop("text")||this.chart._body.emptyView.prop("text")||ns.DEF_TEXT}}function os(t,e){return e._vlen>0?e._vlen:g(0,P(t.rd,0)-P(t.rdInner,0))}function as(t,e,i){const s=P(t.rdInner,0),r=os(t,e);return r<=0?s:s+e.getPos(r,i)}function hs(t,e,i,s){const r=P(t.rdInner,0),n=os(t,e);return n<=0?r:r+e.getPos(n,i)*s}ns.DEF_TEXT="표시할 데이터가 없습니다.",ns.defaults=ni(hi.defaults,{visible:void 0});class ls extends _i{getDefaultIconPos(){return"left"}}class cs extends hi{}cs.defaults=ni(hi.defaults,{visible:!1});class _s extends hi{_doInit(t){this._line=this._addChild("line",new cs(this.chart)),this._endLine=this._addChild("endLine",new cs(this.chart)),this._gridLine=this._addChild("gridLine",new cs(this.chart))}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}_s.defaults=ni(hi.defaults,{});class ds extends hi{_doInit(t){this._xSide=this._addChild("xSide",new _s(this.chart)),this._ySide=this._addChild("ySide",new _s(this.chart)),this._orgLine=this._addChild("orgLine",new cs(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 n(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._angle=p(60,g(30,this.num("angle")))}prop(t){return"angle"===t?this._angle:super.prop(t)}}ds.defaults=ni(hi.defaults,{visible:!1,length:32,angle:32});class us extends hi{constructor(t){super(t),this._annotations=new gi(this)}_doInit(t){this._depth=this._addChild("depth",new ds(this.chart)),this._image=this._addChild("image",new di(null)),this._emptyView=this._addChild("emptyView",new ns(this.chart)),this._innerText=this._addChild("innerText",new ls(this.chart)),this._zoomButton=this._addChild("zoomButton",new rs(this))}anchorByName(t){var e;const i=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return i instanceof Hi&&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=c(_(s*v)*i),n=c(d(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,p(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?p(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,p(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(e){const i=this,s=function(t){t!==i._anns&&(i._anns=t,i._annotations.load(t,!0))};super._doApply(e),this._setDims(e,"radius","innerRadius","centerX","centerY"),t.call(this._op,"annotation")?s(this.prop("annotation")):t.call(this._op,"annotations")&&s(this._op.annotations)}_doPrepareRender(t){this._annotations.prepareRender(),this._innerText._prepareRender()}}us.defaults=ni(hi.defaults,{circular:!0,zoomType:"none",radius:"45%",innerRadius:0,centerX:"50%",centerY:"50%"});class ps extends hi{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)}}ps.defaults=ni(hi.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class gs extends hi{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class fs extends Ii{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")||fs.defaults.location,this._items=this._getLegendSources().map(t=>new gs(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(ot.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 ms;fs.defaults=ni(Ii.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 ys=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),bs=.001;class xs{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?g(1,p(r,.9*a)):p(.15*a,12),l=Math.atan2(o,n),c=y/6,u=i+h*_(l+Math.PI-c),f=s+h*d(l+Math.PI-c),m=i+h*_(l+Math.PI+c),b=s+h*d(l+Math.PI+c);return{body:["M",t,e,"L",(u+m)/2,(f+b)/2],head:["M",u,f,"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=p(f(s)/2,i/2,r),n=p(f(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=p(f(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=p(f(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=p(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<bs}static arc(t,e,i,s,r,n,o,a=!1){const h=p(b,f(n-r)),l=this.isCircled(h),c=h>y?1:0,u=o?1:0,g=_(r),m=d(r),x=_(n-=l?u?bs:-.001:0),v=d(n),w=[];return w.push("M",t+i*g,e+s*m,"A",i,s,0,c,u,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=p(b,f(o-n)),l=this.isCircled(h),c=h>y?1:0,u=a?1:0,g=_(n),m=d(n),x=_(o-=l?u?bs:-.001:0),v=d(o),w=i*r,S=s*r,V=[];return V.push("M",t+i*g,e+s*m,"A",i,s,0,c,u,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-u,t+w*g,e+S*m),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,u,c,n,o),w.push("L",n,o+r),w.push("A",i,s,0,u,1-c,t,e+r),w.push("Z")}const c=a?1:0;let u,g=p(b,f(o-n));const m=this.isCircled(g);let x=(n%b+b)%b,v=(o%b+b)%b;const w=[];let S,V,C,P;if(!m&&(c&&x<=y&&v>=0&&v<x||!c&&v<=y&&x>=0&&x<v))u=0,c?(S=t+i*_(n),V=e+s*d(n),C=t+i*_(y),P=e+s*d(y),l(S,V,C,P),h&&(h.x1=S,h.y1=V),S=t+i*_(0),V=e+s*d(0),C=t+i*_(o),P=e+s*d(o),l(S,V,C,P),h&&(h.x2=C,h.y2=P)):(S=t+i*_(n),V=e+s*d(n),C=t+i*_(0),P=e+s*d(0),l(S,V,C,P),h&&(h.x1=S,h.y1=V),S=t+i*_(y),V=e+s*d(y),C=t+i*_(o),P=e+s*d(o),l(S,V,C,P),h&&(h.x2=C,h.y2=P));else{S=t+i*_(n),V=e+s*d(n),C=t+i*_(o-=m?c?bs:-.001:0),P=e+s*d(o),c?(x=m||x<=b&&!(v>=x&&v<b)?0:x,v=m||v>y&&!(x<=v&&x>y)?y:v):(x=m||x>y&&!(v<=x&&v>y)?y:x,v=m||v<b&&!(x>=v&&x<b)?0:v);const r=t+i*_(x),a=e+s*d(x),p=t+i*_(v-=m?c?bs:-.001:0),g=e+s*d(v);u=f(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=p(b,f(o-n)),c=this.isCircled(l),u=a?1:0,g=t+i*_(n),m=e+s*d(n),x=t+i*_(o-=c?u?bs:-.001:0),v=e+s*d(o),w=l>y?1:0,S=[];return S.push("M",g,m,"A",i,s,0,w,u,x,v),S.push(c?"M":"L",x,v+r),S.push("A",i,s,0,w,1-u,g,m+r),h&&(h.x1=g,h.y1=m,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*d(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*_(r),o+h*d(r));for(let t=0;t<5;t++)g.push("L",n+a*_(r),o+h*d(r),"L",n+l*_(r+p),o+c*d(r+p)),r+=u;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=ms[e](0,0,g(2*i,0),g(2*s,0));break;default:r=ms.circle(i,s,g(p(i,s),0))}t.setPath(r)}}ms=xs,xs._drawers=Object.assign({circle:t=>ms.circle(0,0,t),none:t=>[]},ms._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class vs extends Pe{static create(t,e,i,s,r,n,o=0){return new vs(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=ft,i=ft){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 ws extends Ne{constructor(t,e){super(t,e)}setBox(t,e,i,s){return this.setPath(xs.box(t,e,i,s)),this}}const Ss="head",Vs="far",Cs="inside",Ps="none",As="near",ks="displayAll",Ls="largestFirst",Ts="hidden",Ms="line",Ns="area",Es="circlebar",Bs="treemap",Os="heatmap",Ds="vector",$s="wordcloud",Rs="pictogram",Is="pictorialbar",Fs="pictorial",zs="racebar",Hs="raceline";let Gs=0;const js="_deleted",Ys="_drop",Xs="_save";class Ws{static getSum(t){let e=0;for(const i of t)isNaN(i.y)||(e+=i.y);return e}constructor(t){this.pid=Gs++,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 s=this.source;null==s?this.isNull=!0:i(s)?0===s.length?this.isNull=!0:this._readArray(t,s):e(s)?(this._readObject(t,s),(i(s.drillDown)||e(s.drillDown))&&(this.drillDown=s.drillDown)):this._readSingle(s),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[js]=!0}_isDeleted(){return this[js]}_setDrop(t){this[Ys]=t}_getDrop(){return this[Ys]}_setSave(t){this[Xs]=t}_getSave(){return this[Xs]}updateValues(t,s){if(this._prev=this.copy(),e(s)?this.source=Object.assign(e(this.source)?this.source:{},s):i(s)?this.source=s.slice(0):this.source=s,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=ft}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return h(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,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 Us{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,i){function s(t,i,s){return e(t)?t.pid===i:t===s}return this._points.find(e=>s(t,e.pid,e.xValue)&&(void 0===i||s(i,e.pid,e.yValue)))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach(t=>{const 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[js])}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 Zs extends Ws{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return h(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 qs extends Ws{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 h(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[Dt(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 Ks extends Ti{getPosition(){const t=this.prop("position");return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Ks.defaults=ni(Ti.defaults,{step:1});class Qs extends Ei{getTick(t,e){if(null!=e){const t=this.axis,s=e.levels;if((null==s?void 0:s.length)&&t.hasCategoryTree())return s[0];const r=this._getText(e,e,!1,!1),n=r.lastIndexOf(this.sep);return i(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}}Qs.defaults=ni(Ei.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class Js extends Ci{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 tr extends $i{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")||tr.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 tr.categoryTreeDefaults;if(!e(t)||!1===t.visible)return null;const i={...tr.categoryTreeDefaults,...t};return e(t.divider)&&e(tr.categoryTreeDefaults.divider)&&(i.divider={...tr.categoryTreeDefaults.divider,...t.divider}),e(t.band)&&(i.band={visible:!0,...t.band}),i}$_normalizeDivider(t){const e=tr.categoryTreeDividerDefaults;return!1===t?{...e,visible:!1}:!0===t||null==t?{...e}:{...e,...t}}$_isDividerOn(t){var i;const s=this._categoryTreeOp,r=null===(i=null==s?void 0:s.levels)||void 0===i?void 0:i[t],n=null==r?void 0:r.divider;if(void 0!==n){if(!1===n)return!1;if(!0===n)return!0;if(e(n)&&void 0!==n.visible)return!1!==n.visible}return!1!==this.$_normalizeDivider(null==s?void 0:s.divider).visible}$_dividerProp(t,i){var s;const r=this._categoryTreeOp,n=null===(s=null==r?void 0:r.levels)||void 0===s?void 0:s[t];return e(null==n?void 0:n.divider)&&void 0!==n.divider[i]?!1!==n.divider[i]:!1===(null==r?void 0:r.divider)?this.$_isDividerOn(t):e(null==r?void 0:r.divider)&&void 0!==r.divider[i]?!1!==r.divider[i]: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":n(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 i=t.divider;return!1!==i&&(!0===i||null==i||(!e(i)||!1!==i.visible&&!1!==i.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(r(t))return t;if(e(t)&&Object.keys(t).length>0)return t;const i=this.line._style;return r(i)||e(i)&&Object.keys(i).length>0?i:"rct-axis-tree-divider"}$_dividerStyleOf(t){if(e(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||!!e(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 s=e(null==t?void 0:t.band)?t.band.colors:null;return i(s)&&s.length>0?s:["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 Oi(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new Js(this)}_createTickModel(){return new Ks(this)}_createLabel(){return new Qs(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=ot.makeIntArray(0,this._categories.length):super.collectValues(),this.$_resolveNumericScale()}getStartAngle(){let t=super.getStartAngle(),e=+this.prop("startOffset");return e>0&&(t-=p(e,1)*this.getWeight(0)*b/this._catLen),t}_doPrepareRender(){this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=Dt(this.prop("minPadding"),this.prop("padding"),0),this._maxPad=Dt(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],f(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(n(t))return t;const e=this._map[t];return void 0!==e?e:NaN}getXLabel(t){var e,s;const r=this._categories[t];if(!r)return t;const n=r.levels,o=this.prop("categoryField");return(null==n?void 0:n.length)&&i(o)&&o.length>1?this.hasCategoryTree()?n[0]:n[n.length-1]:null!==(s=null!==(e=r.t)&&void 0!==e?e:r.c)&&void 0!==s?s: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=p(0,e),i=g(0,i)),this.$_applyRangeOptions(e,i)}$_hasExplicitCategories(){const t=this.prop("categories");return i(t)&&t.length>0}$_hasDefinedTickRange(){const t=this._op;return n(t.minValue)&&!isNaN(t.minValue)&&n(t.maxValue)&&!isNaN(t.maxValue)}$_applyRangeOptions(t,e){const i=this._op,s=i.minValue,r=i.maxValue,o=n(s)&&!isNaN(s),a=n(r)&&!isNaN(r);return o&&a?this._numericScale?{min:p(s,t),max:g(r,e)}:{min:s,max:r}:(o&&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=g(i,f(e))}return i>g(2*e,tr.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>tr.NUMERIC_SCALE_SPAN_THRESHOLD&&i>n*tr.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:p(0,t.min),i=this._isX?t.max:g(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=xt(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=g(t,r),h=p(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[g(p(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(!i(e)||e.length<2||null==t)return;const s=this.getCategorySeparator(),r=t.split(s);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 s,n;const o=this._op,a=o.categories,h=this._categories=[];let l=this._weights;if(l.clear(),i(a)&&a.length>0)this._len=0,a.forEach(t=>{const i=null==t?1:g(P(t.weight,1),0),s=t&&t.icon;let r,n;null==t?n=r=null:e(t)?(r=A(t.name,t.label),n=A(t.label,t.name)):n=r=String(t),this._len+=i,this.$_pushCategory(r,n,s),l.set(l.size,i)});else{const e=this.chart.seriesByName(o.categorySeries),a=this.chart.seriesByName(o.weightSeries)||e,h=o.weightField,c=null==a?void 0:a.data,_=o.weightByFrequency;e&&(t=[e]);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&&i(c)&&c.length>0){const t=a.getPoints();let e=null;for(let i=0,o=c.length;i<o;i++){const o=c[i],a=t.get(i);if(!a)continue;const u=a.x,p=g(null!==(s=o[h])&&void 0!==s?s:1,0);if(r(u)){const t=d.get(u);if(void 0===t){e=null;continue}if(!l.has(t)){l.set(t,p),e=u,this._len+=p;continue}_&&e===u&&(l.set(t,g((null!==(n=l.get(t))&&void 0!==n?n:0)+p,0)),this._len+=p)}else Number.isInteger(u)?(l.has(u)||(l.set(u,p),this._len+=p),e=null):e=null}}else if(i(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)})}}tr.type="category",tr.categoryTreeDividerDefaults={visible:!0,edge:!0,between:!0,below:!0},tr.categoryTreeDefaults={visible:!0,divider:{...tr.categoryTreeDividerDefaults},band:!1},tr.defaults=ni($i.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+",categoryTree:!1}),tr.NUMERIC_SCALE_SPAN_THRESHOLD=1e3,tr.NUMERIC_SCALE_SPAN_FACTOR=10;class er extends hi{}er.defaults=ni(hi.defaults,{visible:!1});class ir extends _i{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:ir.OFFSET:e}getOffsetY(t){const e=this.prop("offsetY");return isNaN(e)?"middle"===t?0:ir.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=p(1,g(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)}}ir.OFFSET=4,ir.defaults=ni(_i.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class sr extends hi{getRadius(){return g(0,this.num("radius"))}}sr.defaults=ni(hi.defaults,{visible:!1,radius:4});class rr extends hi{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 er(this.chart)),this._fixedArea=this._addChild("fixedArea",new er(this.chart)),this._label=this._addChild("label",new ir(this.chart)),this._marker=this._addChild("marker",new sr(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")||rr.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=g(0,this.num("forward")),this._backward=g(0,this.num("backward")),this._formatter=Ht.getFormatter(this.prop("numberFormat")||rr.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(f(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++)f(i[t][r])>f(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=g(1,p(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 nr;rr.defaults=ni(hi.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,forward:0,backward:0,maExtrapolation:"none",numberFormat:"0.####"});const or={},ar={},hr=/\$\{detail\}/g;class lr extends hi{}lr.defaults=ni(hi.defaults,{visible:!1});class cr extends _i{_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 ot.isValidNum(t)?this._getText(null,t,f(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 g(-90,p(90,this.num("rotation")))}_isVisible(){return this.prop("visible")||s(this.prop("visibleCallback"))}_doSetSimple(t,e){return s(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}}nr=cr,cr.OFFSET=4,cr.defaults=ni(_i.defaults,{visible:void 0,position:"default",offset:nr.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class _r extends _i{_doInit(t){super._doInit(t),this._args={}}getText(t){return ot.isValidNum(t)?this._getText(null,t,f(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(s(i)){const e=i(t);if(r(e))return e}return this.getText(e)}getRotation(){return g(-90,p(90,this.num("rotation")))}getStackLabelStyle(t){const e=this.prop("styleCallback");if(s(e))return e(t)}_isVisible(){return this.prop("visible")||s(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")}}_r.OFFSET=4,_r.defaults=ni(_i.defaults,{visible:!1,align:"center",gap:_r.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const dr={x:"xValue",y:"yValue",z:"zValue"};class ur extends ye{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 pr extends ye{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 gr extends ye{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 fr extends Ws{}const mr=12;class yr extends hi{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach(t=>{or[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 Us(this),this._pointArgs={},this._paletteColors=Array(mr).fill(0).map((t,e)=>e);this.chart.general.prop("paletteMode")==wt&&ot.shuffle(this._paletteColors),this._pointLabel=this._addChild("pointLabel",this._createLabel(this.chart))}onDataValueChanged(t,e,i,s,r){ot.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){ot.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){ot.log("onDataRowDeleted",e);const i=this._runPoints[e];i&&this.removePoint(i)}onDataChanged(t){ot.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=r(s)?s:""}if(void 0===e){const t=this.prop("tooltipDetail");e=r(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);r(t)&&(i=t)}if(void 0===i){const t=this.prop("tooltipText");i=r(t)?t:"",i&&(i=i.replace(hr,this.getTooltipDetail(e)))}return i}getTooltipParam(t,e,i){return yr.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 tr)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.prop("categoryField");if(null!=e){if(i(e)){const i=e.length-1,s=t.getCategorySeparator();return this._points._internalPoints().filter(t=>r(t.getProp(e[i]))).map(t=>e.map(e=>t.getProp(e)).join(s))}return this._points.getProps(e).filter(t=>r(t))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter(t=>r(t))}collectValues(t,e){if(t===this._xAxisObj){let i=this.$_getXStart(t),s=this.$_getXStep(t);r(s)&&(s=s.trim());const n=r(s)?NaN:ot.getNumber(s);this._points.forEach((e,o)=>{let a=t.getValue(e.x);isFinite(a)||(a=i,isFinite(n)?i+=n:r(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=vt(this.prop("viewRanges"),i,s,!1,!1,!0,this._runColor))?t.forEach((t,i)=>{this._setViewRange(t,e)}):t.forEach((t,e)=>{t.range=ft})}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)),cr.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=Bt(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 n;return s(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),n=this._pointLabelCallback(this._pointArgs),r(n))?n:(n=t.getPointText(e),null!=n?n:i)}getPointStyle(t){const e=this.prop("pointStyleCallback");if(s(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}getPointLabelStyle(t){if(s(this._pointLabel.prop("styleCallback")))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.prop("styleCallback")(this._pointArgs)}pointClicked(t){const e=this.prop("onPointClick");if(s(e))return this._getPointCallbackArgs(this._pointArgs,t),e(this._pointArgs)}pointHovered(t){const e=this.prop("onPointHover");s(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 r(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const i=this.getPointAt(t);return i?i[e]:ft}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,i=!0){if(t instanceof Ws||(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 ur(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 ur(this,i,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return i}addPoints(t,e=!0){const s=[];return i(t)&&t.forEach(t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)}),s.length>0&&(e&&this.chart.animatable()&&s.forEach(t=>{const e=t._prev=t.copy();e.ani=new ur(this,t,this._points.count>1),e.ani.start()}),this._dataPointsChanged()),s}_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 Ws||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Ws&&this._points.contains(t)){let i=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new pr(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new gr(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(i(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(i(t)){let s=[];if(t.forEach(t=>{t instanceof Ws||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof Ws&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)}),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new pr(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach(t=>this._dropAni.addPoint(t)):(this._dropAni=new gr(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=this.prop("name")||`Series ${this.index+1}`,this._setData(this.prop("data")),this._createFielders(),this._decayDuration=g(0,this.num("decayDuration"))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new cr(t)}_createPoint(t){return new fr(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 vs.create(t,yr.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 s(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(i(t))return t;if(t){let i;if(t._obj instanceof ut)i=t._obj;else if(t instanceof ut)i=t;else if(Number.isFinite(t)||e(t)||o(t))return[t];if(i)return i!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=i,this._cdata&&this._cdata._addListener(this)),i._internalValues()}}_loadPoints(t){this._doLoadPoints(t);const e=this.prop("onPointsLoaded");return s(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"),s=this._runColor=n(e)?`var(--color-${Math.max(1,(Math.floor(e)-1)%mr+1)})`:e;let o,a;i(t)?o=t:r(t)?t.endsWith("@pal")||t.endsWith("@palette")?o=this.chart.getPaletteColors(t.split("@")[0]):a=this.chart._assets.get(t):this._colorByPoint()&&(o=this.chart.general.prop("colors")),a instanceof ei?this._runPoints.forEach((t,e)=>{t.color=t.color||a.getAt(e)||s}):i(o)?this._runPoints.forEach((t,e)=>{t.color=t.color||o[e%o.length]||s}):this._runPoints.forEach((t,e)=>{t.color=t.color||s}),this._preparePointArgs(this._pointArgs),this._labelPosCallback=Bt(this._pointLabel.prop("position")),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=Bt(this._pointLabel.prop("offset")),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const i=t[dr[e]];for(const e of this._runRanges)if(i>=e.fromValue&&i<=e.toValue)return void(t.range=e);t.range=ft}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}yr.LEGEND_MARKER="rct-legend-item-marker",yr.defaults=ni(hi.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 br extends li{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 Er&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const 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 s=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach((t,e)=>{r.push(this.$_loadItem(s,t,e))}):e(t)&&r.push(this.$_loadItem(s,t,0)),r.forEach(t=>{t instanceof Er?n.push(...t.series):t instanceof yr&&n.push(t)}),this._map={},this._widget=!0,n.forEach(t=>this.$_add(t)),s._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 yr?e=t:r(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),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(ys[e++%ys.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 kr&&(t._single=i)}),this._visibles.forEach(t=>t._prepareRender())}prepareAfter(){this._visibles.forEach(t=>t.prepareAfter())}updateOptions(t,e){if(null==t)return;const s=this.chart,r=i(t)?t:[t];for(r.forEach((t,e)=>{e<this._items.length?this._items[e].updateOptions(t,!1):this._items.push(this.$_loadItem(s,t,e))});this._items.length>r.length;){const t=this._items.pop();if(t instanceof Er)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 yr){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 Er?t.push(...e.series):e instanceof yr&&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,s){const r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i._setIndex(s),i.init(),i._load(e),i}return yr._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Pr||(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 xr extends yr{_doInit(t){super._doInit(t),this._trendline=this._addChild("trendline",new rr(this))}get trendline(){return this._trendline}connectable(t){return!0}}xr.defaults=ni(yr.defaults,{});class vr extends hi{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 r(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}}vr.defaults=ni(hi.defaults,{radius:3});class wr extends Ws{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 Sr extends hi{_doSetSimple(t,e){return r(e)?(this.setStyle("stroke",e,!1),!0):super._doSetSimple(t,e)}}Sr.defaults=ni(hi.defaults,{curved:!0});class Vr extends cr{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),this._connector=this._addChild("connector",new Sr(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")}}Vr.defaults=ni(cr.defaults,{visible:!0,convergent:!0,align:Ps,dedupeMode:ks});class Cr extends hi{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,Ws.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=Tt(this.prop("minValue"),!0)}}Cr.DEF_COUNT=10,Cr.defaults=ni(hi.defaults,{visible:!1,x:"기타"});class Pr extends yr{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=Tt(k(i,e.prop("center"),Pr.DEF_CENTER),!0)),s!==e._centerY&&(e._centerY=s,e._centerYDim=Tt(k(s,e.prop("center"),Pr.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))}}Pr.DEF_CENTER="50%",Pr.defaults=ni(yr.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Pr.DEF_CENTER,centerY:Pr.DEF_CENTER});class Ar extends Pr{getRadius(t,e){return R(this._radiusDim,p(t,e))}_doApply(t){var e,i;super._doApply(t),e=this,(i=this.prop("radius"))!==e._radius&&(e._radiusDim=Tt(A(e._radius=i,Ar.defaults.radius),!0))}}Ar.defaults=ni(Pr.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class kr extends xr{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,g(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)}}kr.defaults=ni(yr.defaults,{pointWidth:1,minPointWidth:0});class Lr extends cr{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 lr(this.chart))}}Lr.defaults=ni(cr.defaults,{align:"center",alignOffset:0});class Tr extends kr{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Lr(t)}_doPrepareRender(){const t=this._group;if(super._doPrepareRender(),t?(this._depth=g(0,Dt(this.prop("depth"),t.getDepth(),Tr.DEPTH)),this._distance=t.getDistance()+P(this.prop("distance"),0)):(this._depth=g(0,P(this.prop("depth"),Tr.DEPTH)),this._distance=P(this.prop("distance"),Tr.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}}Tr.DEPTH=10,Tr.DISTANCE=5,Tr.defaults=ni(kr.defaults,{nullAsBase:!1});class Mr extends kr{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 Nr extends Mr{}class Er extends hi{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach(t=>{ar[t.type]=t})}static registerSeries(...t){t.forEach(t=>{ar[t.seriesType]=t})}static collectTooltipText(t,e,s,r,n){function o(t,e,i,s){let r=e.replace(hr,t.getTooltipDetail(i));return r=r.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+s+"."),r}const a=e.length>1&&i(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach((t,e)=>{let i=r;t!==s&&t.needAxes()&&(i=t.getPointAt(r.xValue)),i&&(a?(n.items.push(t),n.rows.push([o(t,h[0],i,e),o(t,h[1],i,e)])):(l&&(l+="<br>"),l+=o(t,h,r,e)))}),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,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"),yr.getPointTooltipParam(e,i,s)}isGroupTooltip(){return!0}getTooltipText(t,e,i){return Er.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 Er.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:Er.LAYOUT_MAX}_doInit(t){super._doInit(t),this._stackLabel=this._addChild("stackLabel",new _r(this.chart))}_doLoad(e,i){super._doLoad(e,i),t.call(i,"children")&&this._syncChildren(i.children)}updateOptions(e,i=!0){return e&&t.call(e,"children")?(super.updateOptions(e,!1),this._syncChildren(e.children),i&&this._changed(),this):super.updateOptions(e,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=!ot.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 s=this.chart,r=this._seriesType(),n=this._series,o=[],a=(t,e)=>{const i=t.type||r;let a=n[e];a&&a._type()===i?(a._setIndex(e),a._load(t),o.push(a)):(a=yr._loadSeries(s,e,t,r),a._group=this,o.push(a))};i(t)?t.forEach((t,e)=>a(t,e)):e(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+(f(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)}}}}Er.LAYOUT_MAX=100,Er.defaults=ni(hi.defaults,{layout:"default",layoutMax:Er.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class Br extends Er{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Or extends Er{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}}Or.defaults=ni(Er.defaults,{groupWidth:1,groupPadding:.1});class Dr extends xr{isMarker(){return!0}isXY(){return!0}}Dr.defaults=ni(yr.defaults,{colorByPoint:!1});class $r extends hi{}class Rr extends hi{}const Ir={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Fr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},zr={minPadding:0,maxPadding:0};class Hr extends hi{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;this._handle=this._addChild("handle",new $r(e)),this._mask=this._addChild("mask",new Rr(e)),this._borderLine=this._addChild("borderLine",new hi(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 Hr.HANDLE_TRACK_OFFSET+Hr.HANDLE_RADIUS}getSize(){const t=g(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,i){super._doLoad(t,i);const s={};if(e(i.series)){let t=i.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=h({},i.series,Ir[t]())}else s.series=Ir.area();e(i.xAxis)?s.xAxis=h({},i.xAxis,(Fr[i.xAxis.type]||Fr.linear)(),zr):s.xAxis=h({},zr),e(i.yAxis)?s.yAxis=h({},i.yAxis,(Fr[i.yAxis.type]||Fr.linear)(),zr):s.yAxis=h(Fr.linear(),zr),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()}}Hr.HANDLE_RADIUS=9.75,Hr.HANDLE_TRACK_HEIGHT=6,Hr.HANDLE_TRACK_OFFSET=Hr.HANDLE_TRACK_HEIGHT/2,Hr.defaults=ni(hi.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Gr extends hi{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)?Gr.defaults.gap:e}_isVisible(){return this.bool("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}Gr.defaults=ni(hi.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class jr extends Gr{}jr.defaults=ni(Gr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Yr extends hi{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!!o(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:g(this.num("headerHeight"),0)}getTailSize(){return this.bool("simpleMode")?0:g(this.num("tailSize"),0)}getBorderRadius(){return this.bool("simpleMode")?0:g(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 r(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?Ht.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?ne.getFormatter(e._timeFormat):void 0)}(this.prop("timeFormat"))}}Yr.defaults=ni(hi.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 Xr="vline",Wr="hline",Ur="line",Zr="arrow";class qr extends pi{getImageUrl(){const t=this.prop("imageUrl");if(!r(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 ii?i.getImage(r):s}return t}_isVisible(){return this.prop("visible")&&!N(this.prop("imageUrl"))}_doSetSimple(t,e){return r(e)?(this._op.imageUrl=e,!0):super._doSetSimple(t,e)}}qr.type="image";class Kr extends pi{getShape(){return this.prop("shape")||Kr.defaults.shape}hasCustomPath(){return r(this.prop("path"))&&this.prop("path").length>0}getHeadSize(){return this.getShape()!==Zr?Kr.defaults.headSize:this._headSize}_doApply(t){super._doApply(t),this.getShape()===Zr&&(this._headSize=g(1,this.num("headSize")),this._style=this.$_resolveArrowStyle())}_doSetSimple(t,e){return r(e)?(this._op.shape=e,!0):super._doSetSimple(t,e)}$_resolveArrowStyle(){const t=this._style;if(r(t))return t;const i=e(t)?{...t}:{},s=this.prop("lineWidth");return null!=s?i.strokeWidth=`${g(1,P(s,1))}px`:i.strokeWidth||i["stroke-width"]||(i.strokeWidth="1px"),i.stroke||(i.stroke="#555"),i.fill||(i.fill=i.stroke),i}}Kr.type="shape",Kr.defaults=ni(pi.defaults,{width:64,height:64,shape:"square",headSize:12});class Qr extends pi{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:Qr.defaults.textOrientation}_isVisible(){return this.prop("visible")&&!N(this.prop("text"))}_doSetSimple(t,e){return r(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?Ht.getFormatter(i):ft),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?ne.getFormatter(t):ft)}(this.prop("timeFormat"))}}Qr.type="text",Qr.defaults=ni(pi.defaults,{text:"Text",textOrientation:"upright"});class Jr extends Ci{_doInit(t){super._doInit(t),this._minorGrid=this._addChild("minorGrid",new Ni(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 tn extends Ti{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,i,r,n){if(s(e)){const s=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:r,max:n});isNaN(s)||(e=s)}return e>0?e:void 0}buildSteps(t,e,r,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),r,n,o,l):i(h.steps)||s(h.steps)||s(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof on&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,r,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,r,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,r,n,o):c>0?this._getStepsByPixels(e,c,r,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?g(8,c(t/(.9*e))+1):P(this.prop("maxCount"),1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(e){super._doApply(e);const r=!s(this.prop("stepPixels"))&&ot.parseTuples(this.prop("stepPixels"));let n;if(this._stepPixels=r&&r.every(([,t])=>t>0)?r:void 0,t.call(this._op,"stepMultiples")){const t=this.prop("stepMultiples");if(s(t))n=t;else{let e;if(i(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(s(i)&&(i=i.call(void 0,e)),!i){const t=this.axis;i=t._isPolar?tn.STEP_PIXELS_P:t._isX?tn.STEP_PIXELS_X:tn.STEP_PIXELS_Y}for(let e=0;e<i.length;e++)if(t<=i[e][0])return g(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 on&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>l(t/e)*e?t=l(t/e)*e:t<c(t/e)*e&&(t=c(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))),_=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h===2.5&&l(t*o/a)==t*o/a?this._step=a:a=this._step=c(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=g(3,t);;){if(!(c((e-i)/a)+c((s-e)/a)+1>t))break;a+=h}i=e-c((e-i)/a)*a}else i=n._fixedMin;_.push(bt(i));for(let e=1;e<t;e++)_.push(bt(_[e-1]+a));return _}_getStepsByInterval(t,e,i,s){const r=[];let n;if(i=bt(this._normalizeMin(i,t)),isNaN(e))for(r.push(n=i);n<s;)r.push(n=bt(n+t));else{for(r.push(n=e);n>i;)r.unshift(n=bt(n-t));for(n=e;n<s;)r.push(n=bt(n+t))}return this._step=t,r}_getStepMultiples(t,e){var i;return(null!==(i=s(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==i?i:this.prop("fineStep"))?tn.STEP_MULTIPLES[2]:this.prop("enableDecimals")&&1===t?tn.STEP_MULTIPLES[0]:tn.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,r){const n=this._op,o=s(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,r),i(a)&&!a.every(t=>!isNaN(+t))||(a=t!==e?[t,e]:[t])):a=n.steps.filter(t=>isFinite(+t)).map(t=>+t),a=a.filter(n.clipSteps?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=g(1,l(t/e))+1,_=o/(h-1);const d=function(t){return Math.pow(10,t)}(l(u(_))),p=this._getStepMultiples(d,n),f=[];let m,y=0;if(_/=d,p)if(_>p[y]){for(;y<p.length-1;y++)if(_>p[y]&&_<p[y+1]){_=_<=p[y]+(p[y+1]-p[y])/2?p[y]:p[y+1];break}}else _=p[y];for(;;){for(_*=d,(_<=0||!isFinite(_))&&(_=o/h),s=isNaN(i)?this._normalizeMin(s,_):i-c((i-s)/_)*_,this._step=_,f.push(bt(m=s));m<r;)f.push(bt(m+=_));if(!p||y>p.length-2||f.length<=a)break;_=p[++y],f.length=0}return f}}tn.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],tn.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],tn.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],tn.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],tn.defaults=ni(Ti.defaults,{baseRange:!1,enableDecimals:!0});class en extends Ei{}en.defaults=ni(Ei.defaults,{numberFormat:"0.##"});class sn extends en{getTick(t,e){return this._getText(null,e,"*"===this.prop("useSymbols")||this.prop("useSymbols")&&this.axis.tick.canUseNumSymbols(),!1)}}sn.defaults=ni(en.defaults,{useSymbols:!0});class rn extends xi{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=Tt(null!==(e=this.prop("size"))&&void 0!==e?e:rn.defaults.size,!1),this.axis._breaksChanged=!0}prop(t){return"space"===t?this._space:super.prop(t)}}rn.defaults=ni(xi.defaults,{size:"30%",space:16,gridVisible:!0});class nn extends vi{_isVisible(){return this.prop("visible")}}nn.defaults=ni(vi.defaults,{visible:!1});class on extends $i{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),this._baseLine=this._addChild("baseLine",new nn(this)),this._minorTick=this._addChild("minorTick",new Mi(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=on.PADDINGS}for(let s=0;s<t.length;s++)if(e<=t[s][0])return t[s][1]*i;return 0}_doApply(e){var i,s;super._doApply(e);const n=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,r(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,r(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=ot.parseTuples(n)),isNaN(this._maxPadPixels)&&(this._maxPaddings=ot.parseTuples(o)),this._baseVal=+this.prop("baseValue"),this._strictMin=Tt(this.prop("strictMin"),!0),this._strictMax=Tt(this.prop("strictMax"),!0),t.call(this._op,"break")&&this.$_loadBreaks(this.prop("break"))}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Jr(this)}_createTickModel(){return new tn(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 on&&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(!(bt(h-t)>bt(t-i)))break;{const r=this._createTick(0,s+bt(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 bt(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")?xt(t-r-s.pos):xt(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=xt(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,o=this.isZoomed(),a=this.isZoomed(),h=!0,c=!0,_=NaN,d=NaN,u=1;if(this._series.length>0){let t,l=0;this._series.forEach(t=>{isNaN(t._sBase=t.getBaseValue(this))||l++,u=g(u,t.getAxisPadRate())}),!this._isX&&l>0&&l<this._series.length&&(r={},this._series.forEach(t=>{const e=t._type();r[e]?r[e]=[p(t._yMin,r[e][0]),g(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]})),this._series.forEach(r=>{let l=r._sBase;n(l)&&!isNaN(l)&&(l=bt(l),s?l>=0&&l<=e&&l<=i&&(e=t=l):l<=e?r.isBased(this)?e=t=l:_=P(p(_,l),l):l>=i&&(r.isBased(this)?i=t=l:d=P(g(d,l),l))),h&&!o&&(s||r.canMinPadding(this,e,t))&&(h=!1),c&&!a&&(s||r.canMaxPadding(this,i,t))&&(c=!1)})}else h=o,c=a;o||(o=h),a||(a=c),this._fixedMin=this._fixedMax=NaN;const f=g(0,i-e),m=this.$_calcStrict(this._strictMin,e,-f),y=this.$_calcStrict(this._strictMax,i,f);let b=NaN,x=NaN,v=0,w=0;isNaN(m)?o?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-=f*v,V+=f*w;if(!isNaN(b)||!isNaN(x)){isNaN(b)&&(b=0),isNaN(x)&&(x=0);const e=Math.min(b+x,.9*t),i=f-l(f*(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=g(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=p(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(e(t)&&"from"in t&&"to"in t){const e=new rn(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(i(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){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 rn(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 rn(this)._initObject().loadOptions(o.options,!1))}}}}on.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],on.defaults=ni($i.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class an extends on{get label(){return this._label}_createLabel(){return new sn(this)}_adjustMinMax(t,e,i){const s=super._adjustMinMax(t,e,i),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Er&&"fill"===r[0].prop("layout")&&(s.max=r[0].getLayoutMax()),s}}an.type="linear";const hn=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],ln=[[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]],cn={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class _n extends tn{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,n,o){if(s(e)){const s=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o});null!=s&&(e=s)}if(!isNaN(e))return+e>0?+e:NaN;if(r(e)&&cn.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>=hn[e]/2&&t<hn[e+1]/2)return this._scale=e,ln[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=g(1,Math.floor(o/(l-1)));const _=this._getStepMultiples(c),d=hn[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 f,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)}f=m.getTime();const t=h.getTime();f<t&&f+c>t&&(f=t);do{n.push(f),f+=c}while(f<=r)}return n}_getStepsByInterval(t,e,i,s){if(r(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=cn[a],t=hn[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(hn[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 dn=[{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 un extends en{_doApply(t){super._doApply(t);const s=r(this.prop("timeFormat"))?this.prop("timeFormat"):void 0,n=r(this.prop("beginningFormat"))?this.prop("beginningFormat"):void 0,o=this.prop("timeFormats"),a=this.prop("useBeginningFormat");if(this._formats=dn.map(t=>h(t)),s&&this._formats.forEach(t=>{t.format=t.beginningFormat=s}),a&&n&&this._formats.forEach(t=>{t.beginningFormat=n}),i(o))for(let t=0;t<o.length;t++){const i=this._formats[t],s=o[t];Ot(s)?i.format=s:e(s)&&(Ot(s.format)&&(i.format=s.format),a&&Ot(s.beginningFormat)&&(i.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=ne.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)}}un.defaults=ni(en.defaults,{useBeginningFormat:!0});class pn extends on{get label(){return this._label}_createTickModel(){return new _n(this)}_createLabel(){return new un(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 n(t)?t:r(t)?new Date(t).getTime()+P(this._offset,0):NaN}getValue(t){return n(t)?t:t instanceof this._dateClass?t.getTime():r(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(r(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}}pn.type="time",pn.subtype="date",pn.defaults=ni(on.defaults,{baseValue:NaN});class gn extends qs{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class fn extends Nr{pointLabelCount(){return 2}_createLegendMarker(t,e){return vs.create(t,yr.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new gn(t)}_getBottomValue(t){return t.lowValue}}fn.type="barrange",fn.defaults=ni(Nr.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class mn extends Ws{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class yn extends Tr{canCategorized(){return!0}_colorByPoint(){return this.prop("colorByPoint")}_createPoint(t){return new mn(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this.prop("baseValue")}}yn.defaults=ni(Tr.defaults,{colorByPoint:!1,pointOffset:0});class bn extends yn{canDepth(){return!0}_createLegendMarker(t,e){return vs.create(t,yr.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}bn.type="bar";class xn extends Or{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=g(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})}}xn.defaults=ni(Or.defaults,{depth:10,distance:5});class vn extends xn{_canContain(t){return t instanceof bn}}vn.type="bargroup",vn.seriesType="bar";class wn extends Pe{constructor(t){super(t,yr.LEGEND_MARKER),this.add(this._back=new vs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new Ne(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){xs.setShape(this._marker,this._shape,t,t)}}class Sn extends wn{constructor(t){super(t),this.insertFirst(this._line=new Ne(t)),this.insertFirst(this._area=new Ne(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 Vn extends wn{constructor(t){super(t),this.insertFirst(this._line=new Ne(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Ne(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Ne(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 Ne{constructor(t,e=ft,i=ft){super(t,e),i&&this.setLine(i)}setLine(t,e,i,s){n(t)?this.setPath(xs.line(t,e,i,s)):t&&this.setPath(xs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(xs.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(xs.line(t,e,t,i))}setHLine(t,e,i){this.setPath(xs.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(xs.line(e,t,i,t))}}class Pn extends wn{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 An extends Ws{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class kn extends vr{}kn.defaults=ni(vr.defaults,{radius:4,hoverScale:1.75});class Ln extends vr{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 i=Ln.STYLE_ISOLATION,s={};return r(t)?(s.stroke=i.stroke,s.strokeWidth=i.strokeWidth,s):(e(t)&&null==t.strokeDasharray&&(s.strokeDasharray=i.strokeDasharray),s)}getArrowStyle(t){const i=t&&this.getMarkerStyle(t);return i?e(i)?this.$_applyStyleIsolation(h({},i)):i: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(r(t))return t;const i=h({},e(t)?t:{});return i.fill||(i.fill=this.series._runColor),this.$_applyStyleIsolation(i)}$_applyStyleIsolation(t){return null==t.stroke&&(t.stroke=Ln.STYLE_ISOLATION.stroke),t.stroke===Ln.STYLE_ISOLATION.stroke&&null==t.strokeWidth&&(t.strokeWidth=Ln.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}}Ln.defaults=ni(vr.defaults,{visible:!1,shape:"triangle",radius:6,rotation:"auto",position:"end"}),Ln.STYLE_ISOLATION={stroke:"none",strokeDasharray:"",strokeWidth:""};class Tn extends cr{getAlignOffset(){const t=+this.prop("alignOffset");return isNaN(t)?"left"===this.prop("align")||"right"===this.prop("align")?Tn.ALIGN_GAP:0:t}getPosition(){return this.prop("position")}}Tn.ALIGN_GAP=4,Tn.defaults=ni(cr.defaults,{align:"center"});class Mn extends xr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new kn(this))}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return Dt(t.radius,this.marker.prop("radius"),kn.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 Tn(t)}_createPoint(t){return new An(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.prop("shape")||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Pn(t)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),p(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}}Mn.defaults=ni(yr.defaults,{nullAsBase:!1});class Nn extends _i{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"}}Nn.defaults=ni(_i.defaults,{visible:!1,offset:8});class En extends Mn{_doInit(t){super._doInit(t),this._flag=this._addChild("flag",new Nn(this)),this._arrow=this._addChild("arrow",new Ln(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(o(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 Fn||this._group instanceof zn?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")}}En.type=Ms,En.defaults=ni(Mn.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Bn extends En{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Bn.type="spline";class On extends An{}class Dn extends En{_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 Sn(t)}_createPoint(t){return new On(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)}}Dn.type=Ns,Dn.defaults=ni(Mn.defaults,{});class $n extends On{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 h(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 Rn extends Tn{getPosition(){return"default"===this.prop("position")||null==this.prop("position")?"foot":this.prop("position")}}class In extends Mn{pointLabelCount(){return 2}_createLabel(t){return new Rn(t)}_createLegendMarker(t,e){return new Vn(t)}_createPoint(t){return new $n(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}}In.type="arearange",In.defaults=ni(Mn.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Fn extends Er{_canContain(t){return t instanceof En}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}Fn.type="linegroup",Fn.seriesType=Ms,Fn.defaults=ni(Er.defaults,{lineType:"default"});class zn extends Er{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 Dn}getBaseValue(t){return t===this._yAxisObj?k(this.prop("baseValue"),t.getBaseValue(),0):NaN}}zn.type="areagroup",zn.seriesType=Ns,zn.defaults=ni(Er.defaults,{lineType:"default"});class Hn extends On{}class Gn extends Dn{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new Hn(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.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}}Gn.type="bellcurve",Gn.defaults=ni(Dn.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class jn extends Ws{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 h(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[Dt(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 Yn extends Nr{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new jn(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return vs.create(t,yr.LEGEND_MARKER,0,0,e,e,2)}}Yn.type="boxplot",Yn.defaults=ni(Nr.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 Xn extends Ne{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 xs.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 xs.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 Wn=2*Math.PI,Un=-Math.PI/2;class Zn extends Pe{constructor(t){super(t,yr.LEGEND_MARKER),this._sectors=[],this.add(this._back=new vs(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=Wn/e;let a=Un;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 Xn(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 qn{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)%mr+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 Kn{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 Qn extends Zs{}class Jn extends hi{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 to&&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]),o=n(r)&&r>0?r:0;o>0&&i.push({index:s,value:o})}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,o=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],n=o*(e.value/s)*a,c=this._legendSources[e.index];if(c){const t=new Kn;t.source=c,t.value=e.value,t.percent=Math.round(e.value/s*1e4)/100,t.startAngle=h,t.angle=n,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}h+=n}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)%mr+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)%mr+1})`);return i}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t,e){return o(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=i(this.prop("categories"))&&this.prop("categories").length>0?this.prop("categories"):this._fields;const e=this.prop("colors");i(e)?this._sliceColors=e:r(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 s=this.num("totalAngle");this._totalRad=v*g(0,p(360,s<=0?360:s)),this._clockwise=this.bool("clockwise"),this.prop("innerRadius")?this._innerRadiusDim=Tt(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 qn;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[i(t)?+e:e]}}Jn.defaults=ni(hi.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class to extends Dr{_doInit(t){super._doInit(t),this._pie=this._addChild("pie",new Jn(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 Qn(t)}_getNoClip(t){const e=super._getNoClip(t);return!o(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 Zn(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=p(t,i.zValue),e=g(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){r(t)&&(t=this._xAxisObj.getValue(t)),r(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}}}to.type="bubble",to.defaults=ni(Dr.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 eo extends Br{_canContain(t){return t instanceof En}_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 ot.makeIntArray(0,t.length)}}eo.type="bump",eo.seriesType=Ms;class io extends Ws{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_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[Dt(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 so extends Nr{canCategorized(){return!0}_createPoint(t){return new io(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const i=new we;return i.rect(0,.2*e,e,.6*e),i.vline(e/2,0,e),new Ne(t,yr.LEGEND_MARKER).setPath(i.end())}}so.type="candlestick",so.defaults=ni(Nr.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class ro extends Lr{}ro.defaults=ni(Lr.defaults,{position:"inside"});class no extends yn{get pointLabel(){return this._pointLabel}_createLabel(t){return new ro(t)}}no.type=Es;class oo extends xn{_canContain(t){return t instanceof no}}oo.type="circlebargroup",oo.seriesType=Es;class ao extends qs{}class ho extends vr{}ho.defaults=ni(vr.defaults,{radius:4,shape:"circle"});class lo extends cr{}lo.defaults=ni(cr.defaults,{highVisible:!0,lowVisible:!0});class co extends Nr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new ho(this)),this._lowMarker=this._addChild("lowMarker",new ho(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)+g(0,this.marker.prop("radius"))}_createLabel(t){return new lo(t)}_createPoint(t){return new ao(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()}}co.type="dumbbell";class _o extends Ws{}class uo extends Tr{getSegmentSize(t){return R(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new _o(t)}_createLegendMarker(t,e){const i=new we;return i.rect(0,0,e,.4*e),i.rect(0,.6*e,e,.4*e),new Ne(t,yr.LEGEND_MARKER).setPath(i.end())}}uo.type="equalizer",uo.defaults=ni(Tr.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class po extends Nr{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new qs(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const i=(new we).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),s=new Ne(t,yr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}_getBottomValue(t){return t.lowValue}}po.type="errorbar",po.defaults=ni(Nr.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class go extends wr{}class fo extends go{constructor(t,e){super(t),this.points=e}}class mo extends Vr{getDistance(){return isNaN(this.prop("distance"))?"far"===this.prop("align")?mo.ENDED_DIST:mo.OUTSIDE_DIST:this.prop("distance")||0}}mo.OUTSIDE_DIST=25,mo.ENDED_DIST=10;class yo extends Pr{getSize(t,e){return{width:g(.1*t,R(this._widthDim,t)),height:g(.1*e,R(this._heightDim,e))}}getNeckSize(t,e){return{width:ot.clamp(R(this._neckWidthDim,t),this._minNeckWidth,t),height:ot.clamp(R(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new mo(t)}_createPoint(t){return new go(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new fo(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("width"))!==e._width&&(e._width=i,e._widthDim=Mt(e._width,yo.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Mt(e._height,yo.defaults.height))}(this.prop("height")),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Mt(e._neckWidth,yo.defaults.neckWidth))}(this.prop("neckWidth")),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Mt(e._neckHeight,yo.defaults.neckHeight))}(this.prop("neckHeight")),this._minNeckWidth=Math.max(0,+this.num("minNeckWidth"))}}yo.type="funnel",yo.defaults=ni(Pr.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class bo extends Ws{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return h(super._assignTo(t),{min:this.min,max:this.max})}}const xo={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 vo extends xr{getBinCount(t){const e=P(this.prop("binWidth"),0);if(e>0)return t/e;return P(this.prop("binsNumber"),0)<1?xo[this.prop("binsNumber")||"squreRoot"](t):void 0}_createPoint(t){return new bo(t)}_doLoadPoints(t){function s(t){let s;return s=i(t)?t[P(this.yField,0)]:e(t)?k(t[this.yField],t.y,t.value):t,parseFloat(s)}const r=[];let n=[];for(let e=0;e<t.length;e++){const i=s(t[e]);isNaN(i)||n.push(i)}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=Dt(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 vs.create(t,yr.LEGEND_MARKER,0,0,e,e,2)}}vo.type="histogram",vo.defaults=ni(yr.defaults,{baseValue:0,binsNumber:"squreRoot"});class wo extends vr{}wo.defaults=ni(vr.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class So extends Ws{_assignTo(t){return h(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 Vo extends Tr{_doInit(t){super._doInit(t),this._marker=this._addChild("marker",new wo(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 So(t)}prepareAfter(){const t=this.marker,e=t.prop("radius"),i=t.prop("shape"),s=this.prop("radiusField"),r=g(t.num("minRadius"),0),n=g(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()}}Vo.type="lollipop";class Co extends io{}class Po extends so{_createPoint(t){return new Co(t)}_createLegendMarker(t,e){const i=new we;i.vline(e/2,0,e),i.hline(.4*e,e/2,e),i.hline(.7*e,0,e/2);const s=new Ne(t,yr.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}}Po.type="ohlc";class Ao extends An{}class ko extends Mn{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this.prop("curved")?"spline":"default"}_createPoint(t){return new Ao(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)}}}ko.type="pareto",ko.defaults=ni(Mn.defaults,{curved:!1});class Lo extends wr{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 h(super._assignTo(t),{sliced:this.sliced})}}class To extends Lo{constructor(t,e){super(t),this.points=e}}class Mo extends _i{getDefaultIconPos(){return"left"}}class No extends Vr{getDistance(t,e,i){return i>0&&(e-=e*i),this._distanceDim?R(this._distanceDim,e,0):t?R(i?No.INNER_DIST:No.INSIDE_DIST,e):"far"===this.prop("align")?No.ENDED_DIST:No.OUTSIDE_DIST}}No.INSIDE_DIST=Tt("30%",!1),No.INNER_DIST=Tt("50%",!1),No.OUTSIDE_DIST=25,No.ENDED_DIST=10,No.defaults=ni(Vr.defaults,{radius:.7,rotationMode:"arc"});class Eo extends hi{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 n(e)&&e>0?(this._op.length=e,this._op.visible=!0,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._runLength=g(0,this.num("length")),this._runRatio=g(.3,p(.8,this.num("ratio")))}}Eo.DEPTH_RATIO=.6,Eo.defaults=ni(hi.defaults,{visible:!1,length:25,ratio:Eo.DEPTH_RATIO});class Bo extends Ar{_doInit(t){super._doInit(t),this._innerText=this._addChild("innerText",new Mo(this.chart)),this._depth=this._addChild("depth",new Eo(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 No(t)}_createPoint(t){return new Lo(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new To(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*g(0,p(360,t)),this._groupPos=NaN}}Bo.type="pie",Bo.defaults=ni(Ar.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Oo extends Er{getPolarSize(t,e){return R(this._polarDim,p(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=Tt(i,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Tt(t,!0))}(this.prop("innerSize"))}needAxes(){return!1}_canContain(t){return t instanceof Bo}_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})}}Oo.type="piegroup",Oo.seriesType="pie",Oo.defaults=ni(Er.defaults,{polarSize:"80%",innerSize:0});class Do extends Ws{}class $o extends Dr{_createPoint(t){return new Do(t)}_getNoClip(t){const e=super._getNoClip(t);return!o(e)||e}_createLegendMarker(t,e){return new wn(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),p(e/2,this.prop("radius"))),i}}$o.type="scatter",$o.defaults=ni(Dr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Ro extends Ws{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class Io extends cr{}Io.defaults=ni(cr.defaults,{offset:0});class Fo extends Mr{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Io(t)}_createPoint(t){return new Ro(t)}_createLegendMarker(t,e){return vs.create(t,yr.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}}Fo.type="waterfall",Fo.defaults=ni(Mr.defaults,{tooltipDetail:"<b>${y}</b>"});class zo extends tn{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 _=[],d=g(1,l(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))),l=this._getStepMultiples(e);if(t/=e,l&&l.length>0)if(t>l[0]){for(let e=0;e<l.length-1;e++)if(t>l[e]&&t<l[e+1]){t=t<=l[e]+(l[e+1]-l[e])/2?l[e]:l[e+1];break}}else t=l[0];t*=e,(t<=0||!isFinite(t))&&(t=h/d),s=isNaN(i)?this._normalizeMin(s,t):i-c((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(_.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>_[_.length-1]&&(m<r&&(1==_.length&&m-_[_.length-1]<t||_.length>1&&m-_[_.length-1]<(_[_.length-1]-_[_.length-2])*g)&&_.pop(),_.push(m))}else{s=o(s);const t=(r=o(r))-s;let e=t/(d-1);const i=o(l(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=l(s/e)*e;for(c<s&&(c+=e),_.push(n(c));c<=r+h;)c+=e,c>0&&_.push(n(c))}return _}}zo.defaults=ni(tn.defaults,{arrangeDecimals:!0});class Ho extends on{_isLog(){return!0}_createLabel(){return new sn(this)}_createTickModel(){return new zo(this)}_doApply(t){super._doApply(t);const e=this._logBase=g(2,this.num("logBase"));this._roundThreshold=Dt(this._op.roundThreshold,this._op.roundThrrehold,Ho.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=l(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,bt(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)?bt(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=p(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)}}Ho.type="log",Ho.defaults=ni(on.defaults,{logBase:10,roundThreshold:500,roundThrrehold:500});class Go extends hi{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})}}}Go.defaults=ni(hi.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class jo extends li{load(t){const e=this.chart,s=this._items=[];i(t)?t.forEach((t,i)=>{s.push(this.$_loadItem(e,t))}):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map(t=>t.options)}$_loadItem(t,e){const i=new Go(t);return i.init(),i._load(e),i}}const Yo="$ctrl";class Xo extends hi{isFloating(){return this.prop("floating")||"middle"===this.prop("verticalAlign")&&"center"===this.prop("align")}_doSetSimple(t,e){return r(e)?(this._op.text=e,!0):super._doSetSimple(t,e)}}Xo.defaults=ni(hi.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Wo extends hi{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"}}Wo.defaults=ni(hi.defaults,{scope:"auto"});class Uo extends hi{_doInit(t){this._pointHovering=this._addChild("pointHovering",new Wo(this.chart))}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this.prop("xStart"))&&void 0!==e?e:t.getXStart()}}var Zo;Uo.defaults=ni(hi.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"}(Zo||(Zo={}));class qo extends _t{static registerSplitClass(t){this.split_class=t}constructor(t,i){super(),this._data=new pt,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=i,this._assets=new si,(this._general=new Uo(this)).init(),(this._title=new Gr(this)).init(),(this._subtitle=new jr(this)).init(),(this._legend=new fs(this)).init(),(this._credits=new Xo(this)).init(),(this._tooltip=new Yr(this)).init(),this._buttons=new jo(this),qo.split_class&&(this._split=new qo.split_class(this)).init(),(this._body=new us(this)).init(),(this._navigator=new Hr(this)).init(),(this._exporter=new ps(this)).init(),this._series=new br(this),this._xAxes=new Ri(this,!0),this._yAxes=new Ri(this,!1),this._gauges=new Xi(this),this._annotations=new gi(this),e(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},qo.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Yo]).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 qo(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 Er.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 Er.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 Hi?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 Zo.LEFT:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Zo.RIGHT:r=i.filter(t=>t._isOpposite);break;case Zo.BOTTOM:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Zo.TOP:r=s.filter(t=>t._isOpposite)}else switch(t){case Zo.LEFT:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case Zo.RIGHT:r=s.filter(t=>t._isOpposite);break;case Zo.BOTTOM:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case Zo.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 qo.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,i,s){const r=this._bases[i];let n;return e(r.base)&&ai(n={},r.base),e(r[s])&&(n||(n={}),ai(n,r[s])),n?ai(n,t):t}_load(t){var i,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)),e(t.general)?this._credits._load(t.general.credits):e(t.chart)?this._credits._load(t.chart.credits):e(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===(i=this._gauges)||void 0===i||i.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,i){if(e(t)){this._setProperties(t,!1);for(const e in t){const i=this[e];(i instanceof hi||i instanceof li||i instanceof si)&&i.updateOptions(t[e],!1)}i&&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<=mr;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());i.setAttribute(s,r)}}return e}$_loadTemplates(t){const s=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(e(t)){const n=this._templates={};for(const i in t){const s=t[i];e(s)&&(n[i]=h({},s))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach(i=>{t.hasOwnProperty(i)&&e(t[i])&&(s[i.substring(1)]=t[i])}),this.assignTemplates=t=>{const e=t.template;if(r(e)){let i=this._templates[e];if(i)return ai(ai({},i),t)}else i(e)&&e.forEach(e=>{let i=this._templates[e];return i?ai(ai({},i),t):i});return t}}else this.assignTemplates=void 0}_getGroupType(t){return r(t)&&ar[t.toLowerCase()]}_getSeriesType(t){return r(t)&&or[t.toLowerCase()]}_getAxisType(t){return r(t)&&bi[t.toLowerCase()]}_getGaugeType(t){return r(t)&&Fi[t.toLowerCase()]}_getGaugeGroupType(t){return r(t)&&zi[t.toLowerCase()]}_getAnnotationType(t){return r(t)&&ui[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)}}qo.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},$i.register(tr,an,Ho,pn),yr.register(Dn,In,fn,bn,Gn,Yn,to,so,no,co,uo,po,yo,vo,En,Bn,Vo,Po,ko,Bo,$o,Fo),Er.register(zn,vn,eo,oo,Fn,Oo),Er.registerSeries(zn,vn,oo,Fn,Oo),pi.register(qr,Kr,Qr);class Ko{constructor(t,i){this._modelCallback=i,this._obj=new qo(t,this),this._loaded=e(t),null==i||i(this._obj,null)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[Yo]=null===(t=this[Yo])||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 r(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,i=!1,s){var r;if(e(t)){const e="load chart";ot.LOGGING&&console.time(e);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new qo(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=i,this._loadCallback=s,ot.log("chart-items:",ri),ot.LOGGING&&console.timeEnd(e),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[Yo].refresh()}}class Qo{constructor(t,e){this._obj=new ut(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,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 Jo extends K{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 ta{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new ta(t,t,t,t):new ta(t,t,e,e):new ta(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 ta(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}}}ta.Empty=Object.freeze(new ta),ta.Temp=new ta;class ea extends Pe{constructor(t,e=ft){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return ea.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ea.IGNORE_ATTRS={width:"",height:""};class ia extends Pe{constructor(t,e=ft){super(t,e,"g"),Pe.DEBUGGING&&(this.add(this._debugRect=new vs(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),Pe.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new vs(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 sa extends ia{constructor(t,e,i){super(t,e),this._margins=new ta,this._paddings=new ta,this.add(this._background=new vs(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 ra extends ea{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 na extends ia{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 oa extends Pe{constructor(t,e,i){super(t,i,"image"),this._bounds=X,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&&!nt||(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 aa extends ea{constructor(t,e=ft){super(t),this.add(this._text=new Fe(t,e)),this._text.anchor=$e.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 vs(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 Fe(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 oa(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=oe.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,i=this._outline,s=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,c=0,_=0,d=0,u=0;if(this._box=void 0,s){const t=s.getBBox();r=this._model.num("iconGap");const e=this._model.num("iconWidth"),i=this._model.num("iconHeight");switch(c=t.width||e||i,_=t.height||i||e,this._model.getIconPos()){case"left":case"right":h+=r+c,l=Math.max(_,a);break;default:l+=r+_,h=Math.max(c,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(s)switch(this._model.getIconPos()){case"left":s.trans(d,(l-_)/2),d+=c+r,h-=c+r;break;case"right":s.trans(d+h-c,(l-_)/2),h-=c+r;break;case"top":s.trans((h-c)/2,u),u+=_+r;break;case"bottom":s.trans((h-c)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=$e.MIDDLE;break;case"right":d+=h,e.anchor=$e.END;break;default:e.anchor=$e.START}return e.trans(d,u),i&&(i.anchor=e.anchor,i.setAttr("y",e.getAttr("y")),i.trans(e.tx,e.ty)),this._iconBox=s?{x:s.tx,y:s.ty,width:c,height:_}: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 Fe(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 ha extends sa{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new Fe(t)),this._richText=new Ze}rotatedWidth(){const t=this.model.getRotation()*v,e=this.getBBox();return f(d(t)*e.height)+f(_(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*v,e=this.getBBox();return f(_(t)*e.height)+f(d(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=U(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=o.width;o.width=o.height,o.height=t}return o}_doLayout(t){const e=this._textView,i=e.getStyle("writing-mode"),s=i===Vt||i===Ct;t?this.rotation=0:this.setRotation(0,(s?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=$e.START,s||(n-=this.width/2);break;case"right":e.anchor=$e.END,s?r+=this.height:n+=this.width/2;break;default:e.anchor=$e.MIDDLE,s&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class la extends sa{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new Fe(t)),this._textView.anchor=$e.START,this._richText=new Ze}_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),U(this._textView.getBBox())}_doLayout(t){const e=this._textView;let i=this._margins.top+this._paddings.top,s=0;switch(this.textAlign()){case"left":e.anchor=$e.START,s-=this.width/2;break;case"right":e.anchor=$e.END,s+=this.width/2;break;default:e.anchor=$e.MIDDLE}e.trans(s,i)}}class ca extends ia{constructor(t,e=ga.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 _a extends aa{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 f(d(t)*e.height)+f(_(t)*e.width)}rotatedHeight(){const t=this.rotation*v,e=this.getBBox();return f(_(t)*e.height)+f(d(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 da extends Pe{constructor(t){super(t,void 0),this.add(this._back=new Ne(t,"rct-crosshair-flag")),this.add(this._text=new Fe(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 we,n=g(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 ua extends ia{static isThumb(t){return t.classList.contains(ua.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new vs(t,ua.TRACK_CLASS)),this.add(this._thumbView=new vs(t,ua.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,i=t.end-t.start;this._len=g(0,e),this._page=p(i,e),this._pos=p(t.min+e-i,g(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=g(0,p(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)}}}ua.CLASS_NAME="rct-axis-scrollbar",ua.TRACK_CLASS="rct-axis-scrollbar-track",ua.THUMB_CLASS="rct-axis-scrollbar-thumb";const pa=/\${label}.*?/g;class ga extends ia{constructor(t){super(t,ga.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._minorMarkViews=[],this._categoryTreeLevelSizes=[],this._categoryTreeLevelOffsets=[],this._categoryTreeExtraSize=0,this.add(this._lineView=new Cn(t,ga.LINE_CLASS)),this.add(this._titleView=new ha(t)),this.add(this._markContainer=new Pe(t,"rct-axis-ticks")),this.add(this._minorMarkContainer=new Pe(t,"rct-axis-minor-ticks")),this.add(this._labelContainer=new Pe(t,"rct-axis-labels")),this.add(this._unitView=new la(t)),this._labelViews=new Jo(this._labelContainer,_a,"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 ua(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?g(0,s.tick._getGap()):g(0,s.tick._getLength())+g(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?g(0,s.tick._getGap()):g(0,s.tick._getLength())+g(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 da(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?p(0,this.width-n.width):g(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,ga.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 on?(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 on&&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 tr?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&&ot.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=ga.TICK_CLASS){for(;i.length<s;){const s=new ca(t,r);e.add(s),i.push(s)}for(;i.length>s;)i.pop().remove()}$_prepareTickMarkViews(t,e,i,s,r,n=ga.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,ga.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(pa)?t.setLabel(i,a,e,n.replace(pa,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,i){if(t===i)return!0;if(null==t||null==i)return t==i;if(r(t)||r(i))return t===i;if(!e(t)||!e(i))return!1;const s=Object.keys(t);if(s.length!==Object.keys(i).length)return!1;for(const e of s)if(t[e]!==i[e])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=g(0,p(s-1,h.prop("startStep")||0)),c=t._ticks,d=c.length,u=(s=g(1,s))*(r=p(g(1,r),c.length)),m=n||0,y=f(m)*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<d;r+=u){let s=0;for(let e=r;e<r+u&&e<d;e++)s+=t.getLabelLength(i,c[e].value);if(r+u<d){x=e.pull(S++),x.rotation=m,x.row=n,x.index=r,this._prepareLabel(x,c[r],h,d,a),x.setVis(!0);const t=s;if(0===m&&x.getBBox().width>=t){w=!0;break}if(b&&x.getBBox().width*_(y)>=t){w=!0;break}if(0!==m&&x.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<d&&(x=e.pull(S++),x.row=n,x.rotation=m,x.index=t,this._prepareLabel(x,c[t],h,d,a),x.setVis(!0))}}!o&&e.freeFrom(S)}$_applyStep(t,e,i){const s=t.label,r=g(0,p(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 tr?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?p(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:g(1,+r.prop("maxRows")|0);a=p(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]=g(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=g(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=g(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=g(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=g(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=g(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 on)return this._prevWidth;const r=t instanceof tr?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=g(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=g(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=g(s,l[t].rotatedWidth())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),this._prevWidth=s}return 0}$_ensureCategoryTreeViews(){this._categoryTreeBandContainer||(this.add(this._categoryTreeBandContainer=new Pe(this.doc,"rct-axis-tree-bands")),this._categoryTreeBandViews=new Jo(this._categoryTreeBandContainer,vs,"rct-axis-tree-band")),this._categoryTreeLabelContainer||(this.add(this._categoryTreeLabelContainer=new Pe(this.doc,"rct-axis-tree-labels")),this._categoryTreeLabelViews=new Jo(this._categoryTreeLabelContainer,_a,"rct-axis-tree-label")),this._categoryTreeDividerContainer||(this.add(this._categoryTreeDividerContainer=new Pe(this.doc,"rct-axis-tree-dividers")),this._categoryTreeDividerViews=new Jo(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=ga.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=g(h[c.level]||0,t);null!=(null==a?void 0:a[c.level])&&(i=g(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 tr?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:p(o,a),yMax:g(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:p(l,c),y1:g(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:p(l,c),x1:g(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:p(h,l),xMax:g(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:p(s,r),yMax:g(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=f(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:p(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=f(_-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 f=t.getDividerLinePositions(e);if(f.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,f[0]),c=t.getLabelX(e,f[f.length-1]),_=p(h,c),d=g(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)&&[f[0],f[f.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(_)&&[f[0],f[f.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 tr?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 tr,c=l&&h.label.prop("fillToCategory"),_=h.label,u=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+=d(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=d(m)*S.height/2,t.setRotation(0,S.height/2,f)):r?(V-=S.width,C-=d(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=d(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):f>15&&f<=90?i?r?(V+=S.width,C-=d(m)*S.height/2,t.setRotation(S.width,S.height/2,-f)):(V-=S.width,C+=d(m)*S.height/2,t.setRotation(S.width,S.height/2,f)):r?(C+=d(m)*S.height/2,t.setRotation(0,S.height/2,-f)):(C-=d(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(u?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=u?_.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(u?x-2:1)),e=t.get(u?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=u?_.prop("firstOverflow"):_.prop("lastOverflow");let c,d;a<=r?"pull"===l?a=Math.max(r+s,n-h):o="hidden"!==l:(c=e.elementToSvg(e.getBBox().width,0).x)>(d=t.control.getBounds().width)&&("pull"===l?a=Math.max(r+s,a-(c-d+4)):o="hidden"!==l),o?e.transX(a):e.setVis(!1)}(this,e,t.get(u?1:x-2))}}$_layoutLabelsVert(t,e,i,s,r,n,o,a){var h,l;const c=this.model,_=c instanceof tr,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)}}ga.AXIS_CLASS="rct-axis",ga.LINE_CLASS="rct-axis-line",ga.TICK_CLASS="rct-axis-tick",ga.HIERARCHY_ROW_GAP=2,ga.MINOR_TICK_CLASS="rct-axis-minor-tick";class fa extends Pe{constructor(t,e,i){super(t,fa.STYLE),this.add(this._back=new vs(t,fa.BACK_STYLE)),this.add(this._textView=new Fe(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 ta).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}}fa.STYLE="rct-button",fa.BACK_STYLE="rct-button-background";class ma extends Pe{constructor(t,e){super(t,e,"circle")}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class ya extends Ne{setArc(t,e,i,s,r,n){this.setPath(xs.arc(t,e,i,i,s,close?s+r:s-r,n))}}class ba extends ya{setPolyline(t){this.setPath(xs.polygon(...t))}}const xa={};class va extends sa{static register(...t){t.forEach(t=>{xa[t[0].type]=t[1]})}constructor(t,e){super(t,va.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new Pe(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)}}va.CLASS_NAME="rct-annotation";const wa={};class Sa extends na{static register(...t){t.forEach(t=>{wa[t[0].type]=t[1]})}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new vs(t,Sa.PANE_CLASS)),this.add(this._contentContainer=new ke(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Sa.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=h(ae.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 ka)return t;t=t.parent}}}Sa.GAUGE_CLASS="rct-gauge",Sa.PANE_CLASS="rct-gauge-pane";class Va extends ye{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class Ca extends Sa{constructor(){super(...arguments),this.valueOf=(t,e,i)=>{const s=t.getParam(e);return n(s)?Ht.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 Va(this).start(()=>{t._runValue=NaN,t._prevValue=t.prop("value")}))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class Pa extends aa{}class Aa extends ia{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new ke(t,"rct-gauge-scale-ticks")),this._ticks=new Jo(this._tickContainer,Cn),this.add(this._labelContainer=new ke(t,"rct-gauge-scale-tick-labels")),this._labels=new Jo(this._labelContainer,Pa)}}class ka extends Sa{_defaultCalss(){return ka.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new ke(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))})}}ka.GAUGE_GROUP_CLASS="rct-gauge-group";const La=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))])},Ta=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},Ma=function(t,e){const i=t.map(([t,i])=>t*e[0]+i*e[1]);return[Math.min(...i),Math.max(...i)]},Na=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},Ea=function(t,e){const i=La(t),s=La(e),r=Ta(i),n=Ta(s);for(const t of[...r,...n]){const e=Ma(i,t),r=Ma(s,t);if(!Na(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 Oa{static reveal(t,e){new Ra(t,e)}static grow(t,e){new Fa(t,e)}static spread(t,e){new za(t,e)}static fadeIn(t){new Da(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);ot.isAnimation(i)&&(i.addEventListener("finish",()=>{t._animationFinished(i)}),t._animationStarted(i))}}class Da extends Oa{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:ye.DURATION,fill:"none"})}}class $a extends Oa{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=$a.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:ye.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 Ra extends ye{constructor(t,e){super(),this._series=t,this._cr=$a.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 Pe}_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 Ia extends ye{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Pe}_stop(t){super._stop(t),this._series=null}}class Fa extends Ia{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class za extends Ia{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Ha extends aa{constructor(t){super(t,"rct-series-trendline-label")}}class Ga extends ke{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new Ne(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new Ne(t,"rct-series-trendline-variable")),this.add(this._line=new Ne(t)),this.add(this._label=new Ha(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 Ne(t,"rct-series-trendline-marker")),this.add(this._endMarker=new Ne(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=as(e,n,t.y);return{x:e.cx+s*_(i),y:e.cy+s*d(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 we;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 we,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 we,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=xs.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 ja extends ye{constructor(t,e,i,s){super(),this.duration=i?200:100,this._sv=t,this._focused=i,this._marker=e,i||(this._marker.setBoolData(eh.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(eh.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Ya extends aa{constructor(t){super(t,"rct-point-label")}}class Xa extends ke{constructor(t){super(t,"rct-point-labels"),this._labels=[new Jo(this,Ya),new Jo(this,Ya)],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=g(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===Ls)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(Ea(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});Ea(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(Ea(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});Ea(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===Ts&&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 Wa extends ea{constructor(t){super(t),this.add(this._line=new Ne(t))}setLine(t){this._line.setPath(t)}}class Ua extends ea{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Jo(this,Wa)}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 Za extends ke{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 qa extends aa{constructor(t){super(t,"rct-stack-label")}}class Ka extends ke{constructor(t){super(t,"rct-stack-labels"),this._labels=new Jo(this,qa),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 Qa={},Ja="rct-point-hover",th="rct-point-unhover";class eh extends na{static register(...t){t.forEach(t=>{Qa[t[0].type]=t[1]})}static isPointDom(t){for(;ae.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 Za(t,"rct-series-points")),this._labelContainer=new Xa(t),this._stackLabelContainer=new Ka(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")===St,this.setData("index",e._seriesIndex%mr),this.setData("pointcolors",this._colorByPoint?this._getPointColors():ft),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(Ja).addClass(th)})):this._getPointPool().forEach(t=>{t.containsClass(th)&&t.removeClass(th).addClass(Ja)})}_clearHoverClasses(t){t instanceof Pe&&t.removeClass(Ja).removeClass(th)}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 Pe&&(!t||t.indexOf(e)<0)){const t=i.find(t=>t._marker===e);t&&t.cancel(),e.setBoolData(eh.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof dh&&r.push(new ja(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 Pe&&(t.setBoolData(eh.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof dh?r.push(new ja(this,t,!0,()=>{t.endHover(this,!0)})):this instanceof gh&&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&&me(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 xr&&e.trendline.visible?(this._trendView||this.add(this._trendView=new Ga(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(),u=t.prop("align"),p=this._labelContainer,g=p&&p.visible,m=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=m?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(u);const V=y?0:t.getRotation(),{width:C,height:N}=e.getBBox(),E=V*v,B=0!==V?N*f(_(E))+C*f(d(E)):N,O=0!==V?C*f(_(E))+N*f(d(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(m){const t=P(null==I?void 0:I.xPos,m.cx+m.rd*_(m.start+h.getPos(A,n))),i=P(null==I?void 0:I.yPos,m.cy+m.rd*d(m.start+h.getPos(A,n))),s=Math.atan2(i-m.cy,t-m.cx),r=as(m,a,x)+(S!==w?-1:1)*(N/2+l);let o=0;"left"===u?o=-(C/2+c):"right"===u&&(o=C/2+c),D=m.cx+r*_(s)+-d(s)*o,$=m.cy+r*d(s)+_(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,_=o?this.getPointView(o):null,d=(null==_?void 0:_.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"===u?"right":"right"===u?"left":u:u;$="left"===a?o-d/2-B/2-N/2-c:"right"===a?o+d/2+B/2-N/2+c:o-N/2+c,$+=N*t._vertAdjust;const _=this._applyOverflowFit(t._overflowFit,D,C,k);if(null===_){e.setVis(!1);continue}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"===u?o-d/2-O/2-C/2-c:"right"===u?o+d/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(ot.randomLike(e.index)*mr):e.index%mr;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 xr&&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,g(a.axisMin(),s.fromValue)),c=a.getPos(o?t:e,p(a.axisMax(),s.toValue));n?o?h?r.setBounds(c,-e,f(c-l),e):r.setBounds(l,-e,f(c-l),e):r.setBounds(0,-g(l,c),t,f(c-l)):o?h?r.setBounds(c,0,f(c-l),e):r.setBounds(l,0,f(c-l),e):r.setBounds(0,e-g(l,c),t,f(c-l))}_setFill(t,i){e(i)&&i[Pt]?t.internalSetStyle(Pt,i[Pt]):r(i)&&t.dom.classList.add(i)}_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&&_!==Cs)if(l?_!==Vs&&_!==Ss||(d*=-1):_===Ss&&(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}}eh.POINT_CLASS="rct-point",eh.DATA_FOCUS="focus",eh.DATA_UNFOCUS="unfocus",eh.DATA_UNHOVER="unhover",eh.LEGEND_MARKER="rct-legend-item-marker";class ih extends Ne{constructor(t){super(t,eh.POINT_CLASS)}savePrevs(){}}class sh extends ih{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class rh extends Pe{constructor(t){super(t,eh.POINT_CLASS)}savePrevs(){}}class nh extends rh{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let oh=class extends sh{layout(t,e,i,s,r,n,o){this.x=t,this.y=e,this.setPath(xs.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 ah extends nh{constructor(t){super(t),this.add(this._topView=new Ne(t)),this.add(this._frontView=new Ne(t)),this.add(this._sideView=new Ne(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(nt&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(xs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(xs.polygon(t,c,t+a,c,t+a-r,c+n,t-r,c+n)),this._topView.setStyle("fill",oe.interpolate(o?oe.BLACK:oe.WHITE,l,.2)),this._sideView.setPath(xs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",oe.interpolate(o?oe.WHITE:oe.BLACK,l,.2))}}class hh extends ea{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class lh extends eh{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&&Oa.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach(t=>t.savePrevs())}getPointsAt(t,e){return[]}}class ch extends lh{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new Ua(t))}depthEnabled(){return!0}_prepareSeries(t,e,i,s){s?(this._depthAngle=s.prop("angle")*v,this._base=_(this._depthAngle)*e.depth,this._side=d(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,l=this._labelViews(),c=this._labelLineContainer,u=s._xAxisObj,p=s._yAxisObj,f=this._yReversed,m=this._depthExt,y=s._group?s._groupDistance:s.distance,b=m?y*(r?d(this._depthAngle):_(this._depthAngle)):0,x=m?y*(r?_(this._depthAngle):d(this._depthAngle)):0,v=2*u.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=>u.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(g(L,P(M,T))),T),B=this._pointOff,O=l&&h(this._labelInfo,{inverted:r,reversed:f,labelPos:s.getLabelPos(a),labelOff:s.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:x,side:this._side,base:this._base});l&&c.setVis(s.pointLabel.line.visible)&&(c.internalClearStyleAndClass(),c.internalSetStyleOrClass(s.pointLabel.line._style),c.prepare(s),O.pb=new we),this._prepareLayoutPoints(t,e),null===(i=this._getPointPool().getOrphans())||void 0===i||i.forEach(t=>{this._shrinkPoint(t)}),this._getPointPool().forEach((i,h)=>{const c=i.point;if(i.setVis(!c.isNull)){const _=u.getUnitLen(V,c.xValue)*(1-v);let d=s.getPointWidth(_,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)-_/2,y=k-p;isNaN(o+i.wSave)||(d=i.wSave+(d-i.wSave)*o),m+=s.getPointPos(_)+d/2,isNaN(o+i.xSave)||(m=i.xSave+(m-i.xSave)*o),c.xPos=m+=d*B,c.yPos=y,this._layoutPoint(i,h,m-b,k-E*(1-n)-g*n+x,d,f),r&&(y=V-A(c.xValue)+_/2,m=k,c.yPos=y-=s.getPointPos(_)+d/2+d*B,c.xPos=m+=N?C(c.yGroup)*n:C(c.yGroup*n)),O&&(O.labelView=l.get(c,0))&&(O.pointView=i,O.x=m,O.y=y,O.wPoint=d,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 _h extends lh{_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(),l=i._xAxisObj,c=i._yAxisObj,_=2*l.unitPad(),d=P(i.prop("minPointWidth"),0),u=s?t:e,p=s?e:t,g=s?0:e,f=this._pointOff,m=a&&h(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((h,y)=>{const b=h.point;if(h.setVis(!b.isNull)){const x=l.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=l.getPos(p,b.xValue)-x/2,V=g-c.getPos(u,this._getHighValue(b))*r;isNaN(n+h.wSave)||(v=h.wSave+(v-h.wSave)*n),S+=i.getPointPos(x)+v/2,isNaN(n+h.xSave)||(S=h.xSave+(S-h.xSave)*n),b.xPos=S+=v*f,b.yPos=V,this._layoutPoint(h,y,S,V,v,w),s&&(V=p-l.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=h,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 dh extends ih{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 uh extends eh{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!==Cs){(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 ph extends ye{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 gh extends eh{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 ph(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,i){return vs.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 fh extends va{constructor(t){super(t,fh.CLASS_NAME),this.addToTransform(this._imageView=new oa(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),U(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)}}fh.CLASS_NAME="rct-image-annotation";class mh extends va{constructor(t){super(t,mh.CLASS_NAME),this.addToTransform(this._shapeView=new Ne(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 Wr:!Number.isNaN(l)&&Number.isNaN(h)&&(i=l),Number.isNaN(_)||(r=Number.isNaN(c)?s-_:n.height/2),this._shapeView.setPath(xs.line(i,r,i+n.width,r));break;case Xr:Number.isNaN(l)||(i=Number.isNaN(h)?l:n.width/2),!Number.isNaN(_)&&Number.isNaN(c)&&(r=s-_),this._shapeView.setPath(xs.line(i,r,i,r+n.height));break;case Ur:{const t=this.$_lineEndpoints(h,l,c,_,s,n);this._shapeView.setPath(xs.line(t.xStart,t.yStart,t.xEnd,t.yEnd));break}case Zr:{const i=this.$_lineEndpoints(h,l,c,_,s,n),r=xs.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:xs.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 Ne(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}}}mh.CLASS_NAME="rct-shape-annotation";class yh extends va{constructor(t){super(t,yh.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new Fe(t)),this._textView.anchor=$e.START,this._richText=new Ze}_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=U(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()}}yh.CLASS_NAME="rct-text-annotation";class bh extends Jo{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 xh extends dh{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;xs.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)),xs.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 vh extends Za{}class wh extends eh{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new vh(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Ne(t,"rct-line-series-line")),this._markers=new bh(this._pointContainer,xh),this.add(this._tester=new Ne(t)),this._tester.setFill("#ff000010"),this._arrowViews=new Jo(this._pointContainer,Ne,"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 En&&(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&&Oa.grow(this):t&&Oa.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 Ne(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 Jo(this._lineContainer,Ne)),s.prepare(e.length);i.length<e.length;){const t=new Me(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=bt(g(0,p((b-f(o-a))/2,.2))),c=n?1:this._getGrowRate(),_=s-r,d=r+(g(i,r)-r)*c,u=r+_*c,m=u>0?d/u:0;this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(xs.donut(t,e,u,d)),this._outerLineClip.setPath(this._outerClip.getPath())):r>0?(this._outerClip.setPath(xs.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(xs.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(xs.circle(t,e,d)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(xs.sector(t,e,u,u,m,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():xs.sector(t,e,u,u,m,o-l,a+l,!0))):r>0?(this._outerClip.setPath(xs.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(xs.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(xs.sector(t,e,d,d,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():xs.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 En&&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),xs.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"),u=r.prop("lastVisible"),f=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 an?s.getBaseValue(C):NaN,F=I>C.axisMin(),z=A?F?as(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:p(P.min,j),P.max=null==P.max?j:g(P.max,j),Y=R?isNaN(t.yGroup)?F?z:T:F?z+(as(P,C,t.yGroup)-z)*h:hs(P,C,t.yGroup,h):isNaN(t.yGroup)?F?z:M:F?z+(as(P,C,t.yGroup)-z)*h:hs(P,C,t.yGroup,h),H=t.px=k+Y*_(j),G=t.py=L+Y*d(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 X=H,W=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!=u?u:s._maxY==t.yGroup&&null!=f?f: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*_(j),G=L+Y*d(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,X,W,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 En&&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),ae.setImportantStyle(t.dom.style,Pt,"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),ae.setImportantStyle(t.dom.style,Pt,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);if(t){const e=!isNaN(l)&&l>h.axisMin()?as(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")),ae.setImportantStyle(a.dom.style,Pt,"none"))}}_buildLine(t,e,i,s){const r=this.model;"spline"===e?this._drawCurve(t,i,s):r instanceof En&&"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 we;return"spline"===s?this._drawCurves(t,e,r):i instanceof En&&"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 En&&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 an?a.getBaseValue(h):NaN,c=l>h.axisMin()?as(t,h,l):this._yReversed?0:n,u=e[0],p=u.length;let g,f;o?(i.move(u[0].px,u[0].py),i.closedSpline(u,!0)):(g=s+c*_(u[0].angle),f=r+c*d(u[0].angle),i.move(g,f),i.line(u[0].xPos,u[0].yPos),i.closedSpline(u,!1),g=s+c*_(u[p-1].angle),f=r+c*d(u[p-1].angle),i.line(g,f))}else e.forEach(t=>this._drawCurve(t,!1,i))}_buildAreas(t,e,i){const s=new we;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 En))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)){xs.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),r(i)&&this.$_isolateClassArrowStrokeDasharray(t,Ln.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 Sh extends wh{constructor(t){super(t,Sh.CLASS),this._flagView=new aa(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)}}}Sh.CLASS="rct-line-series";class Vh extends wh{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new vh(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Ne(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Ne(t,"rct-areanrange-series-line")),ae.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,u=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=u-l.getPos(c,i.lowValue)}const w=this._markers;for(let h=0,u=t.length;h<u;h++){const m=t[h],S=w.get(u+h),V=p&&p.get(m,1);let C,A,k,L;this._prepareMakrer(S),f?(k=P(m.angle,0),L=hs(f,l,m.lowValue,v),C=m.px2=f.cx+L*_(k),A=m.py2=f.cy+L*d(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===u-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*_(k),A=f.cy+e*d(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 wh{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new vh(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Ne(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 Ne(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 Jo(this._areaContainer,Ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<p(e.length,s.length);t++)this.isClip(s[t])||(s[t]=this.control.addClip(new Me(i)));for(;s.length<e.length;)s.push(this.control.addClip(new Me(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=as(a,r,i.yGroup-i.yValue),e=i.angle;i.yLow=a.cy+t*d(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(Pt,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(Pt,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 an?s.getBaseValue(o):NaN,l=this._polar,{cx:c,cy:u,rd:f,rdInner:m,cyclic:y}=l,x=new we,v=i.length;if(!r||"stack"!==r.prop("layout")&&"fill"!==r.prop("layout")){const r=h>o.axisMin(),w=r?as(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*_(i[0].angle),C=u+w*d(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*_(i[v-1].angle),C=u+w*d(i[v-1].angle),x.line(V,C))}const T=i.map(t=>t.angle),M=this._polar.min=p(...T),N=this._polar.max=g(...T),E=(new we).push(x.end());if(r)y?x.circle(c,u,w):a&&x.push(...xs.arc(c,u,w,w,M,N,!0)),P=x.end(),k=!0,y?E.circle(c,u,w):E.push(...xs.arc(c,u,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,u,f):x.polygon(...i.map(i=>({x:c+_(t+i.pos/f*e/b)*f,y:u+d(t+i.pos/f*e/b)*f}))):S?x.push(...xs.sector(c,u,f,f,0,M,N,!0)):x.polygon({x:c,y:u},...i.map(i=>({x:c+_(t+i.pos/f*e/b)*f,y:u+d(t+i.pos/f*e/b)*f}),{x:c,y:u})),m>0&&x.circle(c,u,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=as(l,o,t.yGroup-t.yValue);return{x:c+e*_(t.angle),y:u+e*d(t.angle)}},s=e(i[0]);x.move(P(s.x,c),P(s.y,u)),x.line(P(i[0].xPos,c),P(i[0].yPos,u));for(let t=1;t<i.length;t++)x.line(P(i[t].xPos,c),P(i[t].yPos,u));const r=e(i[i.length-1]);x.line(P(r.x,c),P(r.y,u));for(let t=i.length-1;t>=0;t--){const s=e(i[t]);x.line(P(s.x,c),P(s.y,u))}t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),ae.setImportantStyle(t.dom.style,At,"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")),ae.setImportantStyle(e.dom.style,At,"none")),s._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new Ee(this.doc)));const t=m>0?m/f:0,e=xs.sector(c,u,f,f,t,l.start,l.start+l.total,!0);this._arcClip.setPath(e),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Ph extends _h{constructor(t){super(t,"rct-barrange-series"),this._bars=new bh(this._pointContainer,oh)}_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 Ah extends Xn{constructor(t){super(t,eh.POINT_CLASS)}savePrevs(){}}class kh extends ch{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 bh(this._pointContainer,Ah)),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:u,rd:g,rdInner:f}=l,m=o instanceof an?t.getBaseValue(o):NaN,y=m>o.axisMin(),b=as(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=hs(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=as(l,o,A.yGroup);if(a?y?(T=b+(E-b)*e,M=b):(T=g,M=r):y?(T=b+(E-b)*e,M=b):(T=r,M=f),i.setSector({cx:c,cy:u,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*_(N),A.yPos=u+i.ry*d(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?p(b,r+s/2+V):"foot"===S?b-s/2-V:b-(b-r)/2-V:"outside"===S?n-s/2-V:"head"===S?p(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=u+o*d(N),o=c+o*_(N),"outside"!==S&&P.setContrast(i.dom),this.applyAutoRotation(P,N,l.total),P.trans(o-e/2,h-s/2)}}})}}class Lh extends kh{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new bh(t,ah):new bh(t,oh)}_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 oh){const e=this.model._xAxisObj;t.shrink(e.prop("reversed"),e._vlen,this._rdTop,this._rdBottom)}}}class Th extends Ch{constructor(t){super(t,"rct-bellcurve-series")}}class Mh extends hh{constructor(t){super(t,eh.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 vs(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 Nh extends _h{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new bh(this._pointContainer,Mh)}_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 Eh extends dh{}class Bh extends uh{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new ke(t,"rct-bubble-pie"))}_createMarkers(t){return new bh(t,Eh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oa.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 Jo(this._pieContainer,Xn,eh.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(vs.create(t,eh.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(),u=s._xAxisObj,p=s._yAxisObj,g=this._polar=s.chart._body.getPolar(u),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=xs.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+u.getPos(m,T.xValue),e=as(g,p,T.yValue);L=g.cx+e*_(t),N=g.cy+e*d(t)}else L=u.getPos(m,T.xValue),N=v-p.getPos(f,T.yValue),r&&(L=p.getPos(f,T.yValue),N=e-u.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:f(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*_(a),c=r+h*d(a),u={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:u})}}}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 Oh=class extends hh{constructor(t){super(t,eh.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue;const r=0+e-e*(0===s?1:(p(i.openValue,i.closeValue)-i.lowValue)/s),n=0+e-e*(0===s?1:(g(i.openValue,i.closeValue)-i.lowValue)/s),o=p(n,r),a=g(1,f(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 vs(t))}};class Dh extends _h{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new bh(this._pointContainer,Oh)}_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 $h extends ih{layout(t,e,i){const s=new we;s.circle(t,e,i),this.setPath(s.end())}}class Rh extends kh{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new bh(t,$h)}_layoutPoint(t,e,i,s,r,n){t.layout(i,s-n/2,n/2-1)}}let Ih=class extends hh{constructor(t){super(t,eh.POINT_CLASS),this.add(this._line=new Cn(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Ne(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Ne(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),xs.setShape(r,o.shape,a,a),xs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,s-a)}};class Fh extends _h{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new bh(this._pointContainer,Ih)}_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 zh=class extends ea{constructor(t){super(t,eh.POINT_CLASS),this._segments=new Jo(this,Ne),this._decimal=0,this.add(this._back=new Ne(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(xs.rectangle(e,i,s,-r)),this._segments.forEach((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(xs.rectangle(e,i-t[2*a],s,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(xs.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 Hh extends ch{constructor(t){super(t,"rct-equalizer-series"),this._bars=new bh(this._pointContainer,zh)}_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 Gh=class extends hh{constructor(t){super(t,eh.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 vs(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 jh extends _h{constructor(t){super(t,"rct-errorbar-series"),this._bars=new bh(this._pointContainer,Gh)}_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 Yh extends ih{}class Xh extends gh{constructor(t){super(t,"rct-funnel-series"),this._segments=new bh(this._pointContainer,Yh),this.add(this._lineContainer=new Ua(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&&Oa.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=bt(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=bt(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 we,m=s.getCenter(t,e),y=m.x-u.width/2,b=m.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 we,A=(null==r?void 0:r.getWidth(0))||0;let k,L;this._lineContainer.setStyleOrClass(n.connector.prop("style")),this._segments.forEach(n=>{const m=n.point;if(n.setVis(!m.isNull)){const y=m.yPos*u.height,T=(m.yPos+m.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(m),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=f(V-M),n.nx3=D,n.nx4=$),n.setPath(g.close(!0)),m.xPos=v,m.yPos=M+(N-M)/2,r&&(k=r.get(m,0))&&k.visible){const i=s.getLabelOff2(m);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(m.xPos-s/2+i,m.yPos-e.height/2);break;case 1:k.trans(m.xPos+s/2-e.width-i,m.yPos-e.height/2);break;default:k.trans(m.xPos-e.width/2,m.yPos-e.height/2)}}else-1===h?this.$_layoutLabelAligned(!1,m,n,k,l,d,L,P,u,v,i,a):1==h?this.$_layoutLabelEnded(!1,m,n,k,l,d,L,P,v,i,a,A,t,e):this.$_layoutLabelOutside(!1,m,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 Wh=class extends sh{layout(t,e){this.setPath(xs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Uh extends lh{constructor(t){super(t,"rct-histogram-series"),this._bars=new bh(this._pointContainer,Wh)}_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,l=i._yAxisObj,c=s?t:e,_=s?e:t,d=l.getPos(c,i.getBaseValue(l)),u=s?0:e,p=o&&h(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((h,g)=>{const f=h.point,m=a.getPos(_,f.min),y=a.getPos(_,f.max),b=l.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(h,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+=l.getPos(c,f.yGroup)),p.pointView=h,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=g(1,c-l-1);h.xPos=_,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(_,r)})}}class Zh extends ea{constructor(t){super(t,eh.POINT_CLASS),this.add(this._line=new Cn(t,"rct-lollipop-point-bar")),this.add(this._marker=new Ne(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),xs.setShape(this._marker,this.point.shape,i,i),this._marker.trans(-i,-i)}savePrevs(){this.xSave=this.tx}}class qh extends ch{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 bh(this._pointContainer,Zh)),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 Kh extends hh{constructor(t){super(t,eh.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue,r=-t/2;const n=0+e-e*(p(i.openValue,i.closeValue)-i.lowValue)/s,o=0+e-e*(g(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 vs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class Qh extends _h{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new bh(this._pointContainer,Kh)}_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 Jh extends wh{constructor(t){super(t,"rct-pareto-series")}}class tl extends Ne{setOff(t){return this.off=f(t),this}}class el extends Xn{constructor(t){super(t,eh.POINT_CLASS)}render(t,e,i){this._assignShape(i,!1)}}class il extends Pe{constructor(t){super(t,eh.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Xn(t))}setSides(t,e,i,s,r){const n=this.point,o=bt(y),a=bt(((t?n.startAngle:n.startAngle+n.angle)+y/2+b)%b),h=bt(a+(t?n.angle:-n.angle)-1e-4+b)%b,l=o-(a+f(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(p(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(p(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=s.setOff(l),a>=0&&a<=y&&this._outArcView.setOff(p(this._outArcView.off,this._side1View.off)),h>=y&&h<b&&this._outArcView.setOff(p(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,i){const s=xs.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;nt&&(r=this.control.getIEColor(r)),this._outArcView.setPath(xs.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(xs.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(xs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(xs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(xs.polygon(i.cx,i.cy,a.x1,a.y1,a.x1,a.y1+o,i.cx,i.cy+o)),this._side2View.setPath(xs.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",oe.interpolate("#000",r,.2)),this._side2View.setStyle("fill",oe.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",oe.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",oe.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(eh.DATA_FOCUS,t),this._side2View.setBoolData(eh.DATA_FOCUS,t),this._inArcView.setBoolData(eh.DATA_FOCUS,t),this._outArcView.setBoolData(eh.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 sl extends gh{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new we,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 ma(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new aa(t,"rct-pie-series-inner")),this._textView._text.anchor=$e.MIDDLE,this._pointContainer.add(this._sideContainer=new ke(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new Ua(t))}_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&&Oa.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 el||t instanceof il)&&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 il&&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 bh(this._pointContainer,il,null),n=this._sides=new Jo(this._sideContainer,tl,"rct-pie-series-side")):this._sectors=new bh(this._pointContainer,el,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=bt(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,u=this._depth,p=this._ratio,g=this._sides,m=s.pointLabel,y=m.connector.prop("curved"),b=this._labelViews(),x="inside"===s.getLabelPos(m),v=P(m.prop("radius"),.7),w=this._pb,S=m.getDistance(x,l,c),V=m.getWidgetAlign();let C=null==b?void 0:b.textAlign();const A=this._lineContainer.setVis(m.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(m.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 m=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(m),m.isNull)t.setVis(!1),b&&(B=b.get(m,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=E>1&&m.sliced,g=m.startAngle,P=g+m.angle/2;let A=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(A+=_(P)*k,D+=d(P)*k),t.trans(A,D).setVis(!0),m.xPos=a+_(P)*(k+l*v),m.yPos=h+d(P)*(k+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:c,start:g,angle:f(m.angle),clockwise:r,depth:u}),b&&(B=b.get(m,0))){const r=s.getLabelOff2(m);let n;x?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,B,C,r,S,o?k:0)):(n=-1===V?this.$_layoutLabelAligned(!1,m,B,C,O,w,y,r,S,o?k:0):1==V?this.$_layoutLabelEnded(!1,m,B,C,O,w,y,r,S,o?k:0,N,e,i):this.$_layoutLabelOutside(!1,m,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=m.prop("convergent"),$=m.prop("dedupeMode"),R=m.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(),u=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+_(u)*y,v=g+d(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+d(u)*m;if(w?(C=p+_(Math.PI)*f-h,P=C-S.width-a,A=p+_(Math.PI)*y-h,S.width):(C=p+_(0)*f+h,P=C+a,A=p+_(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,u,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+_(f)*v,V=y+d(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+d(f)*x;if(C?(k=h+c+a,T=h+c-P.width,L=k):(k=u-h-c-a,T=u-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 u=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=_(p)*l,x=d(p)*l,v=g+_(p)*this._rx,w=f+d(p)*this._ry,S=g+_(p)*m;let V=f+d(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-=u.width+a:A+=a,V-=u.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,g=t.startAngle+t.angle/2;if(l){const t=a._totalRad,i=p(a.prop("totalAngle")||360,360);if("angle"===c){let s=g/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,g,t,i)}else this._layoutLabelRotation(e);const f=h.prop("align")===As?.3:h.prop("align")===Ps?.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(g),x=Math.sin(g);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(_(l)*o,d(l)*o,a):t.transEx(0,0,a),!r)return;const c=s.pointLabel,u=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&&u.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 rl extends dh{setHoverRate(t,e,i){const s=this.point,r=xs.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 nl extends uh{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new bh(t,rl)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Oa.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"),u=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=xs.getDrawer(i.getShape(V)),S=ot.jitter(V.xValue,u),P=ot.jitter(V.yGroup,p);let A,k;if(a){const t=a.start+n.getPos(b,S),e=hs(a,o,P,h);A=a.cx+e*_(t),k=a.cy+e*d(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 ol extends _h{constructor(t){super(t,"rct-waterfall-series"),this._bars=new bh(this._pointContainer,oh),this.add(this._lineContainer=new ke(t,"rct-waterfall-series-lines")),this._lines=new Jo(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 al(t,e){return new(xa[e._type()])(t)}function hl(t,e){return new(Qa[e._viewType()])(t)}eh.register([Dn,Ch],[In,Vh],[bn,Lh],[fn,Ph],[Gn,Th],[Yn,Nh],[to,Bh],[so,Dh],[no,Rh],[co,Fh],[uo,Hh],[po,jh],[yo,Xh],[vo,Uh],[En,Sh],[Vo,qh],[Po,Qh],[ko,Jh],[Bo,sl],[$o,nl],[Fo,ol]),va.register([Qr,yh],[qr,fh],[Kr,mh]);class ll extends ia{constructor(t){super(t,"rct-axis-grid"),this._lines=new Jo(this,Cn),this.add(this._minorLineContainer=new Pe(t,"rct-axis-minor-grid")),this._minorLines=new Jo(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 Jr&&e instanceof on){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 cl extends Pe{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Ne(t)),this._mask.setStroke("none"),this.add(this._upLine=new Ne(t)),this._upLine.setFill("none"),this.add(this._downLine=new Ne(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 we;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 _l extends Pe{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new aa(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 dl extends _l{constructor(t,e){super(t),this.insertFirst(this._line=new(e?ba:Cn)(t,"rct-axis-guide-line"))}prepare(t,i){super.prepare(t,i),this.setVis(i.visible&&i.axis.contains(i.prop("value")))&&e(i._style)&&this._line.setStyles(i._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=os(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(Pt,"none"),n&&n.trans(i.cx+h*_(i.start),i.cy+h*d(i.start))}}class ul extends _l{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Xn:ws)(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=!a(i)&&!a(s);this._range=r?e.axis.trimRange(p(i,s),g(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(g(0,p(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=os(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*_(i.start),i.cy+t*d(i.start))}}}class pl extends ke{constructor(){super(...arguments),this._views=new Jo(this,Ne)}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=g(0,p(t,o.getPos(t,a))),r=g(0,p(t,o.getPos(t,h)));s.setPath(xs.rectangle(i,0,r-i,e))}else{const i=g(0,p(e,o.getPos(e,a))),r=g(0,p(e,o.getPos(e,h)));s.setPath(xs.rectangle(0,e-i,t,i-r))}s.internalClearStyleAndClass(),s.setFill("none"),s.setFill(n.color),n.style&&s.internalSetStyleOrClass(n.style)})}}class gl extends ke{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof ul?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,i){e.forEach(e=>{let s;e instanceof Li?s=this._rangePool.pop()||new ul(t,i):e instanceof ki&&(s=this._linePool.pop()||new dl(t,i)),this.add(s),s.prepare(t,e)})}add(t){return this._views.push(t),super.add(t)}}class fl extends Ne{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 we;if(this._bar){const c=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 tr&&(_=l(_)),!isNaN(_)){const t=o.getPos(c,_);let e=o.getUnitLen(c,_);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 ml extends fa{constructor(t){super(t,"Reset Zoom",ml.CLASS_NAME),this.setVis(!1)}}ml.CLASS_NAME="rct-reset-zoom";class yl extends ke{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new vs(t,"rct-empty-view-back")),this.add(this._labelView=new aa(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 bl extends ke{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new Jo(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 xl extends ke{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new Ne(t)),this.add(this._gridContainer=new ke(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(xs.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(xs.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 bl(t),h.set(l,i),a.add(i)),i.layout(e,c,s,r,n,o)}}}class vl extends ke{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new xl(t,!0)),this.add(this._ySideView=new xl(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 wl extends ia{constructor(t,e){super(t,wl.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 vs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Ne(t,"rct-body-background")),this.add(this._depthLayer=new vl(t)),this.add(this._image=new oa(t,!0,"rct-body-image")),this.add(this._emptyView=new yl(t)),this.add(this._gridRowContainer=new pl(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new ke(t,"rct-axis-grids")),this.add(this._baseContainer=new ke(t,"rct-axis-bases")),this.add(this._guideContainer=new gl(t,"rct-axis-guides")),this.add(this._annotationContainer=new ke(t,"rct-annotations")),this.add(this._seriesContainer=new ke(t,"rct-series-container")),this.add(this._axisBreakContainer=new ke(t,"rct-axis-breaks")),this.add(this._labelContainer=new ke(t,"rct-label-container")),this.add(this._stackLabelContainer=new ke(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new gl(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new ke(t,"rct-front-annotations")),this.add(this._feedbackContainer=new ke(t,"rct-feedbacks")),this.add(this._zoomButton=new ml(t)),this._crosshairViews=new Jo(this._feedbackContainer,fl)}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=Ce._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(eh.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 Mn)){_=!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 Dr){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 to){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(eh.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(eh.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 f=.02*h;u<f&&(u=f);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=g(m,n.min),y=p(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=p(g(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(xs.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(wa[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 on)||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 ll(t);r.set(e,i),s.add(i)}if(e instanceof on&&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)||hl(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)||al(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 on&&o.push(...t._getBreaks())}));s.length<o.length;){const e=new cl(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)})}}wl.BODY_CLASS="rct-body";class Sl extends Pe{constructor(t){super(t,Vl.HANDLE_STYLE),this.add(this._back=new vs(t)),this.add(this._shape=new Ne(t)),this._shape.setFill("white")}layout(t,e,i){if(t!==this._w||e!==this._h||i!==this._vertical){const s=2*Hr.HANDLE_RADIUS,r=new we;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 Vl extends ia{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Vl.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Vl.MASK_STYLE)}constructor(t){super(t,Vl.CLASS_NAME),this.add(this._back=new vs(t,Vl.BACK_STYLE)),this.add(this._container=new ke(t,null)),this.add(this._mask=new vs(t,Vl.MASK_STYLE)),this.add(this._trackView=new vs(t,Vl.TRACK_CLASS)),this.add(this._thumbView=new vs(t,Vl.THUMB_CLASS)),this.add(this._startHandle=new Sl(t)),this.add(this._endHandle=new Sl(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=Hr.HANDLE_TRACK_HEIGHT,h=Hr.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*Hr.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=hl(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 ga(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 ga(t)),s._simpleMode=!0)}}Vl.CLASS_NAME="rct-navigator",Vl.BACK_STYLE="rct-navigator-back",Vl.MASK_STYLE="rct-navigator-mask",Vl.HANDLE_STYLE="rct-navigator-handle",Vl.HANDLE_BACK_STYLE="rct-navigator-handle-back",Vl.TRACK_CLASS="rct-navigator-track",Vl.THUMB_CLASS="rct-navigator-thumb";class Cl extends De{constructor(t){super(),this.chart=t}}class Pl 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=g(0,n.x),this._yStart=g(0,n.y),this._body.addFeedback(this._feedback=new vs(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const i=this._body.svgToElement(t,e);this._vertical?(e=g(0,p(this._body.height,i.y)),this._body.setZoom(0,p(g(0,this._yStart),e),this._body.width,g(p(this._yStart,this._body.height),e))):(t=g(0,p(this._body.width,i.x)),this._body.setZoom(g(0,p(this._xStart,t)),0,g(p(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=g(0,p(this._body.height,n.y)),this._feedback.setBounds(0,p(this._yStart,r),this._body.width,f(this._yStart-r))):(s=g(0,p(this._body.width,n.x)),this._feedback.setBounds(p(this._xStart,s),0,f(this._xStart-s),this._body.height)),!0}}class Al 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 kl 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 Ll 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 Tl 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=g(0,p(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Ml{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=f(this._clickX-s),l=f(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 Ws){const s=e,r=t.seriesByPoint(s);if(r){r.setPointVisible(s,!s.visible);const t=i.findSeriesView(r);t instanceof gh&&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(eh.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(ua.isThumb(t)||Vl.isHandle(t)||Vl.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&&(ua.isThumb(t)||Vl.isHandle(t)||Vl.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(f(this._clickX-r.x)>5||f(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=f(r-1)<.01,h=f(n)<.5&&f(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(ua.isThumb(t))return new Al(this._chart,s.getScrollView(t));if(Vl.isHandle(t))return new kl(this._chart,s._navigatorView,t);if(Vl.isMask(t)&&r&&r.model.isZoomed())return new Tl(this._chart,s._navigatorView,t);if(r&&r.contains(t)){if(this._isTouchPointer)return!this.$_followTouch()&&r.isAxisZoomed()?new Ll(this._chart,r):null;if(r.model.canZoom())return new Pl(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 Nl extends ke{constructor(t){super(t,Nl.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const i=this._itemViews,s=this._separators;for(;i.length<e.length;){const e=new Fe(t,"rct-history-item");e.anchor=$e.START,i.push(e)}for(;i.length>e.length;)i.pop().remove();for(;s.length<e.length-1;){const e=new Fe(t);e.anchor=$e.START,e.text=">",s.push(e)}for(;s.length>e.length-1;)s.pop().remove();this.$_layout(e)}}$_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)}}Nl.TITLE_CLASS="rct-history";class El extends ia{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new vs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Fe(t,"rct-legend-item-label")),this._label.anchor=$e.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():X,l=U(this._label.getBBox());return this._gap=e.legend.num("markerGap"),{width:h.width+this._gap+l.width,height:g(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 sa{constructor(t){super(t,Bl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Jo(this,El)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find(e=>e.model.source===t)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.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,f,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]),f=y.mh,x++,b++):(f+=h+y.mh,f<=n?(m.push(y),x++,b++):x=0);this._wMarkers=[],p=f=0,d.forEach((t,e)=>{let i=0,s=0,r=0;t.forEach(t=>{s+=t.mh,i=g(i,t.mw),r=g(r,t._rMarker.width),t._col=e}),s+=h*(t.length-1),f=g(f,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=f=0,d.forEach(t=>{let e=0,i=0;t.forEach(t=>{e+=t.mw,i=g(i,t.mh)}),e+=h*(t.length-1),p=g(p,e),f+=i,u.push(i)}),f+=l*(d.length-1)}return{width:p,height:f}}}Bl.LEGEND_CLASS="rct-legend";class Ol extends Pe{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new ma(t))}layout(){}}class Dl extends Pe{constructor(t,e,i,s){super(t,e),this.add(this._markContainer=new ke(t,"rct-polar-axis-markers")),this._markViews=new Jo(this._markContainer,Ol),this.add(this._gridContainer=new Pe(t,"rct-polar-axis-grids")),this._labelViews=new Jo(this._labelContainer=i,_a,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(pa)?t.setLabel(i,o,e,r.replace(pa,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 $l extends Dl{constructor(t,e,i){super(t,"rct-polar-xaxis",i,!0),this._gridLines=new Jo(this._gridContainer,Cn,$l.GRID_CLASS),e.insertFirst(this._startView=new Cn(t,$l.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Cn(t,$l.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new ba(t,$l.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+_(o+l)*s,u=i+d(o+l)*s,p=e+_(o+l)*h,g=i+d(o+l)*h;n.setFill("none"),n.setLine(p,g,c,u),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=[],u=t.label.prop("rotation")||0,p="auto"===u;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+_(g)*(h+a.width/2),r=i-a.height/2+d(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+_(g)*(h+a.width/2)-a.width/2,r=i+d(g)*(h+a.height/2)-a.height/2;t.trans(s,r),t.setRotation(a.width/2,a.height/2,u)}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(Ea(r,n)?(e.setVis(!1),c.splice(t,1),--t):(f=e,g=t),t===c.length-1&&c.length>1){if(ot.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});Ea(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+_(o)*s,i+d(o)*s),r.map(t=>{const r=t.pos;h.push(e+_(o+r)*s,i+d(o+r)*s)}),n&&r[r.length-1].pos<a&&h.push(e+_(o+a)*s,i+d(o+a)*s),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e+_(o)*h,i+d(o)*h,e+_(o)*s,i+d(o)*s),this._endView.setLine(e+_(o+a)*h,i+d(o+a)*h,e+_(o+a)*s,i+d(o+a)*s))}}$l.LINE_CLASS="rct-polar-xaxis-line",$l.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",$l.GRID_CLASS="rct-polar-xaxis-grid-line";class Rl extends Dl{constructor(t,e,i){super(t,"rct-polar-yaxis",i,!1),this._gridViews=new Jo(this._gridContainer,ba,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Cn(t,"rct-polar-yaxis-line")),e.add(this._baseView=new ba(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,i,s){const r=t.line,n=t instanceof on&&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=os(o,t);function l(t,s){if(t.setFill("none"),c)t.setArc(e,i,s,g,f,!0);else{const r=[];p&&u[0].pos>0&&r.push(e+_(g)*s,i+d(g)*s),u.forEach(t=>{const n=t.pos;r.push(e+_(g+n)*s,i+d(g+n)*s)}),p&&u[u.length-1].pos<f&&r.push(e+_(g+f)*s,i+d(g+f)*s),t.setPolyline(r)}}const c=this._circular,u=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+_(t)*c-l.width*s+o,i+d(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*_(g),i+a*d(g),e+s*_(g),i+s*d(g)):this._lineView.setVLine(e,i-a,i-s)),this._baseView.visible&&l(this._baseView,a+t.getPos(h,t.getBaseValue()))}}class Il extends wl{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?xs.donut(s,r,n,o):xs.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(t){this._innerTextView||(this.add(this._innerTextView=new aa(t,"rct-polar-body-inner")),this._innerTextView._text.anchor=$e.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 ke(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),i),this.insertAfter(this._yAxisLabelContainer=new ke(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),i),this.insertAfter(this._lineContainer=new ke(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new ke(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new ke(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<i.length;){const e=new Rl(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 $l(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,s,r))}}class Fl extends sa{constructor(t,e){super(t,e?Fl.SUBTITLE_CLASS:Fl.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Fe(t)),this._richText=new Ze}_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),U(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Fl.TITLE_CLASS="rct-title",Fl.SUBTITLE_CLASS="rct-subtitle";class zl extends Pe{constructor(t){super(t,"rct-tooltip-row"),this._hasMarker=!0,this.add(this._marker=new Ne(t,"rct-tooltip-row-marker")),this.add(this._textView=new Fe(t,"rct-tooltip-row-text")),this._textView.anchor=$e.START,this.add(this._detailView=new Fe(t,"rct-tooltip-row-detail")),this._detailView.anchor=$e.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=xs.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 Hl extends Pe{constructor(t){super(t,"rct-tooltip-list"),this.add(this._headerView=new Fe(t)),this._headerView.anchor=$e.START,this.add(this._rowLayer=new ke(t,"")),this.add(this._footerView=new Fe(t)),this._footerView.anchor=$e.START,this._rows=new Jo(this._rowLayer,zl)}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=g(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 Gl extends Pe{constructor(t){super(t,Gl.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Ne(t,"rct-tooltip-back")),this.add(this._top=new Ne(t,"rct-tooltip-top")),this.add(this._textView=new Fe(t,"rct-tooltip-text")),this.add(this._listView=new Hl(t)),this._back.setAttr("filter","url(#"+Ce.SHADOW_FILTER+")"),this._textView.anchor=$e.START,this._richText=new Ze,this.close(!0,!1)}setOnHidden(t){this._onHidden=t}show(t,e,s,r,n,o,a){const h=s.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=i(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=i(e)?e.join(" "):e,!d||!d.trim())return}this.setStyleOrClass(l._style);const f=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 Tr&&t.getBaseValue(S)>s.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=g(l.num("minWidth"),V.width+16),P=g(l.num("minHeight"),V.height+12)+x;let k=t.getTooltipHeaderColor(h);null===k&&(k=t._calcedColor,t instanceof Pr?(t.prop("legendByPoint")||t._colorByPoint())&&(k=h._calcedColor):t._colorByPoint()&&(k=getComputedStyle(s.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-g(0,p(o-P/2,m-P)),O=D?A?C+T>n:n+C+T>f:A?C+T>M.x-N.x+M.width:M.x-N.x-T>f-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-g(0,p(n-C/2,f-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-g(0,p(o-P/2,m-P));const t=M.x-N.x;B=f-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=g(0,p(n,f-C)),o=g(0,p(o,m-P)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(g(0,n-20),g(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"):Yr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){var t;me(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)}}Gl.CLASS_NAME="rct-tooltip";class jl extends Ae{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Gl(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 Yl extends K{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=ae.isHoverAt(e),s=this._model=t;return ae.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(s.num("width"))?s.prop("autoWidth")?e.style.width="max-content":e.style.width="":e.style.width=kt(s.prop("width")),isNaN(s.num("height"))?e.style.height="":e.style.height=kt(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")?ae.setStyles(this._img,{display:"",width:T(s.prop("imageWidth")),height:T(s.prop("imageHeight"))}):ae.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(nt?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",ae.setStyles(e,{position:"absolute",textAlign:"center"}),ae.setStyles(i,{display:nt?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(i),this._img=t.createElement("span"),this._img.className="rct-html-button-image",ae.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),i.appendChild(this._img),this._span=t.createElement("span"),ae.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),nt&&ae.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 Xl extends ra{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Fl(t,!1)),this.add(this.subtitleView=new Fl(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,f=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,f=o.num("titleGap")):d.setModel(o),o.prop("position")){case"leftSide":case"left":case"rightSide":case"right":p=g(l,_),u=h+f+c;break;default:p=l+f+_,u=g(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=g(this._hTitle,this._hSub);u=g(u,u+t(s,e,this._hTitle)),f=g(f,f+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=g(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=g(m,m+c(r,o,this._wSub))},d=r.num("titleGap");let u=0,p=a,f=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=g(m,m+(o-this._wTitle-this._wSub)/2);break;case"right":m=g(m,h+o-this._wSub)}l();break;case"top":_(),u=f+this._hSub+d;break;default:_(),f=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=f+this._hSub+d;break;default:_(),f=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=f+this._hSub+d;break;default:_(),f=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,f)}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 Wl extends ra{_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 Ul extends ra{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=g(n,l),o=g(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===Zo.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Zo.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 tr?Math.floor(e):e,to:t instanceof tr?Math.floor(i):i})})})}}class Zl extends ia{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Fe(t)),this._textView.anchor=$e.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 ql extends ke{}class Kl extends ke{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 ke(t,"rct-annotations")),this.add(this._plotContainer=new ke(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new wl(t,this));for(const e in Zo){const i=new Ul(t,Zo[e]);this._plotContainer.add(i),this._axisSectionMap[Zo[e]]=i}Kl.pane_class&&this.add(this._paneContainer=new Kl.pane_class(t,this)),this.add(this._titleSectionView=new Xl(t)),this.add(this._legendSectionView=new Wl(t)),this.add(this._frontAnnotationContainer=new ke(t,"rct-front-annotations")),this.add(this._creditView=new Zl(t)),this.add(this._navigatorView=new Vl(t)),this.add(this._historyView=new Nl(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||([Zo.LEFT,Zo.RIGHT].forEach(i=>{(e=t[i])&&e.visible&&(s-=e.mw)}),[Zo.TOP,Zo.BOTTOM].forEach(i=>{(e=t[i])&&e.visible&&(r-=e.mh)}),(e=t[Zo.LEFT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0),w+=e.mw),(e=t[Zo.RIGHT])&&e.visible&&(e.resize(e.mw,r-(g?g.side:0)),e.layout(0)),(e=t[Zo.BOTTOM])&&e.visible&&(e.resize(s-(g?g.base:0),e.mh),o||e.transX(w),e.layout(0),S-=e.mh),(e=t[Zo.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[Zo.LEFT])&&e.visible&&e.trans(i.x-e.mw,i.y-e.height),(e=t[Zo.RIGHT])&&e.visible&&e.trans(i.x+s,i.y-e.height),(e=t[Zo.BOTTOM])&&e.visible&&e.trans(i.x,i.y),(e=t[Zo.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 jl(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 Gl(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 ga(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 yr?d.hoverSeries(t):e.prop("pointHovering")&&t instanceof Ws&&d.hoverPoint(t)})}}if(g instanceof gs&&!(this._hoverItem instanceof gs)&&(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 $n&&!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 Zo){const i=this._axisSectionMap[Zo[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 Il(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 Yl(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[Zo.LEFT].checkWidths(t,i,s),i-=n[Zo.RIGHT].checkWidths(t,i,s),s-=n[Zo.BOTTOM].checkHeights(t,i,s),s-=n[Zo.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===Zo.LEFT||t===Zo.RIGHT?i-=e.mw:t!==Zo.BOTTOM&&t!==Zo.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===Zo.LEFT||t===Zo.RIGHT?i-=e.mw:t!==Zo.BOTTOM&&t!==Zo.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)||al(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 Ql;!function(t){t.EXPORT="$$realchart_export"}(Ql||(Ql={}));class Jl extends Ce{static $_conf(t,e){!function(t,e){const i=pe(e);if(!t||!i)return;let s=ue.get(t);s||ue.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 Ko(null,(t,e)=>{this.$_changeModel(t,e)})}_createChartView(t){return new Kl(t)}_createPointerHandler(){return new Ml(this)}_doDispose(){this.$_unbindContextMenuDismiss(),this.setPointerHandler(null),this._chart=null,super._doDispose()}onModelChanged(t,e,i){e instanceof pi&&i===hi.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 Ko&&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===Ql.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,i,s,r){if(this.model){const s=this.model._general._style;if(e(s))for(const e in s)e.startsWith("padding")?i.setStyle(e,s[e]):t.style[e]=s[e]}}_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 tc{static getVersion(){return le.version}static setLicenseKey(t){le.code=t}static setLocale(t,e){e&&ct(t,e),(t=>{t&&(lt=at[ht=t.substring(0,2)]),lt||(lt=at[ht="ko"])})(t)}static registerLocale(t,e){ct(t,e)}static setDebugging(t){Pe.DEBUGGING=t}static setLogging(t){ot.LOGGING=t}static setAnimatable(t){Ce._animatable=t}static configure(t){return t}static createChart(t,i,s,r=!0,n){const o=new Jl(t,i);return o.chart.load(e(s)?s:{},r,n),o.chart[Yo]=o,o.chart}static createData(t,e){return new Qo(t||{},e)}}class ec{static empty(){return new ec}static create(t=0,e=0){return new ec(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const ic="bullet",sc="bulletgroup",rc="circle",nc="circlegroup",oc="clock",ac="linear",hc="lineargroup";class lc{static empty(){return new lc}static create(t=0,e=0){return new lc(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const cc=tc.getVersion,_c=tc.setDebugging,dc=tc.setLogging,uc=tc.setAnimatable,pc=tc.configure,gc=tc.createChart,fc=tc.createData,mc=tc.setLicenseKey;export{pi as Annotation,va as AnnotationView,ya as ArcElement,In as AreaRangeSeries,Vh as AreaRangeSeriesView,Dn as AreaSeries,zn as AreaSeriesGroup,Ch as AreaSeriesView,si as AssetCollection,$i as Axis,nn as AxisBaseLine,Ri as AxisCollection,Ci as AxisGrid,xi as AxisItem,Ei as AxisLabel,vi as AxisLine,Bi as AxisScrollBar,ua as AxisScrollView,Di as AxisSectorLine,Ti as AxisTick,wi as AxisTitle,ga as AxisView,fn as BarRangeSeries,Ph as BarRangeSeriesView,bn as BarSeries,yn as BarSeriesBase,vn as BarSeriesGroup,xn as BarSeriesGroupBase,mn as BarSeriesPoint,Lh as BarSeriesView,kh as BarSeriesViewBase,Tr as BasedSeries,ch as BasedSeriesView,Gn as BellCurveSeries,Th as BellCurveSeriesView,us as Body,ds as BodyDepth,wl as BodyView,Yn as BoxPlotSeries,Nh as BoxPlotSeriesView,nh as BoxPointElementEx,Jn as BubblePie,to as BubbleSeries,Bh as BubbleSeriesView,sc as BulletGaugeGroupType,ic as BulletGaugeType,eo as BumpSeriesGroup,so as CandlestickSeries,Dh as CandlestickSeriesView,tr as CategoryAxis,Js as CategoryAxisGrid,Qs as CategoryAxisLabel,Ks as CategoryAxisTick,Ko as Chart,Jl as ChartControl,Qo as ChartData,pt as ChartDataCollection,ia as ChartElement,hi as ChartItem,qo as ChartObject,Ml as ChartPointerHandler,ci as ChartText,Kl as ChartView,ro as CircelBarPointLabel,no as CircleBarSeries,oo as CircleBarSeriesGroup,Rh as CircleBarSeriesView,ma as CircleElement,nc as CircleGaugeGroupType,rc as CircleGaugeType,is as CircularGauge,ss as CircularGaugeGroup,ts as CircularGaugeLabel,oc as ClockGaugeType,kr as ClusterableSeries,Or as ClusterableSeriesGroup,oe as Color,xr as ConnectableSeries,Br as ConstraintSeriesGroup,na as ContentView,on as ContinuousAxis,Xo as Credits,yi as Crosshair,Ws as DataPoint,Us as DataPointCollection,cr as DataPointLabel,ae as Dom,co as DumbbellSeries,Fh as DumbbellSeriesView,Jo as ElementPool,uo as EqualizerSeries,Hh as EqualizerSeriesView,po as ErrorBarSeries,jh as ErrorBarSeriesView,ps as Exporter,yo as FunnelSeries,Xh as FunnelSeriesView,ji as Gauge,Hi as GaugeBase,Yi as GaugeGroup,ka as GaugeGroupView,Gi as GaugeItem,Ji as GaugeLabel,Qi as GaugeRangeBand,Ki as GaugeRangeLabel,qi as GaugeScale,Sa as GaugeView,Os as HeatmapSeriesType,vo as HistogramSeries,Uh as HistogramSeriesView,_i as IconedText,qr as ImageAnnotation,fh as ImageAnnotationView,oa as ImageElement,ke as LayerElement,fs as Legend,gs as LegendItem,El as LegendItemView,Bl as LegendView,Cn as LineElement,Tn as LinePointLabel,En as LineSeries,Mn as LineSeriesBase,wh as LineSeriesBaseView,Fn as LineSeriesGroup,An as LineSeriesPoint,Sh as LineSeriesView,an as LinearAxis,hc as LinearGaugeGroupType,ac as LinearGaugeType,Ho as LogAxis,Vo as LollipopSeries,qh as LollipopSeriesView,Nr as LowRangedSeries,Dr as MarkerSeries,dh as MarkerSeriesPointView,uh as MarkerSeriesView,Rr as NavigatorMask,$r as NavigiatorHandle,x as ORG_ANGLE,Po as OhlcSeries,Qh as OhlcSeriesView,Cr as OthersGroup,b as PI_2,ql as PaneContainer,ko as ParetoSeries,Jh as ParetoSeriesView,we as PathBuilder,Ne as PathElement,Rs as PictogramSeriesType,Is as PictorialBarSeriesType,Fs as PictorialSeriesType,Bo as PieSeries,Oo as PieSeriesGroup,No as PieSeriesLabel,Mo as PieSeriesText,sl as PieSeriesView,ec as Point,ih as PointElement,Wo as PointHovering,Ua as PointLabelLineContainer,Wa as PointLabelLineView,Ya as PointLabelView,bh as PointViewPool,w as RAD_DEG,K as RObject,zs as RaceBarSeriesType,Hs as RaceLineSeriesType,Ar as RadialSeries,Mr as RangedSeries,ye as RcAnimation,Ce as RcControl,Pe as RcElement,K as RcObject,vs as RectElement,Et as SVGNS,Aa as ScaleView,$o as ScatterSeries,nl as ScatterSeriesView,ra as SectionView,Xn as SectorElement,yr as Series,Oa as SeriesAnimation,Er as SeriesGroup,vr as SeriesMarker,Hr as SeriesNavigator,eh as SeriesView,Kr as ShapeAnnotation,mh as ShapeAnnotationView,lc as Size,Bn as SplineSeries,_r as StackLabel,jr as Subtitle,xs as SvgShapes,$e as TextAnchor,Qr as TextAnnotation,yh as TextAnnotationView,Fe as TextElement,Re as TextLayout,pn as TimeAxis,Gr as Title,Yr as Tooltip,Bs as TreemapSeriesType,er as TrendLineArea,ir as TrendLineLabel,rr as Trendline,ot as Utils,Wi as ValueGauge,Ca as ValueGaugeView,Ds as VectorSeriesType,Fo as WaterfallSeries,ol as WaterfallSeriesView,Ii as Widget,Pr as WidgetSeries,Sr as WidgetSeriesConnector,Vr as WidgetSeriesLabel,wr as WidgetSeriesPoint,gh as WidgetSeriesView,$s as WordCloudSeriesType,Zs as ZValuePoint,f as absv,h as assignObj,vt as buildValueRanges,R as calcPercent,pc as configure,m as copyObj,_ as cos,gc as createChart,fc as createData,W as createRect,ni as extend,bt as fixnum,cc as getVersion,L as incv,i as isArray,Z as isEmptyRect,nt as isIE,n as isNumber,e as isObject,r as isString,g as maxv,p as minv,Tt as parsePercentSize,P as pickNum,A as pickProp,k as pickProp3,T as pixel,U as rectToSize,uc as setAnimatable,_c as setDebugging,mc as setLicenseKey,dc as setLogging,d as sin,Lt as toStr};
|