UNPKG

realmap

Version:

Wooritech map chart component library

8 lines 507 kB
/** 
 * Realmap v1.1.20
 * Copyright (C) 2023-2026 WooriTech Inc.
 * All Rights Reserved. 
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(this,(function(t){"use strict";const e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=Object.assign,l=Math.floor,c=Math.ceil,d=Math.cos,_=Math.sin,u=Math.min,p=Math.max,g=Math.abs,m=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},f=Math.PI,b=2*f,y=-f/2,w=f/180,x=180/f;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const v="undefined"!=typeof navigator?navigator.userAgent:"",S=v?navigator.appVersion:"",C=!!v.match(/Trident.*rv\:11\./),P=-1!==S?.indexOf("MSIE 10"),M=-1!==S?.indexOf("MSIE 9"),L=C||P||M,A="undefined"!=typeof window&&window.devicePixelRatio||1,k=function(t,e){const i="number"==typeof t?t:parseFloat(t);return isNaN(i)?"number"==typeof e?e:parseFloat(e):i},I=function(t,e,i){const s="number"==typeof t?t:parseFloat(t);if(!isNaN(s))return s;const r="number"==typeof e?e:parseFloat(e);return isNaN(r)?"number"==typeof i?i:parseFloat(i):r},E=function(t,e){return void 0!==t?t:e},T=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},N=(t,e,i)=>t+(e-t)*i;function V(t){return t>b?t%b:t}function $(t){return t*Math.PI/180}function R(t){return 180*t/Math.PI}function D(t){return t+"px"}function O(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function F(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const i={};return i[t]=e,i}const H=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},W="%".charCodeAt(0),Y=class{static setDebugging(t=!0){this._debugging=t}static on(){this._debugging}};Y._debugging=!1;let Z=Y;function U(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===W&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;throw new Error(`Invalid size value: ${t}`)}}return{size:s,fixed:i}}function X(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const K="vertical-lr",q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),i=k(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const Q={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},tt=(new Date).getTime(),et=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(u(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-tt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=s(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return p(e,u(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=p(e,t)),isNaN(i)||(t=u(i,t)),t}static makeIntArray(t,e){const i=new Array(p(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=g(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=u(e,t[s]),i=p(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||s(t))?e.split(".").reduce(((t,e)=>t?t[e]:void 0),t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let n=0;n<s;n++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};et.LOGGING=!1,et.week_days=["일","월","화","수","목","금","토"],et.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],et.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 it=et;const st=["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"],rt=["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"],nt=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(it.startsWith(e,"rgb(")&&it.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(it.startsWith(e,"rgba(")&&it.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(it.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return n(e)?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,n=.5){const o=new t(null);return r<n?(o.r=Math.ceil(e.r+(i.r-e.r)*(r/n)),o.g=Math.ceil(e.g+(i.g-e.g)*(r/n)),o.b=Math.ceil(e.b+(i.b-e.b)*(r/n)),o.a=(i.a+e.a)/2):(o.r=Math.ceil(i.r+(s.r-i.r)*((r-n)/(1-n))),o.g=Math.ceil(i.g+(s.g-i.g)*((r-n)/(1-n))),o.b=Math.ceil(i.b+(s.b-i.b)*((r-n)/(1-n))),o.a=(s.a+i.a)/2),o}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};nt.TRANSPARENT=new nt("rgba(0,0,0,0)"),nt.WHITE=new nt("rgb(255,255,255)"),nt.BLACK=new nt("rgb(0,0,0)"),nt.COLORS=function(){const t={};for(let e=0;e<st.length;e++)t[st[e]]=rt[e];return t}();let ot=nt;const at=class t{constructor(t=0,e=0){this.width=t,this.height=e}static empty(){return new t}static create(e=0,i=0){return new t(e,i)}get isEmpty(){return 0===this.width||0===this.height}clone(){return new t(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}};at.EMPTY=new at;let ht=at;const lt=Object.freeze({x:0,y:0,width:0,height:0});function ct(t){return{width:t.width,height:t.height}}const dt=class t{constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}static create(e,i,s,r){const n=arguments.length;return it.isObject(e)?new t(e.x,e.y,e.width,e.height):n<2?new t(e,e,e,e):n<3?new t(e,i,e,i):new t(e,i,s,r)}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new t(this.x,this.y,this.width,this.height)}getInner(){return new t(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}};dt.Empty=new dt,dt.Temp=new dt;let _t=dt,ut=0;class pt{constructor(){this._hash=++ut,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)}}let gt=651212;class mt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static isChildOf(t,e){let i=t;for(;i;){if(i.classList.contains(e))return i;i=i.parentElement}}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=i.pageYOffset||n.scrollTop||r.scrollTop,a=i.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+o-h;return{x:Math.round(c),y:Math.round(d)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,i){t.style.left=e+"px",t.style.top=i+"px"}static moveI(t,e,i){t.style.left=(e>>>0)+"px",t.style.top=(i>>>0)+"px"}static resize(t,e,i){t.style.width=e+"px",t.style.height=i+"px"}static resizeSVG(t,e,i){t.setAttribute("viewBox",`0 0 ${e} ${i}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,i=e.defaultView;return{width:i.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:i.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const i=t.style;i.left=D(e.x),i.top=D(e.y),i.width=D(e.width),i.height=D(e.height)}static setBounds(t,e,i,s,r){const n=t.style;n.left=D(e),n.top=D(i),n.width=D(s),n.height=D(r)}static setBoundsEx(t,e,i,s,r){const n=t.style;isNaN(e)||(n.left=D(e)),isNaN(i)||(n.top=D(i)),isNaN(s)||(n.width=D(s)),isNaN(r)||(n.height=D(r))}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const i=e.children;for(let e=i.length;e--;)if(i[e]===t)return e}}return-1}static clear(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static createElement(t,e,i,s){const r=t.createElement(e);return s&&(r.id=s),n(i)?r.className=i:i&&Object.assign(r.style,i),r}static fillSelect(t,e,i){t.options.length=0,e.forEach((e=>{const s=null!=e.value?e.value:e,r=null!=e.label?e.label:String(e),n=new Option(r,s);s===i&&(n.selected=!0),t.add(n)}))}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,i){null==i||""===i?delete t.dataset[e]:t.dataset[e]=i}static removeData(t,...e){e.forEach((e=>delete t.dataset[e]))}static clearData(t){for(const e in t.dataset)delete t.dataset[e]}static toggleData(t,e,i){i?t.dataset[e]="1":delete t.dataset[e]}static setBoolData(t,e,i){return i?e in t.dataset||(t.dataset[e]=""):e in t.dataset&&delete t.dataset[e],i}static getBoolData(t,e){return null!=t.dataset[e]}static getData(t,e){return t.dataset[e]}static getNumData(t,e){return parseFloat(t.dataset[e])}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,i){t.style.setProperty(e,i)}static animate(t,e,i,s,r=150,n="none"){const o={},a={};return o[e]=i,a[e]=s,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+gt++}static createDiv(t,e,i){return this.createElement(t,"div",e,i)}static createSpan(t,e,i){return this.createElement(t,"span",e,i)}static createCheckBox(t,e,i){const s=this.createElement(t,"input",e,i);return s.type="checkbox",s}static createRadio(t,e,i){const s=this.createElement(t,"input",e,i);return s.type="radio",s}static createBR(t,e){return this.createElement(t,"br",e)}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 getPaddingEx(t){const e=this.getPadding(t);return e.horz=e.left+e.right,e.vert=e.top+e.bottom,e}static stopAnimation(t){if(t)try{t.finish()}catch(t){Z.on(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!L&&t.setAttribute("vector-effect","non-scaling-stroke")}static isIntersectRectPath(t,e,i=1){const s=t.getBBox(),r=e.getBBox(),n=t.getCTM(),o=e.getCTM();if(!n||!o)return console.warn("CTM is null — element may not be in DOM or in an <svg> tree"),!1;const a=[new DOMPoint(s.x,s.y).matrixTransform(n),new DOMPoint(s.x+s.width,s.y).matrixTransform(n),new DOMPoint(s.x,s.y+s.height).matrixTransform(n),new DOMPoint(s.x+s.width,s.y+s.height).matrixTransform(n)],h=[new DOMPoint(r.x,r.y).matrixTransform(o),new DOMPoint(r.x+r.width,r.y).matrixTransform(o),new DOMPoint(r.x,r.y+r.height).matrixTransform(o),new DOMPoint(r.x+r.width,r.y+r.height).matrixTransform(o)],l=Math.min(...a.map((t=>t.x))),c=Math.max(...a.map((t=>t.x))),d=Math.min(...a.map((t=>t.y))),_=Math.max(...a.map((t=>t.y))),u=Math.min(...h.map((t=>t.x))),p=Math.max(...h.map((t=>t.x))),g=Math.min(...h.map((t=>t.y))),m=Math.max(...h.map((t=>t.y)));if(c<u||p<l||_<g||m<d)return!1;const f=e.getTotalLength(),b=t.ownerSVGElement.createSVGPoint();for(let t=0;t<=f;t+=i){const{x:i,y:s}=e.getPointAtLength(t);b.x=i,b.y=s;const r=b.matrixTransform(o);if(r.x>=l&&r.x<=c&&r.y>=d&&r.y<=_)return!0}const y=o.inverse();for(const t of a){const i=t.matrixTransform(y);if(e.isPointInFill(i))return!0}return!1}static createSvg(t,e){const i=t.createElementNS("http://www.w3.org/2000/svg","svg");return e&&(i.innerHTML=e),i}static getTableCell(t){if(t instanceof Element){let e=t;do{if(e instanceof HTMLTableCellElement)return e;e=e.parentElement}while(e)}return null}static selectAll(t){const e=t.ownerDocument,i=e.defaultView,s=i?.getSelection();if(s){const i=e.createRange();i.selectNodeContents(t),s.removeAllRanges(),s.addRange(i)}}static clearSelection(t=document){const e=t.defaultView;e?.getSelection()?.removeAllRanges()}}const ft=/(.*)/,bt=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))'),yt=class t{constructor(t){this._pattern=ft,this._replace="$1",this.$_parse(this._format=t)}static getFormatter(e){let i=t.Formatters[e];return i||(t.Formatters[e]=i=new t(e)),i}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(bt);if(e.length>1){let t=e[0].trim(),i=e[1].trim();t&&i&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==i.charAt(0)&&(i=t.substr(1,i.length-2)),i&&(this._pattern=new RegExp(t,e[2]||""),this._replace=i)))}}}};yt.Formatters={};let wt=yt;class xt extends Error{}const vt=function(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(s(t)&&s(r)){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!vt(t[e],r[e]))return!1;return!0}if(i(t)&&i(r)){const i=Object.keys(t),s=Object.keys(r);if(i.length!==s.length)return!1;for(const s of i){if(!e.call(r,s))return!1;if(!vt(t[s],r[s]))return!1}return!0}return!1},St=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)){let e=r[t];s(e)?n[t]=e.slice(0):e instanceof Date?n[t]=new Date(e):i(e)?n[t]=St(n[t],e):n[t]=e}return n},Ct=class t extends pt{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}preset(t,e=!0){return this._preset=t._op,e&&this._children&&this._children.forEach(((e,i)=>{const s=t._children?.get(i);s&&e.preset(s,!0)})),this}_doDispose(){this._externals=void 0,this._preset=void 0,this._children&&(this._children.forEach((t=>t.dispose())),this._children=void 0)}prop(t){const e=this._op[t];if(void 0!==e)return e;if(this._preset){const e=this._preset[t];if(void 0!==e)return e}return this.constructor.defaults[t]}str(t){const e=this._op[t];if(void 0!==e)return String(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return String(e)}return String(this.constructor.defaults[t])}num(t){let e=parseFloat(this._op[t]);return isNaN(e)?this._preset&&(e=parseFloat(this._preset[t]),!isNaN(e))?e:parseFloat(this.constructor.defaults[t]):e}bool(t){let e=this._op[t];if(void 0!==e)return Boolean(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return Boolean(e)}return e=this.constructor.defaults[t],Boolean(e)}propAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.prop(t):e.rest?e.child.propAt(e.rest):void 0}strAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.str(t):e.rest?e.child.strAt(e.rest):void 0}numAt(t){const e=this._resolvePath(t);return-1===e?NaN:0===e?this.num(t):e.rest?e.child.numAt(e.rest):NaN}boolAt(t){const e=this._resolvePath(t);return-1!==e&&(0===e?this.bool(t):!!e.rest&&e.child.boolAt(e.rest))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){let t=e[r];void 0===t&&this._preset&&(t=this._preset[r]),s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);if(e)return e.saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this.$_load(t),this._optionChanged(),this}saveOption(t){if(this._children&&this._children.has(t))return this._findChild(t).saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}saveOptions(t,e=!1,r=!1,n=!1){const o={};let a,h,l;return s(t)?a=t:i(t)&&([a,h,l]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,e,r,h,n,l),o}saveTo(t,e,r=!1,n=!1,o=!1){let a,h,l;return s(e)?a=e:i(e)&&([a,h,l]=this.$_splitProps(e)),this._doSave(t,a,this.constructor.defaults,r,n,h,o,l),t}updateOptions(e,i=!0){const s=this._op,r=this._externals??t.EMPTY_MAP;let n,o;if(void 0!==e&&!this._doSetSimple(s,e)){const t={};let i;for(const s in e)r.has(s)?(this._doUpdateProp(s,e[s]),(o??=[]).push(s)):(i=this._findChild(s))?(i=this.$_recreateChild(s,i,e[s]),(n??=[]).push(s)):e[s]!==this.prop(s)&&(this.$_validateOptions(s,e[s]),t[s]=e[s],(o??=[]).push(s));St(s,t)}return this._doApply(s),n?.forEach((t=>this._findChild(t).updateOptions(e[t]))),i&&this._optionChanged(o),this}invertOptions(t){if(!i(t))return{};const s={},r={};let n=!1;for(const i in t){if(!e.call(t,i))continue;const o=this._findChild(i);o?s[i]=o.invertOptions(t[i]):(r[i]=t[i],n=!0)}return n&&this.saveTo(s,r,!0,!1,!0),s}updateOption(t,e,r=!0,n=!1){if(this._doUpdateProp(t,e))return this._doApply(this._op),r&&this._optionChanged(t),this;let o=this._findChild(t);if(o)o=this.$_recreateChild(t,o,e),o.updateOptions(e);else{const o=this._op;(n||e!==this.prop(t))&&(this.$_validateOptions(t,e),s(e)?e=e.slice(0):e instanceof Date?e=new Date(e):i(e)&&(e=St({},e)),o[t]=e,this._doApply(o),r&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r=!a(s)||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(t,i=!0){const s=this._op,r=this._findChild(t);return r?r.clearOptions(!0):this._externals?.has(t)?(this._doUpdateProp(t,void 0),this._externals.delete(t),this._doApply(s),i&&this._optionChanged(t)):e.call(s,t)&&(delete s[t],this._doApply(s),i&&this._optionChanged(t)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);if(-1===r)return this;if(0===r)return this.updateOption(t,e,i,s);if(r.rest)return r.child.updateAt(r.rest,e,i,s);return this.$_recreateChild(t,r.child,e).updateOptions(e,i),this}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}deleteAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.deleteAt(i.rest,e):(i.child.clearOptions(!0,e),this)}_clearExternalOptions(){this._externals=void 0}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach((t=>t&&e(t))),i._clearExternalOptions(),i._doApply(i._op)}(this),e&&this._optionChanged(),this}_cleanExternalOptions(){}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))vt(s[t],i._propBaseline(t,r))&&delete s[t];t&&i._children&&i._children.forEach((t=>e(t))),i._cleanExternalOptions()}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e&&e._init(),e}_attachRef(t,e){(this._children??=new Map).set(t,e)}_findChild(t){return this._children?.get(t)}_resolveChild(t){return this._findChild(t)}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._resolveChild(i);return r?{child:r,rest:s}:e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_includeTags(t,...e){return!t||(s(t)?e.some((e=>t.includes(String(e)))):e.includes(t))}$_recreateChild(t,e,i){const s=this._doRecreateChild(t,e,i);return s?((this._children??=new Map).set(t,s),s._init(),s):e}_doRecreateChild(t,e,i){}_doLoad(t,r){for(const n in r)if(e.call(r,n)){let e,o=r[n];this._doLoadProp(n,o)?(this._externals??=new Map).set(n,o):void 0!==(e=this._findChild(n))?(e=this.$_recreateChild(n,e,o),e.$_load(o)):s(o)?t[n]=o.slice(0):o instanceof Date?t[n]=new Date(o):i(o)?t[n]=Object.assign({},o):t[n]=o}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doUpdateProp(t,e){return this._doLoadProp(t,e)}_doSaveProp(t,e,i){return!1}_doApply(t){}_propBaseline(t,e){return e[t]}_doSave(i,r,n,o,a,h,l=!1,c){const d=this._op,_=this._children??t.EMPTY_MAP,u=this._externals??t.EMPTY_MAP,p=r&&r.length>0,g=l&&p,m=p?r:Object.keys(d);for(const t of m)if(!_.has(t)&&!u.has(t)){const r=e.call(d,t);if(!r&&!a&&!g)continue;const o=this._propBaseline(t,n),h=r?d[t]:o;(a||g||!vt(h,o))&&(s(h)?i[t]=h.slice():void 0!==h?i[t]=h:g&&(i[t]=void 0))}if(u.size>0)if(p){if(c)for(const t in c)u.has(t)&&this._doSaveProp(i,t,c[t])}else u.forEach(((t,e)=>this._doSaveProp(i,e,u.get(e))));_.forEach(((t,s)=>{const n=null!=h&&e.call(h,s),c=p&&r.indexOf(s)>=0;if(p&&!n&&!c)return;const d=n||c;if(o||d){const e=n?h[s]:void 0,r=l&&d,o=t.saveOptions(e,!0,a,r);(r||a||Object.keys(o).length>0)&&(i[s]=o)}}))}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof xt?e:new xt(`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){}};Ct.defaults={},Ct.EMPTY_MAP=new Map;let Pt=Ct;(class t extends Pt{constructor(t=!1){super(),this._items=[],t&&this.keyProp&&(this._map=new Map)}get keyProp(){}get addMissingOnUpdate(){return t.UPDATE_MODE.addMissing}get removeMissingOnUpdate(){return t.UPDATE_MODE.removeMissing}get reorderOnUpdate(){return t.UPDATE_MODE.reorder}get count(){return this._items.length}get isEmpty(){return 0===this._items.length}get isSingle(){return 1===this._items.length}get items(){return this._items.slice()}get first(){return this._items[0]}get last(){const t=this._items;return t.length?t[t.length-1]:void 0}_internalItems(){return this._items}get(t){return this._items[t]}getOf(t){return this._map?this._map.get(t):this.keyProp?this.findProp(this.keyProp,t):void 0}itemAt(t){return this._items[t]}indexOf(t){return this._items.indexOf(t)}indexOfProp(t,e){for(let i=0;i<this._items.length;i++)if(this._items[i].prop(t)===e)return i;return-1}findIndex(t){return this._items.findIndex(((e,i)=>t(e,i,this)))}contains(t){return-1!==this._items.indexOf(t)}forEach(t){this._items.forEach(((e,i)=>t(e,i,this)))}some(t){return this._items.some(((e,i)=>t(e,i,this)))}someProp(t,e){return this._items.some((i=>i.prop(t)===e))}find(t){return this._items.find(((e,i)=>t(e,i,this)))}findProp(t,e){return this._items.find((i=>i.prop(t)===e))}filter(t){return this._items.filter(((e,i)=>t(e,i,this)))}filterProp(t,e){return this._items.filter((i=>i.prop(t)===e))}map(t){return this._items.map(((e,i)=>t(e,i,this)))}addSource(t,e=!0){return this.insertSource(t,this._items.length,e)}insertSource(t,e,i=!0){const s=this.$_newItem(t);if(s){const t=Math.max(0,Math.min(e,this._items.length));this.$_insertItem(s,t,i)}return s}add(t,e=!0){return this.insert(t,this._items.length,e),!0}insert(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this.$_insertItem(t,s,i),!0}addAll(t,e=!0){return this.insertAll(t,this._items.length,e)}insertAll(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this._items.splice(s,0,...t),t.forEach(((t,e)=>this.$_inserted(t,s+e))),this._doItemsChanged(this._items),i&&this._optionChanged(),t.length}remove(t,e=!0){if(n(t)){const e=this.keyProp;if(!e)return;t=this.findProp(e,t)}const i=this._items.indexOf(t);if(-1!==i)return this.removeAt(i,e)}removeAll(t,e=!0){const i=this.keyProp;let s=0;for(const e of t){let t;t=n(e)?this.indexOfProp(i,e):this._items.indexOf(e),-1!==t&&(this.removeAt(t,!1),s++)}return s>0&&(this._doItemsChanged(this._items),e&&this._optionChanged()),s}removeAt(t,e=!0){const i=this._items;if(t<0||t>=i.length)return;const s=i.splice(t,1)[0];return this.$_removed(s,t),this._doItemsChanged(this._items),e&&this._optionChanged(),s}clear(t=!0){return!!this.$_clearItems()&&(t&&this._optionChanged(),!0)}moveTo(t,e,i=!0){const s=this._items,r=s.indexOf(t);if(-1===r)return!1;const n=Math.max(0,Math.min(e,s.length-1));return n!==r&&(s.splice(r,1),s.splice(n,0,t),this._doItemMoved(t,r,n),this._doItemsChanged(this._items),i&&this._optionChanged(),!0)}replace(t,e,i=!1,s=!0){const r=this._items.indexOf(t);if(r>=0)this._items[r]=e,this.$_removed(t,r),this.$_inserted(e,r);else{if(!i)return!1;this._items.push(e),this.$_inserted(e,this._items.length-1)}return this._doItemsChanged(this._items),s&&this._optionChanged(),!0}_doItemInserted(t,e){}_doItemRemoved(t,e){}_doCleared(){}_doItemMoved(t,e,i){}_doItemsChanged(t){}$_insertItem(t,e,i){this._items.splice(e,0,t),this.$_inserted(t,e),this._doItemsChanged(this._items),i&&this._optionChanged()}saveOptions(t,e=!0,r=!1,n=!1){const o=this.keyProp;if(i(t)&&s(t.items)&&(t=t.items),s(t)){if(o){const s=[];for(const a of t){const t=this.$_findByKey(o,i(a)?a[o]:void 0);t&&s.push(this.$_saveItem(t,a,e,r,n,o))}return s}return this._items.map(((i,s)=>i.saveOptions(t[s],e,r,n)))}const a=i(t)?t:void 0;return this._items.map((t=>this.$_saveItem(t,a,e,r,n,o)))}$_saveItem(t,e,s,r,n,o){const a=t.saveOptions(e,s,r,n);return o&&i(a)&&void 0===a[o]&&(a[o]=t.getOption(o)),a}saveTo(t,e,i=!0,s=!1,r=!1){return this.saveOptions(e,i,s,r)}updateOptions(t,e=!0){const{items:i,updateMode:r}=this.$_split(t);"*"===r?.remove&&this.$_clearItems(),i&&this.$_reconcile(this._normalizeOptions(i),{addMissing:r?.addMissing??this.addMissingOnUpdate,removeMissing:r?.removeMissing??this.removeMissingOnUpdate,reorder:r?.reorder??this.reorderOnUpdate});const n=r?.remove;return s(n)&&n.length&&this.$_removeKeys(n),this._doItemsChanged(this._items),e&&this._optionChanged(),this}invertOptions(t){const{items:e,updateMode:r}=this.$_split(t),n=this.keyProp,o=r?.addMissing??this.addMissingOnUpdate,a=r?.removeMissing??this.removeMissingOnUpdate,h=r?.reorder??this.reorderOnUpdate,l=s(r?.remove)?r.remove:[],c=a||h||"*"===r?.remove||l.length>0;if(!n||c)return{items:this.saveOptions(),updateMode:{addMissing:!0,removeMissing:!0,reorder:!0,remove:"*"}};const d=[],_=[];for(const t of e??[]){const e=i(t)?t[n]:void 0;if(void 0===e)continue;const s=this.$_findByKey(n,e);s?d.push(this.$_saveItem(s,t,!0,!1,!0,n)):o&&_.push(e)}const u={};return _.length&&(u.remove=_),{items:d,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);B(e)||this._map.set(e,t)}this._doItemInserted(t,e)}$_removed(t,e){if(this._map){const e=t.prop(this.keyProp);B(e)||this._map.delete(e)}this._doItemRemoved(t,e)}$_split(t){if(s(t))return{items:t,updateMode:void 0};if(i(t)){const e=t;return{items:s(e.items)?e.items:void 0,updateMode:i(e.updateMode)?e.updateMode:void 0}}return{items:void 0,updateMode:void 0}}$_replaceItems(t){if(this.$_clearItems(),t){const e=this._items;for(const i of t){const t=this.$_newItem(i);t&&(e.push(t),this.$_inserted(t,e.length-1))}this._doItemsChanged(e)}}$_reconcile(t,e){const{addMissing:s,removeMissing:r,reorder:n}=e,o=this._items,a=this.keyProp;if(a){if(r){const e=new Set;for(const s of t){const t=i(s)?s[a]:void 0;void 0!==t&&e.add(t)}for(let t=o.length-1;t>=0;t--)if(!e.has(o[t].getOption(a))){const e=o.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}for(const e of t){const t=this.$_findByKey(a,i(e)?e[a]:void 0);if(t)t.updateOptions(e,!1);else if(s){const t=this.$_newItem(e);t&&(o.push(t),this.$_inserted(t,o.length-1))}}n&&this.$_reorderByKey(t,a)}else{const e=t.length;if(r)for(;o.length>e;)o.splice(o.length-1,1)[0].dispose();for(let i=0;i<e;i++)if(i<o.length)o[i].updateOptions(t[i],!1);else if(s){const e=this.$_newItem(t[i]);e&&o.push(e)}}}$_reorderByKey(t,e){const s=new Set,r=[];for(const n of t){const t=this.$_findByKey(e,i(n)?n[e]:void 0);t&&!s.has(t)&&(s.add(t),r.push(t))}for(const t of this._items)s.has(t)||r.push(t);this._items=r,this._doItemsChanged(this._items)}$_findByKey(t,e){if(void 0!==e)for(const i of this._items)if(i.getOption(t)===e)return i}$_removeKeys(t){const e=this.keyProp,i=this._items;if(e){const s=new Set(t);for(let t=i.length-1;t>=0;t--)if(s.has(i[t].getOption(e))){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}else{const e=Array.from(new Set(t.filter((t=>Number.isInteger(t)&&t>=0&&t<i.length)))).sort(((t,e)=>e-t));for(const t of e){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}}$_clearItems(){const t=this._items;if(t.length){for(let e=t.length-1;e>=0;e--){const i=t.pop();i.dispose(),this.$_removed(i,e)}return this._doCleared(),this._doItemsChanged(t),!0}return!1}}).UPDATE_MODE={addMissing:!0,removeMissing:!1,reorder:!1};const Mt=class t extends pt{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 d=t;a!==h||h!==l||l!==c||"function"!=typeof d.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()):d.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,d=o[1]-(a[1]-r[1])*n;t.bezierCurveTo(h,l,c,d,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(k(t,s&&s.clientWidth))),n=Math.max(0,Math.floor(k(e,s&&s.clientHeight)));return this._cssWidth===r&&this._cssHeight===n&&this._dpr===A||(this._canvas.width=Math.round(r*A),this._canvas.height=Math.round(n*A),this._canvas.style.width=r+"px",this._canvas.style.height=n+"px",this._cssWidth=r,this._cssHeight=n,this._dpr=A),this._ctx.setTransform(A,0,0,A,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)),d=Math.max(1,Math.round(r));if(a.save(),n&&(t._applyFill(a,n),a.fillRect(h,l,c,d)),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,d-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}};Mt.SHAPES=Mt._builtinShapes();const Lt="http://www.w3.org/2000/svg";class At{static async loadConfigAsync(t,e=!1){if(t&&!t.map&&console.warn("지도 설정이 비어 있습니다. map 옵션을 지정하세요."),t&&t.map){if(n(t.map))t.map={url:t.map};else if(s(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=s(t.map)?t.map:[t.map];for(const t of r){if(s(t.areas))for(let i=0;i<t.areas.length;i++)if(n(t.areas[i])){if(e){console.warn("원격 areas 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.areas[i]);continue}t.areas[i]=await this.fetchJson(t.areas[i])}const r=i(t.source),o=t.url&&n(t.url);r||o?r||(o&&e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url)):console.warn("지도 소스가 지정되지 않았습니다. source 옵션을 사용하거나 url옵션을 지정하세요. 만약 url 옵션을 사용한다면, 반드시 RealMap.createChartAsync()로 생성해야 합니다.")}}if(t&&t.series){const o=s(t.series)?t.series:[t.series];for(const t of o)if(!i(t.data)&&!s(t.data)&&t.dataUrl&&n(t.dataUrl))if(e)console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl);else{const e=await this.fetchJson(t.dataUrl);delete t.dataUrl,s(e)&&r(t.dataFilter)?t.data=e.filter(t.dataFilter):t.data=e}}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const kt=void 0;function It(t){return parseFloat(t.toPrecision(12))}const Et={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"},Tt=function(t){const e=Et[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Et[t]=e,e}return e};var Nt;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(Nt||(Nt={}));const Vt={inOutSine:t=>-(d(f*t)-1)/2};class $t{constructor(){this.delay=0,this.duration=$t.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=u(1,p(0,It(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return isNaN(t)||(this.duration=t),this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,i=null){this._started&&this._stop(),this.duration=k(t,$t.DURATION),this.delay=e||0,this._easing=Vt[i],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}$t.DURATION=700,$t.SHORT_DURATION=300;const Rt={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",nameKeys:["name"],notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",nameKeys:["en-name","name-en","name"],notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let Dt="ko",Ot=Rt[Dt];const Bt=t=>n(t)?t.substring(0,2):t,Ft=t=>{var e;return null!==(e=Rt[Bt(t)])&&void 0!==e?e:Rt.ko},zt=t=>"en"===Bt(t);class jt extends pt{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}}}}class Gt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new Gt(t,t,t,t):new Gt(t,t,e,e):new Gt(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 Gt(this.top,this.bottom,this.left,this.right)}set(...t){for(const e of t)if(isNaN(e))return;const e=t.length;1===e?this.top=this.bottom=this.left=this.right=t[0]:2===e?(this.top=this.bottom=t[0],this.left=this.right=t[1]):3===e?(this.top=t[0],this.bottom=t[1],this.left=this.right=t[2]):e>3&&(this.top=t[0],this.right=t[1],this.bottom=t[2],this.left=t[3])}applyPadding(t){return this.left=k(t.paddingLeft,0),this.right=k(t.paddingRight,0),this.top=k(t.paddingTop,0),this.bottom=k(t.paddingBottom,0),this}applyMargin(t){return this.left=k(t.marginLeft,0),this.right=k(t.marginRight,0),this.top=k(t.marginTop,0),this.bottom=k(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}var Ht;Gt.Empty=Object.freeze(new Gt),Gt.Temp=new Gt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ht||(Ht={}));const Wt={name:"RealMap",version:"1.1.20",license:"enterprise",code:""},Yt={name:"RealMap",version:"1.1.20",license:"enterprise",code:null};class Zt{static decode(t){const e=Zt.CHARS,i=Zt.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}}Zt.PAD="=",Zt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ut{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=Ut.xor,s=Ut.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=Ut.xor,s=Ut.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=Ut.kb,s=Ut._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*Ut.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=Ut._decryptBlock;let s=Ut._init(e),r=[],n=Zt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ut.POW24|n[a+1]*Ut.POW16|n[a+2]*Ut.POW8|n[a+3],h.right=n[a+4]*Ut.POW24|n[a+5]*Ut.POW16|n[a+6]*Ut.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)}}Ut.POW2=Math.pow(2,2),Ut.POW3=Math.pow(2,3),Ut.POW4=Math.pow(2,4),Ut.POW8=Math.pow(2,8),Ut.POW16=Math.pow(2,16),Ut.POW24=Math.pow(2,24),Ut.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 Xt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==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}const n=r.split(".").length,o=r.indexOf("*");if(n>=2&&n<=4&&o>=2){const t=r.substring(0,o);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=Ut.decrypt(t,"dkdl"+this._getLDKey(Ut.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 Kt=new Map;function qt(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const Jt=function(t){const e=location.hostname;let i;const s="RealMap을 사용하려면 도움말을 참조하세요.\nhttps://realmap.co.kr/";try{if(i=Yt.code||realMapLic,!i)throw new Error(s)}catch(t){throw new Error(s)}const r=Xt.decrypt(i);if(!function(t,e){if("RealMap"===t)return!0;const i=qt(e),s=Kt.get(t);return!!s&&s.has(i)}(r.name,t)||"RealMap"!==Wt.name)throw new Error(s);try{const t=r.server.toLowerCase(),i=location.pathname.toLowerCase();if(Wt.license!=Ht.Developer&&!Xt.includedDomains(t,e.toLowerCase(),i))throw new Error(s);const n=r.lic.toLowerCase();if(!Object.values(Ht).includes(n))throw new Error(s);if(Wt.code=r.code,Wt.license=r.lic,n==Ht.Evaluation||n==Ht.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(s)}}catch(t){throw new Error(s)}return!0},Qt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class te extends pt{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._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this.$_updateBlockDrag(t),this._doTouchStart(t),null===(e=this._tool)||void 0===e||e.touchStart(t)},this._touchMoveHandler=t=>{var e;t.touches.length<2&&this._scrolling?t.preventDefault():(this._doTouchMove(t),null===(e=this._tool)||void 0===e||e.touchMove(t))},this._touchEndHandler=t=>{var e;this._doTouchEnd(t),null===(e=this._tool)||void 0===e||e.touchEnd(t)},this._touchCancelHandler=t=>{var e;null===(e=this._tool)||void 0===e||e.touchCancel(t),this._blockDrag=!0},this._pointerDownHandler=t=>{var e;this.$_updateBlockDrag(t),this._doPointerDown(t)||null===(e=this._tool)||void 0===e||e.pointerDown(t)},this._pointerMoveHandler=t=>{var e;this._doPointerMove(t),null===(e=this._tool)||void 0===e||e.pointerMove(t)},this._pointerUpHandler=t=>{var e;this._doPointerUp(t),null===(e=this._tool)||void 0===e||e.pointerUp(t),this._blockDrag=!0},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t),this._blockDrag=!0},this._pointerLeaveHandler=t=>{var e;this._doPointerLeave(t),null===(e=this._tool)||void 0===e||e.pointerLeave(t)},this._keyPressHandler=t=>{var e;this._doKeyPress(t),null===(e=this._tool)||void 0===e||e.keyPress(t)},this._wheelHandler=t=>{var e;this._doWheel(t)&&(null===(e=this._tool)||void 0===e||e.wheel(t))},Jt(e),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||te.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(this._dom),this._inited=!0,this._blockDrag=!0,this.invalidate(!0)}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),mt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}setData(t,e,i){const s="data-"+t;F(e)?(this._root.dom.hasAttribute(s)&&this._root.dom.removeAttribute(s),i&&this._dom.hasAttribute(s)&&this._dom.removeAttribute(s)):(this._root.dom.getAttribute(s)!==e&&this._root.dom.setAttribute(s,e),i&&this._dom.getAttribute(s)!==e&&this._dom.setAttribute(s,e))}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}clipContainer(){return this._defs}activeTool(){return this._activeTool||this._tool}setSctiveTool(t){t!==this._activeTool&&(this._activeTool=t,this._tool=t||this._defaultTool)}isLoading(){return!1}isDraggable(){return!this._blockDrag}clearDefs(){const t=Array.from(this._defs.children).filter((t=>"true"===t.dataset.essential));for(const e of t)this._defs.removeChild(e);mt.clear(this._defs);for(const e of t)this._defs.appendChild(e)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}removeElement(t){this._root.removeChild(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._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}hasDef(t){return!!this._defs.querySelector("#"+t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new le(this.doc(),t,e,i,s,r,r))}clip(t){return this._defs.appendChild(t.dom),t}pointerToPoint(t){const e=this._dom.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_setTesting(){this._testing=!0,ee.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_registerEventHandlers(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,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),this.$_addListener(t,"touchcancel",this._touchCancelHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler),this.$_addListener(this.doc(),"pointermove",this._pointerMoveHandler),this.$_addListener(this.doc(),"pointerup",this._pointerUpHandler)}_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("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("touchcancel",this._touchCancelHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler),this.doc().removeEventListener("pointermove",this._pointerMoveHandler),this.doc().removeEventListener("pointerup",this._pointerUpHandler)}_prepareRenderers(t){}_initControl(t,e,i){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||H(Ot.invalidOuterDiv,e);const s=this._container.ownerDocument,r=this._dom=s.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)",touchAction:"manipulation"}),r.className=i,this._container.appendChild(r);const n=this._svg=s.createElementNS(Lt,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=s.createElement("desc");o.textContent="Created with RealMap 1.0.0",n.appendChild(o);const a=this._defs=s.createElementNS(Lt,"defs");this._initDefs(s,a),n.appendChild(a),r.appendChild(n),this._root=new se(this),n.appendChild(this._root._dom),this._htmlRoot=s.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=s.createElement("div"),r.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,e){let i=t.createElementNS(Lt,"filter");i.dataset.essential="true";const s=t.createElementNS(Lt,"feDropShadow");i.setAttribute("id",te.SHADOW_FILTER),s.setAttribute("dx","0"),s.setAttribute("dy","4"),s.setAttribute("flood-color","#000"),s.setAttribute("flood-opacity","0.4"),s.setAttribute("stdDeviation","2"),i.appendChild(s),e.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._padding=mt.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;if(n>0&&o>0){this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:s,y:r,width:n,height:o});const i=this._debugger;if(i.textContent){i.style.display="";const t=i.getBoundingClientRect();i.style.left=s+(n-t.width)/2+"px",i.style.top=r+(o-t.height)/2+"px"}else i.style.display="none"}}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),this._updateTouchAction()}it.log("render in "+(+new Date-t)+"ms.")}}_setBackgroundStyle(t){Object.assign(this._dom.style,t)}setDebug(t){this._debugger.textContent=t,this.invalidateLayout()}_doBeforeRender(t){}_doAfterRender(){}_updateTouchAction(){}_doClick(t){}_doDblClick(t){}_doTouchStart(t){}_doTouchMove(t){return!0}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){return!0}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),i):this.invalidateLayout())}$_updateBlockDrag(t){const e=t.target&&!0===this.dom().contains(t.target);this._blockDrag=!e}}te.CLASS_NAME="rm-control",te.SHADOW_FILTER="rm-shadow-filter",te._animatable=!0;class ee extends pt{static createElement(t,e){return t.createElementNS(Lt,e)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,n){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,n);e.add(s),i.push(s)}}constructor(t,e,i=kt){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(Lt,i||"g"),(this._styleName=e)&&this.setAttr("class",e),this._doInitStyles()}_doInitStyles(){}_doDispose(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom.style.display=this._visible?"":"none"),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,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)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}append(t){if(t){const e=t._parent;t._parent=this,this._dom.appendChild(t._dom),e!=this&&t._doAttached(this)}return t}addAll(...t){t.forEach((t=>this.add(t)))}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent?this._parent.removeChild(this):this._dom.remove(),this}appendElement(t,e){const i=t.createElementNS(Lt,e);return this._dom.appendChild(i),i}insertElement(t,e,i){const s=t.createElementNS(Lt,e);return this._dom.insertBefore(s,i),s}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}setAttrEx(t,e){return F(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).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return _t.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=it.isValidNum(t)?t:this._tx,e=it.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)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=it.isValidNum(t)?t:this._tx,e=it.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&it.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&it.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",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)}hasSavedStyles(){return void 0!==this._saveStyle||void 0!==this._saveClass}saveStyles(){let t=this._dom.getAttribute("style"),e=this._dom.getAttribute("class");t||(t=""),e||(e=""),this._saveStyle=t,this._saveClass=e}restoreStyles(){null!=this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",""===this._saveStyle&&(this._styles={}),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(Tt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(Tt(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(Tt(i),this._styles[i]=t[i],"important")}}resetStyles(t){this.clearStyles(),this.internalSetStyles(t)}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let i=!1;if(t){for(let s in t)if(s in Qt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(k(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Qt){const i=Qt[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let i=!1;return t in Qt&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=E(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}hasClip(){return this.hasAttr("clip-path")}setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,r);return this.setClip(n),n}clipPath(t){const e=this.control.clip(new ce(this.doc).setPath(t));return this.setClip(e),e}createClipId(t){return"url(#"+(t.id||t)+")"}sort(t){t.forEach((t=>t&&this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}onScrollStart(){}onScrollEnd(){}onRotationStart(){}onRotationEnd(){}_testing(){return ee.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(it.isValidNum(e)||it.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),it.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+it.pick(this._originX,t.getAttribute("x"),0)+" "+it.pick(this._originY,t.getAttribute("y")||0)+")");const r=it.getNum(this._scaleX,1),n=it.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}ee.TESTING=!1,ee.DEBUGGING=!1,ee.ASSET_KEY="_asset_",ee.TEMP_KEY="_temp_";class ie extends ee{constructor(t,e=void 0){super(t,e,"g")}}class se extends ee{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class re extends ee{constructor(t,e=void 0){super(t,e,"use")}get id(){return this._id}setId(t){return t!==this._id&&this.dom.setAttribute("href",this._id=t),this}}class ne extends ee{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}path(){return this._path}setPath(t){const e=n(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class oe extends ee{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ae extends ee{constructor(t){super(t,kt,"mask");const e=this._id=it.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class he extends ee{constructor(t){super(t,kt,"clipPath");const e=this._id=it.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class le extends he{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new ee(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.move(t,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 ce extends he{constructor(t,e){super(t),this._path=new ne(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var de;!function(t){t.SIDO="sido"}(de||(de={}));const _e="shuffle",ue="random";var pe;class ge{constructor(t){this.source=t}hasDef(){return!0}}class me extends ge{getElement(t,e){throw new Error("Method not implemented.")}}me.TYPE="shape";class fe extends ge{getElement(t,e){throw new Error("Method not implemented.")}}fe.TYPE="image";class be extends ge{_setStops(t,e){const i=t.createElementNS(Lt,"stop"),r=t.createElementNS(Lt,"stop"),n=this.source.color,o=B(this.source.opacity)?1:this.source.opacity,a=s(n)?n[0]:n,h=s(n)&&n.length>1?n[1]:"white",l=s(o)?o[0]:o,c=s(o)&&o.length>1?o[1]:o;e.setAttribute("id",this.source.id),i.setAttribute("offset","0"),i.setAttribute("stop-color",a),i.setAttribute("stop-opacity",l),r.setAttribute("offset","1"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),e.appendChild(i),e.appendChild(r)}}class ye extends be{getElement(t,e){const i=t.createElementNS(Lt,"linearGradient");let{x1:s,x2:r,y1:n,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),e.dir){case"up":n=1;break;case"right":r=1;break;case"left":s=1;break;default:o=1}return i.setAttribute("x1",s),i.setAttribute("y1",n),i.setAttribute("x2",r),i.setAttribute("y2",o),i}}ye.TYPE="lineargradient";class we extends be{getElement(t,e){const i=t.createElementNS(Lt,"radialGradient");return B(e.cx)||i.setAttribute("cx",e.cx),B(e.cy)||i.setAttribute("cy",e.cy),B(e.r)||i.setAttribute("r",e.r),this._setStops(t,i),i}}we.TYPE="radialgradient";class xe extends ge{getElement(t,e){const s=t.createElementNS(Lt,"pattern"),r=t.createElementNS(Lt,"path");let o,a,l,c,d=!1;if(s.setAttribute("id",e.id),s.setAttribute("patternUnits","userSpaceOnUse"),r.classList.add("rm-pattern"),+e.pattern>=0){const t=pe.STOCK[+e.pattern%pe.STOCK.length];o=t.path,a=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else n(e.pattern)&&(o=e.pattern,l=e.width||e.height||20,c=e.height||e.width||20);s.setAttribute("width",String(l)),s.setAttribute("height",String(c)),r.setAttribute("d",o),a&&h(r.style,a),e.style&&h(r.style,e.style),d&&(r.style.fill="none");let _=e.backgroundStyle;if(n(_)||i(_)){const e=t.createElementNS(Lt,"rect");s.append(e),e.style.fill=n(_)?_:_.fill,e.setAttribute("width",String(l)),e.setAttribute("height",String(c))}return e.transform&&s.setAttribute("patternTransform",e.transform),s.append(r),s}}pe=xe,xe.TYPE="pattern",xe.STOCK=[{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",width:10,height:10,style:{strokeWidth:"0.3px",stroke:"#333"}},{path:"M3 2a1 1 0 101 1A1 1 0 003 2M8 6a1 1 0 101 1A1 1 0 008 6",width:10,height:10,fill:!0,style:{fill:"#333"}},{path:"m8 6-.86.86-.86-.86-.48.48.86.86-.86.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L8 6zM4 2l-.86.85-.86-.85-.48.48.85.86-.85.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L4 2z",width:10,height:10,fill:!0},{path:"M0 5 1 6H0ZM0 0 6 6V5L1 0Z",width:6,height:6,fill:!0},{path:"M4.54 3h.92L5 2.54 4.54 3ZM7.58 3h.85L5.42 0H4.58L1.57 3h.85L5 .42 7.58 3Zm.01-3L10 2.41V1.6L8.4 0H7.59ZM0 1.6v.81L2.41 0H1.6L0 1.6Z",width:10,height:3,fill:!0},{path:"m5.8 11.27-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95Zm0-9.99L4.98.77l-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM.81 6.27 0 5.76l-.8.51.25-.96-.76-.62.98-.04.37-.92.34.89.96.08-.75.63.22.95Zm9.99 0-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM7.51 7.02l-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm4.99-4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm7.49 7.49-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm9.99-9.99-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19L.23.12l.28-.23-.36-.03-.13-.33Zm4.99 4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33ZM1.5 8.75c0 .14-.11.25-.25.25S1 8.89 1 8.75s.11-.25.25-.25.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25M1.5 1.25c0 .14-.11.25-.25.25S1 1.39 1 1.25 1.11 1 1.25 1s.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25S8.6 1 8.74 1s.25.11.25.25M4 3.75c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m2.5-2.5c0 .14-.11.25-.25.25S6 3.89 6 3.75s.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25S6 6.39 6 6.25 6.11 6 6.25 6s.25.11.25.25",width:10,height:10,fill:!0},{path:"M8.81 0H10V1.21L9.52 1 9.04.72c-.14-.1-.23-.2-.26-.3-.04-.1-.03-.24.02-.4L8.82 0H8.81ZM10 8.8V10H8.81c.03-.1.1-.26.21-.49l.27-.48c.1-.14.2-.22.3-.25l.39.02H10ZM1.22 10H0V8.8c.1.03.27.1.51.22.24.13.41.22.49.27.14.1.22.2.25.3.04.1.03.23-.02.39V10M0 1.21V0H1.23L1.01.5.73.99c-.1.14-.2.22-.3.25L.04 1.22H.01L0 1.21ZM10 6.1259V3.896l-.02.02H9.86l-.55.09c-.16.04-.28.11-.34.19-.07.09-.11.21-.12.38-.01.1 0 .29.03.56.04.27.06.45.09.55.05.16.12.28.2.34.08.07.21.11.38.12l.45-.02ZM0 3.896v2.23l.01-.01.12-.02.55-.09c.16-.04.27-.1.34-.19s.11-.21.12-.38l-.03-.56-.09-.55c-.04-.16-.11-.28-.19-.34-.09-.07-.21-.11-.38-.11L0 3.896Zm5.7855.1243-.5414-.15.02-.01-.5515-.09c-.1705-.01-.3008.02-.391.08-.1003.05-.1705.16-.2306.32l-.1604.54-.0902.55c0 .17.0201.3.0802.39.0797.1088.1921.1893.3209.23l.5415.15.5515.09c.1705 0 .3008-.02.381-.08.0902-.06.1704-.16.2306-.32l.1504-.54.0902-.55c.01-.16-.0201-.29-.0802-.38-.0501-.09-.1604-.17-.3209-.23ZM6.16 0H3.9l.06.27.16.54c.0702.15.1498.26.24.31.0902.05.2195.07.39.05l.55-.1.54-.17c.1504-.07.2599-.15.31-.24.0501-.09.0701-.22.05-.39ZM3.89 10H6.15l-.06-.27-.17-.54c-.0702-.15-.1498-.25-.24-.3-.0903-.06-.2195-.08-.39-.06l-.55.11-.54.16c-.1504.07-.2499.15-.3.24-.0602.09-.0801.22-.06.39l.05.27Z",width:10,height:10,fill:!0}],xe.SELECT=Object.assign(pe.STOCK[4],{id:"rm-selected-area-fill",pattern:pe.STOCK[4].path,transform:"scale(0.5)"});class ve extends ge{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===ue?this._index=-1:(t.mode===_e&&it.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=s(e.colors)?e.colors:[]}}ve.TYPE="colors";class Se extends ge{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Se.SIZE,height:e.height||e.width||Se.SIZE})}}Se.TYPE="images",Se.SIZE=20;class Ce{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new xe(xe.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(ee.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(ee.ASSET_KEY,"1"),e.addDef(s)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(it.isObject(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=xe.TYPE:s(t.colors)?e=ve.TYPE:s(t.images)?e=Se.TYPE:null!=t.url?e=fe.TYPE:null!=t.path&&(e=me.TYPE)),e)switch(e.toLowerCase()){case me.TYPE:return new me(t);case fe.TYPE:return new fe(t);case ye.TYPE:return new ye(t);case we.TYPE:return new we(t);case xe.TYPE:return new xe(t);case ve.TYPE:return new ve(t);case Se.TYPE:return new Se(t)}}}}const Pe="0".charCodeAt(0),Me="#".charCodeAt(0),Le=",".charCodeAt(0),Ae="s".charCodeAt(0),ke="a".charCodeAt(0),Ie=".".charCodeAt(0);class Ee{static getFormatter(t){let e=Ee.Formatters[t];return e||(Ee.Formatters[t]=e=new Ee(t)),e}static get Default(){return Ee.getFormatter(Ee.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){for(let i=0;i<e;i++){const e=t.charCodeAt(i);e!==Pe&&e!==Me&&e!==Ie&&e!==Le&&e!==Ae&&e!==ke&&H(`Invalid number format: ${t}`,t)}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)===Pe;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Me;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Pe;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Le){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===Ae){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===ke){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}Ee.DEFAULT_FORMAT="",Ee.Formatters={};const Te=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Ne=[".","/","-",":"],Ve="Z".charCodeAt(0),$e="z".charCodeAt(0),Re="A".charCodeAt(0),De="a".charCodeAt(0),Oe="y".charCodeAt(0),Be="M".charCodeAt(0),Fe="m".charCodeAt(0),ze="W".charCodeAt(0),je="w".charCodeAt(0),Ge="d".charCodeAt(0),He="H".charCodeAt(0),We="h".charCodeAt(0),Ye="S".charCodeAt(0),Ze="s".charCodeAt(0);class Ue{static getFormatter(t){let e=Ue.Formatters[t];return e||(Ue.Formatters[t]=e=new Ue(t)),e}static get Default(){return Ue.getFormatter(Ot.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||Ot.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case Oe:s+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case Be:s+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case Ge:s+=a>1?z(t.getDate()):t.getDate();break;case ze:s+=a>1?z(it.weekOfYear(t,e)+1):it.weekOfMonth(t,e,!0)+1;break;case je:s+=a>1?it.long_week_days[t.getDay()]:it.week_days[t.getDay()];break;case He:s+=a>1?z(t.getHours()):t.getHours();break;case We:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?z(e):e}else s+=a>1?z(t.getHours()):t.getHours();break;case Fe:s+=a>1?z(t.getMinutes()):t.getMinutes();break;case Ze:s+=a>1?z(t.getSeconds()):t.getSeconds();break;case De:case Re:t.getHours()<12?s+=Ot.am:s+=Ot.pm;break;case Ye:let i=t.getMilliseconds();s+=3==a?j(i):2==a?z(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(Ne.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),Te.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Re&&e<=Ve||e>=De&&e<=$e)&&H(Ot.invalidDateFormat,t)}e.push(n)}if(r<s&&it.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&it.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||Ot.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}var Xe,Ke,qe;Ue.Formatters={},t.TextAnchor=void 0,(Xe=t.TextAnchor||(t.TextAnchor={})).START="start",Xe.MIDDLE="middle",Xe.END="end",t.TextLayout=void 0,(Ke=t.TextLayout||(t.TextLayout={})).TOP="top",Ke.MIDDLE="middle",Ke.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(qe||(qe={}));class Je extends ee{constructor(e,i=kt){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.bbox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=s-i.height;break;default:r=Math.ceil(s)}this.setAttr("y",r)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(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.internalSetStyleOrClass(ot.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in Qt||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i&&this.layoutText(),i}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&&this.layoutText(),e}clearDom(){super.clearDom(),this._dirty=!0}bbox(){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 Qe="$_TH",ti="$_TW";class ei{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)try{const t=i[r+3]?Ee.getFormatter(i[r+3]):e.numberFormatter;t&&(n=t.toStr(n))}catch(t){console.warn(`Failed to apply number format "${i[r+3]}" to ${n}:`,t)}else if(n instanceof Date)try{const t=i[r+3]?Ue.getFormatter(i[r+3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}catch(t){console.warn(`Failed to apply date format "${i[r+3]}" to ${n}:`,t)}else null==n&&(n=i[r+2]||"");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),kt);const e=this._literals.length-2;0===this._literals[e].length&&(this._literals[e]=kt)}else this._literals.push(r,n,kt,kt);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class ii extends ei{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 si extends ii{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","rm-text-link")}}const ri={t:class extends ii{tag(){return"</t>"}},b:class extends ii{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends ii{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:si};class ni{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 ei).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 ri){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 ri[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 oi=/<br.*?>|\r\n|\n/;class ai{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,n=!0){const o=t.doc,a=k(this.lineHeight,1),h=this._lines,l=h.length,c=[],d=[];t.clearDom(),s=s||t;const _=t.getStyle("writing-mode"),u=_===K||_===q;for(let e=0;e<l;e++){const i=h[e];let _=0,g=0,m=null;for(let[a,h]of i.words.entries()){const c=0===e&&0===a,d=e===l-1&&a===i.words.length-1,f=h.prepareSpan(t.appendElement(o,"tspan"),s,r);if(s instanceof Pt){const t=c&&n&&s.prop("prefix")||"",e=d&&n&&s.prop("suffix")||"";f.textContent=t+(f.textContent||"")+e}const b=f.getBBox();if(f[ti]=b.width,f[Qe]=b.height,u?(_=p(_,f[ti]),g+=f[Qe]):(_+=f[ti],g=p(g,f[Qe])),m||(m=f),h instanceof si){const e=o.createElementNS(Lt,"a");e.setAttribute("href",h.url),e.setAttribute("target",h.target),e.appendChild(f),t.appendDom(e)}}d.push(m),i[Qe]=g*a,i[ti]=_*a,c.push(0==e?i[ti]/2:i[ti])}if(l>0){let e=h[0];for(let i=1;i<d.length;i++)if(d[i]){let s=0,r=0;if(u?null!=d[i-1]&&(s=Math.floor(e[ti]-t.getAscent(e[ti]))+t.getAscent(h[i][ti])):r=e[Qe]-t.getAscent(e[Qe])+t.getAscent(h[i][Qe]),null==d[0]&&d[i]==d.find((t=>null!=t))){const r=t.insertElement(o,"tspan",d[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[ti]=n.width,r[Qe]=e[Qe]=n.height,d[0]=r}switch(_){case K:d[i].setAttribute("dx",String(s)),d[i].setAttribute("y","0");break;case q:d[i].setAttribute("dx",String(-s)),d[i].setAttribute("y","0");break;default:d[i].setAttribute("x","0"),d[i].setAttribute("dy",String(r))}e=h[i]}if(u){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=d,r=s[ti];if(e)s.setAttribute("dx",String(_===q?i-r/2:r/2));else switch(_){case K:s.setAttribute("x",String((i-r)/-2));break;case q:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(h[0][Qe])}}layout(e,i,s,r,n){const o=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===K||l===q)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(oi);for(let t of i)e.push((new ni).parse(t))}}}let hi=0;const li=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},ci=["__proto__","constructor","prototype"],di=function(t,r){const n=i(t)?t:{};for(const t in r)if(e.call(r,t)&&!ci.includes(t)){let e=r[t];s(e)?n[t]=e.slice(0):e instanceof Date?n[t]=new Date(e):i(e)?n[t]=di(n[t],e):n[t]=e}return n};class _i extends Pt{constructor(t){super(),this.chart=t,hi++}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this.prop("visible")}_doSetSimple(t,e){return a(e)?(t.visible=e,!0):super._doSetSimple(t,e)}_addChild(t,e){return super._addChild(t,e)}_doLoad(t,e){var i;if(null!=(null==e?void 0:e.template)){const t=null===(i=this.chart)||void 0===i?void 0:i.assignTemplates;t&&(e=t(e))}super._doLoad(t,e)}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,i,s=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==i&&""!==i||(i=void 0),void 0===i?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==i||(r||(r=this._style=this._op.style={}),r[t]=String(i),n=!0),n&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(t)){n||(n=this._style=this._op.style={});for(const e in t){let i=t[e];n[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=U(this[i]=s,!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t,e){}_doAfterRender(){}}_i.REFRESHED="refreshed",_i.defaults=li(Pt.defaults,{visible:!0});class ui{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 pi extends _i{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=k(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?Ee.getFormatter(t):null)}_setText(t){t!==this._text&&this.prepareRich(this._text=t);const e=this.prop("lineHeight");return!isNaN(e)&&this._richTextImpl&&(this._richTextImpl.lineHeight=e),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,n,o=!0){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n,o),e&&this._richTextImpl.build(e,i,s,r,n,o))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ai),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.prop("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(t.text)}$_getNumberText(t,e,i){if(it.isValidNum(t)){const s=this._numSymbols&&e&&it.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(r=o+r),a&&(r+=a),r}getNumberText(t,e,i,s){let r="";if(it.isValidNum(t)){const n=this._numSymbols&&e&&it.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,s)+n.symbol:this._numberFormatter.toStrEx(t,s):n?n.value+n.symbol:String(t)}const n=this.prop("prefix"),o=this.prop("suffix");return n&&(r=n+r),o&&(r+=o),r}}pi.defaults=li(_i.defaults,{effect:"none",autoContrast:!1,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class gi extends pi{getIconPos(){const t=this.prop("iconPosition");return"default"===t?this.getDefaultIconPos():t}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof Se&&(this._images=i)}this._root=this._images?"":e.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2);return i instanceof Se?i.getImage(s):s}return this._root+t}}}gi.defaults=li(pi.defaults,{iconPosition:"default",iconGap:2});class mi extends _i{}mi.defaults=li(pi.defaults,{});class fi extends gi{getDisplay(t){const e=this.prop("display");return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return k(this.prop("gap"),t?10:5)}_isVisible(){return this.prop("visible")&&!!this.prop("text")}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}fi.defaults=li(gi.defaults,{display:"auto"});class bi extends _i{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){const t=this.prop("order");return isNaN(t)?1/0:t}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){this._addChild("background",this._background=new mi(this.chart)),this._addChild("title",this._title=new fi(this.chart)),this._addChild("footer",this._footer=new fi(this.chart))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=E(e.location,"bottom")}}bi.defaults=li(_i.defaults,{offsetX:0,offsetY:0});class yi extends bi{}class wi extends bi{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this.prop("direction")}}wi.defaults=li(bi.defaults,{direction:"vertical"});class xi extends ui{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(t)?this._dic[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,r=this._items=[],n=this._dic={};if(s(t))t.forEach(((t,i)=>{r.push(this.$_loadItem(e,t,i))}));else if(i(t))r.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const i={};a(t)&&(i.visible=t),r.push(this.$_loadItem(e,i,0))}r.forEach((t=>{t.prop("name")&&(n[t.prop("name")]=t)}))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s.init(),s._setIndex(i),s.loadOptions(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class vi extends xi{_collectionProp(){return"widgetGroup"}_createWidget(t){return new wi(t)}beforeRender(){this._collectVisibles()}}class Si extends _i{constructor(){super(...arguments),this.index=-1,this._offsetX=0,this._offsetY=0}get name(){return this._name}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)||0,y:(this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY)||0}}getSize(t,e){let i,s;return isNaN(i)&&(i=X(this._widthDim,t)),isNaN(s)&&(s=X(this._heightDim,e)),{width:i,height:s}}getPosition(t,e,i,s,r,n){let o,a,h;switch(o=this.getOffset(r,n),a=t,this.prop("align")||this._getDefaultAlign()){case"center":a+=(i-r)/2+o.x;break;case"right":a+=i-o.x-r;break;default:a+=o.x}switch(o=o||this.getOffset(r,n),h=e,this.prop("verticalAlign")){case"middle":h+=(s-n)/2-o.y;break;case"bottom":h+=s-o.y-n;break;default:h+=o.y}return{x:a,y:h}}_doApply(t){const e=this,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`${this._getNamePrefix()} ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_getDefaultAlign(){return"left"}}Si.defaults=li(_i.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ci extends ui{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.chart,n=this._items=[],o=this._map={};s(t)?t.forEach(((t,i)=>{n.push(this._loadItem(r,t,i,e))})):i(t)&&n.push(this._loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender()}))}}class Pi extends yi{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Pi.defaults=li(bi.defaults,{});class Mi extends _i{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Mi.defaults=li(_i.defaults,{text:"RealMap v1.1.20",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const Li="_model_",Ai="_tag_",ki="disabled",Ii="rm-legend-item-marker",Ei=Object.freeze([0,0]),Ti=/s\+/;function Ni(t){if(s(t))return[+t[0],+t[1]];if(n(t)){const e=t.split(Ti);return[+e[0],+e[1]]}if(i(t)){if(t&&!isNaN(t.lon)&&!isNaN(t.lat))return[t.lon,t.lat];if(!isNaN(t.x)&&!isNaN(t.y))return[t.x,t.y]}return[0,0]}function Vi(t){return isFinite(t[0]+t[1])}function $i(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function Ri(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=u(e,...t),i=u(i,...o),s=p(s,...t),r=p(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const Di=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Oi=.001,Bi=Math.PI;class Fi{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return 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){return r>0?n>0?(r=u(-s/2,i/2,r),["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=u(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=u(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 ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=V(g(n-r)),l=2*Bi-h<.01,c=h-Bi<.01?0:1,u=o?1:0,p=d(r),m=_(r),f=d(n-=l?u?Oi:-.001:0),b=_(n),y=[];return y.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=V(g(o-n)),l=2*Bi-h<Oi;let c=h-Bi<Oi?0:1;const u=a?1:0,p=d(n),m=_(n),f=d(o-=l?u?Oi:-.001:0),b=_(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-u,t+y*p,e+w*m),x.push("Z"),x}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*_(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*d(r),o+h*_(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*_(r),"L",n+l*d(r+p),o+c*_(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=Fi[e](0,0,2*i,2*s);break;default:r=Fi.circle(i,s,u(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const zi={minimumZoom:200,maximumZoom:1600},ji={};class Gi extends Si{static register(...t){t.forEach((t=>{ji[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"annotation",this._type())),super._doLoad(t,e)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}Gi.defaults=li(Si.defaults,{front:!1});class Hi extends Ci{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof Gi)return e}load(t,e){super.load(t,e)}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):void 0}))}_loadItem(t,e,i,s){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a.init(),a.index=i,a.loadOptions(e),a}}const Wi="geo",Yi="chart",Zi="route";class Ui{static getDistance(t,e){const i=(e[0]-t[0])*w,s=(e[1]-t[1])*w,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*w)*Math.cos(e[0]*w)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}static normalizeToSteps(t,e){if(t.length<2)return t;const i=Math.min(...t),s=Math.max(...t);if(i===s)return[i];const r=(s-i)/(e-1),n=10**Math.floor(Math.log10(r)),o=r/n;let a;a=o<=1?1:o<=2?2:o<=5?5:10,a*=n;const h=Math.floor(i/a)*a,l=[];a=(Math.ceil(s/a)*a-h)/(e-1);for(let t=0;t<e;t++)l.push(It(h+t*a));return l}static valueAt(t,e){if(null!=e&&""!==e&&(it.isObject(t)||s(t))){const i=String(e).split(".");let s=t;for(let t of i)s=s[t];return s}return t}}class Xi extends ee{static create(t,e,i,s,r,n,o=0){return new Xi(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=void 0,i=void 0){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))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}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)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}class Ki{constructor(t,e){}}const qi="@_rm_state_",Ji="@_rm_add_",Qi="@_rm_update_",ts="@_rm_delete_";let es=0;const is=[0,0];class ss{constructor(t){this.source=t,this.inset=is,this.pid=es++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.chart.coordOfArea(this.id)),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[qi]=t:delete this[qi]}_isAdding(){return this[qi]===Ji}_isUpdating(){return this[qi]===Qi}_isDeleting(){return this[qi]===ts}_isStatic(){const t=this[qi];return t!==Ji&&t!==ts}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){var i,r,n,o,a,h;const l=t.prop("fields");if(s(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(i=t._idFielder)||void 0===i?void 0:i.call(t,e),this.name=null===(r=t._nameFielder)||void 0===r?void 0:r.call(t,e),this.color=null===(n=t._colorFielder)||void 0===n?void 0:n.call(t,e),this.coord=[null===(o=t._lonFielder)||void 0===o?void 0:o.call(t,e),null===(a=t._latFielder)||void 0===a?void 0:a.call(t,e)],this.value=null===(h=t._valueFielder)||void 0===h?void 0:h.call(t,e)}$_localeName(t,e){var i;const s=Ft(null===(i=t.chart)||void 0===i?void 0:i.general.prop("locale")).nameKeys;for(const t of s)if(void 0!==e[t])return e[t]}_relocalizeName(t){const e=this.source;i(e)&&(this.name=E(t._nameFielder(e),this.$_localeName(t,e)))}_readObject(t,e){var i;if(this.id=E(t._idFielder(e),e.id),this._relocalizeName(t),this.color=E(t._colorFielder(e),e.color),this.className=e.className,s(e.coord))this.coord=[+e.coord[0],+e.coord[1]];else if(n(e.coord)){const t=e.coord.split(Ti);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const s=t._lonFielder(e),r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);isNaN(s)||isNaN(r)||(this.coord=[s,r])}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=this.id&&t.chart.coordOfArea(this.id)),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=s(e.callout)&&this.$_parseCallout(e.callout),s(this.callout)||(this.offset=s(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),s(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(s(t))e.push(t.slice(0,2));else if(n(t)){const i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class rs{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const ns={};class os extends gi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}getValue(t,e){const i=this.prop("textField");if(n(i)){const e=t.getProp(i);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return it.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return r(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}_doApply(t){super._doApply(t),r(t.positionCallback)?this._getPosition=t=>{const e=this.prop("positionCallback"),i=this.prop("position");return e({point:t,chart:this.chart.wrapper})||i||os.DEFAULT_POSITION}:this._getPosition=()=>this.prop("position")||os.DEFAULT_POSITION}}os.DEFAULT_POSITION="auto",os.defaults=li(gi.defaults,{visible:!0,position:os.DEFAULT_POSITION});class as extends _i{}as.defaults=li(_i.defaults,{shape:"circle",radius:2.5});class hs extends _i{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),this._addChild("anchorPoint",this._anchorPoint=new as(this.chart))}get anchorPoint(){return this._anchorPoint}}hs.defaults=li(_i.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class ls{constructor(t,e){this._args=t,this._chart=e}get chart(){return this._chart}get count(){return this._points.length}get(t){if(t>=0&&t<this._points.length)return this._points[t].assignTo(this._args),this._args}}class cs extends $t{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class ds extends $t{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class _s extends cs{_init(t){super._init(t),t._setState(Ji)}}class us extends cs{_init(t){super._init(t),t._setState(ts),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class ps extends cs{_init(t){super._init(t),t._setState(Qi)}}class gs extends ds{_init(t){t.forEach((t=>{t._setState(Ji),t._setVrate(0)}))}}class ms extends ds{_init(t){t.forEach((t=>{t._setState(ts),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class fs extends ds{_init(t){t.forEach((t=>{t._setState(Qi),t._setVrate(0)}))}}class bs extends _i{static register(...t){t.forEach((t=>{ns[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}getProp(t){return this.prop(t)}constructor(t){super(t),this._index=-1,this._seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._dataDirty=!1,this._maxZindex=0,this._points=new rs(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new ls(this.$_createPointArgs(),this.chart.wrapper),this._addChild("pointLabel",this._pointLabel=this._createLabel(this.chart)),this._addChild("callout",this._callout=new hs(this))}_createLabel(t){return new os(t)}getTooltipText(t,e){var i;const s=this.prop("tooltipText"),r=this.prop("tooltipCallback");return"function"==typeof r?(this._getPointArgs(this._pointArgs,e),null!==(i=r(this._pointArgs))&&void 0!==i?i:n(s)?s:bs.defaultTooltipText):"boolean"==typeof s?s?bs.defaultTooltipText:null:s}getTooltipParam(t,e,i){return bs.getPointTooltipParam(t,e,i)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this.prop("label")||this.name}_type(){return this.constructor.type}_inspect(){var t,e;const i={name:this.name,type:this._type(),points:this.pointCount,rendered:null!==(e=null===(t=this._visPoints)||void 0===t?void 0:t.length)&&void 0!==e?e:0,hasData:!!(this._op.dataUrl||s(this._op.data)&&this._op.data.length>0)};if(i.hasData&&this._positionsByCoord()){let t=0;this._points.forEach((e=>{s(e.coord)&&0===e.coord[0]&&0===e.coord[1]&&++t})),i.unpositioned=t}return i}_positionsByCoord(){return!0}get index(){return this._index}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}get cluster(){return null}displayName(){return this.prop("label")||this.name||`Series${this.index}`}get data(){return this._data}$_setData(t,e){if(t!==this._data||e!==this._dataPath)return this._data=Ui.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}get needAnimate(){return this._needAnimate}set needAnimate(t){this._needAnimate=t}get dataLoaded(){return this._dataLoaded}set dataLoaded(t){this._dataLoaded=t}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}isInteractive(){return this.bool("interactive")&&!this.bool("disabled")}needMapScale(){return!1}needTranslate(){return!0}contains(t){return this._points.contains(t)}isExcluded(t){return!1}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e&&e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?{isCallbackExecuted:!0,label:s}:{label:i,isCallbackExecuted:!1}}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}_relocalize(){this._points.getPoints().forEach((t=>t._relocalizeName(this)))}getPointStyle(t){const e=this.prop("styleCallback");if("function"==typeof e)return e(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if("function"==typeof this.pointLabel.prop("styleCallback"))return this.pointLabel.prop("styleCallback")(this._getPointArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.prop("zoomLevel");return this._pointLabel.isVisible()&&this.pointLabelCount()>0&&(isNaN(t)||this.chart.body.zoom>=t)}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!0===e.visible)}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.prop("layoutOnly")}getLegendSources(t,e){this._legend===t&&e.push(this)}getLabelOff(){return k(this._pointLabel.prop("offset"),this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){return this.$_setData(t,this.prop("dataPath"))&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s;const r=this.$_addPoint(t,-1);return this._points.insert(e,r),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(r._prev={},r._prev.ani=new _s(this,r,(t=>{var e;null===(e=this.prop("onPointAdded"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(s=this.prop("onPointAdded"))||void 0===s||s(this._getPointArgs(this._pointArgs,r)),r}addPointList(t,e=-1,i=500){var r;if(!s(t)||t.length<1)return;const n=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new gs(this,n,(t=>{var e;null===(e=this.prop("onPointListAdded"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(r=this.prop("onPointListAdded"))||void 0===r||r(this._getPointListArgs(n)),n}removePoint(t,e=300){var i,s,r;o(t)?t=this._points.get(t):n(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new us(this,t,(t=>{var e;this._points.remove(t),null===(e=this.prop("onPointRemoved"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(r=this.prop("onPointRemoved"))||void 0===r||r(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];o(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new ms(this,t,(t=>{var e;this._points.removeAll(t),null===(e=this.prop("onPointListRemoved"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(i=this.prop("onPointListRemoved"))||void 0===i||i(this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s;if(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points.get(t)),t instanceof ss&&this._points.contains(t)){let r=t._prev;return r&&r.ani&&r.ani.stop(),r=t.updateValues(this,e),r&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?r.ani=new ps(this,t,(t=>{var e;null===(e=this.prop("onPointUpdated"))||void 0===e||e(this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(s=this.prop("onPointUpdated"))||void 0===s||s(this._getPointArgs(this._pointArgs,t))),!!r}return!1}updatePointList(t,e,i=300){var s;const r=this.$_points(t).filter((t=>this._points.contains(t)));r.length>0&&(r.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new fs(this,r,(t=>{var e;null===(e=this.prop("onPointListUpdated"))||void 0===e||e(this._getPointListArgs(t))})).setDuration(i).start():null===(s=this.prop("onPointListUpdated"))||void 0===s||s(this._getPointListArgs(r)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){const e=this.prop("onPointClick");if(e)return this._getPointArgs(this._pointArgs,t),e(this._pointArgs)}show(t=!1,e=!0){this.visible&&!t||(e?this.chart.requestShowSeries(this,!0):this.visible=!0)}hide(t=!0){this.visible&&(t?this.chart.requestShowSeries(this,!1):this.visible=!1)}getCalloutShape(t){return this.callout.anchorPoint.prop("shape")||"circle"}canSelect(){return!1}select(t){t&&(t.setSelected(!0),this.$_bringToFront(t),this.chart._selectionChanged(this,[t]))}unselect(t){t.setSelected(!1),this.chart._selectionChanged(this,[t])}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0),this.$_bringToFront(t);this.chart._selectionChanged(this,e)}unselectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!1);this.chart._selectionChanged(this,e)}$_bringToFront(t){t instanceof ss&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0)}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_isPointsDirty(){return this._dataSourceDirty}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._isPointsDirty()){const t=this._doLoadData(this._data);this.$_loadPoints(t),this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))}else this._optionsDirty||this._dataDirty?(this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);this._visPoints.forEach((t=>t._excluded=this.isExcluded(t))),super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let a,h,l;this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,r(i)?a=i:s(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))})):l instanceof ve?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e++)}$_addPoint(t,e){const i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return r(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(t){this._idFielder=this._createFielder(t.idField),this._nameFielder=this._createFielder(t.nameField),this._colorFielder=this._createFielder(t.colorField),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createLegendMarker(t,e){return Xi.create(t,Ii,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"series",this._type())),super._doLoad(t,e)}_doLoadData(t){if(t instanceof Ki);else if(s(t))return t}$_loadPoints(t){var e;this._doLoadPoints(t),null===(e=this.prop("onPointsLoaded"))||void 0===e||e(this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){var e,i;const s=this._pointLabel.prop("textCallback"),n=this._pointLabel.prop("visibleCallback");this._pointLabelCallback=r(s)?s:null,this._pointLabelVisCallback=r(n)?n:null,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count,t.locale=null===(i=null===(e=this.chart)||void 0===e?void 0:e.general)||void 0===i?void 0:i.prop("locale")}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:u(s,e),i=isNaN(i)?s:p(s,i))})),{min:e,max:i}}}bs.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",bs.defaults=li(_i.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:bs.defaultTooltipText,loadAnimation:"default",legend:0,interactive:!0});class ys extends ui{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},s(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):i(t)&&this.$_loadItem(r,t,0)}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.prop("legend"),null)))),this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t,e){const i=this.$_loadItem(this.chart,t,this._items.length);return i&&(i.needAnimate=e),i}remove(t){let e;if(t instanceof bs?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>t._setIndex(e))),e}$_loadItem(t,e,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t);return n.init(),n.isDataSeries()&&n._setIndex(i,t._seriesIndex++),n.loadOptions(e),this.$_addSeries(n,i)}$_addSeries(t,e){return e>=0?this._items.splice(Math.min(e,this._items.length),0,t):this._items.push(t),t.name&&(this._map[t.name]=t),t}}class ws extends ss{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_readArray(t,e){super._readArray(t,e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:N(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}_valuesChanged(t){const e=super._valuesChanged(t),i=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],s=this.value!==t.value;return e||s||i}}class xs extends bs{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t)}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}xs.defaults=li(bs.defaults,{valueField:"value"});class vs extends xs{isExcludedCoord(t){if(this._excludes)for(let e=0;e<this._excludes.length;e++){const i=this._excludes[e];if(t[0]>=i[0][0]&&t[0]<=i[1][0]&&t[1]>=i[1][1]&&t[1]<=i[0][1])return!0}}isExcluded(t){return this.isExcludedCoord(t.coord)}_doApply(t){if(super._doApply(t),e.call(t,"excludeBounds")){const e=t.excludeBounds,r=[];if(i=e,Array.isArray(i)&&i.length>0)for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];if(s(i)&&s(n)){const t=+i[0],e=+i[1],s=+n[0],o=+n[1];isNaN(t)||isNaN(e)||isNaN(s)||isNaN(o)||r.push([[u(t,s),p(e,o)],[p(t,s),u(e,o)]])}}this._excludes=r.length>0?r:void 0}var i}}vs.defaults=li(xs.defaults,{});class Ss extends ws{}class Cs extends vs{}Cs.defaults=li(vs.defaults,{});class Ps extends ws{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=s(this.values)?this.values.reduce(((t,e)=>t+k(e,0)),0):0:this._sum}_readArray(t,e){super._readArray(t,e),this.$_initValues(t)}_readObject(t,e){super._readObject(t,e),this.$_initValues(t)}$_initValues(t){var e;const i=this.value;if(s(i)){const s=t.getProp("nullAsBase"),r=null!==(e=t.getProp("baseValue"))&&void 0!==e?e:0,n=s?r:NaN;this.values=i.map((t=>null==t?n:t))}else this.values=isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class Ms{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return Xi.create(t,Ii,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class Ls extends vs{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t);const e=this.prop("categories");this._categories=this.$_parseCategories(e)}_relocalize(){super._relocalize(),this._categories=this.$_parseCategories(this.prop("categories"))}_createValueFielder(t){const e=this.prop("valueFields");return s(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this.prop("legendByCategory")&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){var e,i;if(s(t)){const s=zt(null===(i=null===(e=this.chart)||void 0===e?void 0:e.general)||void 0===i?void 0:i.prop("locale"));return t.map((t=>{var e;return new Ms(s&&null!==(e=t.nameEn)&&void 0!==e?e:t.name,t.color)}))}}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{const i=e;t=Math.max(t,i.values?i.values.length:0)})),t<2)return[this._calcedColor];{const e=ot.create("white"),i=ot.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=ot.interpolate(e,i,r/(2*t)).toString();return s}}}Ls.defaults=li(vs.defaults,{position:"top"});class As extends Ps{}class ks extends Ls{_doInit(t){super._doInit(t),this._addChild("baseLine",this._baseLine=new _i(this.chart))}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=it.getMinMax(t),s=i.base=this.prop("baseValue");if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=k(this._minValue,i.min),e=k(this._maxValue,i.max);i.min=isNaN(s)?Math.min(t,i.min):Math.min(t,i.min,s),i.max=isNaN(s)?Math.max(e,i.max):Math.max(e,i.max,s)}return i}getPadding(t){return k(X(this._paddingDim,t),0)}_doApply(t){super._doApply(t);const e=this.prop("width"),i=this.prop("height"),s=this.prop("minValue"),r=this.prop("maxValue"),n=this.prop("valueDomain");this._width=k(+e,ks.DEF_WIDTH),this._height=k(+i,ks.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+s,this._maxValue=+r,this._pointDomain="point"===n}}ks.DEF_WIDTH=80,ks.DEF_HEIGHT=50,ks.defaults=li(Ls.defaults,{width:ks.DEF_WIDTH,height:ks.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Is extends ws{}class Es extends vs{_doApply(t){super._doApply(t),this._width=k(+t.width||+t.size||+t.height,Es.DEF_SIZE),this._height=k(+t.height||+t.size||+t.width,Es.DEF_SIZE)}}Es.DEF_SIZE=60,Es.defaults=li(vs.defaults,{size:Es.DEF_SIZE});class Ts extends Es{getValueRate(t){return(k(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=this.num("minValue"),this._maxValue=this.num("maxValue")}_doPrepareRender(t){let e=k(this._minValue,1/0),i=k(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t,r=s.getValue();s.isNull||isNaN(r)||(e=u(e,r),i=p(i,r))})),this._min=e,this._max=i}}Ts.defaults=li(Es.defaults,{minValue:10});class Ns extends Ss{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}}class Vs extends os{}Vs.defaults=li(os.defaults,{visible:!1});class $s extends Cs{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new Vs(this.chart))}get subLabel(){return this._subLabel}get color(){return this._colorObj}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:X(this._minSizeDim,t),max:X(this._maxSizeDim,t)}}getRadius(t,e,i){if(isNaN(t))return 0;let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"===this.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return k(this._subLabel.prop("offset"),0)}_doApply(t){super._doApply(t);const e=this.prop("minValue"),i=this.prop("maxValue"),s=this.prop("alignToSurface");this._setDims(t,"minSize","maxSize"),this._extMin=+e,this._extMax=+i,this._alignToSurface=s}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ns(t)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new ot(this._calcedColor)}getColorScale(){var t;return null!==(t=this.prop("colorScale"))&&void 0!==t?t:null}getValueRange(){return{min:this._colorMin,max:this._colorMax}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._colorMin,this._colorMax,t.getValue(),this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._extMin,r=this._extMax;if(!isNaN(s)&&!isNaN(r)&&this._runPoints.length>0)this._noSize=s>r||(this._vMin=s)===(this._vMax=r);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((i=>{const n=i.getValue();i.isNull||isNaN(n)||(isNaN(s)&&(t=u(t,n)),isNaN(r)&&(e=p(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}const{min:n,max:o}=this._calcMinMax(this._visPoints),a=this.prop("colorScale");this._colorMin=n,this._colorMax=o,this._colorRanger=null!=a?null===(i=t.getColorScale(a))||void 0===i?void 0:i.getRanger():void 0}}$s.type="bubble",$s.defaults=li(Cs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Rs extends _i{}Rs.defaults=li(Pi.defaults,{length:10});class Ds extends gi{getText(t){return it.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ds.defaults=li(Pi.defaults,{offset:4});class Os extends _i{_doInit(t){this._line=this._addChild("line",new Rs(this.chart)),this._label=this._addChild("label",new Ds(this.chart))}get line(){return this._line}get label(){return this._label}}Os.defaults=li(Pi.defaults,{});class Bs extends Pi{_doInit(t){super._doInit(t),this._tick=this._addChild("tick",new Os(this.chart))}get tick(){return this._tick}getSteps(t,e){const i=this._series,s=this._steps;if(i instanceof $s){let{min:r,max:n}=i.getPixelMinMax(u(t,e));isNaN(this.prop("minRadius"))||(r=this.prop("minRadius")),isNaN(this.prop("maxRadius"))||(n=this.prop("maxRadius")),s.forEach((t=>{t.rd=i.getRadius(t.value,r,n)}))}else if(s.length>0){const t=k(this.prop("minRadius"),10),e=k(this.prop("maxRadius"),50)-t,i=s[0].value,r=s[s.length-1].value-i;s.forEach((s=>{s.rd=t+e*(s.value-i)/r}))}return s}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){this._op;const t=this.prop("steps"),e=[];if(s(t)&&t.length>0){const s=this.tick.label;t.forEach((t=>{i(t)?e.push({value:+t.value,label:t.label||s.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:s.getText(+t),rd:0})}))}return e}}Bs.defaults=li(Pi.defaults,{});class Fs extends xi{_collectionProp(){return"bubbleScale"}_createWidget(t){return new Bs(t)}beforeRender(){this._collectVisibles()}}class zs extends _i{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}zs.MARKER_SIZE=10;class js extends yi{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this.prop("layout")||"body"===t)return this.prop("layout");switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return X(this._maxWidthDim,t,t)}getMaxHeight(t){return X(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("maxWidth"))!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=U(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=U(t,!0))}(this.prop("maxHeight"))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new zs(this,t))),this.prop("reversed")&&(this._items=this._items.reverse())}}js.defaults=li(bi.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:zs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class Gs extends xi{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new js(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class Hs{constructor(t){this._color1=ot.create(t.minColor),this._color2=ot.create(t.maxColor),this._logger=it.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return ot.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return T(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class Ws extends _i{_doInit(t){this._label=this._addChild("label",new pi(this.chart))}get label(){return this._label}getMarkerSize(){return k(this.prop("size"),7)}}Ws.defaults=li(_i.defaults,{size:7});class Ys extends _i{}Ys.defaults=li(_i.defaults,{length:6});class Zs extends gi{getDefaultIconPos(){}}Zs.defaults=li(gi.defaults,{});class Us extends _i{_doInit(t){this._line=this._addChild("line",new Ys(this.chart)),this._label=this._addChild("label",new Zs(this.chart))}get line(){return this._line}get label(){return this._label}}Us.defaults=li(_i.defaults,{});class Xs{constructor(t,e,i,s,r){this.from=t,this.to=e,this._color1=i,this._color2=s,this.label=r,this.visible=!0}get color(){return this._color2.toString()}canHide(){return!0}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this.$_createLegendMarker(t,e))}$_createLegendMarker(t,e){const i=+e||zs.MARKER_SIZE;return Xi.create(t,Ii,0,0,i,i,0)}legendColor(){return this._color2.toString()}legendLabel(){return this.label}constains(t,e){return t>=this.from&&(e?t<=this.to:t<this.to)}getPosition(t,e){if(this.constains(t,e))return(t-this.from)/(this.to-this.from)}getColor(t,e){const i=this._color1,s=this._color2;if(!i)return(s||e).toString();const r=this.from,n=this.to;if(i&&s)return ot.interpolate(i,s,(t-r)/(n-r)).toString();return T(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class Ks extends _i{}Ks.defaults=li(_i.defaults,{});class qs extends _i{getLabel(){var t;return null!==(t=this.prop("label"))&&void 0!==t?t:"No Data"}getGap(){return k(+this.prop("gap"),0)}}qs.defaults=li(_i.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const Js=ot.create("#000");class Qs extends Pi{_doInit(t){super._doInit(t);const e=this.chart;this._marker=this._addChild("marker",new Ws(e)),this._stepLine=this._addChild("stepLine",new Ks(e)),this._tick=this._addChild("tick",new Us(e)),this._nullStep=this._addChild("nullStep",new qs(e))}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(this._logger&&(i=this._logger(i)),r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=this._min?r[0]._color1.toString():s.toString()}return ot.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this.nullStep.prop("visible"))return this.nullStep.prop("color")}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get endColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this.prop("layout")){case"horizontal":case"vertical":return this.prop("layout");default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?X(this._barLengthDim,e):e,s=k(this.prop("barWidth"),12)):(s=this._barLengthDim?X(this._barLengthDim,t):t,r=k(this.prop("barWidth"),12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,n=s?s.length:r?r.length-1:0,o=e?n+1:n,a=[];if(e&&(t-=i),n>0)for(let e=0;e<n;e++)a.push((e+1)/o*t);return a}getPosition(t){const e=this._steps;if(!e){const e=this._logger;return e&&(t=e(t)),(t-this._min)/(this._max-this._min)}for(let i=0,s=e.length;i<s;i++){const r=e[i].getPosition(t,i===s-1);if(!isNaN(r))return(i+r)/s}}getTicks(){const t=this._tick.label,e=this._steps,i=this._valueSteps,s=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=k(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=k(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=k(e[n-1].to,r)})}else if(i){n=i.length,o.push({pos:i[0]});for(let t=1;t<n-1;t++)o.push({pos:i[t]});o.push({pos:i[n-1]})}else o=[{pos:s},{pos:r}];const a=this._logBase;return n=o.length-1,o.forEach(((e,i)=>{if(null==e.label){const s=this._logger?Math.pow(a,e.pos):e.pos;e.label=t.getNumberText(s,!1,!1,0===i?"trunc":i===n?"ceil":void 0)}})),o}getSteps(){return this._steps}getLegendSources(t){"legend"!==this.prop("display")&&"both"!==this.prop("display")||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||Js,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t);const e=this.prop("colors"),i=this.prop("minColor"),s=this.prop("maxColor");this._setDim(t,"barLength"),this._minColor=ot.create(i),this._maxColor=t.maxColor&&ot.create(s),this._colors=this.$_parseColorStops(e)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this.prop("name")}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(s(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:ot.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:ot.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+this.prop("minValue"),this._max=+this.prop("maxValue"),this._logger=it.getLogger(this._logBase=this.prop("logBase")),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?ot.interpolate(this._minColor,this._endColor,parseFloat(t)/100):ot.create(t)}$_buildSteps(){var t;const e=this.prop("solidFill"),i=this.prop("steps"),r=[],n=zt(null===(t=this.chart)||void 0===t?void 0:t.general.prop("locale")),o=this._min,a=this._max;let h=o,l=a;if(this._valueSteps=null,s(i)&&i.length>0){let t="0%";i.forEach(((s,o)=>{var a,c;let d,_,u=this.$_parseValue(s.from,h,l),p=this.$_parseValue(s.to,h,l);if(0===o&&isNaN(u)&&(u=h),o===i.length-1&&isNaN(p)&&(p=l),s.fromColor&&s.toColor)d=this.$_parseColor(s.fromColor),_=this.$_parseColor(t=s.toColor);else if(e){let t=s.toColor||s.fromColor||s.color;t=0===o?t||"0%":t||"100%",_=d=this.$_parseColor(t)}else d=this.$_parseColor(s.fromColor||t),_=this.$_parseColor(t=(null!==(a=s.toColor)&&void 0!==a?a:s.color)||"100%");r.push(new Xs(u,p,d,_,n&&null!==(c=s.labelEn)&&void 0!==c?c:s.label))}))}else if(h>=l)r.push(new Xs(h,l,e?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(h)&&!isNaN(l)){const t=this.prop("logBase"),i=this._logger&&h>=0&&l-h>=t?this._logger:null,s=this._valueSteps=[],n=Math.max(1,k(this.prop("stepCount"),1));if(i&&(h=i(h),l=i(l)),this.prop("integralSteps"))s.push(...Ui.normalizeToSteps([h,l],n+1));else{const t=(l-h)/n;s.push(h);for(let e=1;e<n;e++)s.push(It(s[e-1]+t));s.push(It(l))}if(this._min=s[0],this._max=s[n],e){const t=this._minColor,e=this._endColor,i=s.length-1;for(let n=1;n<=i;n++){const o=ot.interpolate(t,e,n/i);r.push(new Xs(s[n-1],s[n],o,o,void 0))}}}return r.length>1?r:void 0}}Qs.defaults=li(_i.defaults,{display:"scale",minColor:"#fff",layout:"auto",barWidth:12,barLength:"40%"});class tr extends xi{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.prop("display")))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new Qs(t)}beforeRender(){this._collectVisibles()}}class er extends _i{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()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e){this._module&&this._module.exportToImage(t,e)}dispose(){return this._module&&this._module.dispose(),this._module=null,this._isCompose=!1,super.dispose()}}er.defaults=li(_i.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1});class ir extends _i{_doSetSimple(t,e){return it.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}ir.defaults=li(_i.defaults,{});class sr extends _i{_doInit(t){this._addChild("line",this._line=new ir(this.chart)),this._addChild("lonLine",this._lonLine=new ir(this.chart)),this._addChild("latLine",this._latLine=new ir(this.chart))}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this.prop("fitTo")}getLonStep(){return Math.max(0,I(this._lonLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}getLatStep(){return Math.max(0,I(this._latLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}_doApply(t){super._doApply(t)}$_defaultStep(){return 10}}sr.defaults=li(_i.defaults,{visible:!1,fitTo:"map"});class rr extends _i{}rr.defaults=li(_i.defaults,{visible:!1});class nr extends _i{}nr.defaults=li(_i.defaults,{visible:!1});class or extends pi{getText(t,e){let i=this.prop("suffix");if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this.prop("prefix")&&(i=this.prop("prefix")+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=this.prop("dirSymbols")}}or.defaults=li(pi.defaults,{dirSymbols:"NSEW",suffix:"°°"});class ar extends _i{_doInit(t){this._addChild("line",this._line=new nr(this.chart)),this._addChild("label",this._label=new or(this.chart))}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,I(this.prop("lonInterval"),this.prop("interval"),1))|0}getLatInterval(){return Math.max(1,I(this.prop("latInterval"),this.prop("interval"),1))|0}_doApply(t){super._doApply(t);const e=this.prop("positions");this._positions=s(e)?e:[]}}ar.defaults=li(_i.defaults,{visible:!1,positions:["top","right"],interval:1});class hr extends gi{getDefaultIconPos(){return"left"}}hr.defaults=li(gi.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class lr extends _i{_doInit(t){this._addChild("label",this._label=new hr(this.chart))}get label(){return this._label}}lr.defaults=li(_i.defaults,{front:!0,zindex:0});class cr extends lr{}cr.defaults=li(lr.defaults,{});class dr extends lr{}dr.defaults=li(lr.defaults,{});class _r extends lr{}_r.defaults=li(lr.defaults,{});class ur extends _i{}ur.defaults=li(_i.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class pr extends _i{constructor(t){super(t.chart),this.axis=t}_doInit(t){this._addChild("flag",this._flag=new ur(this.chart)),this._args={chart:this.chart.wrapper,axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag;let i=Ee.getFormatter(e.prop("numberFormat")).toStr(t);const s=e.prop("prefix"),r=e.prop("suffix");return s&&(i=s+i),r&&(i+=r),i}moved(t,e,i){}_doSetSimple(t,e){return r(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}pr.defaults=li(_i.defaults,{visible:!1});class gr extends _i{constructor(){super(...arguments),this._guides=[]}_doInit(t){this._addChild("line",this._line=new rr(this.chart)),this._addChild("leftLine",this._leftLine=new rr(this.chart)),this._addChild("rightLine",this._rightLine=new rr(this.chart)),this._addChild("topLine",this._topLine=new rr(this.chart)),this._addChild("bottomLine",this._bottomLine=new rr(this.chart)),this._addChild("equatorLine",this._equatorLine=new rr(this.chart)),this._addChild("meridianLine",this._meridianLine=new rr(this.chart)),this._addChild("grid",this._grid=new sr(this.chart)),this._addChild("tick",this._tick=new ar(this.chart)),this._addChild("crosshair",this._crosshair=new pr(this))}get line(){return this._line}get leftLine(){return this._leftLine}get rightLine(){return this._rightLine}get topLine(){return this._topLine}get bottomLine(){return this._bottomLine}get equatorLine(){return this._equatorLine}get meridianLine(){return this._meridianLine}get grid(){return this._grid}get tick(){return this._tick}get crosshair(){return this._crosshair}get guides(){return this._guides.slice()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(s(e)?e:[e]))}const i=this.prop("lonInterval"),r=this.prop("latInterval"),n=this.prop("interval");this._lonInterval=Math.max(1,I(i,n,10)),this._latInterval=Math.max(1,I(r,n,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new _r(this.chart):"line"===t.type?new cr(this.chart):"band"===t.type?new dr(this.chart):new cr(this.chart),i.init(),i.loadOptions(t),e.push(i)}))}}function mr(t,e){const[i,s]=t;let r=!1;for(let t=0,n=e.length-1;t<e.length;n=t++){const[o,a]=e[t],[h,l]=e[n];a>s!=l>s&&i<(h-o)*(s-a)/(l-a)+o&&(r=!r)}return r}function fr(t,e){let i=!1;mr(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)mr(t,e[s])&&(i=!i);return i}gr.defaults=li(_i.defaults,{interval:5});class br{constructor(t,e=4){this.bbox=t,this.capacity=e,this.entries=[],this.children=null,this.divided=!1}subdivide(){const{minLon:t,minLat:e,maxLon:i,maxLat:s}=this.bbox,r=(t+i)/2,n=(e+s)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:s},a={minLon:r,minLat:n,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:i,maxLat:n};this.children=[new br(o,this.capacity),new br(a,this.capacity),new br(h,this.capacity),new br(l,this.capacity)],this.divided=!0}intersects(t,e){return!(t.minLon>e.maxLon||t.maxLon<e.minLon||t.minLat>e.maxLat||t.maxLat<e.minLat)}isContained(t,e){return t.minLon>=e.minLon&&t.maxLon<=e.maxLon&&t.minLat>=e.minLat&&t.maxLat<=e.maxLat}insert(t){if(!this.intersects(t.bbox,this.bbox))return!1;if(this.divided&&this.children){let e=!1;for(const i of this.children)if(this.isContained(t.bbox,i.bbox)&&(e=i.insert(t),e))break;return e||(this.entries.push(t),e=!0),e}return this.entries.length<this.capacity?(this.entries.push(t),!0):(this.subdivide(),this.insert(t))}containsPoint(t,e,i){return t>=i.minLon&&t<=i.maxLon&&e>=i.minLat&&e<=i.maxLat}queryPoint(t,e,i=[]){if(!this.containsPoint(t,e,this.bbox))return i;for(const s of this.entries)this.containsPoint(t,e,s.bbox)&&i.push(s);if(this.divided&&this.children)for(const s of this.children)s.queryPoint(t,e,i);return i}}class yr{constructor(t,e){var i;this.worldBBox=t,this.root=new br(t);for(const t of e)this.root.insert({featureId:t.id,originalFeature:{id:t.id,geometry:{type:t.source.polygon?"Polygon":"MultiPolygon",coordinates:null!==(i=t.source.polygon)&&void 0!==i?i:t.source.polygons}},bbox:{minLon:t.h1,minLat:t.v1,maxLon:t.h2,maxLat:t.v2}})}find(t){const e=this.root.queryPoint(t[0],t[1]).find((e=>function(t,e){if("Polygon"===e.type)return fr(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(fr(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}class wr{constructor(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}}function xr(t,e){return t>e?1:t<e?-1:0}function vr(t,e,i){const s=new wr(null,null);let r=s,n=s;for(;;){const s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){const t=e.left;if(e.left=t.right,t.right=e,null===(e=t).left)break}n.left=e,n=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){const t=e.right;if(e.right=t.left,t.left=e,null===(e=t).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,n.left=e.right,e.left=s.right,e.right=s.left,e}class Sr{constructor(t=xr){this._root=null,this._size=0,this._comparator=t}insert(t,e){return this._size++,this._root=function(t,e,i,s){const r=new wr(t,e);if(null===i)return r.left=r.right=null,r;const n=s(t,(i=vr(t,i,s)).key);return n<0?(r.left=i.left,r.right=i,i.left=null):n>=0&&(r.right=i.right,r.left=i,i.right=null),r}(t,e,this._root,this._comparator)}add(t,e){const i=new wr(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);const s=this._comparator,r=vr(t,this._root,s),n=s(t,r.key);return 0===n?this._root=r:(n<0?(i.left=r.left,i.right=r,r.left=null):n>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root}remove(t){this._root=this._remove(t,this._root,this._comparator)}_remove(t,e,i){let s;if(null===e)return null;return 0===i(t,(e=vr(t,e,i)).key)?(null===e.left?s=e.right:(s=vr(t,e.left,i),s.right=e.right),this._size--,s):e}pop(){let t=this._root;if(t){for(;t.left;)t=t.left;return this._root=vr(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null}find(t){return this._root&&(this._root=vr(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root}next(t){let e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}const s=this._comparator;for(;e;){const r=s(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i}prev(t){let e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}const s=this._comparator;for(;e;){const r=s(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i}get size(){return this._size}}const Cr=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,Pr=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,s=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:s,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let Mr=Number.EPSILON;void 0===Mr&&(Mr=Math.pow(2,-52));const Lr=Mr*Mr,Ar=(t,e)=>{if(-Mr<t&&t<Mr&&-Mr<e&&e<Mr)return 0;const i=t-e;return i*i<Lr*t*e?0:t<e?-1:1};class kr{constructor(){this.tree=new Sr,this.round(0)}round(t){const e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===Ar(e.key,i.key))return this.tree.remove(t),i.key;const s=this.tree.next(e);return null!==s&&0===Ar(e.key,s.key)?(this.tree.remove(t),s.key):t}}const Ir=new class{constructor(){this.reset()}reset(){this.xRounder=new kr,this.yRounder=new kr}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}},Er=11102230246251565e-32,Tr=134217729,Nr=(3+8*Er)*Er;function Vr(t,e,i,s,r){let n,o,a,h,l=e[0],c=s[0],d=0,_=0;c>l==c>-l?(n=l,l=e[++d]):(n=c,c=s[++_]);let u=0;if(d<t&&_<i)for(c>l==c>-l?(o=l+n,a=n-(o-l),l=e[++d]):(o=c+n,a=n-(o-c),c=s[++_]),n=o,0!==a&&(r[u++]=a);d<t&&_<i;)c>l==c>-l?(o=n+l,h=o-n,a=n-(o-h)+(l-h),l=e[++d]):(o=n+c,h=o-n,a=n-(o-h)+(c-h),c=s[++_]),n=o,0!==a&&(r[u++]=a);for(;d<t;)o=n+l,h=o-n,a=n-(o-h)+(l-h),l=e[++d],n=o,0!==a&&(r[u++]=a);for(;_<i;)o=n+c,h=o-n,a=n-(o-h)+(c-h),c=s[++_],n=o,0!==a&&(r[u++]=a);return 0===n&&0!==u||(r[u++]=n),u}function $r(t){return new Float64Array(t)}const Rr=$r(4),Dr=$r(8),Or=$r(12),Br=$r(16),Fr=$r(4);function zr(t,e,i,s,r,n){const o=(e-n)*(i-r),a=(t-r)*(s-n),h=o-a,l=Math.abs(o+a);return Math.abs(h)>=33306690738754716e-32*l?h:-function(t,e,i,s,r,n,o){let a,h,l,c,d,_,u,p,g,m,f,b,y,w,x,v,S,C;const P=t-r,M=i-r,L=e-n,A=s-n;w=P*A,_=Tr*P,u=_-(_-P),p=P-u,_=Tr*A,g=_-(_-A),m=A-g,x=p*m-(w-u*g-p*g-u*m),v=L*M,_=Tr*L,u=_-(_-L),p=L-u,_=Tr*M,g=_-(_-M),m=M-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Rr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Rr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Rr[2]=b-(C-d)+(f-d),Rr[3]=C;let k=function(t,e){let i=e[0];for(let s=1;s<t;s++)i+=e[s];return i}(4,Rr),I=22204460492503146e-32*o;if(k>=I||-k>=I)return k;if(d=t-P,a=t-(P+d)+(d-r),d=i-M,l=i-(M+d)+(d-r),d=e-L,h=e-(L+d)+(d-n),d=s-A,c=s-(A+d)+(d-n),0===a&&0===h&&0===l&&0===c)return k;if(I=11093356479670487e-47*o+Nr*Math.abs(k),k+=P*c+A*a-(L*l+M*h),k>=I||-k>=I)return k;w=a*A,_=Tr*a,u=_-(_-a),p=a-u,_=Tr*A,g=_-(_-A),m=A-g,x=p*m-(w-u*g-p*g-u*m),v=h*M,_=Tr*h,u=_-(_-h),p=h-u,_=Tr*M,g=_-(_-M),m=M-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Fr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Fr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Fr[2]=b-(C-d)+(f-d),Fr[3]=C;const E=Vr(4,Rr,4,Fr,Dr);w=P*c,_=Tr*P,u=_-(_-P),p=P-u,_=Tr*c,g=_-(_-c),m=c-g,x=p*m-(w-u*g-p*g-u*m),v=L*l,_=Tr*L,u=_-(_-L),p=L-u,_=Tr*l,g=_-(_-l),m=l-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Fr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Fr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Fr[2]=b-(C-d)+(f-d),Fr[3]=C;const T=Vr(E,Dr,4,Fr,Or);w=a*c,_=Tr*a,u=_-(_-a),p=a-u,_=Tr*c,g=_-(_-c),m=c-g,x=p*m-(w-u*g-p*g-u*m),v=h*l,_=Tr*h,u=_-(_-h),p=h-u,_=Tr*l,g=_-(_-l),m=l-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Fr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Fr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Fr[2]=b-(C-d)+(f-d),Fr[3]=C;const N=Vr(T,Or,4,Fr,Br);return Br[N-1]}(t,e,i,s,r,n,l)}const jr=(t,e)=>t.x*e.y-t.y*e.x,Gr=(t,e)=>t.x*e.x+t.y*e.y,Hr=(t,e,i)=>{const s=zr(t.x,t.y,e.x,e.y,i.x,i.y);return s>0?-1:s<0?1:0},Wr=t=>Math.sqrt(Gr(t,t)),Yr=(t,e,i)=>{const s={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return jr(r,s)/Wr(r)/Wr(s)},Zr=(t,e,i)=>{const s={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return Gr(r,s)/Wr(r)/Wr(s)},Ur=(t,e,i)=>0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i},Xr=(t,e,i)=>0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)};class Kr{static compare(t,e){const i=Kr.comparePoints(t.point,e.point);return 0!==i?i:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:Jr.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const i=this.point.events[e];if(void 0===i.segment.consumedBy)for(let s=e+1;s<t;s++){const t=this.point.events[s];void 0===t.consumedBy&&(i.otherSE.point.events===t.otherSE.point.events&&i.segment.consume(t.segment))}}}getAvailableLinkedEvents(){const t=[];for(let e=0,i=this.point.events.length;e<i;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,i=i=>{const s=i.otherSE;e.set(i,{sine:Yr(this.point,t.point,s.point),cosine:Zr(this.point,t.point,s.point)})};return(t,s)=>{e.has(t)||i(t),e.has(s)||i(s);const{sine:r,cosine:n}=e.get(t),{sine:o,cosine:a}=e.get(s);return r>=0&&o>=0?n<a?1:n>a?-1:0:r<0&&o<0?n<a?-1:n>a?1:0:o<r?-1:o>r?1:0}}}let qr=0;class Jr{static compare(t,e){const i=t.leftSE.point.x,s=e.leftSE.point.x,r=t.rightSE.point.x,n=e.rightSE.point.x;if(n<i)return 1;if(r<s)return-1;const o=t.leftSE.point.y,a=e.leftSE.point.y,h=t.rightSE.point.y,l=e.rightSE.point.y;if(i<s){if(a<o&&a<h)return 1;if(a>o&&a>h)return-1;const i=t.comparePoint(e.leftSE.point);if(i<0)return 1;if(i>0)return-1;const s=e.comparePoint(t.rightSE.point);return 0!==s?s:-1}if(i>s){if(o<a&&o<l)return-1;if(o>a&&o>l)return 1;const i=e.comparePoint(t.leftSE.point);if(0!==i)return i;const s=t.comparePoint(e.rightSE.point);return s<0?1:s>0?-1:1}if(o<a)return-1;if(o>a)return 1;if(r<n){const i=e.comparePoint(t.rightSE.point);if(0!==i)return i}if(r>n){const i=t.comparePoint(e.rightSE.point);if(i<0)return 1;if(i>0)return-1}if(r!==n){const t=h-o,e=r-i,c=l-a,d=n-s;if(t>e&&c<d)return 1;if(t<e&&c>d)return-1}return r>n?1:r<n||h<l?-1:h>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,i,s){this.id=++qr,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=i,this.windings=s}static fromRing(t,e,i){let s,r,n;const o=Kr.comparePoints(t,e);if(o<0)s=t,r=e,n=1;else{if(!(o>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);s=e,r=t,n=-1}const a=new Kr(s,!0),h=new Kr(r,!1);return new Jr(a,h,[i],[n])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,i=this.rightSE.point,s=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;const r=(t.y-e.y)/s.y,n=e.x+r*s.x;if(t.x===n)return 0;const o=(t.x-e.x)/s.x,a=e.y+o*s.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),i=t.bbox(),s=Pr(e,i);if(null===s)return null;const r=this.leftSE.point,n=this.rightSE.point,o=t.leftSE.point,a=t.rightSE.point,h=Cr(e,o)&&0===this.comparePoint(o),l=Cr(i,r)&&0===t.comparePoint(r),c=Cr(e,a)&&0===this.comparePoint(a),d=Cr(i,n)&&0===t.comparePoint(n);if(l&&h)return d&&!c?n:!d&&c?a:null;if(l)return c&&r.x===a.x&&r.y===a.y?null:r;if(h)return d&&n.x===o.x&&n.y===o.y?null:o;if(d&&c)return null;if(d)return n;if(c)return a;const _=((t,e,i,s)=>{if(0===e.x)return Xr(i,s,t.x);if(0===s.x)return Xr(t,e,i.x);if(0===e.y)return Ur(i,s,t.y);if(0===s.y)return Ur(t,e,i.y);const r=jr(e,s);if(0==r)return null;const n={x:i.x-t.x,y:i.y-t.y},o=jr(n,e)/r,a=jr(n,s)/r;return{x:(t.x+a*e.x+(i.x+o*s.x))/2,y:(t.y+a*e.y+(i.y+o*s.y))/2}})(r,this.vector(),o,t.vector());return null===_?null:Cr(s,_)?Ir.round(_.x,_.y):null}split(t){const e=[],i=void 0!==t.events,s=new Kr(t,!0),r=new Kr(t,!1),n=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(s);const o=new Jr(s,n,this.rings.slice(),this.windings.slice());return Kr.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),Kr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(s.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,i=t;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const s=Jr.compare(e,i);if(0!==s){if(s>0){const t=e;e=i,i=t}if(e.prev===i){const t=e;e=i,i=t}for(let t=0,s=i.rings.length;t<s;t++){const s=i.rings[t],r=i.windings[t],n=e.rings.indexOf(s);-1===n?(e.rings.push(s),e.windings.push(r)):e.windings[n]+=r}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,s=this._afterState.multiPolys;for(let t=0,s=this.rings.length;t<s;t++){const s=this.rings[t],r=this.windings[t],n=e.indexOf(s);-1===n?(e.push(s),i.push(r)):i[n]+=r}const r=[],n=[];for(let t=0,s=e.length;t<s;t++){if(0===i[t])continue;const s=e[t],o=s.poly;if(-1===n.indexOf(o))if(s.isExterior)r.push(o);else{-1===n.indexOf(o)&&n.push(o);const t=r.indexOf(s.poly);-1!==t&&r.splice(t,1)}}for(let t=0,e=r.length;t<e;t++){const e=r[t].multiPoly;-1===s.indexOf(e)&&s.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(dn.type){case"union":{const i=0===t.length,s=0===e.length;this._isInResult=i!==s;break}case"intersection":{let i,s;t.length<e.length?(i=t.length,s=e.length):(i=e.length,s=t.length),this._isInResult=s===dn.numMultiPolys&&i<s;break}case"xor":{const i=Math.abs(t.length-e.length);this._isInResult=i%2==1;break}case"difference":{const i=t=>1===t.length&&t[0].isSubject;this._isInResult=i(t)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${dn.type}`)}return this._isInResult}}class Qr{constructor(t,e,i){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const s=Ir.round(t[0][0],t[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};let r=s;for(let e=1,i=t.length;e<i;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let i=Ir.round(t[e][0],t[e][1]);i.x===r.x&&i.y===r.y||(this.segments.push(Jr.fromRing(r,i,this)),i.x<this.bbox.ll.x&&(this.bbox.ll.x=i.x),i.y<this.bbox.ll.y&&(this.bbox.ll.y=i.y),i.x>this.bbox.ur.x&&(this.bbox.ur.x=i.x),i.y>this.bbox.ur.y&&(this.bbox.ur.y=i.y),r=i)}s.x===r.x&&s.y===r.y||this.segments.push(Jr.fromRing(r,s,this))}getSweepEvents(){const t=[];for(let e=0,i=this.segments.length;e<i;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class tn{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Qr(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,i=t.length;e<i;e++){const i=new Qr(t[e],this,!1);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const i=this.interiorRings[e].getSweepEvents();for(let e=0,s=i.length;e<s;e++)t.push(i[e])}return t}}class en{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,i=t.length;e<i;e++){const i=new tn(t[e],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,i=this.polys.length;e<i;e++){const i=this.polys[e].getSweepEvents();for(let e=0,s=i.length;e<s;e++)t.push(i[e])}return t}}class sn{static factory(t){const e=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];if(!s.isInResult()||s.ringOut)continue;let r=null,n=s.leftSE,o=s.rightSE;const a=[n],h=n.point,l=[];for(;r=n,n=o,a.push(n),n.point!==h;)for(;;){const t=n.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){o=t[0].otherSE;break}let i=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===n.point){i=t;break}if(null!==i){const t=l.splice(i)[0],s=a.splice(t.index);s.unshift(s[0].otherSE),e.push(new sn(s.reverse()));continue}l.push({index:a.length,point:n.point});const s=n.getLeftmostComparator(r);o=t.sort(s)[0].otherSE;break}e.push(new sn(a))}return e}constructor(t){this.events=t;for(let e=0,i=t.length;e<i;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let i=1,s=this.events.length-1;i<s;i++){const s=this.events[i].point,r=this.events[i+1].point;0!==Hr(s,t,r)&&(e.push(s),t=s)}if(1===e.length)return null;const i=e[0],s=e[1];0===Hr(i,t,s)&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,n=this.isExteriorRing()?0:e.length-1,o=this.isExteriorRing()?e.length:-1,a=[];for(let t=n;t!=o;t+=r)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,i=this.events.length;e<i;e++){const i=this.events[e];Kr.compare(t,i)>0&&(t=i)}let e=t.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class rn{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const i=this.interiorRings[e].getGeom();null!==i&&t.push(i)}return t}}class nn{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,i=this.polys.length;e<i;e++){const i=this.polys[e].getGeom();null!==i&&t.push(i)}return t}_composePolys(t){const e=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];if(!s.poly)if(s.isExteriorRing())e.push(new rn(s));else{const t=s.enclosingRing();t.poly||e.push(new rn(t)),t.poly.addInterior(s)}}return e}}class on{constructor(t,e=Jr.compare){this.queue=t,this.tree=new Sr(e),this.segments=[]}process(t){const e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;const s=t.isLeft?this.tree.add(e):this.tree.find(e);if(!s)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r,n,o=s,a=s;for(;void 0===r;)o=this.tree.prev(o),null===o?r=null:void 0===o.key.consumedBy&&(r=o.key);for(;void 0===n;)a=this.tree.next(a),null===a?n=null:void 0===a.key.consumedBy&&(n=a.key);if(t.isLeft){let s=null;if(r){const t=r.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!r.isAnEndpoint(t))){const e=this._splitSafely(r,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}let o=null;if(n){const t=n.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(o=t),!n.isAnEndpoint(t))){const e=this._splitSafely(n,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}if(null!==s||null!==o){let t=null;if(null===s)t=o;else if(null===o)t=s;else{t=Kr.comparePoints(s,o)<=0?s:o}this.queue.remove(e.rightSE),i.push(e.rightSE);const r=e.split(t);for(let t=0,e=r.length;t<e;t++)i.push(r[t])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&n){const t=r.getIntersection(n);if(null!==t){if(!r.isAnEndpoint(t)){const e=this._splitSafely(r,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}if(!n.isAnEndpoint(t)){const e=this._splitSafely(n,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}}this.tree.remove(e)}return i}_splitSafely(t,e){this.tree.remove(t);const i=t.rightSE;this.queue.remove(i);const s=t.split(e);return s.push(i),void 0===t.consumedBy&&this.tree.add(t),s}}const an="undefined"!=typeof process&&void 0!==process.env?process.env:{},hn=an.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ln=an.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;const cn=new class{run(t,e,i){cn.type=t,Ir.reset();const s=[new en(e,!0)];for(let t=0,e=i.length;t<e;t++)s.push(new en(i[t],!1));if(cn.numMultiPolys=s.length,"difference"===cn.type){const t=s[0];let e=1;for(;e<s.length;)null!==Pr(s[e].bbox,t.bbox)?e++:s.splice(e,1)}if("intersection"===cn.type)for(let t=0,e=s.length;t<e;t++){const e=s[t];for(let i=t+1,r=s.length;i<r;i++)if(null===Pr(e.bbox,s[i].bbox))return[]}const r=new Sr(Kr.compare);for(let t=0,e=s.length;t<e;t++){const e=s[t].getSweepEvents();for(let t=0,i=e.length;t<i;t++)if(r.insert(e[t]),r.size>hn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const n=new on(r);let o=r.size,a=r.pop();for(;a;){const t=a.key;if(r.size===o){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(r.size>hn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(n.segments.length>ln)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=n.process(t);for(let t=0,i=e.length;t<i;t++){const i=e[t];void 0===i.consumedBy&&r.insert(i)}o=r.size,a=r.pop()}Ir.reset();const h=sn.factory(n.segments);return new nn(h).getGeom()}};var dn=cn;const _n=(t,...e)=>dn.run("difference",t,e);class un{static ringArea(t){let e=0;for(let i=0;i<t.length;i++){const s=t[i],r=t[(i+1)%t.length];e+=s[0]*r[1]-r[0]*s[1]}return Math.abs(e/2)}static polygonArea(t){let e=this.ringArea(t[0]);for(let i=1;i<t.length;i++)e-=this.ringArea(t[i]);return e}static boundsIntersect(t,e){return t.h1<=e.h2&&t.h2>=e.h1&&t.v1<=e.v2&&t.v2>=e.v1}static subtract(t,e){if(0===t.length||0===e.length)return t;const i=e.map((t=>Ri(t))).reduce(((t,e)=>({h1:Math.min(t.h1,e.h1),h2:Math.max(t.h2,e.h2),v1:Math.min(t.v1,e.v1),v2:Math.max(t.v2,e.v2)}))),s=[],r=[];for(const n of t){if(!this.boundsIntersect(Ri(n),i)){s.push(n);continue}const t=_n([n],e),o=Math.min(2e-4,.005*this.polygonArea(n)),a=t.filter((t=>this.polygonArea(t)>o));0!==a.length?(a.sort(((t,e)=>this.polygonArea(e)-this.polygonArea(t))),s.push(a[0]),r.push(...a.slice(1))):s.push(n)}return s.concat(r)}static union(t){return 0===t.length?[]:((t,...e)=>dn.run("union",t,e))(t[0],...t.slice(1))}}const pn="37630",gn={area:"39",name:"제주특별자치도",children:["39010","39020"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},mn={area:pn,name:"울릉도",parent:"37",polygons:[1,2],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},fn={area:"",name:"백령도",parent:"23,23520",polygons:[[8,9],[14,15,16]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},bn={area:"39",name:"제주특별자치도",children:["39010110","39010120","39010130","39010140","39010310","39010620","39010630","39010640","39010330","39010510","39010520","39010530","39010540","39010550","39010560","39010570","39010580","39010590","39010600","39010610","39010650","39010660","39010670","39010680","39010690","39020110","39020120","39020130","39020310","39020320","39020510","39020520","39020530","39020540","39020550","39020560","39020570","39020580","39020590","39020600","39020610","39020620"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},yn={area:pn,name:"울릉도",children:["37630110","37630310","37630320"],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},wn={area:"23520",name:"백령도",children:["23520330","23520340"],coord:[125.4,37.7],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},xn={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},vn={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},Sn={area:"JPN-3502",name:"Okinawa",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};class Cn{constructor(t){this.id=t}}class Pn extends Cn{constructor(t,e){super(t),this.props=e}}function Mn(t){const e=s(null==t?void 0:t.features)?t.features:"Feature"===(null==t?void 0:t.type)?[t]:[],i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Pn(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,i.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,i.push(e)}}})),i}class Ln extends Pn{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(this.holes=t.holes,e<=0)r.splice(i,1);else if(1!==e){const t=r[i],n=[];for(let e=0;e<t.length;e++){const i=[];for(let s=0;s<t[e].length;s++)i.push(t[e][s].slice());n.push(i)}r[i]=n,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=Ri(this.polygons[t]),r=Ri(this.polygons[e]);let n,o,a=0,h=0;if((n=s.h1-r.h2)>0&&(o=r.v1-s.v2,n>o&&(a=-n*i,h=o*i)),0!==a)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][0]+=a;if(0!==h)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][1]+=h}}class An{constructor(t,e,i){this.name=t,this.closed=i,s(e)&&e.length>=2&&(this.border=[it.makeArray(e[0]),it.makeArray(e[1])])}}class kn extends Cn{constructor(t,e){super(t),this.polygon=e}}class In extends pt{static createStockInset(t,e){let s,r=!1;switch(t){case"제주":case"제주도":s=gn;break;case"제주_B":case"제주도_B":s=gn,r=!0;break;case"울릉":case"울릉도":s=mn;break;case"울릉_B":case"울릉도_B":s=mn,r=!0;break;case"백령":case"백령도":s=fn;break;case"백령_B":case"백령도_B":s=fn,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=bn;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=bn,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=yn;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=yn,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=wn;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=wn,r=!0;break;default:if(!t)return void console.warn("등록된 Inset 프리셋이 존재하지 않습니다.");switch(t.toLowerCase()){case"alaska":s=xn;break;case"hawaii":s=vn;break;case"okinawa":s=Sn;break;case"okinawa_b":s=Sn,r=!0}}return s&&(a(e)?s=Object.assign({visible:e},s):i(e)&&(s=Object.assign({},s,e)),r&&s.border&&delete s.frame),s}constructor(t,e){var r,a,h;super(),this._excludes={};const l=null!==(r=t.source)&&void 0!==r?r:t.map,c=t.insets,d=s(c)?c:i(c)||n(c)?[c]:void 0;this.name=t.name,this.enabled=E(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey,this.parentKey=t.parentKey||"rm-parent",this.meta=i(null==l?void 0:l.meta)?it.deepClone(l.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(a=this.meta.dummies)||void 0===a?void 0:a.slice(),this.paddings=J(String(null!==(h=t.padding)&&void 0!==h?h:"0")),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this.bounds=s(t.bounds)&&4===t.bounds.length&&t.bounds.every(o)?t.bounds:void 0,this._excludes={},s(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},d&&d.length>0&&d.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?In.createStockInset(t.substring(1),!1):In.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,name:t.name,children:t.children,parent:t.parent,polygons:s(t.polygons)?t.polygons.slice():s(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:s(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&it.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new An(t.name,t.border,!0===t.closed))})),l&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(l,t),this.$_processAreas(t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}$_itemId(t){var e;const i=E(null===(e=t.props)||void 0===e?void 0:e[this.idKey],t.id);return null==i?void 0:String(i)}$_processAreas(t){const e=s(t.areas)?t.areas:void 0,r=s(t.unions)?t.unions:void 0;if(!e&&!r)return;const o=this.items.filter((t=>t instanceof Pn)),a=t=>o.find((e=>this.$_itemId(e)===t)),h=[];if(null==e||e.forEach((t=>{n(t)||i(t)&&Mn(t).forEach((t=>{h.push(t),this.items.push(t)}))})),h.forEach((t=>{var e,i,s;const r=null===(e=t.props)||void 0===e?void 0:e[this.parentKey];if(null==r)return;if(!this.included(this.$_itemId(t)))return;const n=a(String(r));if(!n||n===t)return;const o=null!==(i=t.polygons)&&void 0!==i?i:t.polygon?[t.polygon]:[];0!==o.length&&(n.polygons=un.subtract(null!==(s=n.polygons)&&void 0!==s?s:[n.polygon],o),n.polygon=void 0,n.holes=!0,n.internal=n.internals=void 0,n.external=n.externals=void 0)})),r){const t=this.$_reservedAreas();r.forEach((e=>this.$_mergeAreas(e,t)))}}$_reservedAreas(){var t,e;const i=new Set;(null===(t=this.meta.dokdo)||void 0===t?void 0:t.group)&&i.add(this.meta.dokdo.group);for(const t in this.insets){const s=this.insets[t];s.area&&i.add(s.area),s.parent&&String(s.parent).split(",").forEach((t=>i.add(t.trim()))),null===(e=s.children)||void 0===e||e.forEach((t=>i.add(t)))}return i}$_mergeAreas(t,e){if(!i(t)||!s(t.members)||t.members.length<2)return void console.warn("unions의 각 항목은 2개 이상의 영역 id를 갖는 members가 지정된 객체여야 합니다.");const r=Array.from(new Set(t.members.map((t=>String(t))))),n=r.find((t=>e.has(t)));if(n)return void console.warn(`'${n}' 영역은 dokdo 또는 inset 설정에서 참조되고 있어 병합할 수 없습니다.`);const o=[];if(r.forEach((t=>{if(!this.included(t))return;const e=this.items.find((e=>e instanceof Pn&&this.$_itemId(e)===t));e?o.push(e):console.warn(`병합할 영역을 찾을 수 없습니다: ${t}`)})),o.length<2)return;const a=this.$_unionAreaId(t,o,e),h=new Pn(a,this.$_unionProps(t,a));h.polygons=un.union(o.map((t=>{var e;return null!==(e=t.polygons)&&void 0!==e?e:[t.polygon]}))),h.holes=!0,this.items[this.items.indexOf(o[0])]=h,o.slice(1).forEach((t=>{const e=this.items.indexOf(t);e>=0&&this.items.splice(e,1)}))}$_unionAreaId(t,e,i){const s=this.$_itemId(e[0]);if(null==t.id)return s;const r=String(t.id);return""===r.trim()||/\s/.test(r)?(console.warn(`병합 영역의 id는 비어있거나 공백을 포함할 수 없습니다: '${r}'`),s):i.has(r)?(console.warn(`'${r}'는 dokdo 또는 inset 설정에서 참조되고 있어 병합 영역의 id로 사용할 수 없습니다.`),s):this.items.some((t=>t instanceof Pn&&e.indexOf(t)<0&&this.$_itemId(t)===r))?(console.warn(`'${r}'는 이미 다른 영역이 사용하고 있어 병합 영역의 id로 사용할 수 없습니다.`),s):r}$_unionProps(t,e){const i=Object.assign({},t.properties);if(delete i["rm-main-area"],null!=t.center){const e=Ni(t.center);Vi(e)?(i["ctr-lon"]=e[0],i["ctr-lat"]=e[1]):console.warn(`병합 영역의 center가 올바른 좌표가 아닙니다: ${t.center}`)}return i[this.idKey]=e,i}}class En{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}get h1(){return((-180+this._scroll)%360+540)%360-180}get scroll(){return this._scroll}set scroll(t){this._scroll=((t||0)%360+540)%360-180,this._sec&&(this._sec._scroll=this._scroll>0?(this._scroll-360)%360:(this.scroll+360)%360),this.second=0===this._scroll?void 0:this._sec}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this._sec&&(this._sec._offset=this._offset)}prepareSecond(){return this._sec=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}projectCoord(t){if(this.second){const e=this._scroll,i=t[0];return i>=-180+e&&i<=180+e?this.project(t):this.second.project(t)}return this.project(t)}getVisible(t){if(this.isVisible(t))return this.projectCoord(t)}inSecond(t){return this.second&&(t<-180+this._scroll||t>180+this._scroll)}isClipping(){return!0}getScrolledLon(t){return((t+this._scroll)%360+540)%360-180}}const Tn=90,Nn=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Vn extends En{constructor(){super(),this._rotation=[0,0],this._r=Tn,this.bounds={x1:-90,x2:Tn,y1:-90,y2:Tn},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Nn(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Math.max(-90,Math.min(90,t)))!==this._rotation[1]?(this._rotation[1]=t,!0):void 0)}getRotation(){return this._rotation.slice(0)}setRotation(t,e){if([this._setRotationX(t),this._setRotationY(e)].some(Boolean))return this._calcBounds(),!0}_calcBounds(){const[t,e]=this._rotation;Nn(-90-t),Nn(90-t),Nn(90+e),Nn(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*w,r=[Math.cos(s)*Math.sin(e*w)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Tn,i=t[1]/Tn,s=Math.sqrt(e*e+i*i),r=Math.asin(s),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,s*o)/w,Math.asin(s&&i*n/s)/w];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}inSecond(t){return!1}_rotate(t){const e=this._rotation[0]*w,i=(this._rotation[1]||0)*w,s=Math.cos(i),r=Math.sin(i),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*w+e,h=t[1]*w,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*s+c*r;return[Math.atan2(d*n-u*o,c*s-_*r)/w,Math.asin(u*n+d*o)/w]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(s)*n,a=Math.sin(s)*n,h=Math.sin(r);const l=this._rotation[0]*e,c=this._rotation[1]*e,d=Math.cos(l),_=Math.sin(l),u=Math.cos(c),p=Math.sin(c),g={x:u*d*o+_*a-p*d*h,y:-u*_*o+d*a+p*_*h,z:p*o+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class $n extends In{static loadMap(t,e){if(i(t)){const r=t.source;if(i(r)&&"Topology"===r.type&&i(r.objects)&&s(r.arcs))return new $n(t,e);const n=t.map;if(i(n)&&"Topology"===n.type&&i(n.objects)&&s(n.arcs))return new $n(t,e)}}_doLoad(t,e){const r=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>r(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(i(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const i=d[t].geometries;if(s(i)&&i.forEach((t=>{const e=new Pn(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=r(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};s(e.excludeInternal)?e.excludeInternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),it.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};s(e.excludeExternal)?e.excludeExternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),it.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,n=[],o=[];e.forEach((t=>{t instanceof Pn&&(i[0].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)))}));const a=n.flat(1/0),h=o.flat(1/0),l=[];if(a.forEach((t=>{h.forEach((e=>{(t===e||t<0&&~t===e||e<0&&t===~e)&&l.push(t)}))})),l.length>0){const e=l.map((e=>e<0?t[~e].slice().reverse():t[e]));s.push(new kn(r.name,e))}}e.push(...s)}}function Rn(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*w,a=t[0]*w,h=e[1]*w,l=e[0]*w,c=h-o,d=l-a,_=r(c/2)*r(c/2)+s(o)*s(h)*r(d/2)*r(d/2),u=2*i(n(_),n(1-_)),p=6371e3*u,g=Math.round(p/5e5),m=[];if(g>1){const t=1/g;for(let e=t;e<.999;e+=t){const t=r((1-e)*u)/r(u),c=r(e*u)/r(u),d=t*s(o)*s(a)+c*s(h)*s(l),_=t*s(o)*r(a)+c*s(h)*r(l),p=i(t*r(o)+c*r(h),n(d*d+_*_)),g=i(_,d);m.push([g/w,p/w])}}return m}function Dn(t,e){const i=t._base,r=t.off;let o,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof Fn?o=i:i[0]>=0&&(l=e.readBounds(i),h=r||h)}if(n(t.frame)&&t.frame.length>0){const e=J(t.frame);let{h1:i,v1:s,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=u(i,o[t].h1),s=u(s,o[t].v1),n=p(n,o[t].h2),a=p(a,o[t].v2);const c=i+h[0]-e.l,d=n+h[0]+e.r,_=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,_],[d,_],[d,g],[c,g]],t.bounds=r?{h1:c-r[0],h2:d-r[0],v1:g-r[1],v2:_-r[1]}:{h1:c,h2:d,v1:g,v2:_}}else if(a=t.border){let e,c;if(n(a)){let{h1:t,v1:i,h2:s,v2:r}=o?o[0]:l;if(o)for(let e=1;e<o.length;e++)t=u(t,o[e].h1),i=u(i,o[e].v1),s=p(s,o[e].h2),r=p(r,o[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else s(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=r?{h1:l.h1-r[0],h2:l.h2-r[0],v1:l.v1-r[1],v2:l.v2-r[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const On=Math.min,Bn=Math.max;class Fn extends pt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.mainLandBounds=null,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],i=t.props["ctr-lat"];isNaN(e)||isNaN(i)||(this.center=[+e,+i])}}setSelected(t){this._selected=t}get path(){return this._path}get internal(){return this._internal}get external(){return this._external}get selected(){return this._selected}displayText(){return this.name||this.id}getInfo(){return this._info||(this._info={id:this.source.id,props:this.source.props,h1:this.h1,v1:this.v1}),this._info}reset(){this._path=this._internal=this._external=null}$_readBound(t,e){let i=this.h1,s=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{i=On(i,t[0]+e[0]),s=Bn(s,t[0]+e[0]),r=On(r,t[1]+e[1]),n=Bn(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,r=t.offset;let n=[0,0];return s(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),s(r)&&r.length>0&&(n[0]+=k(r[0],0),n[1]+=k(r[1],0)),t.off=n}$_toPath(t,e,i,s){var r;if(null===(r=this.source)||void 0===r?void 0:r.holes){let r="";for(const n of e)r+=this.$_ringToPath(t,n,i,s);return r}return this.$_ringToPath(t,e[0],i,s)}$_ringToPath(t,e,i,s){const r=t.isGlobe,n=e.slice();if(i){for(let t=0;t<n.length;t++)n[t]=n[t].slice(0);n.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let o=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=n.map((e=>{const i=t.project(e);return i.outside||(o=On(o,i[0]),a=Bn(a,i[0]),h=On(h,i[1]),l=Bn(l,i[1])),i}));let d;if(this.x1=o,this.x2=a,this.y1=h,this.y2=l,r){let e,i,s=!1;!function(t){let e=t.length-1;for(;e--;)if(Math.max(Math.abs(t[e][0]-t[e+1][0]),Math.abs(t[e][1]-t[e+1][1]))>10){const i=Rn(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(n),d=[];for(let r=0;r<c.length;r++){const o=n[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=o,n.push(o),c.push(a)),s&&i){Rn(i,o).forEach((e=>d.push(t.project(e))))}d.push(a),i=o,s=!1}}}else d=c;if(d.length>0){const t=`M ${d[0][0]} ${d[0][1]} L`+d.slice(1).map((t=>t.join(" "))).join(" ");return s?t+" Z":t}return""}readBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=On(e,t[0]),i=Bn(i,t[0]),s=On(s,t[1]),r=Bn(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=On(e,t[0]),i=Bn(i,t[0]),s=On(s,t[1]),r=Bn(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)e=On(e,t[0]),i=Bn(i,t[0]),s=On(s,t[1]),r=Bn(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){const i=t.second;let s;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,r=!e||!1!==e.visible;if(e){if(r)if(this._insetChilds){let t=1/0,i=1/0;this.source.polygons.forEach(((e,s)=>{this._insetChilds.indexOf(s)>=0&&e[0].forEach((e=>{t=On(t,e[0]),i=On(i,e[1])}))})),s=this.$_readInset(e,{h1:t,v1:i}),this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Ei)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Ei))):this.$_readBound(this.source.polygon,Ei),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Ei))):this.$_readBound(this.source.polygon,Ei);s&&(this._insetChilds?(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Ei)}))):(this.h1+=s[0],this.h2+=s[0],this.v1+=s[1],this.v2+=s[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;const n=t.inSecond(this.h1),o=n?i:t,a=n?t:i,h=n!==t.inSecond(this.h2);let l="",c="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?r&&(l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))):(l+=this.$_toPath(o,t,null,!0),h&&(c+=this.$_toPath(a,t,null,!0)))})):r&&this.source.polygons.forEach(((t,e)=>{l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))})):r&&(l=this.$_toPath(o,this.source.polygon,s,!0),h&&(c=this.$_toPath(a,this.source.polygon,s,!0))),this._path=l+c}return e.internals&&this.$_readInternal(t,this._insetChilds?Ei:s),e.externals&&this.$_readExternal(t,this._insetChilds?Ei:s),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Fn;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class zn extends pt{constructor(t){super(),this.source=t}get path(){return this._path}reset(){this._path=null}readPath(t){if(!this._path){let e="";this.source.polygon.forEach((i=>{const s=i.map((e=>t.project(e)));e+=`M ${s[0][0]} ${s[0][1]} L`+s.slice(1).join(" ")})),this._path=e}}}class jn extends pt{constructor(t,e,i){if(super(),this.owner=t,this.source=e,this._hiddens={},this._world=!1,!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=i,this._name=e.name,(this._second=e instanceof jn)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new yr({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,s(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof $n&&this.source.internals}get hasExternals(){return this.source instanceof $n&&this.source.externals}get hasBorders(){return this.source instanceof $n&&this.source.borders}get isWorld(){return this._world}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const i in this._areaMap){const s=this._areaMap[i];t in s.source.props&&(e[s.source.props[t]]=s)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()}));for(const t in this._borders)this._borders[t].reset();this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}insetAt(t){for(const e of this._insets)if(e.bounds&&$i(t,e.bounds))return e}getBorder(t){return this._borders[t]}$_preflight(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let r=0;r<this._areas.length;r++){const n=this._areas[r],o=n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null==o?void 0:o.coord){const[t,e]=o.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<t&&(t=a),h>e&&(e=h),l<i&&(i=l),c>s&&(s=c),t<=-180&&e>=180&&i<=-90&&s>=90)return}return{minLat:i,maxLat:s,minLon:t,maxLon:e}}$_resetAreas(){const t=this.owner.getProjection(this._second),e={internals:this.hasInternals,externals:this.hasExternals};if(t instanceof Vn)this._areas.forEach((i=>{i.visible=this.isVisible(i.id),i.readPath(t,e),this.$_updateMainAreaBounds(i)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=Tn,this.y2=Tn;else{let i=1/0,s=-1/0,r=1/0,n=-1/0,o=1/0,a=-1/0,h=1/0,l=-1/0;if(!this._second&&this._useOffset){const e=this.$_preflight();t.offset=e?!0===this._useOffset?[-(e.minLon+(e.maxLon-e.minLon)/2),-(e.minLat+(e.maxLat-e.minLat)/2)]:this._useOffset:[0,0]}if(this._areas.forEach((c=>{c.visible=this.isVisible(c.id),c.readPath(t,e)&&(i=On(i,c.h1),s=Bn(s,c.h2),r=On(r,c.v1),n=On(90,Bn(n,c.v2)),o=On(o,c.x1),a=Bn(a,c.x2),h=On(h,c.y1),l=Bn(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof In){const e=this.source.paddings;r-=e.b,n+=e.t,i-=e.l,s+=e.r;const c=t.project([i,n]),d=t.project([s,r]);h=Math.min(d[1],h-e.b),l=Math.max(c[1],l+e.t),o=Math.min(c[0],o-e.l),a=Math.max(d[0],a+e.r)}n>83.63&&this.source.alignArctic&&(n=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,n])[1]),(this._world=i<=-180&&s>=180)&&(o=Math.min(o,-a),a=Math.max(-o,a)),this.h1=Bn(-180,i),this.v1=Bn(-90,r),this.h2=On(180,s),this.v2=On(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l;const c=this.source instanceof In?this.source.bounds:void 0;c&&4===c.length?this.$_setBoundsByOption(c,t):this.$_hasArea()?this._world=this.h1<=-180&&this.h2>=180:this.$_setBoundaryByWorld(t),this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_hasArea(){return 0!==this._areas.length}$_setBoundaryByWorld(t){this.h1=-180,this.v1=-90,this.h2=180,this.v2=90;const e=t.project([this.h1,this.v2]),i=t.project([this.h2,this.v1]),s=t.project([this.h1,this.v1]),r=t.project([this.h2,this.v2]);this.x1=Math.min(e[0],i[0],s[0],r[0]),this.x2=Math.max(e[0],i[0],s[0],r[0]),this.y1=Math.min(e[1],i[1],s[1],r[1]),this.y2=Math.max(e[1],i[1],s[1],r[1]),this._world=!0}$_setBoundsByOption(t,e){let i=t[0],s=t[1],r=t[2],n=t[3],o=e.project([i,n]),a=e.project([r,s]),h=e.project([i,s]),l=e.project([r,n]);if([o,a,h,l].every((t=>function(t){if(!t)return!1;const e=isFinite(t[0]+t[1]),i=-180<=t[0]&&t[0]<=180,s=-90<=t[1]&&t[1]<=90;return e&&i&&s}(t))))this.h1=i,this.v1=s,this.h2=r,this.v2=n;else{if(this.$_hasArea())return;this.$_setBoundaryByWorld(e)}this.x1=Math.min(o[0],a[0],h[0],l[0]),this.x2=Math.max(o[0],a[0],h[0],l[0]),this.y1=Math.min(o[1],a[1],h[1],l[1]),this.y2=Math.max(o[1],a[1],h[1],l[1]),this._world=t[0]<=-180&&t[2]>=180}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const n=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,n=r&&r[s];if(!n)continue;const o=t.readPolygonBounds(n);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=o),t.mainLandBounds.x1=On(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=Bn(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=On(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=Bn(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_resolveAreaName(t,e){const i=t.source;if(i)for(const s of e)if(t.name=E(i.props[s],i[s]),void 0!==t.name)break}_relocalizeAreas(){var t;let e=this.source;for(;e instanceof jn;)e=e.source;if(!e.nameKey){const t=Ft(this.owner.general.prop("locale")).nameKeys;this._areas.forEach((e=>this.$_resolveAreaName(e,t)))}null===(t=this.sibling)||void 0===t||t._relocalizeAreas()}$_load(t){const e=t.insets,i=t.idKey,r=t.nameKey?[t.nameKey]:Ft(this.owner.general.prop("locale")).nameKeys,n=t.meta.dokdo,a=t.dummies,h=this._areas=[],l=this._areaMap={},c=this._borders={},d=this._insets=[];this._useOffset=t.useOffset,Object.values(e).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((s=>{if(s instanceof Pn){const n=E(s.props[i],s.id);if(n&&t.included(n)){const t=e[n],i=new Fn(s,t);t&&(delete e[n],t._area=i,d.push(t)),a&&a.indexOf(n)>=0?(h.unshift(i),i.dummy=!0):h.push(i),l[i.id=n]=i,this.$_resolveAreaName(i,r)}}else if(s instanceof kn){const t=new zn(s);c[t.source.id]=t}}));for(const t in e){const i=e[t];if(i._parent=i.parent,i.parent&&(o(i.polygons)||s(i.polygons)))if(i.parent.indexOf(",")>=0){const t=i.parent.split(/[\s,]+/g);for(let e=0;e<t.length;e++){const r=l[t[e]];if(r){const n=i.polygons[e];r.inset=i,r._insetChilds=s(n)?n:[n],i._parent=t[e],i._base=r._insetChilds,i._area=r,d.push(i);break}}}else{const t=l[i.parent];t&&(t.inset=i,t._insetChilds=s(i.polygons)?i.polygons:[i.polygons],i._base=t._insetChilds,i._area=t,d.push(i))}else if(s(i.children)){const t=i._base=[],e=i.off?i.off.slice():[0,0],r=i._children=[];if(s(i.coord)){let t=1/0,s=1/0;for(const e of i.children){const i=l[e];if(!i)continue;const r=i.readBounds();t=On(t,r.h1),s=On(s,r.v1)}isNaN(i.coord[0])||(e[0]=i.coord[0]-t),isNaN(i.coord[1])||(e[1]=i.coord[1]-s)}for(const s of i.children){const i=l[s];if(i){const n=i.inset={area:s,offset:e};t.push(i),n._area=i,r.push(n)}}d.push(i)}}if(n&&!isNaN(+t.dokdo)){const e=l[n.group];if(e){const i=+t.dokdo;if(e.source=new Ln(e.source,i,+n.index,+n.parent),0===i){const t=+n.index;for(const e of d)if(e._parent===n.group&&s(e._base)){const i=e._base;i.indexOf(t)>=0&&(e._base=i.filter((e=>e!==t)))}}}}this.reset(),d.forEach((t=>Dn(t,t._area)))}$_copy(t){const e=this._areas=[],i=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const s=t._clone();e.push(s),i[s.id]=s})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new jn(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Gn extends gi{getText(t){return it.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Gn.defaults=li(Pi.defaults,{offset:4});class Hn extends Pi{_doInit(t){super._doInit(t),this._label=this._addChild("label",new Gn(this.chart))}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Hn.defaults=li(Pi.defaults,{visible:!1});class Wn extends _i{getItemGap(){var t;return null!==(t=this.prop("itemGap"))&&void 0!==t?t:Wn.ITEM_GAP}}Wn.ITEM_GAP=4,Wn.defaults=li(_i.defaults,{offsetX:8,offsetY:8,itemGap:3});class Yn extends Wn{get vertical(){return"vertical"===this.prop("direction")}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this.prop("buttonWidth"))&&void 0!==t?t:this.prop("buttonHeight"))&&void 0!==e?e:Yn.BUTTON_SIZE,height:null!==(s=null!==(i=this.prop("buttonHeight"))&&void 0!==i?i:this.prop("buttonWidth"))&&void 0!==s?s:Yn.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this.prop("zoomFactor"))&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.zoomable(!1)&&(this.chart.body.isZoomed||this.prop("showAlways"))}}Yn.BUTTON_SIZE=24,Yn.defaults=li(Wn.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Zn extends Wn{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Zn.defaults=li(Wn.defaults,{type:"text",align:"left",verticalAlign:"top"});class Un extends pt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,i=!1){const s=e.filter(Boolean);let r;return i&&(r=this.clear()),this._items.push(...s),t.selectList(s),this._owner.selectionItemAdded(s),this._changed(),r}remove(t,e){const i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,1),t.unselect(e),this._owner.selectionItemRemoved([e]),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,[e])}_changed(){this._owner.selectionChanged([this])}}class Xn extends _i{isVisible(){return this.visible&&!B(this.prop("text"))}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Xn.defaults=li(_i.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Kn extends Xn{}Kn.defaults=li(Xn.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class qn extends _i{constructor(t){super(t.chart),this.owner=t}_doInit(){this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e){let i=E(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?Ee.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ue.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}qn.defaults=li(_i.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:25,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",mode:"line"});class Jn extends Gi{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(this._paramRegx,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(e[0]):this._params[e[0]];if(void 0===i&&(i=e[1]),e.length>3)switch(e[3]){case"t":i=wt.getFormatter(e[2]).toStr(String(i));break;case"d":if(n(i))i=new Date(i);else{const t=parseFloat(i);isNaN(t)||(i=new Date(t))}i instanceof Date&&(i=Ue.getFormatter(e[2]).toStr(i,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(i);isNaN(t)||(i=Ee.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=wt.getFormatter(e[2]).toStr(String(i))):i=Ee.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this.prop("visible")&&!F(this._op.html)}_doSetSimple(t,e){return n(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},it.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}}Jn.type="html",Jn.defaults=li(Gi.defaults,{});class Qn extends Gi{_isVisible(){return this.prop("visible")&&!F(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}Qn.type="image",Qn.defaults=li(Gi.defaults,{});class to extends Gi{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||to.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}to.type="shape",to.defaults=li(Gi.defaults,{width:64,height:64,shape:"square"});class eo extends Gi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this.prop("visible")&&!F(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?Ee.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ue.getFormatter(t):void 0)}(t.timeFormat)}}eo.type="text",eo.defaults=li(Gi.defaults,{text:"Text"});class io extends En{project(t){return[t[0]+this.offset[0]-this.scroll,t[1]+this.offset[1]]}backward(t){return[t[0]-this.offset[0],t[1]-this.offset[1]]}}const so=1.340264,ro=-.081106,no=893e-6,oo=.003796,ao=Math.sqrt(3)/2,ho=74.03120656864502;class lo extends En{get lonElliptic(){return!0}get latElliptic(){return!1}getYRange(t,e){return t<=0&&e>=0?[0,0]:e<0?[t,e]:[e,t]}project(t){const e=w,i=Math.asin(ao*Math.sin((t[1]+this.offset[1])*e)),s=i*i,r=s*s*s;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(i)*ho/(ao*(so+3*ro*s+r*(7*no+9*oo*s))),i*ho*(so+ro*s+r*(no+oo*s))]}backward(t){const e=t[0]/ho,i=t[1]/ho,s=180/Math.PI;let r,n,o,a,h,l=i;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(so+ro*r+n*(no+oo*r))-i,a=so+3*ro*r+n*(7*no+9*oo*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*ao*e*(so+3*ro*r+n*(7*no+9*oo*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/ao);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const co=63.78137,_o=Math.PI/180;class uo extends En{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]+this.offset[1]));const i=Math.sin(e*_o);return[co*(t[0]+this.offset[0]-this.scroll)*_o,co*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(co*_o),(2*Math.atan(Math.exp((t[1]-this.offset[1])/co))-Math.PI/2)/_o]}}const po=Math.PI/4,go=Math.PI/180,mo=63.78137;class fo extends En{project(t){return[(t[0]+this.offset[0]-this.scroll)*go*mo,79.7267125*Math.log(Math.tan(po+.4*(t[1]+this.offset[1])*go))]}backward(t){return[(t[0]-this.offset[0])/mo/go,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/mo*.8))-po)/go]}}class bo extends As{labelCount(){return 2}}class yo extends os{}yo.defaults=li(os.defaults,{visible:!1});class wo extends ks{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new yo(this.chart))}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this.prop("barOrder")}getFieldColors(){return this._fieldColors}getSubLabelOff(){return k(this._subLabel.prop("offset"),0)}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new bo(t)}_defLabelOff(){return this.$_isLabelCenter()?wo.LABEL_OFFSET_CENTER:wo.LABEL_OFFSET_AUTO}_createLegendMarker(t,e){return Xi.create(t,Ii,0,0,e,e,2)}setCalcedColor(t,e){if(super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories){const t=this.prop("fieldColors");s(t)?this._fieldColors=t:this._fieldColors=this._splitColors()}}$_isLabelCenter(){return"center"===this.pointLabel.prop("position")}}wo.LABEL_OFFSET_CENTER=0,wo.LABEL_OFFSET_AUTO=2,wo.type="bar",wo.defaults=li(ks.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class xo extends _i{constructor(t){super(t.chart),this.gauge=t}}class vo extends xo{}vo.defaults=li(_i.defaults,{visible:!1});class So extends xo{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}So.defaults=li(_i.defaults,{});class Co extends xo{getThickness(t){return X(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Co.defaults=li(_i.defaults,{thickness:"100%",stroked:!1});class Po extends xo{getExtents(t){return{radius:X(this._radiusDim,t,0),length:X(this._lengthDim,t,0),offset:X(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Po.defaults=li(_i.defaults,{visible:!1,radius:3,length:"100%",offset:0});class Mo extends xo{getRadius(t){return X(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}Mo.defaults=li(_i.defaults,{visible:!1,radius:5});class Lo extends pi{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:X(this._offsetXDim,t,0),y:X(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Lo.defaults=li(pi.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class Ao{constructor(){this.setCenterX(Io.DEF_CENTER),this.setCenterY(Io.DEF_CENTER),this.setRadius(Io.DEF_RADIUS),this.setInnerRadius(Io.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=U(E(t,Io.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=U(E(t,Io.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=U(E(t,Io.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=U(E(t,Io.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=U(t,!0))}getCenter(t,e){return{x:X(this._centerXDim,t,t/2),y:X(this._centerYDim,e,e/2)}}getExtents(t){const e=X(this._radiusDim,t,t/2),i=u(e,this._innerDim?X(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?X(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=k(t%360,0),s=p(0,u(360,k(e,360)));this._startRad=y+w*i,this._handRad=w*i,this._sweepRad=w*s}}class ko extends Is{_readObject(t,e){super._readObject(t,e)}}class Io extends Ts{_doInit(t){super._doInit(t),this._face=this._addChild("face",new vo(this)),this._rim=this._addChild("rim",new So(this)),this._valueRim=this._addChild("valueRim",new Co(this)),this._hand=this._addChild("hand",new Po(this)),this._pin=this._addChild("pin",new Mo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Lo(this.chart)),this._props=new Ao}get face(){return this._face}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}_createPoint(t){return new ko(t)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}_doPrepareRender(t){super._doPrepareRender(t),this._props.prepareAngles(this.prop("startAngle"),this.prop("sweepAngle"))}}Io.DEF_CENTER="50%",Io.DEF_RADIUS="50%",Io.DEF_INNER="80%",Io.type="gauge",Io.defaults=li(Ts.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Eo extends _i{constructor(t){super(t.chart),this.gauge=t}}class To extends Eo{getThickness(t){return X(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}To.defaults=li(_i.defaults,{thickness:3});class No extends Eo{getLength(t){return X(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}No.defaults=li(_i.defaults,{thickness:1.5,length:"55%"});class Vo extends No{}Vo.defaults=li(No.defaults,{thickness:1,length:"80%"});class $o extends No{}$o.defaults=li(No.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Ro extends Eo{}Ro.defaults=li(_i.defaults,{length:5});class Do extends Eo{}Do.defaults=li(_i.defaults,{step:1,offset:0});class Oo extends Eo{}Oo.defaults=li(_i.defaults,{radius:4});class Bo extends pi{}Bo.defaults=li(pi.defaults,{text:"RealMap",position:"top"});class Fo extends Is{getTime(){const t=this.time;return t instanceof Date?t:n(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=k(e.time,NaN),this.timezone=k(e.timezone,NaN)}}class zo extends Es{_doInit(t){super._doInit(t),this._face=this._addChild("face",new _i(this.chart)),this._rim=this._addChild("rim",new To(this)),this._hourHand=this._addChild("hourHand",new No(this)),this._minuteHand=this._addChild("minuteHand",new Vo(this)),this._secondHand=this._addChild("secondHand",new $o(this)),this._tick=this._addChild("tick",new Ro(this)),this._tickLabel=this._addChild("tickLabel",new Do(this)),this._pin=this._addChild("pin",new Oo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Bo(this.chart))}get face(){return this._face}get rim(){return this._rim}get hourHand(){return this._hourHand}get minuteHand(){return this._minuteHand}get secondHand(){return this._secondHand}get tick(){return this._tick}get tickLabel(){return this._tickLabel}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}getExtents(t,e,i){const s=u(t,e)*i;return{cx:X(this._centerXDim,t,t/2),cy:X(this._centerYDim,e,e/3),rd:X(this._radiusDim,s,s/2)}}_createPoint(t){return new Fo(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=U(E(e._centerX=t,zo.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=U(E(e._centerY=i,zo.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=U(E(e._radius=s,zo.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}zo.DEF_CENTER="50%",zo.DEF_RADIUS="50%",zo.type="clock",zo.defaults=li(Es.defaults,{centerX:zo.DEF_CENTER,centerY:zo.DEF_CENTER,radius:zo.DEF_RADIUS,active:!0,size:70});class jo extends Ss{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Go extends _i{getSize(){return{width:this.prop("width"),height:this.prop("height")}}}Go.defaults=li(_i.defaults,{});class Ho extends vs{_doInit(t){super._doInit(t),this._innerLabel=this._addChild("innerLabel",new os(this.chart)),this._innerImage=this._addChild("innerImage",new Go(this.chart))}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this.prop("figure")}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this.prop("width"),i=this.prop("height");return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(this.prop("figureBox"))}_createPoint(t){return new jo(t)}_defLabelOff(){return 2}getValueRange(){return{min:this._minValue,max:this._maxValue}}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._visPoints,{min:s,max:r}=this._calcMinMax(i);this._minValue=s,this._maxValue=r}$_calcBox(t){if(s(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}Ho.type="figure",Ho.defaults=li(vs.defaults,{position:"top"});class Wo extends ws{_readObject(t,e){super._readObject(t,e)}}class Yo extends os{}Yo.defaults=li(bs.defaults,{visible:!1});class Zo extends xs{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}getSize(){return{width:+this._op.htmlWidth,height:+this._op.htmlHeight}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t,e){return e.replace(this._paramRegx,((e,i)=>this.$_apply(t,i)))}_createLabel(t){return new Yo(t)}_createPoint(t){return new Wo(t)}_createFielders(t){super._createFielders(t),this._htmlFielder=this._createFielder(t.htmlField||"html")}_defLabelOff(){return 2}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},it.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}$_apply(t,e){const i=e.split(";");let s=E(this._paramCallback?this._paramCallback(i[0]):this._params[i[0]],t.getParam(i[0]));if(void 0===s&&(s=i[1]),i.length>3)switch(i[3]){case"t":s=wt.getFormatter(i[2]).toStr(String(s));break;case"d":if(n(s))s=new Date(s);else{const t=parseFloat(s);isNaN(t)||(s=new Date(t))}s instanceof Date&&(s=Ue.getFormatter(i[2]).toStr(s,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(s);isNaN(t)||(s=Ee.getFormatter(i[2]).toStr(t))}else if(i.length>2){const t=+s;isNaN(t)?s&&(s=wt.getFormatter(i[2]).toStr(String(s))):s=Ee.getFormatter(i[2]).toStr(t)}return s||""}}Zo.DEF_SIZE=100,Zo.type="html",Zo.defaults=li(bs.defaults,{position:"center"});class Uo extends os{}Uo.defaults=li(os.defaults,{visible:!1});class Xo extends ss{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class Ko extends bs{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Uo(t)}_createPoint(t){return new Xo(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this.prop("rootUrl")||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}Ko.type="image",Ko.defaults=li(bs.defaults,{imageWidth:24,imageHeight:24,position:"top"});class qo extends ee{constructor(t,e){super(t,Ii),this.add(this._area=new ne(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new ne(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class Jo extends As{}class Qo extends _i{}Qo.defaults=li(ks.defaults,{visible:!1});class ta extends ks{_doInit(t){super._doInit(t),this._addChild("area",this._area=new Qo(this.chart))}get area(){return this._area}_createPoint(t){return new Jo(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new qo(t,e)}}ta.type="line",ta.defaults=li(ks.defaults,{});class ea extends ws{_readObject(t,e){super._readObject(t,e),this.center=e.center}getLabel(t){var e;return this.name||(null===(e=this.area)||void 0===e?void 0:e.name)}getParam(t){if(this.area){const e="name"===t?this.area.name:this.area.source.props[t];return E(super.getParam(t),e)}return super.getParam(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class ia extends _i{}ia.defaults=li(_i.defaults,{enabled:!0,autoMapChange:!0});class sa extends _i{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return n(e)?(t.name=e,!0):super._doSetSimple(t,e)}}sa.defaults=li(_i.defaults,{});class ra extends _i{constructor(t,e){super(e.chart),this.name=t,this.series=e}}ra.defaults=li(_i.defaults,{visible:!1});class na extends gi{constructor(t){super(t),this._args={chart:t,inset:null}}getInsetText(t){var e;const i=this._op;let s=null!==(e=this._op.text)&&void 0!==e?e:t.name;if(r(i.textCallback)){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if("function"==typeof this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(r(this._op.visibleCallback))return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}na.defaults=li(gi.defaults,{visible:void 0});class oa extends os{}oa.defaults=li(os.defaults,{visible:!1,hoverColor:"white"});class aa extends xs{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),this._drilldown=this._addChild("drilldown",new ia(this.chart)),this._insetLabel=this._addChild("insetLabel",new na(this.chart)),this._internalBorder=this._addChild("internalBorder",new ra(null,this)),this._externalBorder=this._addChild("externalBorder",new ra(null,this))}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t){return this._map.get(t)}pointOf(t){return this._areaPts.get(t.id)}_positionsByCoord(){return!1}_inspect(){const t=super._inspect(),e=[];let i=0;return this._points.forEach((t=>{var s,r;t.area?++i:e.length<20&&e.push(String(null!==(r=null!==(s=t.id)&&void 0!==s?s:t.name)&&void 0!==r?r:""))})),t.bound=i,t.rendered=i,t.hasData&&(t.unbound=e),t}pointByProp(t,e){var i;const s=this._points.getPoints();for(const r of s)if((null===(i=r.area)||void 0===i?void 0:i.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof ea||(t=this.pointById(t)),t.center||t.area.getCenter()}getValueRange(){return{min:this._minValue,max:this._maxValue}}getDetailed(){return this._detailed?this._detail:this}showDetail(){this._detail&&!this._detailed&&(this._detailed=!0,this._detail.show(!0,!0),this.hide(!0))}showParent(){this._parent&&this._parent._detail===this&&(this.hide(!0),this._parent._detailed=!1,this._parent.show(!0,!0))}isMapSeries(){return!0}_createLabel(t){return new oa(t)}$_createDetail(){return this._detail||(this._detail=new aa(this.chart),this._addChild("detail",this._detail),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail().loadOptions(e.detail)}_doApply(t){if(this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),e.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(s(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new ea(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var r;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:s(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,i(e.colorRange)){const t=m(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new Hs(t)}else this._colorRanger=null===(r=t.getColorScale(this.getColorScale()))||void 0===r?void 0:r.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(s(t)?t[0]:t)||"id",r=(s(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{const e=t;e.area=n?o[e[r]]:o[e.source[r]],e.area&&a.set(e.area.id,e)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new ot(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t,e=!0){t&&this.chart.selection.add(this,[t],e)}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0);this.chart._selectionChanged(this,e)}isEmpty(t){return 0===this.map.areaCount}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new sa(t.name,this);i.init(),i.loadOptions(t),e.push(i)}))}}aa.type="map",aa.defaults=li(xs.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class ha extends os{}ha.defaults=li(os.defaults,{visible:!1});class la extends ws{}class ca extends _i{constructor(t){super(t.chart),this.series=t,this._domain={callback:(t,e)=>this._point.getParam(e)}}getTextDomain(t){return this._point=t,this._domain}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ai),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}ca.defaults=li(_i.defaults,{});class da extends ca{getMinSize(t){return X(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}da.defaults=li(ca.defaults,{text:"${name}"});class _a extends ca{}_a.defaults=li(ca.defaults,{text:"${value}"});class ua extends vs{_doInit(t){super._doInit(t),this._header=this._addChild("header",new da(this)),this._divider=this._addChild("divider",new _i(this.chart)),this._body=this._addChild("body",new _a(this))}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:k(this._width,it.clampEx(t,this._minWidth,this._maxWidth)),height:k(this._height,it.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new ha(t)}_createPoint(t){return new la(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t);const e=this.prop("orientation"),i=this.prop("minWidth"),s=this.prop("minHeight");this._vertical="horizontal"!==e,this._minWidth=+i,this._minHeight=+s}}ua.DEF_MIN_WIDTH=80,ua.DEF_MIN_HEIGHT=50,ua.type="panel",ua.defaults=li(vs.defaults,{orientation:"vertical",minWidth:ua.DEF_MIN_WIDTH,minHeight:ua.DEF_MIN_HEIGHT,position:"top"});class pa extends Ps{}class ga{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class ma extends Ls{getRadius(t){return k(X(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}getFieldColors(){return this._fieldColors}_createPoint(t){return new pa(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius"),this._thresholds=this.$_parseThresholds(t.threshold)}_doPrepareRender(t,e){super._doPrepareRender(t,e);let i=k(this.prop("startAngle")%360,0),s=p(0,u(360,k(this.prop("totalAngle"),360)));this._startRad=y+w*i,this._totalRad=w*s}setCalcedColor(t,e){this._op,super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories&&(s(this.prop("fieldColors"))?this._fieldColors=this.prop("fieldColors"):this._fieldColors=this._splitColors())}$_parseThresholds(t){return s(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new ga(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new ga(t.value,t.radius,t.style)]:void 0}}ma.type="pie",ma.defaults=li(Ls.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class fa extends ne{constructor(t,e){super(t,Ii),this._rd=e,this.setPath(Fi.pin({cx:0,cy:2*-e,rd:e,innerRd:0})),this.transY(3*-e)}trans(t,e){return e+=3*this._rd,super.trans(t,e)}}class ba extends Ss{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class ya extends Cs{getExt(t,e){const i=k(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t);const e=this.prop("radius"),i=this.prop("innerRadius");this._rd=k(e,ya.DEF_RADIUS),this._innerRd=k(i,0)}_createPoint(t){return new ba(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new fa(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new ot(this._calcedColor)}getColorScale(){return this.prop("colorScale")}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);this._minValue=r,this._maxValue=n,this._colorRanger=null===(i=t.getColorScale(this.prop("colorScale")))||void 0===i?void 0:i.getRanger()}}ya.DEF_RADIUS=9,ya.type="pin",ya.defaults=li(Cs.defaults,{radius:ya.DEF_RADIUS,innerRadius:0,position:"top"});class wa extends ee{constructor(t,e){super(t,Ii),this._size=e,this.add(this._marker=new ne(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}setColor(t){return this.dom.style.fill=t,this}_renderShape(t){const e=Math.max(4,t/2);Fi.setShape(this._marker,this._shape,e,e)}}class xa extends _i{get acitve(){return this.visible&&this._runner&&this._runner.active}get clusters(){return this.visible&&this._runner?this._runner.clusters:null}run(t,e,i,s,r,n){t.forEach((t=>t.cluster=null)),this._runner="grid"===this._op.algorithm?new Sa:new va,this._runner.prepare(this,e,i).run(this,t,s,r,n)}stop(){}updateClusters(){this._runner.updateClusers()}clear(){var t;null===(t=this._runner)||void 0===t||t.clear()}isVisible(t){return this.acitve&&t.points.length>1||!this.acitve&&t.points.length>=this._op.minDensity}getRange(t){const e=this._ranges;if(e){const i=t.points.length;for(const t of e)if(i>=t.from&&i<t.to)return t}return{radius:this._op.radius}}isExpandable(){return!1!==this._op.expandable}_doApply(t){super._doApply(t),t.distance=k(t.distance,40),t.minDensity=k(t.minDensity,2),t.maxIteration=k(t.maxIteration,100),t.stepDuration=k(t.stepDuration,50),t.radius=k(t.radius,15),this._ranges=this.$_parseRanges(t.ranges)}$_parseRanges(t){const e=[];if(s(t)&&t.length){const s=this._op.radius;let r=-1/0;t.forEach(((t,n)=>{if(i(t)){const i={from:k(r,t.from),to:k(t.to,1/0),radius:k(t.radius,s),color:t.color};e.push(i),r=i.to}e.length>1&&e.sort(((t,e)=>t.from-e.from))}))}return e.length>0?e:null}}xa.defaults=li(_i.defaults,{visible:!1,distance:40,minDensity:2,maxIteration:100,stepDuration:50,zoomLimit:300,radius:15});class va{constructor(){this._ani=null}get active(){return this._clusters&&this._clusters.length>0&&!this._completed}get clusters(){return this._clusters}prepare(t,e,i){return this}run(t,e,i,s,r){const n=this._clusters=this.$_buildDensitySeeds(t,e);if(n.length>0&&!this._completed){const o=this.$_iterate(t,e,n),a=e=>{if(e-this._last>=t.prop("stepDuration")){const t=o.next();t.done?r(n):(s(t.value.step,t.value.clusters),this._ani=requestAnimationFrame(a)),this._last=e}else n.forEach((t=>{t.points.forEach((t=>t.moves+=1/va.MOVE_STEPS))})),s(-1,null),this._ani=requestAnimationFrame(a)};this._completed=!1,i(n),a(this._last=performance.now())}else this._completed=!0}stop(){null!==this._ani&&(cancelAnimationFrame(this._ani),this._ani=null),this._completed=!0}updateClusers(){this._clusters&&this.$_updateCentroids(this._clusters)}clear(){this._clusters&&(this._clusters.forEach((t=>{t.points.forEach((t=>t.cluster=void 0))})),this._clusters=null)}$_buildDensitySeeds(t,e){const i=2*t.prop("distance"),s=new Map;for(const t of e){const e=`${Math.floor(t.px/i)},${Math.floor(t.py/i)}`;s.has(e)||s.set(e,[]),s.get(e).push(t),t.cluster=null,t.moves=1}const r=[];for(const t of s.values()){const e=t.reduce(((t,e)=>t+e.px),0)/t.length,i=t.reduce(((t,e)=>t+e.py),0)/t.length;r.push({cx:e,cy:i,points:[],prevs:[]})}return r}$_assignPoints(t,e,i,s){s*=s,i.forEach((t=>{t.prevs=t.points,t.points=[]}));for(const r of e){let e=i[0],n=1/0;for(const t of i){const i=(r.px-t.cx)**2+(r.py-t.cy)**2;i<n&&(n=i,e=t)}(r.px-e.cx)**2+(r.py-e.cy)**2<=s&&(e.points.push(r),e.points.length>=t.prop("minDensity")&&e.points.forEach((t=>{t.cluster!==e&&(t.cluster=e,t.moves=0)})))}this._completed=!0;for(const t of i)if(!it.equalArrays(t.points,t.prevs)){this._completed=!1;break}for(const t of i)for(const e of t.points)this._completed?e.moves=1:e.moves+=1/va.MOVE_STEPS}$_updateCentroids(t){for(const e of t){const t=e.points.length;t>0&&(e.cx=e.points.reduce(((t,e)=>t+e.px),0)/t,e.cy=e.points.reduce(((t,e)=>t+e.py),0)/t)}}*$_iterate(t,e,i){for(let s=0;s<t.prop("maxIteration")&&!this._completed;s++)this.$_assignPoints(t,e,i,t.prop("distance")),this.$_updateCentroids(i),yield{step:s,clusters:i}}}va.MOVE_STEPS=10;class Sa{get active(){return!1}get clusters(){return null}prepare(t,e,i){return this}run(t,e,i,s,r){}stop(){}updateClusers(){}clear(){}}class Ca extends Ss{_readObject(t,e){super._readObject(t,e)}}class Pa extends Cs{constructor(t){super(t),this._shape=t.getNextPointShape()}_doInit(t){super._doInit(t),this._cluster=this._addChild("cluster",new xa(this.chart))}getShape(){return this.prop("shape")||this._shape}getRadius(){return this.prop("radius")}setLegendMarkerStyle(t){this._stroke&&(t.internalSetStyle("stroke",this._stroke),t.internalSetStyle("stroke-width",this._strokeWidth))}get cluster(){return this._cluster}_createPoint(t){return new Ca(t)}_defLabelOff(){return 2}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new wa(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),u(e,2*this.prop("radius"))),i}}Pa.type="point",Pa.defaults=li(Cs.defaults,{radius:5,position:"center"});class Ma extends ee{constructor(t,e){super(t,Ii),this.add(this._line=new ne(t)),this.add(this._arrow=new ne(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=R(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class La extends ss{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return h(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,r;const o=function(t){let e=[];return s(t)?t.forEach((t=>{s(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(r=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==r?r:[],this.path=null!=e.path?o(e.path):void 0,this.imageUrl=e.imageUrl||t.imageFielder(e)}}class Aa extends bs{get imageFielder(){return this._imageFielder}getImageUrl(t,e=!0){const i=e?this._root:"";return t.imageUrl?i+t.imageUrl:this._imageUrl?i+this._imageUrl:null}getRouteMode(){return this.chart.isGlobe?Wi:this.prop("routeMode")}getLineWidth(){return k(this._op.lineWidth,0)}getCurvePoint(t,e,i){const s=this.chart.getProjection(),r=k(t.getProp("curveFactor"),this.num("curveFactor")),n=s.scroll;let o;return s.scroll=0,o=0===r?[e,i].map((t=>s.project(t))):this.$_getCurvePointBycurveFactor(e,i,r),s.scroll=n,o}needMapScale(){return!0}_createPoint(t){return new La(t)}_positionsByCoord(){return!1}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(s(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const i=h({},t);if(s(i.coords)){const t=i.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new Ma(t,e)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_doApply(t){super._doApply(t),this._root=this._op.imageRootUrl||"",this._imageUrl=this._op.imageUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}$_getCurvePointBycurveFactor(t,e,i){const s=this.chart.getProjection(),r=e[0]-t[0]>0?1:-1,n=s.project(t),o=s.project(e),a=o[0]-n[0],h=o[1]-n[1],l=(n[0]+o[0])/2,c=(n[1]+o[1])/2,d=Math.sqrt(a*a+h*h),_=l+-h/d*i*r,u=c+a/d*i*r,p=a/d,g=h/d,m=d/8;return[[_-p*m,u-g*m],[_+p*m,u+g*m]]}}Aa.type=Zi,Aa.defaults=li(bs.defaults,{routeMode:"geo",lineType:"air",arrowDisplay:"always",arrowWidth:5,arrowLength:13,curveFactor:0,imageWidth:42,imageHeight:42});class ka extends Ps{}class Ia extends Ls{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),n={rowCount:this._rowCount,colCount:this._colCount,grid:s,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:s,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new ka(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Ia.ROW_COUNT,this._colCount=t.colCount||Ia.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Ia.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Ia.CELL_SIZE,this._gap=k(t.gap,Ia.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=s(t.values)?t.values.reduce(((t,e)=>t+k(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*k(i,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(s);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,i=e.length;for(let s=0;s<i;s++)if(isNaN(e[s][t]))return s;return i}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._colCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),a==i-1?(h++,a=this.$_rows(h)):h===s-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=n,t.cols=o}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),h==s-1?(a++,h=this.$_cols(a)):a===i-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=n,t.cols=o}}Ia.ROW_COUNT=10,Ia.COL_COUNT=10,Ia.THRESHOLD=1,Ia.CELL_SIZE=5,Ia.GAP=2,Ia.type="waffle",Ia.defaults=li(Ls.defaults,{rowCount:Ia.ROW_COUNT,colCount:Ia.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Ia.THRESHOLD,cellSize:Ia.CELL_SIZE,gap:Ia.GAP});class Ea extends In{static loadMap(t,e){return i(t)&&i(t.source)&&s(t.source.features)||i(t)&&i(t.map)&&s(t.map.features)?new Ea(t,e):i(t)&&s(t.bounds)&&4===t.bounds.length&&t.bounds.every(o)?new Ea({...t,map:{features:[]}},e):void 0}_doLoad(t){return Mn(t)}}class Ta extends _i{}class Na extends _i{}class Va extends Si{constructor(t,e){super(t),this.inBody=e,this._zoom=100,this._panX=0,this._panY=0,this.scroll=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))}}_doInit(t){t.target=(this._target=new Ta(this.chart)).init(),t.connector=(this._connector=new Na(this.chart)).init()}get target(){return this._target}get connector(){return this._connector}prepareLayout(t,e){return this.$_prepareLayout(t,e)}refresh(){}_getNamePrefix(){return"mapregion"}_doPrepareRender(t,e){const i=this._map=t.map,s=t.getProjection(),r=e.bounds,n=Math.abs(r[0][0]-r[1][0]),o=Math.abs(r[0][1]-r[1][1]),a=Math.abs(i.x2-i.x1)/n,h=Math.abs(i.y2-i.y1)/o,l=[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2],[c,d]=s.project(l);this._zoom=100*Math.min(a,h),s.isGlobe||(t.body.isScrollable()?this.scroll=l[0]:this._panX=c-i.cx,this._panY=-d+i.cy)}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=k(this._panX*d,0),u=k(this._panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,b=s+a/2-m/2+this._panX,y=n+h/2-f/2-this._panY;return this._vRect=_t.create(b,y,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}}Va.defaults=li(_i.defaults,{width:200});class $a extends Ci{getRegion(t){const e=this._map[t];if(e instanceof Va)return e}_loadItem(t,e,i,s){const r=new Va(t,s);return r.init(),r.index=i,r.loadOptions(e),r}}class Ra extends $t{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=k(i,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==s||s()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Da extends $t{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=k(s,300),this._old=t.zoom,this.view.$_moveTo(i),this.endHandler=()=>{this.view.zoom=e,this.view=null,null==r||r()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Oa extends _i{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}Oa.defaults=li(bs.defaults,{visible:void 0,globeFill:"lightblue"});const Ba={zoom:1,panX:1,panY:1};class Fa extends _i{constructor(t){super(t),this._prj=(new io).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this._hMap=null,this._wLayout=0,this._hLayout=0,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new Hi(this)}_doInit(t){super._doInit(t),this._addChild("mapBackground",this._mapBackground=new Oa(this.chart))}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){var t;return(null===(t=this._map)||void 0===t?void 0:t.isWorld)&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof Vn?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Vn?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){return this._prj.scroll}set scroll(t){this.updateOption("scroll",t)}get movable(){return!1!==this.prop("movable")}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this._zoom}set zoom(t){this.updateOption("zoom",this.$_clampZoom(t))}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=this.chart.globalMapBound,e=[t.x1+(t.x2-t.x1)/2,t.y1+(t.y2-t.y1)/2];return this._prj?this._prj.backward(e):e}get map(){return this._map}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}clampPanX(t){const e=this._scale;return e>0?this.$_calcPan(this._wLayout,this._wMap*e,t*e)/e:t}clampPanY(t){const e=this._scale;return e>0?this.$_calcPan(this._hLayout,this._hMap*e,t*e)/e:t}canPanX(){return this.isScrollable()||this._wMap*this._scale>this._wLayout+1}canPanY(){return this._hMap*this._scale>this._hLayout+1}$_clampZoom(t){const e=this.prop("maxZoom"),i=Math.max(100,t);return e>0?Math.min(e,i):i}prepare(t){this._map=t}prepareLayout(t,e){return this._wLayout=t,this._hLayout=e,this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this.chart.globalMapBound,r=i.getYRange(s.v1,s.v2),n=i.project([s.h1,r[0]]),o=i.project([s.h2,r[1]]),a=this._wMap=o[0]-n[0],h=[s.x1,s.y1],l=[s.x2,s.y2],c=this._hMap=l[1]-h[1],d=this.$_calculateRate(t,e,a,c),_=this._scale=this._zoom/100*d,u=k(this.prop("panX")*_,0),p=k(this.prop("panY")*_,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*_,u)/_;this._panX=e}this._panY=this.$_calcPan(e,c*_,p)/_;const g=i.scroll*a/360,m=t/2-(n[0]+a/2)*_-(this._panX+g)*_,f=e/2+(h[1]+c/2)*_-this._panY*_,b=d/_*a,y=d/_*c,w=s.x1+a/2-b/2+this._panX,x=s.y1+c/2-y/2-this._panY;return this._vRect=_t.create(w,x,b,y),{scale:_,wMap:a,hMap:c,tx:m,ty:f}}$_prepareLayout(t,e){const i=this.chart.globalMapBound,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=this._hMap=o-n,l=this.$_calculateRate(t,e,a,h),c=this._zoom/100,d=this._scale=c*l,_=k(this.prop("panX")*d,0),u=k(this.prop("panY")*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,b=s+a/2-m/2+this._panX,y=n+h/2-f/2-this._panY;return this._vRect=_t.create(b,y,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}$_calculateRate(t,e,i,s){const r=Math.min(t/i,e/s);return 0!==r?r:1}getPoint(t){return this._points[t]}toVisible(t){if(this.isFlatWorld)return this._prj.getVisible(t);{const e=this._prj.getVisible(t);if(e&&this._vRect.contains(e[0],e[1]))return e}}isScrollable(){var t;return this.prop("scrollable")&&(null===(t=this.map)||void 0===t?void 0:t.isWorld)}setZoom(t,e=300){let s,n;o(e)?n=e:r(e)?(s=e,n=300):i(e)&&(s=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new Ra(this,t,n,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}zoomByFactor(t,e=!0){if(!isNaN(t)){const i=this.zoom;e?this.setZoom(i+i*t/100):this.zoom=i+i*t/100}}zoomAt(t,e,i){const s=this.zoom,r=this._scale;if((t=this.$_clampZoom(t))===s)return;if(!(r>0))return void(this.zoom=t);const n=(1-s/t)/r,o=(e-this._wLayout/2)*n,a=(i-this._hLayout/2)*n,h=this.panX,l=this.panY;this.zoom=t,this.isScrollable()?this.scroll+=360*o/this._wMap:this.panX=h+o,this.panY=l+a}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new Da(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){var r;const n={...zi,...s},o=null===(r=this.map)||void 0===r?void 0:r.areaOf(t);if(!o)return;const a=o.getCenter(),{x1:h,x2:l,y1:c,y2:d}=o.mainLandBounds,{zoom:_}=this.calcZoomInfo([h,c],[l,d],e),u=Math.min(n.maximumZoom,Math.max(n.minimumZoom,_));new Da(this,u,a,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:n}=this.calcZoomInfo(t,e,s);try{new Da(this,n,r,i,null).start()}catch(t){console.error(t)}}calcZoomInfo(t,e,i){const s=this.map,r=Math.abs(e[0]-t[0]),n=Math.abs(e[1]-t[1]),o=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=Math.abs(s.x2-s.x1)/r*i,h=Math.abs(s.y2-s.y1)/n*i;return{center:o,zoom:100*Math.min(a,h)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this.chart.globalMapBound,i=e.x1+(e.x2-e.x1)/2,s=e.y1+(e.y2-e.y1)/2,[r,n]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(0!==this.scroll||this.isScrollable()?this.scroll=t[0]:this.panX=r-i,this.panY=-n+s)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Ba;s&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,i)}finally{s&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let i=!0;for(const e in t)if(!(e in Ba)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o;const a=this;var h;super._doApply(t),e.call(t,"annotations")&&(h=t.annotations)!==a._anns&&(a._anns=h,a._annotations.load(h,!0));const l=this._zoom;let c=function(t){if(void 0!==t&&t!==a._projection){switch(a._projection=t,a._projection.toLowerCase()){case"orthographic":a.scroll=0,a.panX=0,a.panY=0,a._prj=new Vn;break;case"equalearth":a._prj=(new lo).prepareSecond();break;case"miller":a._prj=(new fo).prepareSecond();break;case"mercator":a._prj=(new uo).prepareSecond();break;default:a._prj=(new io).prepareSecond()}return!0}}(t.projection);const d=this._prj;if(d&&(c||void 0!==t.scroll&&t.scroll!==this._rawScroll)){d.scroll=t.scroll,this._rawScroll=t.scroll,c=!0;const e=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;e&&e.setOptionsDirty(!0)}d instanceof Vn&&(c=d.setRotation(t.rotationX,t.rotationY)||c),function(t){void 0!==t&&(a._zoom=a.$_clampZoom(k(t,100)))}(t.zoom);const _=this._points={};s(t.points)&&t.points.forEach((t=>{s(t)&&t.length>=3&&n(t[0])?_[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(_[t.id]=s(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(c&&this.chart.projectionChanged(),this._zoom!==l&&(this.chart.zoomChanged(this._zoom,l),null===(o=this.prop("onZoomChanged"))||void 0===o||o({chart:this.chart.wrapper,zoom:this._zoom,oldZoom:l})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Fa.defaults=li(_i.defaults,{zoom:100,wheelZoomFactor:5});class za extends aa{}class ja extends _i{constructor(){super(...arguments),this._widgetGaps=new Gt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=this.prop("widgetSectionGap");var i;n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e),i=this.prop("locale"),Ot=Rt[Dt=Bt(i)],Ot||(Ot=Rt[Dt="ko"])}}ja.defaults=li(_i.defaults,{locale:"ko",alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,resizeDelay:50,interactive:!0,wheelDisabled:!1,animatable:!0,clickable:!0,hoverable:!0,draggable:!0});class Ga extends jt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Di.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Ce,this._series=new ys(this),this._annotations=new Hi(this),this._mapRegions=new $a(this),this._widgetGroups=new vi(this),this._legends=new Gs(this),this._colorScales=new tr(this),this._bubbleScales=new Fs(this),(this._general=new ja(this)).init(),(this._axis=new gr(this)).init(),(this._body=new Fa(this)).init(),(this._exporter=new er(this)).init(),(this._title=new Xn(this)).init(),(this._subtitle=new Kn(this)).init(),(this._zoomPanel=new Yn(this)).init(),(this._drilldownPanel=new Zn(this)).init(),(this._mapScale=new Hn(this)).init(),(this._credits=new Mi(this)).init(),(this._tooltip=new qn(this)).init(),this._op=Object.assign({},Ga.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},i(t)?this._load(t):this._initOptions(),this._selection=new Un(this)}_initOptions(){return this._op=Object.assign({},Ga.defaults)}get wrapper(){return this._wrapper}get exporter(){return this._exporter}get options(){return this._op}get general(){return this._general}get global(){return this._general}get isGlobe(){return this.getProjection().isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return n(t)&&ns[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ji[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}interactive(){return this._general.bool("interactive")}animatable(t=!0){return(!t||this.interactive())&&this._general.bool("animatable")}hoverable(t=!0){return(!t||this.interactive())&&this._general.bool("hoverable")}clickable(t=!0){return(!t||this.interactive())&&this._general.bool("clickable")}draggable(t=!0){return(!t||this.interactive())&&this._general.bool("draggable")}dragAxes(){const t=this._body;if(!t||!this.draggable())return{x:!1,y:!1};const e=this._general.prop("dragAction");return"zoom"===e||"select"===e||this.isGlobe?{x:!0,y:!0}:t.isScrollable()||t.movable?{x:t.canPanX(),y:t.canPanY()}:{x:!1,y:!1}}zoomable(t=!0){return(!t||this.interactive())&&this._body.bool("zoomable")}wheelable(t=!0){return(!t||this.interactive())&&!this._general.bool("wheelDisabled")}loadAnimatable(){return this._loadAnimatable}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i;this._fireEvent("onModelChanged",t,"selection");new ls({series:t},this._wrapper)._points=e,null===(i=this._general.prop("onSelectionChanged"))||void 0===i||i({chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new io).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this.$_resetGlobalMapBound(),this._fireEvent("onProjectionChanged",this.body._prj)}zoomChanged(t,e){this._fireEvent("onZoomChanged",t,e)}mapChanged(t){this._fireEvent("onMapChanged",t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,i){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){var t;this._fireEvent("onModelChanged",this,"selection"),null===(t=this._general.prop("onSelectionChanged"))||void 0===t||t({chart:this._wrapper})}get type(){return this._op.type}get legend(){return this._legends.first}get credits(){return this._credits}get globalMapBound(){return this._globalMapBound}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof jn?t:this.getMap(t))||this._maps[0];i!==e&&(this._baseMap=i,this._loading||(this._baseMap.reset(),this.mapChanged(i)))}get axis(){return this._axis}get title(){return this._title}get body(){return this._body}get visibleSeries(){return this._series.visibles}get firstVisible(){return this._series.firstVisible}get firstMapSeries(){return this._series.visibles.find((t=>t instanceof aa))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get zoomPanel(){return this._zoomPanel}get drilldownPanel(){return this._drilldownPanel}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof aa&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}isEmpty(){return!this.map}coordOfArea(t){var e,i;return(null===(i=null===(e=this._baseMap)||void 0===e?void 0:e.areaOf(t))||void 0===i?void 0:i.getCenter())||Ei}requestRender(t){this._fireEvent("onRequestRender",t)}mapByName(t){return this._maps.find((e=>e&&e.name===t))}mapAt(t){return this._maps[t]}getMap(t){return n(t)?this.mapByName(t):this.mapAt(+t)}getSeries(t){return o(t)?this._series.get(t):this._series.getSeries(t)}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)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}mapRegionByName(t){return this._mapRegions.getRegion(t)}_collectWidgets(){const t={};for(const e of Object.values(Q))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(Q)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&di(n={},r.base),i(r[s])&&(n||(n={}),di(n,r[s])),n?di(n,t):t}_setProperties(t,e=!0){const i=this._op;for(const e in Ga.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const e=this._op;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(E(t.asset,t.assets)),this._general.loadOptions(E(t.general,t.chart)),this._body.loadOptions(t.body);const r=s(t.map)&&4===t.map.length&&t.map.every(o)?{bounds:t.map}:t.map,n=s(r)?r:i(r)?[r]:null;if(s(n)&&n.forEach(((t,e)=>{if(!1!==t.enabled){const i=$n.loadMap(t,e)||Ea.loadMap(t,e);if(!i)return;const s=i&&new jn(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),0===this._maps.length){const t=new jn(this,new Ea({map:{features:[]}},0),0);this._maps.push(t)}return this.setBaseMap(void 0),this.$_resetGlobalMapBound(),this.$_resolveGrid(t),this._axis.loadOptions(t.axis),this._title.loadOptions(t.title),this._subtitle.loadOptions(t.subtitle),this._zoomPanel.loadOptions(t.zoomPanel),this._drilldownPanel.loadOptions(t.drilldownPanel),this._credits.loadOptions(t.credits),this._tooltip.loadOptions(t.tooltip),this._seriesIndex=0,this._series.load(t.series,za),!1===this._general.prop("alwaysMap")||0!==this._series.count&&this._series.get(0).isMapSeries()||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._mapRegions.load(t.mapRegions||t.mapRegion,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale.loadOptions(t.mapScale),this._exporter.loadOptions(t.exporting),this._loading=!1,this}$_resolveGrid(t){if(!(1===this._maps.length&&0===this._maps[0].areaCount&&this.globalMapBound))return;const e=this.globalMapBound;t.axis||(t.axis={}),"boolean"==typeof t.axis.grid?t.axis.grid={visible:!!t.axis.grid}:t.axis.grid||(t.axis.grid={});const i=t.axis.grid;i.visible=!0;let s=Ga.DEFAULT_GRID_STEP;if("orthographic"!==this._body.prop("projection")){const t=Math.min(Math.abs(e.h2-e.h1),Math.abs(e.v2-e.v1));for(const e of Ga.ZOOM_STEP_MAP)if(t<=e.diff){s=e.step;break}}void 0!==s&&(i.line||(i.line={}),"number"!=typeof i.line&&void 0===i.line.step&&(i.line.step=s))}$_loadTemplates(t){const e=this._bases;if(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=h({},s))}["@series","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return di(di({},i),t)}else s(e)&&e.forEach((e=>{let i=this._templates[e];return i?di(di({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._widgetGroups.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._mapRegions.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(i(t)){const i=this._general.prop("locale");this._setProperties(t,!1);for(const e in t){if("chart"===e){this._general.updateOptions(t[e],!1);continue}const i=this[e];(i instanceof _i||i instanceof ui||i instanceof Ce)&&i.updateOptions(t[e],!1)}this._general.prop("locale")!==i&&this.$_relocalize(),e&&this._optionChanged(null)}}$_relocalize(){this._maps.forEach((t=>null==t?void 0:t._relocalizeAreas())),this._series._internalItems().forEach((t=>t._relocalize()))}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(t){return this._series.getLegendSources(t).concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t,e);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof aa&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.prop("enabled"))return;s.prop("dataUrl")&&(s.updateOption("data",await fetch(s.prop("dataUrl")).then((t=>t.json()))),s.removeOption("dataUrl"));const r=t.map,n=this.getMap(s.prop("map"))||r;i.prop("autoMapChange")&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof aa&&t.parent))return;const e=t.drilldown;if(!e.prop("enabled"))return;const i=t.parent,s=this.map;e.prop("autoMapChange")&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return r(this._general.prop("onClick"))}click(t){var e;null===(e=this._general.prop("onClick"))||void 0===e||e(t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof yi){const i=t.get(e.prop("group"),e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}$_resetGlobalMapBound(){const t={x1:0,x2:0,y1:0,y2:0,h1:0,h2:0,v1:0,v2:0};let e=1/0,i=-1/0,s=1/0,r=-1/0,n=1/0,o=-1/0,a=1/0,h=-1/0;if(this._maps.forEach((t=>{isFinite(t.x1)&&(e=Math.min(e,t.x1)),isFinite(t.x2)&&(i=Math.max(i,t.x2)),isFinite(t.y1)&&(s=Math.min(s,t.y1)),isFinite(t.y2)&&(r=Math.max(r,t.y2)),isFinite(t.h1)&&(n=Math.min(n,t.h1)),isFinite(t.h2)&&(o=Math.max(o,t.h2)),isFinite(t.v1)&&(a=Math.min(a,t.v1)),isFinite(t.v2)&&(h=Math.max(h,t.v2))})),isFinite(e))this._globalMapBound={x1:e,x2:i,y1:s,y2:r,h1:n,h2:o,v1:a,v2:h};else{const e=this._baseMap;this._globalMapBound=e?{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,h1:e.h1,h2:e.h2,v1:e.v1,v2:e.v2}:t}}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s;null===(s=this._body.prop("onHoverArea"))||void 0===s||s({chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i;null===(i=this._body.prop("onClickArea"))||void 0===i||i({chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}Ga.ZOOM_STEP_MAP=[{diff:1,step:.2},{diff:10,step:1},{diff:50,step:5}],Ga.DEFAULT_GRID_STEP=10,Ga.defaults={type:"map",startOfWeek:0},bs.register(aa,Pa,ya,wo,ma,Ho,$s,Aa,Ko,ta,ua,Ia,Zo,Io,zo),Gi.register(Qn,to,eo,Jn);class Ha extends ee{constructor(t,e,i=!1){super(t,e,"image"),this._dirty=!0,this._bounds=lt,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},i&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Wa extends ee{constructor(t,e){super(t,Wa.STYLE),this._spinnerWrapper=new ee(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Ha(t,"rm-loading-spinner",!0)),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=Wa.LOADING_SPINNER,this._spinner.width=Wa.SPINNER_LENGTH,this._spinner.height=Wa.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-Wa.SPINNER_LENGTH/2,t.height/2-Wa.SPINNER_LENGTH/2)}}Wa.STYLE="rm-loading-indicator",Wa.BACK_STYLE="rm-loading-background",Wa.SPINNER_LENGTH=64,Wa.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class Ya{constructor(t,e){this._visible=!1,this._doc=t,this._container="string"==typeof e?t.getElementById(e):e,this._svg=t.createElementNS("http://www.w3.org/2000/svg","svg"),this._svg.style.position="absolute",this._svg.style.top="0",this._svg.style.left="0",this._svg.style.width="100%",this._svg.style.height="100%",this._svg.style.pointerEvents="none",this._svg.style.zIndex="9999",this._loadingElement=new Wa(t),this._svg.appendChild(this._loadingElement.dom),this._setVisible(!1)}show(){this._visible||(this._container.appendChild(this._svg),this._setVisible(!0),this._layout())}hide(){this._visible&&(this._setVisible(!1),this._svg.parentNode===this._container&&this._container.removeChild(this._svg))}dispose(){var t;this.hide(),null===(t=this._loadingElement)||void 0===t||t.dispose(),this._loadingElement=null,this._svg=null}_setVisible(t){this._visible=t,this._loadingElement.visible=t}_layout(){const t=this._container.clientWidth,e=this._container.clientHeight,i=Ya.LOADING_VIEW_LENGTH;this._loadingElement.layout({width:i,height:i});const s=t/2-i/2,r=e/2-i/2;this._loadingElement.trans(s,r)}}Ya.LOADING_VIEW_LENGTH=128;class Za{static handleChartInitError(t,e){throw null==e||e.showErrorView(null==t?void 0:t.message),t}}const Ua="$ctrl";class Xa{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Ga(t,this),this._loaded=i(t),null==e||e(this._obj,null)}get type(){return this._obj.type}get body(){return this._obj.body}get assets(){return this._obj._assets}get map(){return this._obj.map}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get series(){return this._obj.firstVisible}get firstMapSeries(){return this._obj.firstMapSeries}get legend(){return this._obj.legend}get credits(){return this._obj._credits}get colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}get widgetGroup(){return this._obj.widgetGroup}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}get global(){return this._obj.global}get general(){return this._obj.general}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart ";it.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new Ga(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,it.log("chart-items:",hi),it.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,s){var r;const n=this[Ua];if(!i(t))return this;const o=n.doc(),a=n.dom().parentElement,h=new Ya(o,a);h.show();try{n.setLoading(!0),n.hideErrorView();const i="load chart ";it.LOGGING&&console.time(i),await At.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.dispose(),a=this._obj=new Ga(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=s,it.log("chart-items:",hi),it.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){Za.handleChartInitError(t,n)}finally{n.setLoading(!1),h.hide(),h.dispose()}}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,i){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}inspect(){return{series:this._obj.visibleSeries.map((t=>t._inspect()))}}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof aa?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof aa&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof aa?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof aa&&this._obj.drillup(e)}destroy(){var t,e,i;this.$_disposed||this.$_disposing||(this.$_disposing=!0,null===(e=null===(t=this._obj)||void 0===t?void 0:t._exporter)||void 0===e||e.dispose(),this[Ua]=null===(i=this[Ua])||void 0===i?void 0:i.dispose(),this._obj=null,this.$_disposed=!0)}isDestroying(){return this.$_disposing||this.$_disposed}}class Ka{constructor(t){this._draggable=!0,this._touches=[],this._tapped=0,this._firstTime=0,this._secondTime=0,this._distance=0,this._pinching=!1,this._control=t}get control(){return this._control}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}get dragging(){return this._dragTracker&&this._dragTracker.dragging}get _isTouch(){return"touch"===this._pointerType}pointerDown(t){let e;return this._pointerType=t.pointerType,e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=this._prevY=e.y,this._touches=[{x:e.x,y:e.y,t:t.timeStamp}],this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._clickX,this._clickY,i,s,t.shiftKey)&&(this._clearTouchEffects(),i===this._prevX&&s===this._prevY||!this.control.isDraggable()?this._stopEvent(t):this.$_doDrag(t,e,i,s))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this._pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId){const n=this._isTouch?8:3;i&&this.control.isDraggable()?this.$_doDrag(t,e,s,r):(!this._dragTracker&&(Math.abs(this._clickX-s)>n||Math.abs(this._clickY-r)>n)||this._dragTracker&&!i)&&this.$_startMove(t,e,s,r),this._prevX=s,this._prevY=r,this._touches.push({x:s,y:r,t:t.timeStamp})}else i&&this.$_stopDragTracker(e,s,r,!0);this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pointerType=t.pointerType||this._pointerType,this._doPointerUp(t),this._pinching)return;const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.$_stopDragTracker(e,i,s)}pointerCancel(t){const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,i,s,!0),clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerCancel(t)}pointerLeave(t){clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerLeave(t)}touchStart(t){if(this._pinching=!1,t.touches.length>=2){const e=t.target;this._isPinchTarget(e)&&(this._pinching=!0,this._distance=this.$_getDistance(t.touches[0],t.touches[1]),this._pinchRect=this._control.dom().getBoundingClientRect(),t.cancelable&&t.preventDefault())}else this._doTouchStart(t,t.target)}touchMove(t){if((this._pinching||this.dragging)&&t.cancelable&&t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);if(this._distance>0){const i=this.$_getCenter(t.touches[0],t.touches[1]);this._doPinch(e/this._distance,i.x,i.y)}this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t,e,i){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}touchCancel(t){this._pinching=!1,this._distance=0,this._pinchRect=null,this._clearTouchEffects(),this.dragging&&this.$_stopDragTracker(t.target,this._prevX,this._prevY,!0)}click(t){this._doClick(t)}dblClick(t){this._doDblClick(t)}keyPress(t){this._doKeyPress(t)}wheel(t){this._doWheel(t)&&this._stopEvent(t)}requestDrag(t){const e=this.getTrackerFromRequest(t);e&&this.setDragTracker(e)}getTrackerFromRequest(t){}_setDraggable(t){this._draggable=t}_doClick(t){}_doDblClick(t){}_doPointerDown(t){return!0}_doPointerMove(t,e,i){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,i){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,i,s,r){return!1}_getDragTracker(t,e,i,s){return null}$_startDrag(t,e,i,s,r,n){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i,n)),!!this._dragTracker&&this._dragTracker.start(t,e,i,s,r)}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s=!1){this.dragging&&(s?this._dragTracker.cancel():this._dragTracker.drop(null,e,i),this._dragTracker=null)}_pointerToPoint(t){return this._control.pointerToPoint(t)}$_checkSwipe(t,e){const i=this._touches,s=i.length;if(s<2)return;const r=i[s-1];let n=i[s-2];if(r.t-n.t<=100)for(let t=s-3;t>=0&&(n=i[t],!(r.t-n.t>100));t--);const o=n.x,a=n.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-n.t),d=.998;if(c>.1){const e=this._dragTracker,i=Math.log(.1/c)/Math.log(d),s=c*(1-Math.pow(d,i+1))/(1-d);let r,n=Math.round(180*Math.atan2(l-a,h-o)/Math.PI);if(n<0&&(n=360+n),r=n>45&&n<=135?Nt.DOWN:n>135&&n<=225?Nt.LEFT:n>225&&n<=315?Nt.UP:Nt.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}$_getCenter(t,e){const i=this._pinchRect||this._control.dom().getBoundingClientRect();return{x:(t.clientX+e.clientX)/2-i.left,y:(t.clientY+e.clientY)/2-i.top}}}class qa extends pt{constructor(t){super(),this._dragging=!1,this._control=t}get control(){return this._control}get dragging(){return this._dragging}get startWhenCreated(){return!1}get cursor(){}canSwipe(){return!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._doCanceled()}finally{this.end()}}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)}}swipe(t,e,i){if(this._doSwipe(t,e,i))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,i){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_canAccept(t,e,i){return!0}_doCompleted(t,e,i){}_doEnded(t=-1,e=-1){}}class Ja extends qa{_doStart(t,e,i,s,r){return this.control.chartView().onRotationStart(),!0}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=n.scale;if(!(o>0))return!0;const a=2/(Math.PI*o);return n.rotationX+=(s-e)*a,n.rotationY-=(r-i)*a,!0}}class Qa extends qa{constructor(t){super(t);const e=t.model.body;this._oldX=e.panX,this._oldY=e.panY}_doStart(t,e,i,s,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=i,this.control.chartView().onScrollStart(),super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=n.clampPanY(this._oldY-(r-this._yStart)/n.scale);if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else{const t=n.clampPanX(this._oldX-(s-this._xStart)/n.scale);n.panX=t}return n.panY=o,!0}$_mapView(){return this.control.model.body}}class th extends ee{constructor(t,e=kt){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return th.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}th.IGNORE_ATTRS={width:"",height:""};class eh extends th{constructor(e,i){super(e,i),this.add(this._text=new Je(e,void 0)),this._text.anchor=t.TextAnchor.START}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.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Xi(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(e.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Je(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),i?this._icon||(this.add(this._icon=new Ha(t)),this._icon.url=i,this._icon.width=e.prop("width"),this._icon.height=e.prop("height")||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.prop("autoContrast")&&this._text.setContrast(t,this._model.prop("darkStyle")||"rm-label-dark",this._model.prop("lightStyle")||"rm-label-light"),this._outline&&this._outline.parent){const t=ot.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._text,i=this._outline,s=this._icon;let r=0;const n=e.bbox(),o=n.width,a=n.height;let h,l=o,c=a,d=0,_=0,u=0,p=0;if(this._box=void 0,s){const t=s.bbox();switch(r=k(this._model.prop("iconGap"),0),d=t.width,_=t.height,this._model.getIconPos()){case"left":case"right":l+=r+d,c=Math.max(_,a);break;default:c+=r+_,l=Math.max(d,o)}}if(this._back&&this._back.parent&&(h=getComputedStyle(this._back.dom),u=parseFloat(h.paddingLeft)||0,p=parseFloat(h.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(h.paddingRight)||0),c+p+(parseFloat(h.paddingBottom)||0),h.rx)),s)switch(this._model.getIconPos()){case"left":s.trans(u,(c-_)/2),u+=d+r,l-=d+r;break;case"right":s.trans(u+l-d,(c-_)/2),l-=d+r;break;case"top":s.transX((l-d)/2),p+=_+r;break;case"bottom":s.trans((l-d)/2,p+a+r)}switch(h||(h=getComputedStyle(e.dom)),h.textAlign){case"center":u+=l/2,e.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,e.anchor=t.TextAnchor.END;break;default:e.anchor=t.TextAnchor.START}return e.trans(u,p),i&&(i.anchor=e.anchor,i.setAttr("y",e.getAttr("y")),i.trans(u,p)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class ih extends qa{constructor(t,e,i,s){super(t),this.mode=i,this.shift=s,this._body=e}_doStart(t,e,i,s,r){const n=this.control.getBounds(),o=this._body.getBackBounds();this._xStart=p(0,e-o.x+n.x),this._yStart=p(0,i-o.y+n.y),this._body.addFeedback(this._feedback=new Xi(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new eh(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new eh(this.control.doc(),"rm-bounds-tracker-tag"));const a=new _i(this._body.chart());return a.init(),a.loadOptions({effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}),this._fromTag.setModel(document,a,null,null),this._toTag.setModel(document,a,null,null),!0}_hideFeedback(){this._feedback.remove(),this._fromTag.remove(),this._toTag.remove()}_doCompleted(t,e,i){const s=this.$_calcBound(e,i),{from:r,to:n}=this._body.boundsToMap(s,!1,!0);if("zoom"===this.mode)this._body.model.zoomToBounds(r,n);else{const t=this._body.firstMap;if(t){const e=t.chart(),i=t.getIntersectedAreas(this._feedback.dom);this.shift||e.selection.clear(),e.selection.add(t.model,i.map((t=>t.point)),!1)}}}_doDrag(t,e,i,s,r){const n=this.$_calcBound(s,r),{from:o,to:a}=this._body.boundsToMap(n,!1,!0),h=Ee.getFormatter(",0.000");return this._feedback.setRect(n),this._fromTag.setText(`(${h.toStr(o[0])}°, ${h.toStr(o[1])}°)`).layout(),this._fromTag.trans(n.x-this._fromTag.bbox().width/2,n.y-this._fromTag.bbox().height-4),this._toTag.setText(`(${h.toStr(a[0])}°, ${h.toStr(a[1])}°)`).layout(),this._toTag.trans(n.x+n.width-this._toTag.bbox().width/2,n.y+n.height+4),!0}$_calcBound(t,e){const i=this.control.getBounds(),s=this._body.getBackBounds(),r=this.control.width(),n=this.control.height();return t=p(0,u(r,t-s.x+i.x)),e=p(0,u(n,e-s.y+i.y)),{x:u(this._xStart,t),y:u(this._yStart,e),width:g(this._xStart-t),height:g(this._yStart-e)}}}class sh extends Ka{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){const s=this.$_chart();s.map&&s.hoverable()&&(this.dragging?this.dragTracker instanceof Qa&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target))}_doPointerUp(t){if(this._isTouch&&!this.control.dom().contains(t.target)){const{x:e,y:i}=this._pointerToPoint(t);this.$_chartView().pointerMoved(e,i,t.target)}return!0}_doClick(t){const e=this.$_chart(),i=t.target;e.clickable(!1)&&this.$_clickPanelButton(i)||e.clickable()&&(this.$_clickLegend(i)||i===this._clickElement&&this.$_clickBody(t,i))}$_clickPanelButton(t){const e=this.$_chartView().getButton(t);return!!e&&(e.click(),!0)}$_clickLegend(t){const e=this.$_chartView().legendByDom(t);return!!e&&(e.source instanceof ss||!e.source.canHide()||(e.source.visible=!e.source.visible),!0)}$_clickBody(t,e){const i=this.$_chart(),s=this.$_chartView(),r=t.shiftKey,n=L?t.ctrlKey:t.metaKey,o=i.general.prop("clickAction"),a=this._pointerToPoint(t),{x:h,y:l}=a;let c,d;if(a.x-=s.tx,a.y-=s.ty,c=s.seriesByDom(e))c.click(e,a);else if(d=s.creditByDom(e))d.click(e);else if(s.drilldownPanelView().click(e))return;switch(this._isTouch&&i.hoverable()&&"none"===o&&s.pointerMoved(h,l,e),o){case"select":(null==c?void 0:c.model.canSelect())&&c.pointByDom(e,a)?r&&!n?c.select(e,a,!1):c.toggleSelect(e,a,!n&&!r):d||i.selection.clear();break;case"drilldown":this.$_drildown(i,t,s)}s.click(t,e,c)}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView();if(!e.interactive())return;"drilldown"===e.general.prop("dblClickAction")&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart(),i=e.body;if(e.zoomable()){const e=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=k(Math.max(1,i.prop("wheelZoomFactor")),5);return i.zoomByFactor(-e/s,!1),t.preventDefault(),!0}}_isPinchTarget(t){const e=this.$_chartView();return this.$_chart().interactive()&&e.bodyView().dom.contains(t)}_doPinch(t,e,i){const s=this.$_chart().body,r=this.$_chartView().bodyView().transformInfo;r&&s.zoomAt(s.zoom*t,e-r.vx,i-r.vy)}_getDragTracker(t,e,i,s){const r=this.$_chart(),n=r.general.prop("dragAction"),o=r.dragAxes();if(o.x||o.y)return"zoom"===n||"select"===n?new ih(this.control,this.$_chartView().bodyView(),n,s):r.isGlobe?new Ja(this.control):new Qa(this.control)}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,i){const s=t.firstMapSeries;if(s){const r=this._pointerToPoint(e),n=e.target,o=i.bodyView().getSeries(s).pointByDom(n,r);o&&o.point instanceof ea&&t.drilldown(t.firstMapSeries,o.point.area.id)}}}class rh extends ee{constructor(t,e=kt){super(t,e,"g"),ee.DEBUGGING&&(this.add(this._debugRect=new Xi(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.internalSetStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),ee.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Xi(this.doc,"rm-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){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class nh extends rh{constructor(t,e,i){super(t,e),this._margins=new Gt,this._paddings=new Gt,this.add(this._background=new Xi(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const n=this._paddings;n.applyPadding(r);const o=this._doMeasure(t,e,i,s);if(o.width+=n.left+n.right,o.height+=n.top+n.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class oh extends th{measure(t,e,i,s){const r=this._doMeasure(t,e,i,s);return this.mw=r?r.width:0,this.mh=r?r.height:0,r}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}locateInner(t,e,i){return this._doLocateInner(t,e,i),this}}class ah extends eh{constructor(t){super(t,"rm-map-widget-title")}}class hh extends eh{constructor(t){super(t,"rm-map-widget-footer")}}class lh extends nh{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new ah(t)),this.add(this._footerView=new hh(t))}_setBackgroundStyle(t){t.setVisible(this.model.background.visible)&&t.internalSetStyleOrClass(this.model.background._style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.prop("text")),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class ch extends pt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDispose(){this._owner=null,this._creator=null,super._doDispose()}get owner(){return this._owner}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}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()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,n=this._views;for(let t of n)t.parent;for(t=Math.max(0,t);n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(s);n.push(e),i&&i(e,n.length-1,t)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._reversed?this._owner.insertFirst(t):this._owner.add(t),t}free(t,e=0){if(t){t.remove(),this._pool.push(t);const e=this._views.indexOf(t);e>=0&&this._views.splice(e,1)}}freeAll(t,e=0){for(let i of t)this.free(i,e)}clear(){this.freeAll(this._views)}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}find(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return e[i]}sort(t){const e=this._views.sort(t);return e.forEach((t=>t.remove())),e.forEach((t=>this._owner.add(t))),this}map(t){return this._views.map(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const i=this._views.indexOf(t);i>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(i,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._reversed?this._owner.insertFirst(e):this._owner.add(e),e}_getElementId(t){}}class dh extends rh{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new Xi(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Je(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.prop("markerVisible"))?this._marker.bbox():lt,n=ct(this._label.bbox());return this._gap=k(e.legend.prop("markerGap"),0),{width:r.width+this._gap+n.width,height:p(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=k(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.bbox().height)/2)}}class _h extends lh{constructor(t){super(t,_h.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new ch(this,dh)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.items(),n=this._vertical="vertical"===e.getLayout();this._ipr=k(e.prop("itemsPerLine"),Number.MAX_SAFE_INTEGER),n?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),this.$_prepareItems(t,r);const o=this.$_measure(t,e,n,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?o.height=Math.max(o.height,this._rTitle.height):o.width=Math.max(o.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?o.height=Math.max(o.height,this._rFooter.height):o.width=Math.max(o.width,this._rFooter.width)),o}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("sameTextColor"),s=this._sizes,r=t.prop("itemsAlign"),n=t.prop("lineGap")||0,o=t.prop("itemGap")||0,a=this._margins,h=this._paddings,l=this._vertical,c=this._titleView,d=this._footerView,_=this._rTitle,u=c.visible?_.height:0,p=c.visible?_.width:0,g=this._rFooter,m=d.visible?g.height:0,f=d.visible?g.width:0,b=d.visible?this._gapFooter:0;let y,w,x,v=a.left+h.left,S=a.top+h.top,C=this.width-v-a.right-h.right,P=this.height-S-a.bottom-h.bottom;if(c.visible)if(this._inTitle){switch(w=S,t.title.prop("verticalAlign")){case"top":break;case"bottom":w+=P-u;break;default:w+=(P-u)/2}c.trans(v,w),v+=p,C-=p}else{switch(t.title.prop("align")){case"center":y=Math.max(v,v+(C-_.width)/2);break;case"right":y=Math.max(v,v+C-_.width);break;default:y=v}c.trans(y,S),S+=u,P-=u}const M=v,L=S;if(d.visible){if(this._inFooter){switch(y=M+C-f,w=S,t.footer.prop("verticalAlign")){case"top":break;case"bottom":w+=P-m;break;default:w+=(P-m)/2}C-=f+b}else{switch(w=S+P-m,t.footer.prop("align")){case"center":y=Math.max(v,v+(C-g.width)/2);break;case"right":y=Math.max(v,v+C-g.width);break;default:y=v}P-=m+b}d.trans(y,w)}this._itemViews.forEach((t=>{var e;const s=t.model.source,r=s.legendColor();t._marker.setColor(r),null===(e=s.setLegendMarkerStyle)||void 0===e||e.call(s,t._marker),i&&s.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{if(l){const i=this._wMarkers;t.forEach((t=>{t.mw=s[e],t.resizeByMeasured().layout(i[e])})),S=L,"center"!==r&&"end"!==r||(x=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1),S+="center"===r?(P-x)/2:P-x),t.forEach((t=>{t.trans(v,S),S+=t.height+o})),v+=s[e]+n}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),v=M,"center"!==r&&"end"!==r||(x=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1),v+="center"===r?(C-x)/2:C-x),t.forEach((t=>{t.trans(v,S),v+=t.width+o})),S+=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.prop("itemGap")||0,l=e.prop("lineGap")||0,c=a.count,d=this._rowViews=[],_=this._sizes=[];let u,g,m,f;a.forEach(((i,s)=>{i.setMarker(o[s].source.legendMarker(t,+e.prop("markerSize")||zs.MARKER_SIZE)),i.measure(t,o[s],r,n)}));let b=0,y=0;if(i){for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),g=f.mh,y++,b++):(g+=h+f.mh,g<=n?(m.push(f),y++,b++):y=0);this._wMarkers=[],u=g=0,d.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=p(i,t.mw),r=p(r,t._rMarker.width),t._col=e})),s+=h*(t.length-1),g=p(g,s),u+=i,_.push(i),this._wMarkers.push(r)})),u+=l*(d.length-1)}else{for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),u=f.mw,y++,b++):(u+=h+f.mw,u<=r?(m.push(f),y++,b++):y=0);u=g=0,d.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=p(i,t.mh)})),e+=h*(t.length-1),u=p(u,e),g+=i,_.push(i)})),g+=l*(d.length-1)}return this._titleView.visible&&(this._inTitle?u+=this._rTitle.width:g+=this._rTitle.height),this._footerView.visible&&(this._inFooter?u+=this._rFooter.width+this._gapFooter:g+=this._rFooter.height+this._gapFooter),{width:u,height:g}}}_h.LEGEND_CLASS="rm-legend";const uh={};class ph extends nh{static register(...t){t.forEach((t=>{uh[t[0].type]=t[1]}))}constructor(t,e){super(t,ph.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,i){this.measure(this.doc,this.model,e,i),this._layoutView(t,0,0,e,i)}_layoutView(t,e,i,s,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,i,s,r,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._op.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._op.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}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(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)}}ph.CLASS_NAME="rm-annotation";class gh{static interpolate(t,e){if(e instanceof Vn==!1)return t;const i=[];let s=null,r=null,n=!1;for(let o=0;o<t.length;o++){const a=t[o],h=e.project(a);if(h.outside)n=!0;else{if(s||(s=a,t.push(a)),n&&r){const t=Rn(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,n=!1}}return i}}class mh{static box(t,e,i,s,r){const n=Math.floor(Math.abs(i-t)/20),o=this.boxPoints(t,e,i,s,n);return this.coordsToPath(mh.toPixelCoord(r,o))}static ellipse(t,e,i,s,r,n=40){const o=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,n);return this.coordsToPath(mh.toPixelCoord(r,o))}static geoCircle(t,e,i,s,r,n=!1,o=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,o);let h=this.toPixelCoord(r,a);return n&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Vn?gh.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let i=!1;for(const s of t){if(!!s.outside){i=!1;continue}const[t,r]=s;i?e.push("L",t,r):(e.push("M",t,r),i=!0)}return e}static horizontalLineToRight(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([n,t]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][0]===i||r.push([i,t]),r}static horizontalLineToLeft(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([n,t]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([t,n]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][1]===i||r.push([t,i]),r}static verticalLineToDown(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([t,n]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const n=[],[o,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),n.push(...this.horizontalLineToRight(h,o,a,r)),n.push(...this.verticalLineToUp(a,h,l,r)),n.push(...this.horizontalLineToLeft(l,o,a,r)),n.push(...this.verticalLineToDown(o,h,l,r)),n}static arcCoords(t,e,i,s,r,n,o,a=64){const h=2*Math.PI,l=n-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?o?-h:h:l;c||(o&&d>0&&(d-=h),!o&&d<0&&(d+=h));const _=d/a,u=[];for(let n=0;n<=a;n++){const o=r+_*n;u.push([t+Math.cos(o)*Math.abs(i),e+Math.sin(o)*Math.abs(s)])}return u}}class fh extends ne{renderLat(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([e,t]);if(a+=Vi(l)?`M${l[0]},${l[1]}`:"",o.latElliptic){const r=t=>{l=o.project(t),Vi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},n=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+n;for(;h<=i-n+1e-9;)r([h,t]),h+=n;e<i&&r([i,t])}else l=o.project([i,t]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLatGlobe(t,e,i,s,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=i;)o+=s,a=r.project([o,t]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([o,t]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}renderLon(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([t,e]);if(a+=Vi(l)?`M${l[0]},${l[1]}`:"",o.lonElliptic){const r=t=>{l=o.project(t),Vi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},n=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+n;for(;h<=i-n+1e-9;)r([t,h]),h+=n;e<i&&r([t,i])}else l=o.project([t,i]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLonGlobe(t,e,i,s,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=i;)o+=s,a=r.project([t,o]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([t,o]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}}class bh extends rh{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new ch(this,fh),this._lonPool=new ch(this,fh)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{mt.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{mt.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,e.x1),y1:Math.max(-90,e.y1),x2:Math.min(180,e.x2),y2:Math.min(90,e.y2),latStep:e.latStep,lonStep:e.lonStep}}_doMeasure(t,e,i,s){return ht.create(i,s)}_doLayout(t){const e=this.model,i=e.chart,s=e.line,r=e.lonLine,n=e.latLine,o=i.getProjection();o.second;const a=o.isGlobe,h=this._bounds;let l;mt.setImportantStyle(this.dom.style,"pointer-events","none"),mt.setImportantStyle(this.dom.style,"fill","none");const c=h.x1,d=h.x2;let _=h.latStep;if(l=i.axis.latInterval,a)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(n._style),t.renderLatGlobe(h.y1+e*_,c,d,l,o)}));else{const t=Math.ceil(h.y1/_)*_;this._latPool.forEach(((e,i)=>{const r=t+i*_;(e.visible=r<=h.y2&&r>=h.y1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(n._style),e.renderLat(r,c,d,l,o))}))}const u=h.y1,p=h.y2;if(_=h.lonStep,l=i.axis.lonInterval,a)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLonGlobe(h.x1+e*_,u,p,l,o)}));else{const t=Math.ceil(h.x1/_)*_;this._lonPool.forEach(((e,i)=>{const n=t+i*_;(e.visible=n<=h.x2&&n>=h.x1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(r._style),e.renderLon(n,u,p,l,o))}))}}}class yh extends ie{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new ie(t,"rm-axis-tick-labels")),this._labelPool=new ch(this._labelLayer,Je)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),n=e.getLatInterval(),o=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*n,h=1+((i.x2-i.x1)/o|0),l=1+((i.y2-i.y1)/a|0);let c=0;this._model=e,this._bounds=Object.assign({},i),this._topCount=this._bottomCount=this._rightCount=this._leftCount=0,e.visibleAt("top")&&(c+=this._topCount=h),e.visibleAt("bottom")&&(c+=this._bottomCount=h),e.visibleAt("right")&&(c+=this._rightCount=l),e.visibleAt("left")&&(c+=this._leftCount=l),this._labelLayer.setVisible(e.label.visible)&&this._labelPool.prepare(c,null,(t=>{t.internalResetStyleOrClass(s)}))}layout(t){if(this._model,this._labelLayer.visible){const e=0!=t.scroll?t.second:null,i=this._scale,s=this._bounds;let r,n,o,a,h,l=0,c=s.x1,d=s.y1;(n=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,n.forEach(((s,n)=>{o=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(o[0]*i,o[1]*-i),c+=r})),l+=this._topCount),(n=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._bottomCount),(n=this._labelPool.getRange(l,l+this._rightCount)).length>0&&(r=this._latStep,a=this._bounds.x2,h=Math.ceil(d/r)*r,e&&(a=-180+t.scroll,t=e),n.forEach(((e,s)=>{o=t.project([a,h]),e.text=h+"°",e.trans(o[0]*i-e.bbox().width/2,o[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(n=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._leftCount)}}}class wh extends rh{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new bh(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,n=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(r,n),this._gridView.measure(t,r,i,s)),ht.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.globalMapBound,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:n,y1:o,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:o,x2:n,y2:a,latStep:s,lonStep:i}}$_calcBoundary(t,e,i){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class xh extends eh{}class vh extends rh{constructor(t,e){super(t),this.add(this._pathView=new ne(t)),e.add(this._labelView=new xh(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof _r?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.prop("type"),s=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(e.label.prop("text")),"range"===i){const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(e,t,r),s.internalSetStyle("strokeWidth",`${i}px`)}else if("band"===i){o||(this.add(o=this._fromView=new ne(this.doc)),this.add(a=this._toView=new ne(this.doc))),o.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),o.internalSetStyle("fill","none"),o.internalSetStyle("transform",t.trans),a.internalSetStyle("fill","none"),a.internalSetStyle("transform",t.trans);const i=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.internalSetStyle("strokeWidth",`${i}px`),a.internalSetStyle("strokeWidth",`${i}px`),n=this.$_renderBand(e,t,r),s.internalSetStyle("stroke","none")}else{const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(e,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${i}px`)}s.setPath(n).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a,h;if("lat"===t.prop("axis")){const r=t.prop("position"),o=s.h1,a=s.h2;h=mh.horizontalLineToRight(r,o,a,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.prop("position"),a=s.v1,l=s.v2;h=mh.verticalLineToUp(n,a,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const l=r.second;return a=mh.coordsToPath(h.map((t=>r.project(t)))),l&&(a=[...a,...mh.coordsToPath(h.map((t=>l.project(t))))]),a}$_renderBand(t,e,i){const{prj:s}=e,r=s.second;let n=[];n="lat"===t.prop("axis")?this.$_renderBandLat(t,e,i):this.$_renderBandLon(t,e,i);let o=mh.coordsToPath(mh.toPixelCoord(s,n));return r&&(o=[...o,...mh.coordsToPath(mh.toPixelCoord(r,n))]),o}$_renderBandLon(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e,a=r.second;let h=[];const l=Math.min(t.prop("from"),t.prop("to")),c=Math.max(t.prop("from"),t.prop("to")),d=s.v1,_=s.v2;h.push(...mh.verticalLineToUp(l,d,_,n));const u=[...h],p=mh.verticalLineToDown(c,d,_,n);h.push(...p);let g=mh.coordsToPath(u.map((t=>r.project(t)))),m=mh.coordsToPath(p.map((t=>r.project(t))));return a&&(g=[...g,...mh.coordsToPath(u.map((t=>a.project(t))))],m=[...m,...mh.coordsToPath(p.map((t=>a.project(t))))]),this._fromView.setPath(g),this._toView.setPath(m),this.$_renderLonLabel(l,_,r,e.tf,i),h}$_renderBandLat(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e,a=r.second;let h=[];const l=Math.min(t.prop("from"),t.prop("to")),c=Math.max(t.prop("from"),t.prop("to")),d=s.h1,_=s.h2;h.push(...mh.horizontalLineToRight(l,d,_,n));const u=[...h];h.push(...mh.verticalLineToUp(_,l,c,o));const p=mh.horizontalLineToLeft(c,d,_,n);return h.push(...p),h.push(...mh.verticalLineToDown(d,l,c,o)),this.$_renderBandLatFromView(u,r,a),this.$_renderBandLatToView(p,r,a),this.$_renderLatLabel(d,c,e,i),h}$_renderBandLatToView(t,e,i){let s=mh.coordsToPath(t.map((t=>e.project(t))));i&&(s=[...s,...mh.coordsToPath(t.map((t=>i.project(t))))]),this._toView.setPath(s)}$_renderBandLatFromView(t,e,i){let s=mh.coordsToPath(t.map((t=>e.project(t))));i&&(s=[...s,...mh.coordsToPath(t.map((t=>i.project(t))))]),this._fromView.setPath(s)}$_renderRange(t,e,i){const{prj:s}=e,r=s.second;let n;const[o,a]=t.prop("from"),[h,l]=t.prop("to");if(t.prop("elliptic")){const t=[Math.min(o,h),Math.min(a,l)],e=Math.abs(h-o),i=Math.abs(l-a);n=mh.ellipse(t[0],t[1],e,i,s),r&&(n=[...n,...mh.ellipse(t[0],t[1],e,i,r)])}else n=mh.box(o,a,h,l,s),r&&(n=[...n,...mh.box(o,a,h,l,r)]);if(i.visible){const t=Math.min(o,h),r=Math.max(a,l),n=s.project([t,r]);n.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(n[0]*e.tf.scale+e.tf.tx,n[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return n}$_renderLatLabel(t,e,i,s){if(!s.visible)return;const{prj:r,map:n,tf:o}=i;let a=0,h=0;const l=s.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*s.scale+s.tx,o=c*-s.scale+s.ty+a.height/2,"line"===this.model.prop("type")?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}}class Sh extends th{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new Xi(t,"rm-crosshair-flag-back")),this.add(this._text=new Je(t))}prepare(t){this.internalResetStyleOrClass(t._style),this._back.internalResetStyleOrClass(t.prop("backgroundStyle"))}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,n,o){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(n-l.width,Math.max(0,o.tx+h[0]*o.scale-l.width/2)),Math.max(0,o.ty-a[1]*o.scale-l.height))}renderLatFlag(t,e,i,s,r,n){const o=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,n.tx+o[0]*n.scale-a.width),Math.max(0,Math.min(r-a.height,n.ty-o[1]*n.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(s.tx+o[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-o[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,n,o,a){const h=e.project([i,s]),l=e.project([o,s]),c=this.prepareLabel(t);this.trans(Math.min(r-c.width,Math.max(0,a.tx+h[0]*a.scale)),Math.max(0,Math.min(n-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class Ch extends rh{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new fh(t,"rm-crosshair-line")),this.add(this._lonLine=new fh(t,"rm-crosshair-line")),mt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),mt.setImportantStyle(this._latLine.dom.style,"fill","none"),mt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),mt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Sh(t)),this.add(this._lonFlag=new Sh(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.internalSetStyle("transform",e),this._lonLine.internalSetStyle("transform",e),this._latLine.internalSetStyle("strokeWidth",`${i}px`),this._lonLine.internalSetStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag),this._lonFlag.prepare(this.model.flag),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.globalMapBound,n=t[0],o=t[1],a=this._lonLine,h=this._latLine,l=this._lonFlag,c=this._latFlag,d="map"===i.axis.grid.fitTo,_=d?r.h1:-180,u=d?r.h2:180,p=d?r.v1:-90,g=d?r.v2:90;this._bounds={x1:_,x2:u,y1:p,y2:g};const m=[a,l,h,c],f=m.reduce(((t,e)=>t&&e.visible),!0);if(!(_<=n&&n<=u&&p<=o&&o<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(),y=b instanceof Vn?b:new b.constructor;y.offset=b.offset,this.$_renderLon(t,s.axis.lonInterval,e,y),this.$_renderLat(t,s.axis.latInterval,e,y)}$_renderLon(t,e,i,s){const r=this.model,n=r.chart.globalMapBound,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof Vn;_?l.renderLonGlobe(h,o,a,e,s):l.renderLon(h,o,a,e,s);const u=this.calcTopY(i,n,s,o),p=r.chart.getProjection().getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,n=r.chart.globalMapBound,o=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=s instanceof Vn;u?l.renderLatGlobe(h,o,a,e,s):l.renderLat(h,o,a,e,s);const p=u?90-s.rotationX:o,g=s.project(t),m=this.calcRightX(i,s,_,n,g[1]);u?c.renderGlobeLatFlag(d,s,p,h,_.width,_.height,m,i):c.renderLatFlag(d,s,p,h,_.height,i)}calcTopY(t,e,i,s){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let n=[NaN,NaN];const o=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?s:n[1]}calcRightX(t,e,i,s,r){const n=[(i.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?s.x2:o[0]}}const Ph="rm_map_globe_fill";class Mh extends ne{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,n){const o=e.map,a=this.parent,h=e.body.projection;o||this.setPath("");const l=e.body.mapBackground;let c;if(this.internalClearStyles(),a.isProjectionChanged&&this.transEx(0,0).scale(1),e.isGlobe)c=this.$_renderGlobeBg(t,l,c,r,n,i,s);else if(h.lonElliptic||h.latElliptic){const t=e.body.projection.getClipBounds(e.axis.lonInterval,e.axis.latInterval);c=`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`)),this.internalSetStyleOrClass(l._style)}else this.internalSetStyleOrClass(l._style),c=Fi.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof Vn)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,n,o){const a=e.prop("globeFill"),h=Math.max(s,r)/2;let l=!this.control.hasDef(Ph);return i=Fi.circle(n+h,o+h,h),a!==this._globeFill&&(this.control.removeDef(Ph),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${Ph})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:Ph,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new we(i).getElement(t,i)),this._globeFill=e}}class Lh extends ne{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){it.isNum(t)?this.setPath(Fi.line(t,e,i,s)):t&&this.setPath(Fi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(Fi.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(Fi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(Fi.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(Fi.line(e,t,i,t))}}class Ah extends ne{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){it.isNum(t[0])?this.setPath(Fi.lines(...t)):s(t[0])?this.setPath(Fi.lines3(...t)):this.setPath(Fi.lines2(...t))}}var kh;class Ih extends ch{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Eh extends eh{constructor(t){super(t,"rm-point-label")}}class Th extends ie{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new ch(this,Eh),new ch(this,Eh)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,n){var o,a;const h=zt(null===(o=r.chart)||void 0===o?void 0:o.general.prop("locale"))&&null!==(a=n.prop("textEn"))&&void 0!==a?a:n.prop("text"),{label:l,isCallbackExecuted:c}=r.getPointText(s,i,h);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),l?(n.prepareRich(l),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s),!c)):(e.setText(n.getText(n.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),n=this._labels,o=i.getLabeledPoints(),a=this._maps,h=s[0]._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);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.internalSetStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){if(!t)return;const i=this._maps[e];return i&&i[t.pid]}removePoint(t,e){for(let i=0;i<2;i++){const s=this.get(t,i);if(s)return void this._labels[i].removeLater(s,e)}}}class Nh extends th{constructor(t){super(t),this.add(this._line=new Ah(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new ne(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new ne(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.series,n=this._anchor,o=this._line;if(this._dummy.setPath(Fi.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),n.setVisible(t.anchorPoint.visible)){const s=Bh.getDrawer(t.series.getCalloutShape(e)),o=t.anchorPoint.prop("radius");n.internalClearStyleAndClass(),t.prop("useSeriesColor")&&n.internalSetStyleOrClass(r._style),n.internalSetStyleOrClass(t.anchorPoint._style),n.setPath(s(o,o)),n.trans(i[0],i[1])}return o.internalClearStyleAndClass(),t.prop("useSeriesColor")&&this._line.internalSetStyleOrClass(r._style),o.internalSetStyleOrClass(t._style),o.setLines(i,!1),s&&t.prop("usePointColor")&&(n.visible&&n.setFill(s),o.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Vh extends ae{constructor(t){super(t),this.add(this._back=new Xi(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new ne(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(Fi.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(Fi.rect(t).concat(Fi.rect(e))):this._mask.setPath(Fi.rect(t)),this}}class $h extends ie{constructor(t,e){super(t,e),this._callouts=new ch(this,Nh),this._map={},this.add(this._maskLayer=new ie(t)),this._masks=new ch(this._maskLayer,Vh),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,i=t.callout,s=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=i._style,a=this._map={};r.prepare(n.length,(t=>{})),s.prepare(n.length),n.forEach(((t,i)=>{const n=s.get(i);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(i).id}`),n.index=i,a[t.pid]=n)})),this.internalSetStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){if(t)return this._map[t.pid]}setMask(t,e){const i={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},s=this._masks.get(t.index);return s.setBackground(i),s}}class Rh extends oe{constructor(t,e=!1){super(t,Bh.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){Bh.seriesOf(this).setPointLabelVisible(this.point,!1)}return e}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const n=.35,o={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].x-t[r].x,y:t[r+1].y-t[r].y};let c={x:0,y:0},d=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=d,l.y/=d;let _=t[r+1].x-t[r].x,u=t[r].x,p=t[r].y;for(++r;r!=i;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].x-t[r].x,l.y=t[r+1].y-t[r].y,d=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=d,l.y/=d,l.x<h.x?(c.x=h.x-l.x,c.y=h.y-l.y):(c.x=l.x-h.x,c.y=l.y-h.y);const e=Math.sqrt(c.x*c.x+c.y*c.y);c.x/=e,c.y/=e,h.y*l.y>=0&&(c={x:1,y:0}),o.x=-c.x*_*n,o.y=-c.y*_*n;const i=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*n,a.y=c.y*_*n,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.internalSetStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.internalSetStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Dh extends ie{}const Oh={};class Bh extends rh{static register(...t){t.forEach((t=>{Oh[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof kh)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Fi[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,i,s){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,i,s)=>({x:t-i/2,y:e-s}),bottom:(t,e,i,s)=>({x:t-i/2,y:e}),center:(t,e,i,s)=>({x:t-i/2,y:e-s/2}),left:(t,e,i,s)=>({x:t-i,y:e-s/2}),right:(t,e,i,s)=>({x:t,y:e-s/2})},this._labelPositioner={bottom:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e+=r+n}),top:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=r+n+i.height}),right:(t,e,i,s,r,n)=>({x:t+=s+n,y:e-=i.height/2}),left:(t,e,i,s,r,n)=>({x:t-=s+n+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=i.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverPts=[],this._inRegion=!1,s&&this.addDom(this._defs=ee.createElement(t,"defs")),this.add(this._pointLayer=new ie(t)),this._pointLayer.add(this._pointContainer=new Dh(t,"rm-series-points")),this.add(this._calloutContainer=new $h(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}resolveBoundsClip(t,e,i,s,r){return t}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e,i){const s=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,r=this._labelContainer,n=this._calloutContainer;this._scroll=i,this.setModel(e),this.internalSetStyle("pointerEvents",e.isInteractive()?"":"none"),e instanceof aa?this.setData("index",e._seriesIndex%10):this.setData("index",e._seriesIndex%12),null==r||r.setVisible(e.isPointLabelsVisible()),n.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),r&&r.visible&&r.prepare(t,this),n.visible&&n.prepare(t,this)):(r&&r.visible&&(null==r?void 0:r.isEmpty())&&r.prepare(t,this),n.visible&&n.isEmpty()&&n.prepare(t,this)),isNaN(this._aniOpacity)||this.internalSetStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e,i){const s=this.model;if(this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),!(s instanceof aa)&&!s.isEmpty(!0)&&this.chart().animatable()){const t=s&&s.prop("loadAnimation"),e=!this.control.loaded&&this.chart().loadAnimatable();this._runShowEffect(t&&(e||s.dataLoaded||s.needAnimate)&&!s.isEmpty(!0))}s.dataLoaded=!1,s.needAnimate=!1}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t,e,i,s){var r;return null===(r=this._getPointPool())||void 0===r?void 0:r.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}defaultAnimation(){return"grow"}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))}pointByDom(t,e){return this._getPointPool().elementOf(t)}click(t,e){const i=this.pointByDom(t,e);if(i)i.point?!0!==this.model.pointClicked(i.point)&&this._doPointClicked(i):this._doPointClicked(i);else{const e=this.model.cluster;if(e&&e.isExpandable()){const e=this._clusterOfDom(Fh.isClusterView(t));if(e){const t=e._cluster.points;let i=t[0],s=i.lon,r=i.lon,n=i.lat,o=i.lat;for(let e=1;e<t.length;e++)i=t[e],s=u(s,i.lon),r=p(r,i.lon),n=u(n,i.lat),o=p(o,i.lat);const a=.1*(r-s),h=.1*(o-n);this.chart().body.zoomToBounds([s-a,n-a],[r+a,o+h])}}}}_clusterOfDom(t){}select(t,e,i){const s=this.pointByDom(t,e);s&&this.chart().selection.add(this.model,[s.point],i)}toggleSelect(t,e,i=!1){const s=this.pointByDom(t,e);if(s){const t=this.chart().selection;i&&!t.contains(s.point)?t.add(this.model,[s.point],!0):t.toggle(this.model,s.point)}}runPointAddAnimation(t){}setPointLabelVisible(t,e){const i=this._labelViews();if(!i)return;const s=i.get(t,0);s&&s.setVisible(e)}zoomChanged(t,e){}get growRate(){return this._growRate}_createLabelContainer(t,e){return new Th(t,e)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_addDef(t,e){const i=this.hash+e;return t.id=i,this._defs.append(t),t}_getPointPositioner(t,e){return this._pointPositioner[t]||this._pointPositioner[e]}_getLabelPositioner(t,e){return this._labelPositioner[t]||this._labelPositioner[e]}_labelViews(){return this._labelContainer.setVisible(this.model.isPointLabelsVisible()),this._labelContainer.visible?this._labelContainer:void 0}_calloutViews(){return this._calloutContainer.setVisible(this.model.isPointCalloutVisible()),this._calloutContainer.visible?this._calloutContainer:void 0}_getPointPool(){}_collectVisPoints(t){return t._visPoints}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,i){if(t.setAttrEx("aria-label",i.ariaHint()),t.internalClearStyleAndClass(),i._runColor)this._setPointColor(t,i._runColor);else{const s=e.getRangedColor(i);s&&this._setPointColor(t,s)}const s=e.getPointStyle(i);s&&t.internalSetStyleOrClass(s)}_doPointerMoved(t,e,i){return!1}_getGrowRate(){return k(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&it.log("CLICKED: ",t.point.name,t.point.getValue())}}kh=Bh,Bh.POINT_CLASS="rm-point",Bh.DATA_HOVER="hover",Bh.DATA_UNHOVER="unhover",Bh.LEGEND_MARKER="rm-legend-item-marker",Bh._drawers=Object.assign({circle:t=>Fi.circle(0,0,t)},kh._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Fh extends ee{static isClusterView(t){return mt.isChildOf(t,this.CLASS_NAME)}constructor(t){super(t,"rm-point-cluster"),this.add(this._shape=new ne(t)),this.add(this._label=new Je(t,"rm-point-cluster-label"))}setCluster(t){this._cluster=t}render(t,e){const i=[],s=b-.001;let r=0;this._cluster.points.forEach((t=>{t.moves>=1&&r++})),t--,i.push("M",t*d(0),t*_(0)),i.push("A",t,t,0,1,1,t*d(s),t*_(s)),t++,i.push("L",t*d(s),t*_(s)),i.push("A",t,t,0,1,0,t*d(0),t*_(0),"Z"),t-=3,i.push("M",t*d(0),t*_(0)),i.push("A",t,t,0,1,1,t*d(s),t*_(s)),t++,i.push("L",t*d(s),t*_(s)),i.push("A",t,t,0,1,0,t*d(0),t*_(0),"Z"),t-=2,i.push("M",t*d(0),t*_(0)),i.push("A",t,t,0,1,1,t*d(s),t*_(s),"Z"),this._shape.setPath(i.join(" ")),this._label.text=String(r),this._label.transY(-this._label.bbox().height/2),e&&this.internalSetStyle("fill",e)}}Fh.CLASS_NAME="rm-point-cluster";class zh extends Rh{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class jh extends Bh{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}}class Gh extends Rh{prepare(t,e){return this.point=t,this._ext=it.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Hh extends Bh{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.prop("minSize")}}}class Wh extends Gh{constructor(t){super(t,!0),this.add(this._contentLayer=new ie(t)),this.add(this._baseLine=new Lh(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class Yh extends Hh{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,k(t._minValue,i.min)),i.max=Math.max(i.max,k(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.prop("inverted");let r=s?e._height:e._width;const n=e.getPadding(r);this._ext.inverted=s,this._ext.pad=n,this._ext[s?"height":"width"]=r-2*n}}class Zh extends Rh{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class Uh extends Bh{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Xh extends ph{constructor(t){super(t,Xh.CLASS_NAME),this.add(this._imageView=new Ha(t)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.prop("imageUrl"),this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Xh.CLASS_NAME="rm-image-annotation";class Kh extends ph{constructor(t){super(t,Kh.CLASS_NAME),this.add(this._shapeView=new ne(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),Fi.setShape(this._shapeView,e.getShape(),r.width/2,r.height/2),r}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Kh.CLASS_NAME="rm-shape-annotation";class qh extends ph{constructor(e){super(e,qh.CLASS_NAME),this.add(this._textView=new Je(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ai}_doMeasure(t,e,i,s){const r=e.getSize(i,s),n=this._textView;e.prop("writingMode")&&this._textView.setStyle("writingMode",e.prop("writingMode")),e.prop("textOrientation")&&this._textView.setStyle("textOrientation",e.prop("textOrientation")),this._deflatePaddings(r),this._richText.setFormat(e.prop("text")),this._richText.build(n,i,s,null,e._domain);const o=ct(this._textView.bbox());return{width:k(r.width,o.width),height:k(r.height,o.height)}}_doLayout(t){this._richText.layout(this._textView,getComputedStyle(this._textView.dom).textAlign,this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}qh.CLASS_NAME="rm-text-annotation";class Jh{static reveal(t,e){new tl(t,e)}static grow(t,e){new il(t,e)}static spread(t,e){new sl(t,e)}static fadeIn(t){new Qh(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);window.Animation&&i instanceof Animation&&(i.addEventListener("finish",(()=>{t._animationFinished(i)})),t._animationStarted(i))}}class Qh extends Jh{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:$t.DURATION,fill:"none"})}}class tl extends Jh{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:$t.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,i){return e.dom.firstElementChild.animate([{width:"0"},{width:D(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:D(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class el extends $t{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof ee}_stop(){super._stop(),this._series=null}}class il extends el{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class sl extends el{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class rl extends ne{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(Fi.bar(t-i/2,e,i,-s,r,n))}}class nl extends Wh{constructor(t){super(t),this._groupCenter=null,this._bars=new ch(this._contentLayer,rl)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}getGroupCenter(){return this._groupCenter}render(t,e,i,s,r,n,o){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c,base:d}=t.getPointExtents(i,e),_=i.length,u=r/_,p=u*s.barWidth,g=s.barWidth>1&&!s.overflow,m=s.pad,f=c===l||isNaN(d)?0:(d-l)/(c-l)*n,b=n-f;let y=1/0,w=-1/0,x=1/0,v=-1/0,S=!1;this._bars.forEach(((e,s)=>{const d=i[s];if(e.setVisible(!isNaN(d))){const i=((c!==l?(d-l)/(c-l)*n:0)-f)*o;let _=m+u*s+(u-p)/2;g&&(_+p>m+r&&(_=m+r-p),_=Math.max(_,m)),e.setPath(Fi.bar(_,b,p,-i,0,0));const C=_+p/2,P=b-i/2,M=p/2,L=Math.abs(i)/2;C-M<y&&(y=C-M),C+M>w&&(w=C+M),P-L<x&&(x=P-L),P+L>v&&(v=P+L),S=!0,e.internalClearStyleAndClass(),a[s]&&a[s].color?e.setFill(a[s].color):h&&e.setFill(h[s%h.length]);const A=t._style;A&&"string"!=typeof A&&A.stroke&&e.setStroke(A.stroke)}})),this._groupCenter=S?{cx:(y+w)/2,cy:(x+v)/2,halfW:(w-y)/2,halfH:(v-x)/2}:null,this._renderBaseLine(t.baseLine,!1,this.width,b)}}class ol extends Yh{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._hoverBar=null,this._bars=new Ih(this._pointContainer,nl)}_getPointPool(){return this._bars}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,k(this.growRate,1))}_doReset(){this._hoverBar=null}_doPointerMoved(t,e,i){var s,r,n,o;const a=this._bars.elementOf(i)||null;if(a!==this._hoverBar&&((null===(s=this._hoverBar)||void 0===s?void 0:s.point)&&(null===(n=null===(r=this._labelContainer)||void 0===r?void 0:r.get(this._hoverBar.point,0))||void 0===n||n._text.restoreStyles()),this._hoverBar=a,null==a?void 0:a.point)){const t=this.model.pointLabel.prop("hoverStyle"),e=null===(o=this._labelContainer)||void 0===o?void 0:o.get(a.point,0);e&&t&&(e._text.saveStyles(),e._text.internalSetStyleOrClass(t))}return!0}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){const i=t.reversed;this._bars.prepare(e.length,((s,r)=>{const n=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,n)}))}$_layoutBars(t,e,i){const s=this.model,r=s.pointLabel,n=s._width,o=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=this._labelViews(),p=u&&s.subLabel.visible?s.subLabel:void 0,g=s.getCallout(),m=this._calloutViews(),f={pad:this._ext.pad,barWidth:s.prop("barWidth"),overflow:s.prop("overflow")};let b,y;this._bars.forEach(((t,e)=>{const r=t.point,w=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(b=l.getVisible(w)))){const e=this._getPointPositioner(r.position||d,"center"),x=t.getSizeRate(t._ext.max,h),v=this._ext.width*x,S=this._ext.height*x;let C,P,M,L,A,k;if(g&&(C=r.getCallout(w))&&(P=C.map((t=>l.project(t))),b=P[P.length-1]),r.xPos=M=b[0],r.yPos=L=b[1],M*=c[0],L*=c[1],y=e(M,L,n,o),t.resize(n,o),t.render(s,a&&h,r.values,f,v,S,i*r.vrate()),t.trans(y.x,y.y).rotate(this.rotation),u&&(A=u.get(r,0))&&A.setVisible(t._static)){const e=_(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,y,n,o,A,s.getLabelOff()))}if(p&&(A=u.get(r,1))&&A.setVisible(t._static)){const e=p.getPosition(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,y,n,o,A,s.getSubLabelOff()))}if(m&&P&&(k=m.get(r))&&k.setVisible(t._static)){const e=P.flat().map(((t,e)=>t*c[e%2]));m.setMask(k,e).setBounds(t.tx,t.ty,n,o),k.render(g,r,e,t.getFill())}}}))}$_resolveLabelPosition(t,e,i,s,r,n,o){const a=this._getLabelPositioner(e,"bottom");let h=i.x+s/2,l=i.y+r/2,c=s/2,d=r/2;if("center"===e||"top"===e||"bottom"===e){const e=t.getGroupCenter();e&&(h=i.x+e.cx,c=e.halfW,l=i.y+e.cy,d=e.halfH)}return a(h,l,n.bbox(),c,d,o)}}class al extends zh{tooltipColor(){return getComputedStyle(this.dom).fill}}class hl extends jh{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new Ih(t,al)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,k(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_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),i.prepare()}))}$_layoutMarkers(t,e,i){const s=(t,e,i)=>{t.setPath(p(e,e)),t.trans(i.x,i.y).rotate(l)},r=(t,e,i)=>{if(h instanceof Vn){const s=h.r,r=this.chart().width,n=i[1]*Math.PI/180,o=e/2*(360/r),a=o/Math.cos(n),l=o;h.r=Tn*this._scale;const c=mh.geoCircle(i[0],i[1],a,l,h,!0);h.r=s,t.setPath(c),t.trans(0,0).rotate(0)}else s(t,e,S)},n=this.model,o=n.pointLabel,a=n.chart,h=a.getProjection(),l=+n.prop("rotation")||0,c=[this._scale,-this._scale],d=n.prop("position"),_=this._getLabelPositioner(n.subLabel.prop("position"),"right"),p=Bh.getDrawer(n.getShape()),g=this._labelViews(),m=n.getLabelOff(),f=n.getSubLabelOff(),b=n.getCallout(),y=this._calloutViews(),{min:w,max:x}=n.getPixelMinMax(u(a.width,a.height));let v,S;const C=o.getPosition;this._markers.forEach(((t,e)=>{const o=t.point,a=[o.lon,o.lat];if(t.setVisible(!o.isNull&&null!=(v=h.getVisible(a)))){const e=this._getPointPositioner(o.position||d,"center");let l,u,p,P,M,L,A=(t._radius=n.getRadius(o.getValue(),w,x))*o.vrate()*i;if(b&&(l=o.getCallout(a))&&(u=l.map((t=>h.project(t))),v=u[u.length-1]),o.xPos=p=v[0],o.xPos=P=v[1],p*=c[0],P*=c[1],S=e(p,P,2*A,2*A),S.x+=A,S.y+=A,this.model.alignToSurface?r(t,A,a):s(t,A,S),g){if(M=g.get(o,0)){let e=this._getLabelPositioner(C(o),"center");this._layoutLabel(M,t.dom).transp(e(S.x,S.y,M.bbox(),A,A,m))}(M=g.get(o,1))&&this._layoutLabel(M,t.dom).transp(_(S.x,S.y,M.bbox(),A,A,f))}if(y&&u&&(L=y.get(o))&&L.setVisible(t._static)){const e=u.flat().map(((t,e)=>t*c[e%2]));y.setMask(L,e).setCircle(e[e.length-2],e[e.length-1],A),L.render(b,o,e,t.getFill())}}}))}}class ll extends ne{static create(t,e,i,s,r,n,o,a,h=!0){return new ll(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,n,o,a,h,l=!0){return new ll(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=kt,i=kt){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 Fi.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 Fi.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 cl=function(t){return isNaN(t)?0:t};class dl{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return o(t)?this._path.push("M",cl(t),cl(e)):this._path.push("M",cl(t.x),cl(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",cl(t),cl(e)):this._path.push("m",cl(t.x),cl(t.y)),this}movep(t,e){return o(t)?this._path.push("M",O(t),O(e)):this._path.push("M",O(t.x),O(t.y)),this}line(t,e){return o(t)?this._path.push("L",cl(t),cl(e)):this._path.push("L",cl(t.x),cl(t.y)),this}linep(t,e){return o(t)?this._path.push("L",O(t),O(e)):this._path.push("L",O(t.x),O(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",cl(t[e]),cl(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",cl(t[e].x),cl(t[e].y));return this}polygon(...t){return this.lines(...t),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}}class _l extends ne{render(t,e){const i=t.getExtents(e);if(i.radius!==this._radius||i.length!==this._length||i.offset!==this._offset){const t=this._radius=i.radius,e=this._offset=i.offset;if(this._length=i.length,this._radius>0&&this._length>0){const i=new dl;i.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(i.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let ul=class extends ne{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new dl).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class pl extends Zh{constructor(t){super(t),this.add(this._faceView=new ll(t,"rm-circle-gauge-face")),this.add(this._rimView=new ll(t,"rm-circle-gauge-rim")),this.add(this._valueView=new ll(t,"rm-circle-gauge-value")),this.add(this._textView=new Je(t,"rm-circle-gauge-text")),this.add(this._handContainer=new ie(t))}prepare(t,e){this._faceView.setVisible(e.face.visible),this._rimView.setVisible(e.rim.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new _l(t,"rm-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new ul(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=u(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.prop("clockwise")}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const n=t._props,o=s.getValue(),a=t.getValueRate(o)*r,h=t.valueRim.getThickness(i.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,r=i.value+(s.prop("stroked")?0:h/2),o=this._valueView;o.internalResetStyleOrClass(s._style),s.prop("stroked")&&(o.setFill("none"),o.internalSetStyle("strokeWidth",D(h))),o.setBoolData("stroked",s.prop("stroked")),o.setSectorEx({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:(r-h)/r,start:n._startRad,angle:n._sweepRad*a,clockwise:t.prop("clockwise")},s.prop("stroked"))}if(l.visible){const i=t.gaugeLabel;l.text=i.getNumberText(o,!1,!1,void 0),i.buildSvg(l,null,NaN,NaN,t,i._domain);const s=l.bbox(),r=i.getOffset(this.width,this.height);l.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class gl extends Uh{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new Ih(t,pl)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height,1)}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.prop("position"),h=this._labelViews(),l=s.getLabelOff(),c=s.getCallout(),d=this._calloutViews(),_=r.getPosition;let u,p,g;this._gauges.forEach(((r,m)=>{const f=r.point,b=[f.lon,f.lat];if(r.setVisible(!f.isNull&&null!=(u=n.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"top");let y,w,x,v,S,C;if(c&&(y=f.getCallout(b))&&(w=y.map((t=>n.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=o[0],v*=o[1],r.render(s,t,e,i*f.vrate()),p=r._size,g=m(x,v,p,p),r.trans(g.x,g.y),h&&(S=h.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(S,r.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,l))}d&&w&&(C=d.get(f))&&C.setVisible(f._isStatic())&&C.render(c,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}class ml extends ee{constructor(t,e,i,s,r){super(t,e,"circle"),"number"==typeof i&&this.setCircle(i,s,r)}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class fl extends $t{constructor(t,e){super(),this.view=t,this.gauge=e}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.gauge,this.view._exts),!0}}class bl extends Zh{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new ml(e,"rm-clock-gauge-face")),this.add(this._rimView=new ll(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Je(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new ie(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new ie(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new ne(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new ne(e,"rm-clock-gauge-minute")),this.add(this._secondView=new ne(e,"rm-clock-gauge-second")),this.add(this._pinView=new ml(e,"rm-clock-gauge-pin")),this._tickViews=new ch(this._tickContainer,Lh,"rm-clock-gauge-tick"),this._tickLabelViews=new ch(this._tickLabelContainer,Je,"rm-clock-gauge-tick-label")}prepare(e,i){const s=Math.round(12/p(1,Math.floor(i.tickLabel.prop("step"))||1));this._tickViews.prepare(i.tick.visible?12:0),this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=i.prop("timezoneCallback")}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.prop("active")&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),g(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.prop("animatable")&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.prop("length")||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-c/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-c;let g=p-u,m=y,f=b/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+d(m)*p,h+_(m)*p,a+d(m)*g,h+_(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,i=b/12*e;m=y,n.get(0).text="12",g=p-(u+t.tickLabel.prop("offset")||0),g-=.5*n.get(0).bbox().height,n.forEach(((s,r,n)=>{s.text=String(0===r?12:r*e),s.trans(a+d(m)*g,h+_(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.prop("radius")||2),o.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.prop("position")?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=I(t.timezone,null===(e=this._zoneCallback)||void 0===e?void 0:e.call(this,t.coord[0],t.coord[1]),60*Math.round(t.coord[0]/15)),r=i.getMinutes()+i.getTimezoneOffset()+s;i.setMinutes(r)}return i}$_renderHands(t,e){const i=this.$_getNow(this.point),s=i.getHours(),r=i.getMinutes(),n=i.getSeconds(),o=s>=12,{cx:a,cy:h,rd:l}=e,c=new dl;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=b*(s/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*x)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=b*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*x)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?b*(this._aniSec+this._secRate)/60:b*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*x),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new fl(this,t);i.duration=t.secondHand.prop("duration")||200,i.start()}}}class yl extends Uh{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new Ih(t,bl)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=i.pointLabel,r=this.model.chart.getProjection(),n=[this._scale,-this._scale],o=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),d=s.getPosition;let _,p,g;this._gauges.forEach(((s,m)=>{const f=s.point,b=[f.lon,f.lat];if(s.setVisible(!f.isNull&&null!=(_=r.getVisible(b)))){const m=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C;if(l&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),_=w[w.length-1]),f.xPos=x=_[0],f.yPos=v=_[1],x*=n[0],v*=n[1],s.render(i,t,e),p=u(t,e),g=m(x,v,p,p),s.trans(g.x,g.y),a&&(S=a.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(d(f),"bottom");this._layoutLabel(S,s.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,h))}c&&w&&(C=c.get(f))&&C.setVisible(f._isStatic())&&C.render(l,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}class wl extends Rh{constructor(t){super(t,!0),this.add(this._back=new ie(t)),this._back.add(this._figure=new re(t)),this._back.add(this._textView=new eh(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,n=s.prop("text");this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=ee.createElement(t,"use"),this._textView.dom),mt.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!n)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(n),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t,e){const i=this._image,s=this._textView,r=this._rBox=this._figure.bbox();if(this._aniScale(this._back,e),i){const t=i.getBBox();let e,s,n,o;t.width>r.width?(e=(t.width-r.width)/2,r.width=t.width):n=(r.width-t.width)/2,t.height>r.height?(s=(t.height-r.height)/2,r.height=t.height):o=(r.height-t.height)/2,mt.setAttrs(this._figure.dom,{x:e,y:s}),mt.setAttrs(i,{x:n,y:o})}if(s.visible){const t=s.bbox(),e=mt.getPadding(s._text.dom),i=r.width-e.left-e.right,n=r.height-e.top-e.bottom;s.trans(e.left+(i-t.width)/2,(n-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class xl extends Bh{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new Ih(this._pointContainer,wl)}$_createFigure(t){const e=ee.createElement(t,"symbol");return e.append(ee.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=ee.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const r=e.figureBox,n=e.innerImage;mt.setAttr(this._figure,"viewBox",r?`0 0 ${r[0]} ${r[1]}`:null),mt.setAttr(this._figure.firstElementChild,"d",s(e.path)?e.path.join(" "):e.path),mt.setAttrs(this._image,{href:n.prop("url"),width:n.prop("width"),height:n.prop("height")}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutFigures(t)}$_prepareFigures(t,e){const i=t.chart.isDirty,s=e.length,r={id:`#${this._figure.id}`,...t.getFigureSize()},n=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,o=t.innerLabel;this._pointContainer.setFill(t._runColor),this._figures.prepare(s,((s,a)=>{const h=s.point=e[a];this._setPointStyle(s,t,h),i&&s.prepare(this.doc,r,n,o)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(),i=this.model,s=i.pointLabel,r=[this._scale,-this._scale],n=+i.prop("rotation")||0,o=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=l&&"label"===l.prop("mode"),d=this._calloutViews(),_=s.getPosition,u=i.innerImage.prop("minSize"),p=i.getValueRange();let g,m;this._figures.forEach(((i,s)=>{const f=i.point,b=[f.lon,f.lat];if(i.setVisible(!f.isNull&&null!=(g=e.getVisible(b)))){const s=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C,P,M;l&&(y=f.getCallout(b))&&(w=y.map((t=>e.project(t))),c||(g=w[w.length-1])),f.xPos=x=g[0],f.yPos=v=g[1],x*=r[0],v*=r[1];const L=isNaN(u)?1:(f.value-p.min)/(p.max-p.min);if(i.render(L,t),P=i._rBox,m=s(x,v,P.width,P.height),i.trans(m.x,m.y).rotate(n),a&&(S=a.get(f,0))&&S.setVisible(i._static))if(this._layoutLabel(S,i.dom),M=S.bbox(),c&&w){const t=w.flat().map(((t,e)=>t*r[e%2])),e=this._getLabelPositioner("center","center");S.transp(e(t[t.length-2],t[t.length-1],M,0,0,h))}else{const t=this._getLabelPositioner(_(f),"bottom");S.transp(t(m.x+P.width/2,m.y+P.height/2,M,P.width/2,P.height/2,h))}if(d&&w&&(C=d.get(f))&&C.setVisible(i._static)){const t=w.flat().map(((t,e)=>t*r[e%2]));P.x=i.tx,P.y=i.ty,M&&(M.x=t[t.length-2],M.y=t[t.length-1]),d.setMask(C,t).setRects(P,M),C.render(l,f,t,i.getFill())}}}))}}class vl extends Rh{constructor(t){super(t,!0),this.add(this._imageView=new Ha(t))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Sl extends Bh{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new Ih(this._pointContainer,vl)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.prop("imageWidth"),s=t.prop("imageHeight");this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),i,s),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=+e.prop("rotation")||0,n=[this._scale,-this._scale],o=e.prop("position"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews(),d=i.getPosition;let _,u;this._images.forEach(((e,i)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(_=s.getVisible(g)))){const i=this._getPointPositioner(p.position||o,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>s.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=n[0],y*=n[1],e.render(t),v=e._rBox,u=i(b,y,v.width,v.height),e.trans(u.x,u.y).rotate(r),h&&(w=h.get(p,0))&&w.setVisible(e._static)){const t=this._getLabelPositioner(d(p),"bottom");w.layout().transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,a))}if(c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*n[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}class Cl{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:$t.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:D(t.width)}],this.$_aniOptions())}}let Pl=class extends Wh{constructor(t){super(t),this._contentLayer.addAll(this._back=new Xi(t),this._area=new ne(t,"rm-line-series-area"),this._line=new ne(t,"rm-line-series-line"),this._lowLine=new ne(t))}render(t,e,i,s,r,n){const{min:o,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,o,a,s,r,n),c=i.length,d=c>2&&t.prop("curved"),_=new dl;if(this.resize(s,r),this._back.setVisible(!1)&&(this._back.resize(s,r),this._back.setStroke("none")),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}if(this._line.setPath(_.end()),this._area.setVisible(t.area.visible)){if(this._area.internalResetStyleOrClass(t.area._style),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}_.line(l[c-1].x,r),_.line(l[0].x,r),this._area.setPath(_.end(!0))}this._renderBaseLine(t.baseLine,!1,s,r)}$_getPts(t,e,i,s,r,n){const o=t.length,a=[];let h=.05*s,l=.1*r;const c=i-e;s-=.1*s,r-=.2*r;for(let i=0;i<o;i++){const d=t[i],_=h+i/(o-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*n-e)/c)*r);a.push({x:_,y:u})}return a}};class Ml extends Yh{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new Ih(this._pointContainer,Pl)}_getPointPool(){return this._lines}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,k(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Cl(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=s.pointLabel,n=s._width,o=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews();let f,b;this._lines.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"top"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let S,C,P,M,L,A;if(g&&(S=r.getCallout(y))&&(C=S.map((t=>l.project(t))),f=C[C.length-1]),r.xPos=P=f[0],r.yPos=M=f[1],P*=c[0],M*=c[1],b=e(P,M,x,v),t.render(s,a&&h,r.values,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),p&&(L=p.get(r,0))&&L.setVisible(t._static)){const t=this._getLabelPositioner(_(r),"bottom");L.layout().transp(t(b.x+x/2,b.y+v/2,L.bbox(),x/2,v/2,u))}if(m&&C&&(A=m.get(r))&&A.setVisible(t._static)){const e=C.flat().map(((t,e)=>t*c[e%2]));m.setMask(A,e).setBounds(t.tx,t.ty,n,o),A.render(g,r,e,t.getFill())}}}))}}class Ll{static interpolate(t,e){const i=Math.max(1,Math.ceil(Math.abs(e-t))),s=[];for(let r=0;r<=i;r++)s.push(t+(e-t)*r/i);return s}}const Al="rm-map-series-id-";class kl extends Rh{static idClass(t){return Al+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Al))return e.substring(17)}constructor(t){super(t)}setModel(t){var e;t!==this.model&&(this.setPath((this.model=t).path),this.setAttrEx("fill-rule",(null===(e=t.source)||void 0===e?void 0:e.holes)?"evenodd":null))}render(t,e,i,s,r,n){var o;const a=this.point;if(r){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.internalSetStyleOrClass(e);else{const e=!this.point||a.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(kl.idClass(this.model))}a&&(a.isSelected()&&!this.hasSavedStyles()?(this.saveStyles(),this.internalSetStyles({strokeWidth:"var(--rm-map-series-selected-stroke-width)",filter:"var(--rm-map-series-selected-filter)"}),this.internalSetStyleOrClass(i),this.strokeView||(this.strokeView=new Il(this.doc,s)),this.strokeView.render(this,i),this.strokeView.attachToOwner()):a.isSelected()||!this.hasSavedStyles()||n||(this.restoreStyles(),null===(o=this.strokeView)||void 0===o||o.detachFromOwner()))}reset(){this.model=null}}class Il extends ne{constructor(t,e){super(t,"rm-map-series-hover"),this._owner=e}render(t,e){this._area=t;const i=t.dom,s=e&&"string"==typeof e;this.copyPath(),s?this.internalSetStyleOrClass(e):this.internalSetStyles({stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,filter:i.style.filter}),t.internalSetStyles({stroke:"none",strokeWidth:"0"})}refresh(){this._area&&this.copyPath()}attachToOwner(){this._owner.add(this)}detachFromOwner(){this._owner.removeChild(this)}_doInitStyles(){super._doInitStyles(),this.setClass("rm-point"),this.setAttr("vector-effect","non-scaling-stroke"),this.setBoolData("virtual",!0),this.ignorePointer()}copyPath(){this.setPath(this._area.path())}}class El extends ne{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Tl extends ne{constructor(t){super(t,"rm-map-series-border")}setModel(t){t!==this.model&&(this.model=t,this.setPath(t.getPath()))}reset(){this.model=null}}class Nl extends ne{constructor(t){super(t,"rm-map-series-inset")}get center(){if(!this._center){const t=this._pts;let e=t[0][0],i=t[0][1],s=e,r=i;for(let n=1;n<t.length;n++)e=u(e,t[n][0]),s=p(s,t[n][0]),i=u(i,t[n][1]),r=p(r,t[n][1]);this._center=[e+(s-e)/2,i+(r-i)/2]}return this._center}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=this._pts=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);this._pts=[n],i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`,this._pts.push(n);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class Vl extends eh{constructor(t){super(t,"rm-point-label rm-point-inset")}}class $l extends ie{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new ch(this,Vl),new ch(this,Vl)],this._maps=[new Map,new Map],this.ignorePointer()}get(t,e){const i=this._maps[e];return i&&i.get(t)}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}prepare(t,e){const i=e.model,s=i.insetLabel,r=i.map._insets;if(this.visible&&r&&r.length>0){const e=i.getPointLabels(),n=i.pointLabelCount(),o=this._labels,a=this._maps;o[0].prepare(r.length),a[0].clear(),o[1].prepare(n>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{for(let h=0;h<n;h++){const n=o[h].get(r);n.setVisible(!0)&&(this.$_prepareInsetLabel(t,n,e[h],s,i),a[h].set(i,n))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const n=s.getInsetText(r);e.setModel(t,s,null,null),e._text.internalResetStyleOrClass(i._style),e._text.internalResetStyleOrClass(s._style),e._text.internalSetStyleOrClass(s.getInsetLabelStyle(r)),n?(i.prepareRich(n),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class Rl extends Bh{constructor(t){super(t,"rm-map-series",!0,!1),this._boundsClip=null,this._areas={},this._insetLabelContainer=new $l(t),this._areaPool=new Ih(this._pointContainer,kl),this._insetPool=new ch(this._pointContainer,Nl),this._hoverStrokeView=new Il(t,this._pointContainer)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e;let i=t;const s=this._hoverArea;if(i&&(null===(e=i.model)||void 0===e?void 0:e.selected)&&(i=null),i!==s){const t=this.model;if(s){const t=this.getPointLabel(s);s.restoreStyles(),null==t||t._text.restoreStyles(),this._hoverStrokeView.detachFromOwner()}if(!i||i.point||t.prop("nullHovering")||(i=void 0),this._hoverArea=i,i){const t=this.getPointLabel(i);i.saveStyles(),null==t||t._text.saveStyles(),this.setHoverStyle(i,t),this._hoverStrokeView.render(i,this.model.prop("hoverStyle")),this._hoverStrokeView.attachToOwner()}i!=s&&t.chart._hoverAreaChanged(t,null==i?void 0:i.model,null==s?void 0:s.model)}}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=this.dom.contains(e)&&kl.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}getIntersectedAreas(t){const e=[];return this._areaPool.forEach((i=>{mt.isIntersectRectPath(t,i.dom,.4)&&e.push(i)})),e}needClip(){return!0}resolveBoundsClip(t,e,i,s,r){var n,o,a;const h=this.model.map,l=null==h?void 0:h.source;if(!(l instanceof In&&l.bounds)||h.isWorld)return null===(n=this._boundsClip)||void 0===n||n.remove(),this._boundsClip=null,t;if(r.isGlobe)return null===(o=this._boundsClip)||void 0===o||o.remove(),this._boundsClip=null,t;const c=h.h1,d=h.v1,_=h.h2,u=h.v2,p=(t,n)=>{const[o,a]=r.project([t,n]);return[o*e+i,-a*e+s]},g=[];Ll.interpolate(c,_).forEach((t=>g.push(p(t,u)))),Ll.interpolate(u,d).slice(1).forEach((t=>g.push(p(_,t)))),Ll.interpolate(_,c).slice(1).forEach((t=>g.push(p(t,d)))),Ll.interpolate(d,u).slice(1).forEach((t=>g.push(p(c,t))));const m=`M${g[0][0]},${g[0][1]} `+g.slice(1).map((t=>`L${t[0]},${t[1]}`)).join(" ")+" Z";return this._boundsClip&&this._boundsClip.dom.parentElement?this._boundsClip.setPath(m):(null===(a=this._boundsClip)||void 0===a||a.remove(),this._boundsClip=this.control.clip(new ce(this.doc).setPath(m))),this._boundsClip}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e,i){super.prepareModel(t,e,i);const s=this._insetLabelContainer;s.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?s.visible&&s.prepare(t,this):s.visible&&!s.isEmpty&&s.prepare(t,this)}_doPrepeare(t,e,i){const s=e.map,r=e.internalBorder._style,n=e.externalBorder._style,o=e.getMapBorders(),a=e.prop("bringToFront")?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new ie(t,"rm-map-series-internals")),this._internalPool=new ch(this._internalContainer,El)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new ie(t,"rm-map-series-externals")),this._externalPool=new ch(this._externalContainer,El)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&o.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new ie(t,"rm-map-series-borders")),this._borderPool=new ch(this._borderContainer,Tl))),this._areaPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i),r=t.point=e.pointOf(s);t.setModel(s),r?(s.dummy||this._setPointStyle(t,e,r),a&&a.push(t)):t.internalClearStyleAndClass(),mt.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),mt.setNoScale(t.dom),t.internalSetStyleOrClass(r)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"external"),mt.setNoScale(t.dom),t.internalSetStyleOrClass(n)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(o.length,((t,e)=>{const i=o[e];t.setModel(i),mt.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),a&&a.length!==e.areaCount&&a.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{mt.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){return this.hoverArea=this.areaOfDom(i),!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){super.onScrollEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}onRotationStart(){super.onRotationStart(),this.hoverArea=null}onRotationEnd(){super.onRotationEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}$_layoutAreas(t,e){const i=this.chart(),s=i.isDirty,r=i.body,n=this.model,o=n.map,a=i.getProjection(),h=this._areas={},l=this._insets,c=n.prop("allAreas"),d=this._labelViews(),_=this._insetLabelContainer.visible?this._insetLabelContainer:null,u=n.insetLabel,p=n.prop("nullStyle"),g=n.prop("dummyStyle"),m=n.prop("selectStyle")||n.prop("selectedStyle"),f=this._scale,b=this._areaPool;b.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,o=d&&e&&d.get(e,0);if(h[i.id]=t,t.setVisible(i.visible&&(c||!!e)&&!n.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(p,g,m,this._pointContainer,s,a),o){const i=r.toVisible(n.getCenter(e));if(o.setVisible(!!i)){s&&this._layoutLabel(o,t.dom);const r=o.bbox();let[n,a]=i;e.xPos=n,e.yPos=a,n*=f,a*=-f,n-=r.width/2,a-=r.height/2,o.trans(n,a)}}}else o&&o.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=l[e];if(t.setVisible(!1!==i.visible)){const e=h[i.area],l=_&&!u.hideInsetLabel(i)&&_.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(d&&(c=d.get(e.point,0),c&&n.isPointLabelVisible(e.point))){const t=n.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const o=r.toVisible(t);s&&this._layoutLabel(c,e.dom);const a=c.bbox();if(c.setVisible(!!o)){let[t,e]=o;t*=f,e*=-f,t-=a.width/2,e-=a.height/2,c.trans(t,e)}}t.render(i,a)}}else{const e=i._base;if(e)if(e[0]instanceof Fn){for(const t of e){if(!t.visible||n.isHiddenArea(t.id))return;if(d){const e=h[t.id];if(c=e&&d.get(e.point,0),c&&c.visible){const t=n.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const o=r.toVisible(t);s&&this._layoutLabel(c,e.dom);const a=c.bbox();if(c.setVisible(!!o)){let[t,e]=o;t*=f,e*=-f,t-=a.width/2,e-=a.height/2,c.trans(t,e)}}}}t.render(i,a)}else if(e[0]>=0){const e=o.areaOf(i._parent);e&&e.visible&&!n.isHiddenArea(e.id)&&t.render(i,a)}}if(l&&l.setVisible(!c)){s&&l.layout();const e=t.center,i=l.bbox();let[r,n]=e;r*=f,n*=-f,r-=i.width/2,n-=i.height/2,l.trans(r,n)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const i=this.model.prop("hoverColor"),s=this.model.prop("hoverStyle");t.internalSetStyles({filter:Rl.DefaultHoverFilter,strokeWidth:Rl.DefaultHoverStrokeWidth}),t.internalSetStyleOrClass(s),i&&t.internalSetStyle("fill",i),t.point||t.internalSetStyles({fill:"var(--rm-null-area-fill)",stroke:"var(--rm-null-area-stroke)"});const r=this.model.pointLabel.prop("hoverStyle");r&&(null==e||e._text.internalSetStyleOrClass(r))}}Rl.DefaultHoverFilter="var(--rm-map-series-hover-filter)",Rl.DefaultHoverStrokeWidth="var(--rm-map-series-hover-stroke-width)";class Dl extends rh{constructor(t,e,i){super(t,e),this._paddings=new Gt,this.add(this._background=new ne(t,i)),this.add(this._textView=new Je(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const n=e.prop("text");n?(e.prepareRich(n),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.prop("backgroundStyle");r(a)&&(a=a(e.series.getPointArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(e){const i=this._textView,s=this.width;let r=0;this._renderBackgrouond(this._background,s,this.height,e);switch(getComputedStyle(i.dom).textAlign){case"center":r+=s/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=s,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}i.trans(r,this._paddings.top)}}class Ol extends Dl{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Fi.bar(0,i,e,-i,s,0))}}class Bl extends Dl{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Fi.bar(0,i,e,-i,0,s))}}class Fl extends Rh{constructor(t){super(t,!0),this.add(this._back=new ie(t)),this._back.addAll(this._borderView=new Xi(t),this._headerView=new Ol(t),this._bodyView=new Bl(t),this._divider=new Lh(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,n){const o=this.point,a=e.header,h=e.body,l=this._headerView,c=this._bodyView,d=this._divider;let _,u;l.setVisible(a.visible)&&(l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(o).measure(t,h,i,s);let p=u.width,g=u.height;l.visible&&(p=Math.max(p,_.width),g+=_.height);const m=e.getExtents(p,g);l.visible&&(l.resize(m.width,_.height),l.layout(r),d.setVisible(e.divider.visible)&&(d.trans(0,_.height),d.setHLine(0,0,m.width))),c.resize(m.width,m.height-_.height),c.transY(_.height),c.layout(r),this._borderView.setBounds(0,0,m.width,m.height,r),this._rBox={x:0,y:0,width:m.width,height:m.height},this._aniScale(this._back,n)}}class zl extends Bh{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new Ih(this._pointContainer,Fl)}_doPrepeare(t,e,i){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,this._getGrowRate())}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutPanels(this.doc,this.width,this.height,t)}_getPointPool(){return this._panels}$_preparePanels(t,e){const i=e.length;this._panels.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPanels(t,e,i,s){const r=this.model,n=r.chart.getProjection(),o=[this._scale,-this._scale],a=r.prop("position"),h=this._getLabelPositioner(r.pointLabel.prop("position"),"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=k(u.rx,0);let g,m,f;this._panels.forEach(((u,b)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const b=this._getPointPositioner(y.position||a,"top");let x,v,S,C,P,M;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),g=v[v.length-1]),y.xPos=S=g[0],y.yPos=C=g[1],S*=o[0],C*=o[1],u.render(t,r,e,i,p,s),m=u._rBox,f=b(S,C,m.width,m.height),u.trans(f.x,f.y),l&&(P=l.get(y,0))&&P.setVisible(u._static)&&this._layoutLabel(P,u.dom).transp(h(f.x+m.width/2,f.y+m.height/2,P.bbox(),m.width/2,m.height/2,c)),_&&v&&(M=_.get(y))&&M.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));m.x=u.tx,m.y=u.ty,_.setMask(M,t).setRects(m),M.render(d,y,t,u.getFill())}}}))}}class jl extends ll{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Gl extends Gh{constructor(t){super(t,!0),this._sectors=new ch(this,jl,null,.5),this._rdRate=1,this.add(this._circle=new ml(t)),this._circle.internalSetStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,n=0;if(e){this.$_calcAngles(t,[0],s);const o=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.prop("clockwise");let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:n,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),o[0]&&o[0].color&&a.setFill(o[0].color),a.internalSetStyleOrClass(e.style)}else{const e=this.point.values;this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),this.$_layoutSectors(t,r,n,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=e.length,r=t.prop("clockwise")?1:-1,n=e.reduce(((t,e)=>t+e),0),o=t._totalRad*i;let a=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),s>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/n||0;t.start=a,a+=t.angle=r*e*o}}));else if(1==s){const t=this._sectors.get(0);t.start=a,t.angle=o}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.getFieldColors(),a=t.prop("clockwise");this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const h=t.value;if(isNaN(h))t.setVisible(!1);else{const h=t.start;let l=0,c=0;t.trans(l,c).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:h,angle:g(t.angle),clockwise:a}),t.internalClearStyleAndClass(),n[r]&&n[r].color?t.setFill(n[r].color):o&&t.setFill(o[r%o.length])}}))}}class Hl extends Hh{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new Ih(this._pointContainer,Gl)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,k(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._pies.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutPies(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.prop("position"),h=r.getPosition,l=s.getLabelOff(),c=this._labelViews(),d=s.getCallout(),_=this._calloutViews(),u=s.getRadius(Math.min(t,e)),p=s.hasThreshold(),g=this._inRegion;let m,f;this._pies.forEach(((t,e)=>{const r=t.point,b=[r.lon,r.lat];if(t.setVisible(!r.isNull&&(g&&r._excluded||!g&&!r._excluded)&&null!=(m=n.getVisible(b)))){const e=this._getPointPositioner(r.position||a,"top"),g=u*t._rdRate;let y,w,x,v,S,C;if(d&&(y=r.getCallout(b))&&(w=y.map((t=>n.project(t))),m=w[w.length-1]),r.xPos=x=m[0],r.yPos=v=m[1],x*=o[0],v*=o[1],f=e(x,v,2*g,2*g),f.x+=g,f.y+=g,t.render(s,p&&s.getThreshold(r.getSum()),g,i*r.vrate()),t.trans(f.x,f.y),c&&(S=c.get(r,0))){const e=this._getLabelPositioner(h(r),"bottom");this._layoutLabel(S,t.dom).transp(e(f.x,f.y,S.bbox(),g,g,l))}if(_&&w&&(C=_.get(r))&&C.setVisible(t._static)){const e=w.flat().map(((t,e)=>t*o[e%2]));_.setMask(C,e).setCircle(e[e.length-2],e[e.length-1],g),C.render(d,r,e,t.getFill())}}}))}}class Wl extends zh{constructor(t){super(t,!0),this.add(this._pin=new ne(t))}render(t){this._pin.setPath(Fi.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new ml(this.doc,"rm-pin-series-inner")),this._circle.setCircle(t.cx,t.cy,t.innerRd)):this._circle&&(this._circle.remove(),this._circle=null)}tooltipColor(){return getComputedStyle(this._pin.dom).fill}}class Yl extends jh{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new Ih(t,Wl)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(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),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(),i=this._getGrowRate(),s=this.model,r=s.pointLabel,n=[this._scale,-this._scale],o=+s.prop("rotation")||0,a=s.prop("position"),h=r.getPosition;s.pointLabel.prop("position");const l=this._labelViews(),c=s.getLabelOff(),d=s.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((r,g)=>{const m=r.point,f=[m.lon,m.lat];if(r.setVisible(!m.isNull&&null!=(u=e.getVisible(f)))){const g=this._getPointPositioner(m.position||a,"top"),b=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,S,C,P,M;if(d&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),m.xPos=S=u[0],m.yPos=C=u[1],S*=n[0],C*=n[1],p=g(S,C,y,w),t&&r.render(b),r.trans(p.x+y/2,p.y+w).rotate(o),l&&(P=l.get(m,0))&&P.setVisible(r._static)){t&&this._layoutLabel(P,r.dom);const e=this._getLabelPositioner(h(m),"bottom");P.transp(e(p.x+y/2,p.y+w/2,P.bbox(),y/2,w/2,c))}_&&v&&(M=_.get(m))&&M.setVisible(r._static)&&M.render(d,m,v.flat().map(((t,e)=>t*n[e%2])),null)}}))}}class Zl extends zh{}class Ul extends jh{constructor(t){super(t,"rm-point-series",!0,!0),this._pointLayer.add(this._clusterContainer=new ie(t,"rm-point-clusters"))}_createMarkers(t){return new Ih(t,Zl)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){const e=this.model;t&&(this._runClustering(e)||Jh.grow(this))}_doViewRateChanged(t){this.$_layoutMarkers(t)}zoomChanged(t,e){this._runClustering(this.model)}_runClustering(t){const e=t.cluster;if(e.stop(),t._visPoints.forEach((t=>t.cluster=null)),e.visible&&(isNaN(e.prop("zoomLimit"))||t.chart.body.zoom<e.prop("zoomLimit")))return e.run(t._visPoints,this.width,this.height,(e=>{this.$_prepareClusters(t,e)}),((t,e)=>{this.$_layoutMarkers(this._getGrowRate())}),(t=>{this.$_layoutMarkers(this._getGrowRate())})),!0;t.chart.body.zoom>=e.prop("zoomLimit")&&e.clear()}_clusterOfDom(t){if(t)return this._clusterPool.find((e=>e.containsDom(t)))}$_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),i.prepare()})),t.cluster.clusters&&this.$_prepareClusters(t,t.cluster.clusters)}$_layoutMarkers(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=Math.max(0,e.getRadius()),n=[this._scale,-this._scale],o=+e.prop("rotation")||0,a=e.prop("position"),h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews(),_=e.cluster.acitve;let u,p;const g=i.getPosition;this._markers.forEach(((i,m)=>{var f;const b=i.point,y=[b.lon,b.lat];if(i.setVisible(!b.isNull&&(!_&&!b.cluster||_||b.moves<1)&&null!=(u=s.getVisible(y)))){const m=this._getPointPositioner(b.position||a,"center"),w=(null!==(f=i._radius)&&void 0!==f?f:r)*b.vrate(),x=w*t,v=Bh.getDrawer(e.getShape());let S,C,P,M,L,A;if(c&&(S=b.getCallout(y))&&(C=S.map((t=>s.project(t))),u=C[C.length-1]),b.xPos=P=u[0],b.yPos=M=u[1],P*=n[0],M*=n[1],p=m(P,M,2*w,2*w),p.x+=w,p.y+=w,b.px=p.x,b.py=p.y,b.cluster&&_&&b.moves>0&&(p.x=p.x+(b.cluster.cx-p.x)*Math.min(1,b.moves),p.y=p.y+(b.cluster.cy-p.y)*Math.min(1,b.moves)),i.setPath(v(x,x)),i.trans(p.x,p.y).rotate(o),h&&(L=h.get(b,0))&&L.setVisible(i._static)){this._layoutLabel(L,i.dom);let t=this._getLabelPositioner(g(b),"bottom");L.transp(t(p.x,p.y,L.bbox(),w,w,l))}if(d&&C&&(A=d.get(b))&&A.setVisible(i._static)){const t=C.flat().map(((t,e)=>t*n[e%2]));d.setMask(A,t).setCircle(t[t.length-2],t[t.length-1],w),A.render(c,b,t,null)}}})),this.$_layoutClusters()}$_prepareClusters(t,e){const i=t.cluster,s=i._style;this._clusterContainer.setBoolData("disabled",!i.isExpandable()),i.acitve&&!this._clusterPool&&(this._clusterPool=new ch(this._clusterContainer,Fh)),this._clusterPool&&this._clusterPool.prepare(e.length,((t,i)=>{t.setCluster(e[i]),t.internalClearStyleAndClass(),t.internalSetStyles(s)}))}$_layoutClusters(){const t=this.model.cluster;this._clusterPool&&(t.updateClusters(),this._clusterPool.forEach((e=>{const i=e._cluster;if(e.setVisible(t.isVisible(i))){const s=t.getRange(i);e.render(s.radius,s.color),e.trans(i.cx,i.cy)}})))}}class Xl extends Rh{constructor(t){super(t,!0),this._arrowClipPath=null,this.add(this._line=new ne(t)),this.add(this._arrow=new ne(t)),this.add(this._secondArrow=new ne(t)),this.add(this._image=this.$_createImage(t)),this.add(this._secondImage=this.$_createImage(t)),this._arrow.setStyleOrClass("rm-route-series-line"),this._arrow.setStyleOrClass("rm-route-series-arrow"),this._secondArrow.setStyleOrClass("rm-route-series-line"),this._secondArrow.setStyleOrClass("rm-route-series-arrow"),this._image.setStyleOrClass("rm-route-series-image"),this._secondImage.setStyleOrClass("rm-route-series-image")}get line(){return this._line}get arrow(){return this._arrow}get secondArrow(){return this._secondArrow}get image(){return this._image}get secondImage(){return this._secondImage}prepare(t){this._checkStatic();const e=t.getImageUrl(this.point,!1);e?this.point.imageUrl||(this.point.imageUrl=e):this.point.imageUrl=null}isEmpty(t,e,i){return t.length<=1||0===e.length||0===i.length}clear(){this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),this._secondImage.setVisible(!1)}render(t,e,i,s,r,n,o){if(i.length<=1||0===s.length||0===r.length)return this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),void this._secondImage.setVisible(!1);const a=t,h=i[i.length-2],l=i[i.length-1],c=R(Math.atan2(l[1]-h[1],l[0]-h[0]))-90,d=this.$_buildLinePath(s,r,n);if(this._line.setPath(d),this._arrow.setVisible(o)){this.$_drawArrow(this._arrow,l,a,e,c),this.$_drawImage(t,this.point,this._image,a,l,e);const s=this.$_createClipBoundary(t,l,a,e);let r=null,o=c;if(-1!==n){this._secondArrow.setVisible(!0);const s=i[n],h=n>0?i[n-1]:i[0];o=R(Math.atan2(s[1]-h[1],s[0]-h[0]))-90,this.$_drawArrow(this._secondArrow,s,a,e,o),this.$_drawImage(t,this.point,this._secondImage,a,s,e),r=this.$_createClipBoundary(t,s,a,e)}else this._secondArrow.setVisible(!1),this._secondImage.setVisible(!1);this.$_applyArrowClipping(i,n,s,c,l,r,o)}else this._arrowClipPath&&this._line.setClip(null)}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this._secondArrow.setVisible(!1),this}$_createInnerRect(t,e,i){const{minX:s,maxX:r,minY:n,maxY:o}=t,a=i[0],h=i[1],l=$(e),c=Math.cos(l),d=Math.sin(l),_=(t,e)=>{const i=t-a,s=e-h;return[a+i*c-s*d,h+i*d+s*c]},u=_(s,n),p=_(r,n),g=_(r,o),m=_(s,o);return`M ${u[0]} ${u[1]} L ${p[0]} ${p[1]} L ${g[0]} ${g[1]} L ${m[0]} ${m[1]} Z`}$_drawArrow(t,e,i,s,r){const n=i.prop("arrowWidth"),o=i.prop("arrowLength"),a=[`M ${e[0]} ${e[1]}`,`L ${e[0]-n*s} ${e[1]-o*s}`,`L ${e[0]+n*s} ${e[1]-o*s} Z`].join(" ");t.setPath(a),t.setRotation(e[0],e[1],r)}$_drawImage(t,e,i,s,r,n){const o=s.prop("imageWidth")*n,a=s.prop("imageHeight")*n;if(!e.imageUrl)return;const h=r[0]-o/2,l=r[1]-a/2;i.setVisible(!0),i.internalSetStyles({width:`${o}px`,height:`${a}px`,transformOrigin:`${o/2}px ${a/2}px`,transform:`translate(${h}px, ${l}px) scaleY(-1)`})}$_createClipBoundary(t,e,i,s){const r=i.prop("arrowWidth"),n=i.prop("arrowLength"),o=Math.max(r*s,t.getLineWidth()/2);return{minX:e[0]-o,maxX:e[0]+o,minY:e[1]-n*s,maxY:e[1]+5}}$_applyArrowClipping(t,e,i,s,r,n,o){let a="M -10000 -10000 L 10000 -10000 L 10000 10000 L -10000 10000 Z "+this.$_createInnerRect(i,s,r);if(n){const i=t[e];a+=" "+this.$_createInnerRect(n,o,i)}this._arrowClipPath?this._arrowClipPath.setPath(a):(this._arrowClipPath=this._line.clipPath(a),this._arrowClipPath.setAttr("clip-rule","evenodd"))}$_buildLinePath(t,e,i){const s=[];let r=0;for(let n=0;n<t.length;n++){const o=`${t[n][0]},${t[n][1]}`;if(-1!==i&&n===i+1){for(let t=n-1;t>=r;t--)s.push(`L ${e[t][0]},${e[t][1]}`);s.push("Z"),r=n,s.push(`M ${o}`)}else s.push(n===r?`M ${o}`:`L ${o}`)}for(let i=t.length-1;i>=r;i--)s.push(`L ${e[i][0]},${e[i][1]}`);return s.push("Z"),s.join(" ")}$_createImage(t){const e=new Ha(t);return e.setVisible(!1),e}}class Kl extends Bh{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new Ih(this._pointContainer,Xl,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t.line.setFill(e),t.arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(k(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"fill"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._pointContainer.setStroke("none"),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(t),i.line.setStroke("none"),mt.setNoScale(i.line.dom),i.arrow.setStroke("none"),mt.setNoScale(i.arrow.dom),i.image.setAttr("href",t.getImageUrl(r)||""),i.secondImage.setAttr("href",t.getImageUrl(r)||"")}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.prop("arrowDisplay");t=k(t,1),this._lines.forEach(((i,n)=>{this.$_layoutLine(i,e,s,r,t*i.point.vrate())}))}}$_layoutLine(t,e,i,r,o){const a=t.point,h=e.getRouteMode();let l=[];const c=this.chart().isGlobe,d=[a.lon1,a.lat1],_=[a.lon2,a.lat2];if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(s(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t.line.setPath(s.join(" "))}else{if(h===Yi)l=this.$_genCubicBezierPath(a,d,_,Kl.INTERPOLATION);else l=this.$_genGcnPath(d,_,Kl.INTERPOLATION);const s="none"!==r&&(o<1||"moving"!==r);let n=e.getLineWidth();n/=this._scale;!c&&this.$_checkBoundaryCrossing(l)?this.$_renderDuplicatedPaths(t,e,i,l,n,o,s):this.$_renderSinglePath(t,e,i,l,n,o,s)}}$_renderSinglePath(t,e,i,s,r,n,o){const a=s.map((t=>i.project(t))).filter((t=>!t.outside));n<1&&(a.length=a.length*n|0);const{topPath:h,bottomPath:l}=this.$_generateOffsetPaths(a,0,r/2);t.render(e,1/this._scale,a,h,l,-1,o)}$_renderDuplicatedPaths(t,e,i,s,r,n,o){const a=this.model.chart.body.scroll,h=s.map((t=>t[0])),l=Math.min(...h);let c;Math.max(...h)>180+a?c=-360:l<-180+a&&(c=360);const d=s.map((t=>[t[0]+c,t[1]])),_=s.map((t=>i.project(t))).filter((t=>!t.outside)),u=d.map((t=>i.project(t))).filter((t=>!t.outside));if(n<1&&(_.length=_.length*n|0,u.length=u.length*n|0),0===_.length||0===u.length)return void t.clear();const p=[..._,...u],{topPath:g,bottomPath:m}=this.$_genSplitedOffsetPath(_,u,r/2);t.render(e,1/this._scale,p,g,m,_.length-1,o)}$_checkBoundaryCrossing(t){if(t.length<2)return!1;const e=this.chart().body.scroll,i=-180+e,s=180+e,r=t.map((t=>t[0])),n=Math.min(...r),o=Math.max(...r);return n<i||o>s}$_genSplitedOffsetPath(t,e,i){const{topPath:s,bottomPath:r}=this.$_generateOffsetPaths(t,0,i),{topPath:n,bottomPath:o}=this.$_generateOffsetPaths(e,0,i);return{topPath:[...s,...n],bottomPath:[...r,...o]}}$_genGcnPath(t,e,i){const s=[];let r=t[0];for(let n=0;n<=i;n++){const o=n/i,a=this.interpolate(t,e,o,r);s.push(a),r=a[0]}return s}$_genCubicBezierPath(t,e,i,s){const r=[],n=this.model.chart.getProjection(),o=this.model.chart.body.scroll,[a,h]=this.model.getCurvePoint(t,e,i);n.scroll=0;const l=n.project(e),c=n.project(i),d=a,_=h;let u=e[0];for(let t=0;t<=s;t++){const e=t/s,i=this.$_cubicBezier(l,d,_,c,e),o=n.backward(i);let a=o[0];const h=a-u;h>180?a-=360:h<-180&&(a+=360);const p=[a,o[1]];r.push(p),u=a}return n.scroll=o,r}$_cubicBezier(t,e,i,s,r){const n=r*r,o=n*r,a=1-r,h=a*a,l=h*a;return[l*t[0]+3*h*r*e[0]+3*a*n*i[0]+o*s[0],l*t[1]+3*h*r*e[1]+3*a*n*i[1]+o*s[1]]}interpolate(t,e,i,s){const r=$(t[1]),n=$(t[0]),o=$(e[1]),a=$(e[0]),h=Math.acos(Math.sin(r)*Math.sin(o)+Math.cos(r)*Math.cos(o)*Math.cos(a-n)),l=Math.sin((1-i)*h)/Math.sin(h),c=Math.sin(i*h)/Math.sin(h),d=l*Math.cos(r)*Math.cos(n)+c*Math.cos(o)*Math.cos(a),_=l*Math.cos(r)*Math.sin(n)+c*Math.cos(o)*Math.sin(a),u=l*Math.sin(r)+c*Math.sin(o),p=Math.sqrt(d*d+_*_+u*u),g=Math.asin(u/p);let m=R(Math.atan2(_,d));if(void 0!==s){const t=m-s;t>180?m-=360:t<-180&&(m+=360)}return[m,R(g)]}$_getNormalVector(t,e){let i;if(0===e){i=[t[1][0]-t[0][0],t[1][1]-t[0][1]]}else if(e===t.length-1){i=[t[e][0]-t[e-1][0],t[e][1]-t[e-1][1]]}else{i=[t[e+1][0]-t[e-1][0],t[e+1][1]-t[e-1][1]]}const s=Math.sqrt(i[0]*i[0]+i[1]*i[1]);return 0===s?[0,1]:[-i[1]/s,i[0]/s]}$_generateOffsetPaths(t,e,i){if(t.length<2)return{topPath:[],bottomPath:[]};const s=[],r=[];for(let n=0;n<t.length;n++){const o=t[n];let a=e+(i-e)*(n/(t.length-1));const h=1/this._scale;a=Math.max(a,h);const l=this.$_getNormalVector(t,n),c=[o[0]+l[0]*a,o[1]+l[1]*a],d=[o[0]-l[0]*a,o[1]-l[1]*a];s.push(c),r.push(d)}return{topPath:s,bottomPath:r}}}Kl.INTERPOLATION=80;class ql extends Gh{constructor(t){super(t,!0),this._cells=new ch(this,ne)}render(t,e,i,s){const r=t.getPointGrid(this.point,e,s);this.$_prepareCells(Math.round(r.count),i.wCell,i.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,i)}$_prepareCells(t,e,i){this._cells.prepare(t,(t=>{t.setPath(Fi.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const n=i*r.hCell+(i-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[o][a])&&(o++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),n-o*r.hCell-(o>0?o*r.gap:0)),a++}))}}class Jl extends Hh{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new Ih(this._pointContainer,ql)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,k(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._waffles.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.pointLabel,n=s.getWaffleInfo(),o=s.chart.getProjection(),a=+s.prop("rotation")||0,h=[this._scale,-this._scale],l=s.prop("position"),c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.prop("gap")},p=s.getCallout(),g=this._calloutViews();let m,f,b;this._waffles.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(m=o.getVisible(y)))){const e=this._getPointPositioner(r.position||l,"top");let w,x,v,S,C,P;if(p&&(w=r.getCallout(y))&&(x=w.map((t=>o.project(t))),m=x[x.length-1]),r.xPos=v=m[0],r.yPos=S=m[1],v*=h[0],S*=h[1],t.render(s,u,n,i*r.vrate()),f=t.bbox(),b=e(v,S,f.width,f.height),t.trans(b.x,b.y).rotate(a),_&&(C=_.get(r,0))&&C.setVisible(t._static)){const e=this._getLabelPositioner(c(r),"bottom");this._layoutLabel(C,t.dom).transp(e(b.x+f.width/2,b.y+f.height/2,C.bbox(),f.width/2,f.height/2,d))}g&&x&&(P=g.get(r))&&P.setVisible(t._static)&&P.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class Ql extends ph{constructor(t){super(t,Ql.CLASS_NAME),this.add(this._foreignObj=new ee(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=Ql.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.getSize(i,s),n=this._htmlView;let o=e.prop("html")||"";const a=(o.startsWith("#")||o.startsWith("."))&&t.querySelector(o);return this._htmlView.style.width=isNaN(r.width)?"max-content":"",this._foreignObj.resize(k(r.width,1e4),r.height),o=e.applyParams(a?a.innerHTML:o)||"<div></div>",o!==n.innerHTML&&(n.innerHTML=o),isNaN(r.width)&&(this._foreignObj.width=n.firstElementChild.offsetWidth),isNaN(r.height)&&(this._foreignObj.height=n.firstElementChild.offsetHeight),a&&this._templateDom!==a&&(this._templateDom=a,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),ht.create(n.firstElementChild.offsetWidth,n.firstElementChild.offsetHeight)}_doLayout(t){super._doLayout(t)}_doDispose(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}Ql.CLASS_NAME="rm-html-annotation",Ql.HTML_VIEW_CLASS="rm-html-annotation-view";class tc extends Rh{constructor(t){super(t,!0),this.add(this._foreignObj=new ee(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className="rm-html-series-view"}setHtml(t,e,i){const s=this._htmlView,r=k(e,1e4);this._htmlView.style.width=isNaN(e)?"max-content":"",this._foreignObj.resize(r,i),t!==s.innerHTML&&(s.innerHTML=t),isNaN(e)&&(this._foreignObj.width=s.firstElementChild.offsetWidth),isNaN(i)&&(this._foreignObj.height=s.firstElementChild.offsetHeight)}render(t){this._rbox=_t.create(0,0,this._htmlView.firstElementChild.offsetWidth,this._htmlView.firstElementChild.offsetHeight)}}class ec extends Bh{constructor(t){super(t,"rm-html-series",!0,!1),this._htmlViews=new Ih(this._pointContainer,tc),this._observer=new MutationObserver((t=>{this.chart()._optionChanged(this.model)}))}_getPointPool(){return this._htmlViews}_doPrepeare(t,e,i){this.$_prepareHtmls(t,e,this._visPoints)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Jh.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareHtmls(t,e,i){const s=e.getSize(),r=e.prop("html")||"",n=(r.startsWith("#")||r.startsWith("."))&&t.querySelector(r);this._htmlViews.prepare(i.length,((t,o)=>{const a=t.point=i[o],h=e.applyParams(a,n?n.innerHTML:r)||"<div></div>";t.setHtml(h,s.width,s.height),this._setPointStyle(t,e,a)})),n&&this._templateDom!==n&&(this._templateDom=n,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(),s=[this._scale,-this._scale],r=this._getLabelPositioner(e.pointLabel.prop("position"),"bottom"),n=e.getLabelOff(),o=this._labelViews(),a=e.getCallout(),h=this._calloutViews();let l,c;this._htmlViews.forEach(((d,_)=>{const u=d.point,p=[u.lon,u.lat];if(d.setVisible(!u.isNull&&null!=(l=i.getVisible(p)))){const _=this._getPointPositioner(e.prop("position"),"center");let g,m,f,b,y,w,x;if(a&&(g=u.getCallout(p))&&(m=g.map((t=>i.project(t))),l=m[m.length-1]),u.xPos=f=l[0],u.yPos=b=l[1],f*=s[0],b*=s[1],d.render(t),x=d._rbox,c=_(f,b,x.width,x.height),d.trans(c.x,c.y),o&&(y=o.get(u,0))&&y.setVisible(d._static)&&y.layout().transp(r(c.x+x.width/2,c.y+x.height/2,y.bbox(),x.width/2,x.height/2,n)),h&&m&&(w=h.get(u))&&w.setVisible(d._static)){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=d.tx,x.y=d.ty,h.setMask(w,t).setRects(x),w.render(a,u,t,d.getFill())}}}))}}function ic(t,e){return new(Oh[e._type()])(t)}function sc(t,e){return new(uh[e._type()])(t)}Bh.register([aa,Rl],[Pa,Ul],[ya,Yl],[wo,ol],[ta,Ml],[ma,Hl],[Ho,xl],[Ia,Jl],[Aa,Kl],[$s,hl],[Ko,Sl],[ua,zl],[Zo,ec],[Io,gl],[zo,yl]),ph.register([eo,qh],[Qn,Xh],[to,Kh],[Jn,Ql]);class rc extends $t{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class nc extends $t{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class oc extends ie{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new ie(t)),this._axisLayer.add(this.axisView=new wh(t,i)),this._axisLayer.add(this.tickLayer=new yh(t))}get firstMap(){for(const t of this.seriesViews)if(t instanceof Rl&&t.visible)return t}prepare(t,e,i){const s=e.visibleSeries,r=this.seriesMap,n=this.seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=r[e.hash]||ic(t,e);s.parent||(this.add(s),this.labelsContainer.add(s._labelContainer),this.labelsContainer.add(s.secondLabelContainer())),r[e.hash]=s,n.push(s),s._h1=o,s._h2=a,s.prepareModel(t,e,i)})),this.prevViews&&it.equalArrays(this.prevViews,n)||(this.sort(n),this.labelsContainer.sort(n.map((t=>t._labelContainer)))),this.prevViews=n.slice(0)}prepareLayout(t){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}resetClip(t){this._axisLayer.setClip(t)}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}zoomChanged(t,e){}onScrollStart(){this.seriesViews.forEach((t=>t.visible&&t.onScrollStart()))}onScrollEnd(){this.seriesViews.forEach((t=>t.visible&&t.onScrollEnd()))}onRotationStart(){this.seriesViews.forEach((t=>t.visible&&t.onRotationStart()))}onRotationEnd(){this.seriesViews.forEach((t=>t.visible&&t.onRotationEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class ac extends ie{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new ie(t)),this.add(this._labelLayer=new ie(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.prop("front")==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,i,s,r)}$_prepareGuides(t,e){const i=this._guideViews,s=e.length;for(;i.length>s;)i.pop().remove();for(;i.length<s;){const e=new vh(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],s,r),n.layout(i)}))}}class hc extends rh{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._zoom=100,this._owner=e,this.add(this._back=new Xi(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Mh(t)),this.add(this._contentLayer=new ie(t,"rm-body-content")),this.add(this._feedbackContainer=new ie(t,"rm-feedbacks")),this.add(this._crosshairView=new Ch(t)),this._contentLayer.add(this._annotationContainer=new ie(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new ac(t,!1)),this._contentLayer.add(this._seriesContainer=new oc(t,new ie(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new ac(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new ie(t,"rm-front-annotations"))}getAnnotationAnchor(t){return this._annotationMap.get(t)}get firstMap(){return this._seriesContainer.firstMap}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),this._seriesContainer._h1=t+r,this._seriesContainer._h2=s}this.$_prepareSeries(t,e.chart,0),this.$_prepareAnnotations(t,e.getAnnotations())}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(this._mousePos),this._transformInfo),this.model&&(this.model.isScrollable()&&this.onScrollEnd(),this.model.projection.isGlobe&&this.onRotationEnd())}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,i){if(!this.model)return;const s=this.model.chart,r=this._owner.tx,n=this._owner.ty,{sv:o,pv:a}=function(s){let o,a;for(const h of s)h.pointerMoved(t,e,i)&&(o=h,a=h.getPointView(i,t-r,e-n,!0));if(!a)for(const h of s)if(a=h.getPointView(i,t-r,e-n,!0),a){o=h;break}return{sv:o,pv:a}}(this._seriesContainer.seriesViews),h=null==o?void 0:o.model,l=h&&this._owner.getScaleView(s.getColorScale(h.getColorScale()));return(null==a?void 0:a.point)?(this._owner.showTooltip(h,a,this,{x:t,y:e}),null==l||l.setValue(a.point.getValue())):(this._owner.hideTooltip(),null==l||l.setValue(NaN)),this._crosshairView.visible&&s&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!o}seriesByDom(t){return this._seriesContainer.seriesViews.find((e=>e.dom.contains(t)))}showSeries(t){t.visible=!0,this._requestShow=t}hideSeries(t){var e;const i=this.getSeries(t);i&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new nc(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}zoomChanged(t,e){this._seriesContainer.zoomChanged(t,e)}onScrollStart(){var t;(null===(t=this.model)||void 0===t?void 0:t.isScrollable)&&this._seriesContainer.onScrollStart()}onScrollEnd(){this.model.isScrollable&&this._seriesContainer.onScrollEnd()}onRotationStart(){this.model.projection.isGlobe&&this._seriesContainer.onRotationStart()}onRotationEnd(){this.model.projection.isGlobe&&this._seriesContainer.onRotationEnd()}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),ht.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=this._zoom,n=s._prj,o=s.chart,a=o.axis,h=o.map,l=this.height,c=this.width,{wMap:d,hMap:_,scale:u,tx:p,ty:g}=s.prepareLayout(c,l);let m=this._clip;if(this._back.resize(c,l),this._back.internalResetStyleOrClass(s._style),s.zoom!==r&&(this._zoom=s.zoom),h){this.$_prepareLayoutSeries(i),this._transformInfo={tx:p,ty:g,scale:u,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const t=`translate(${p}px, ${g}px) scale(${u}, ${-u})`,e=d*u,m=_*u,f=[this._seriesContainer],b=(c-e)/2-s.panX*u,y=(l-m)/2-s.panY*u,w=this.$_layoutClip(s,n,c,l,u);this._mapBack.setVisible(o.body.mapBackground.isVisible())&&this._mapBack.render(this.doc,o,b,y,e,m),f.forEach((o=>{const h=o.axisView,d=o.tickLayer;h.setScale(u),h.measure(i,a,c,l),h.resize(c,l),h.trans(p,g),d.setVisible(a.tick.visible)&&(d.prepare(i,a.tick,h.steps),d.resize(c,l),d.setScale(u),d.layout(s.projection),d.trans(p,g)),o.seriesViews.forEach((i=>{var s,o;i._scale=u,i.model.needMapScale()?(i._pointLayer.internalSetStyle("transform",t),i._calloutContainer.visible&&i._calloutContainer.internalSetStyles({transform:t})):i.model.needTranslate()?i.trans(p,g):(i.resize(c,l),i.trans(b,y)),i.move(p,g),i.resize(e,m),i.render(c,l,this._transformInfo),null===(s=i._labelContainer)||void 0===s||s.trans(p,g),null===(o=i.secondLabelContainer())||void 0===o||o.trans(p,g);const a=i.resolveBoundsClip(w,u,p,g,n);i.setClip(i.needClip()?a:null),r!==this._zoom&&i.zoomChanged(this._zoom,r)})),h.layout(),o.resetClip(w)})),this._crosshairView.visible&&this._crosshairView.prepare(u,t);const x={map:h,prj:n,tf:this._transformInfo,trans:t,latInterval:a.latInterval,lonInterval:a.lonInterval};this.$_layoutAxisGuides(i,a,x,c,l)}if(this.$_layoutAnnotations(c,l),m&&m.parent&&m.width===c&&m.height===l||(m&&m.dom.remove(),this._clip=this.clipRect(0,0,c,l)),this._requestShow&&this._requestShow.visible){const t=this.getSeries(this._requestShow);t&&(null===(e=this._requestShow.ani)||void 0===e||e.stop(),(this._requestShow.ani=new rc(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}mouseToMap(t,e=!0,i=!1){if(!this._transformInfo)return[NaN,NaN];const{tx:s,ty:r,scale:n,vx:o,vy:a}=this._transformInfo;let h=t.x-s,l=t.y-r;i||(h-=o,l-=a);const c=h/n,d=l/-n;return this.pointToMap(c,d,e)}boundsToMap(t,e=!0,i=!1){return{from:this.mouseToMap({x:t.x,y:t.y},e,i),to:this.mouseToMap({x:t.x+t.width,y:t.y+t.height},e,i)}}pointToMap(t,e,i){if(!this.model)return[NaN,NaN];const{projection:s,scroll:r}=this.model,n=s.backward([t,e]);return i||0===r||(n[0]=s.getScrolledLon(n[0])),n}mapToPoint(t){t=this.model.chart.getProjection().project(t);const{tx:e,ty:i,scale:s,vx:r,vy:n}=this._transformInfo;return{x:t[0]*s-(r-e),y:t[1]*-s-(n-i)}}boundsByCoord(t,e){const i=this.mapToPoint(t),s=this.mapToPoint(e);return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}$_prepareSeries(t,e,i){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e,i)}$_prepareLayoutSeries(t){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t)}$_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.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||sc(t,e);(e.prop("front")?s:i).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r),this._axisGuideContainer.setClip(this._clipMap),this._frontAxisGuideContainer.setClip(this._clipMap)}$_layoutClip(t,e,i,s,r){const n=()=>{const i=e.getClipBounds(t.chart.axis.lonInterval,t.chart.axis.latInterval);return`M${i[0][0]},${i[0][1]} L`+i.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.dom.parentElement&&t.width===i&&t.height===s){if(t){if(this._prevPrj!==e){const e=n();t.setPath(e)}o(t),this._contentLayer.hasClip()}}else{const e=n();t&&t.remove(),this._clipMap=this.control.clip(new ce(this.doc).setPath(e)),o(this._clipMap),this._clipMap.resize(i,s)}}else this._clipMap&&(this._clipMap.remove(),this._clipMap=null);return this._clipMap}}class lc extends nh{constructor(t,e){super(t,e?lc.SUBTITLE_CLASS:lc.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Je(t)),this._richText=new ai}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}lc.TITLE_CLASS="rm-title",lc.SUBTITLE_CLASS="rm-subtitle";const cc="circle",dc="header";var _c;!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(_c||(_c={}));class uc extends ee{constructor(e){super(e,uc.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._gap=8,this._tailVisible=!0,this._circleRadius=6,this._circlePaddingX=12,this._circlePaddingY=5,this._linePaddingX1=5,this._linePaddingX2=6,this._linePaddingY=4,this._lineWidth=2,this._lineGap=4,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ne(e,"rm-tooltip-back")),this.add(this._top=new ne(e,"rm-tooltip-top")),this.add(this._border=new ne(e,"rm-tooltip-border")),this.add(this._textView=new Je(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+te.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ai,this.close(!0,!1)}show(t,e,i,s,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a),c=(null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor,d=h.prop("mode");if(!l)return;const _=h.prop("text")||l.getTooltipText(t,a);if(!_)return;const g=this.control,m=g.contentWidth(),f=g.contentHeight(),b=this._textView;this._richText.setFormat(_),this._richText.build(b,NaN,NaN,null,h.getTextDomain());const{w:y,h:w}=this.calcBounds(d,h);this._top.setFill(c);const x="visible"===this.getStyle("visibility")?300:0,v=h.prop("offset")+this._tailSize,S=e.getBounds(),C=g.getBounds();let P;P=i-y/2-p(0,u(i-y/2,m-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(P),h.isFollowPointer(t)||(C.bottom,S.bottom);const M=_c.TOP;d===cc?(this.drawCircleTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")):d===dc?(this.drawHeaderTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-headermode-bg)"),b.setFill("var(--rm-tooltip-headermode-color)")):(this.drawLineTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")),s-=w+v,i=p(0,u(i-=y/2,m-y)),s=p(0,u(s,f-w)),this.transEx(i,s,x,!1),0===x&&this.internalSetStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.prop("hideDelay"):qn.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?G(e,i):{},a=G(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.internalSetStyle("visibility","hidden")}))}drawHeaderTooltip(t,e,i,s,r,n){const o=this._textView,a=this._radius,h=this._topHeight,l=r===_c.BOTTOM,c=this.drawPanelPath(t,e,i,s,r,n),d=l?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=o.bbox();t+=(i-_.width)/2,e+=(s-_.height+(l?-h:h))/2,o.trans(t,e),this._top.setPath(d),this._border.setPath(c),this._back.setPath(c)}drawCircleTooltip(t,e,i,s,r,n){const o=this._textView,a=o.bbox(),h=this.drawPanelPath(t,e,i,s,r,n),l=this._circleRadius,c=t+this._circlePaddingX+l,d=e+this._circlePaddingY+a.height/2-l+l,_=["M",c+l,d,"A",l,l,0,0,1,c,d+l,"A",l,l,0,0,1,c-l,d,"A",l,l,0,0,1,c,d-l,"A",l,l,0,0,1,c+l,d,"Z"];t+=this._circlePaddingX+this._gap+2*l,e+=this._circlePaddingY,o.trans(t,e),this._top.setPath(_),this._border.setPath(h),this._back.setPath(h)}drawLineTooltip(t,e,i,s,r,n){const o=this._textView;o.bbox();const a=this.drawPanelPath(t,e,i,s,r,n),h=i-2*this._linePaddingX1,l=this._lineWidth,c=t+this._linePaddingX1,d=e+this._linePaddingY,_=this._lineWidth/2,u=["M",c+_,d,"L",c+h-_,d,"Q",c+h,d,c+h,d+_,"L",c+h,d+l-_,"Q",c+h,d+l,c+h-_,d+l,"L",c+_,d+l,"Q",c,d+l,c,d+l-_,"L",c,d+_,"Q",c,d,c+_,d,"Z"];t+=this._linePaddingX2,e+=this._linePaddingY+this._lineGap+this._lineWidth,o.trans(t,e),this._top.setPath(u),this._border.setPath(a),this._back.setPath(a)}calcBounds(t,e){const i=this._textView.bbox();let s=0,r=0;return"header"===t?(s=p(e.prop("minWidth")||0,i.width+16),r=p(e.prop("minHeight")||0,i.height+12)):"circle"===t?(s=p(e.prop("minWidth")||0,i.width+2*this._circlePaddingX+this._gap+2*this._circleRadius),r=p(e.prop("minHeight")||0,i.height+2*this._circlePaddingY)):(s=p(e.prop("minWidth")||0,i.width+2*this._linePaddingX2),r=p(e.prop("minHeight")||0,i.height+2*this._linePaddingY+this._lineWidth+this._lineGap)),{w:s,h:r}}drawPanelPath(t,e,i,s,r,n){const o=this._tailSize,a=this._radius,h=[];return h.push("M",t+a,e),this._tailVisible&&r===_c.BOTTOM&&(h.push("L",t+i/2-o/2+n,e),h.push("L",t+i/2+n,e-o),h.push("L",t+i/2+o/2+n,e)),h.push("L",t+i-a,e),h.push("Q",t+i,e,t+i,e+a),this._tailVisible&&r===_c.LEFT&&(h.push("L",t+i,e+s/2-o/2+n),h.push("L",t+i+o,e+s/2+n),h.push("L",t+i,e+s/2+o/2+n)),h.push("L",t+i,e+s-a),h.push("Q",t+i,e+s,t+i-a,e+s),this._tailVisible&&r===_c.TOP&&(h.push("L",t+i/2+o/2+n,e+s),h.push("L",t+i/2+n,e+s+o),h.push("L",t+i/2-o/2+n,e+s)),h.push("L",t+a,e+s),h.push("Q",t,e+s,t,e+s-a),this._tailVisible&&r===_c.RIGHT&&(h.push("L",t,e+s/2+o/2+n),h.push("L",t-o,e+s/2+n),h.push("L",t,e+s/2-o/2+n)),h.push("L",t,e+a),h.push("Q",t,e,t+a,e),h}}uc.CLASS_NAME="rm-tooltip";class pc extends lh{constructor(t){super(t,pc.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new ie(t);this.add(e),e.add(this._boxLayer=new ie(t)),this._boxes=new ch(this._boxLayer,Xi,"rm-color-scale-box"),e.add(this._splitLayer=new ie(t)),this._splits=new ch(this._splitLayer,Lh,"rm-color-scale-split"),e.add(this._markerLabel=new eh(t,void 0)),e.add(this._marker=new ne(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new ie(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new ie(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new ie(t,"rm-color-scale-null")),this._tickLines=new ch(this._tickLineLayer,Lh),this._tickLabels=new ch(this._tickLabelLayer,eh),this._fills=[]}setValue(t){var e,i;e=t,i=this._value,(isNaN(e)?isNaN(i):e===i)||(this._value=t,this.$_resetMarker(this._wBar,this._hBar,this._vertical,this._reversed,this._inverted))}_doMeasure(t,e,i,s){let r=this.chart().isDirty;const n=e.marker,o=e.tick,a=this._tickLen=+o.line.prop("length")||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.prop("reversed"),_=this._inverted=e.prop("inverted"),u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(n,c,d,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==o.prop("minVisible")),e>1){t.last.setVisible(!1!==o.prop("maxVisible"));for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==o.prop("minVisible")),i>1){e.last.setVisible(!1!==o.prop("maxVisible"));for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-n.x,g-n.y)}$_getFillId(t){return`${pc.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,e){const i=t.createElementNS(Lt,"linearGradient"),s=this.$_getFillId(e);return i.setAttribute("id",s),i.appendChild(t.createElementNS(Lt,"stop")),i.appendChild(t.createElementNS(Lt,"stop")),this.control.addDef(i),i}$_setDir(t,e,i){e?mt.setAttrs(t,i?pc.VERT_FILL_I:pc.VERT_FILL):mt.setAttrs(t,i?pc.HORZ_FILL_I:pc.HORZ_FILL)}$_fillStops(t,e,i){const s=t.childNodes[0],r=t.childNodes[1];s.setAttribute("offset","0"),s.setAttribute("stop-color",e.toString()),s.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",i.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,i,s){this._fills.forEach((t=>this.control.removeDef(t)));const r=this._fills=[],n=e.getSteps();if(e.prop("solidFill"))if(n)this._boxes.prepare(n.length,((t,e)=>{t.internalSetStyle("fill",n[e]._color1)}));else{const t=this._stepCount,i=e.minColor,s=e.endColor;this._boxes.prepare(t,((e,r)=>{e.internalSetStyle("fill",ot.interpolate(i,s,(r+1)/t).toString())}))}else if(n)n.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][Li]=e})),r.forEach((t=>{const e=t[Li];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(r.length,((t,e)=>{t.internalSetStyle("fill",this.$_getFillUrl(e))}));else{this._boxes.prepare(1);const n=this.$_createGradient(t,0);r.push(n),this.$_setDir(n,i,s),this.$_fillStops(n,e.minColor,e.endColor),this._boxes.first.internalSetStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new Xi(t,"rm-color-scale-box")),e.add(this._nullLabel=new eh(t,"rm-color-scale-tick-label")))}$_layoutSplits(t,e){this._splits.forEach((i=>{this._vertical?i.setHLine(i._userData,0,t):i.setVLine(i._userData,0,e)}))}$_layoutTickLines(t){this._tickLines.forEach((e=>{this._vertical?e.setHLine(e._userData,0,t):e.setVLine(e._userData,0,t)}))}$_resetMarker(t,e,i,s,r){const n=this._markerSize,o=isNaN(this._value),a=this.model.getPosition(this._value);let h,l;a>1&&console.log(this.model.getPosition(this._value)),this._marker.setBoolData("null",o),i?(h=s?t-n+1:n-1,l=(o?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(o?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-n+1:n),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,n=this._inverted,o=this._tickLabelLayer,a=this._tickLabelSize,h=this._markerSize,l=this._tickLen,c=this._stepCount,d=t?t.getGap():0,_=((s?i:e)-d)/(c+(t?1:0)),u=this._nullSize=t?_+d:0;let p=e,g=i,m=0,f=0,b=0,y=0;if(s?(m+=r?a:h,p-=h,y=n?f+u:f,a>0&&(r?o.trans(0,y):o.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(n?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=n?m:m+u,a>0&&(r?o.trans(b,0):o.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((n?i-1-e:e)*_-t.bbox().width/2,0)})),g-=a),g-=l,r&&(f+=l),y=f),this._boxLayer.setBounds(b,y,p,g),1===this._boxes.count?s?this._boxes.get(0).setBounds(0,0,p,g-u):this._boxes.get(0).setBounds(0,0,p-u,g):this._boxes.forEach(((t,e,i)=>{s?t.setBounds(0,(n?e:i-1-e)*_,p,_):t.setBounds((n?i-1-e:e)*_,0,_,g)})),this._splitLayer.visible&&(this._splitLayer.trans(b,y),this.$_layoutSplits(p,g)),this._tickLineLayer.visible&&(s?(r?m-=l:m+=p,this._tickLineLayer.trans(m,y)):(r?f-=l:f+=g,this._tickLineLayer.trans(b,f)),this.$_layoutTickLines(l)),t){let e=_,i=_,r=m,a=f;s?(m=this._boxLayer.tx,r=o.tx,e=p,f=n?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=o.ty,i=g,n&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.prop("color")&&this._nullBar.setFill(t.prop("color")),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,n)}}pc.SCALE_CLASS="rm-color-scale",pc.SCALE_FILL="rm-color-scale-fill",pc.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},pc.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},pc.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},pc.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class gc extends ee{constructor(t,e,i){super(t,gc.STYLE),this._hitLimitW=0,this._hitLimitH=0,this.add(this._hit=new Xi(t,gc.HIT_STYLE)),this.add(this._back=new Xi(t,gc.BACK_STYLE)),this.add(this._textView=new Je(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}setHitLimit(t,e){this._hitLimitW=t,this._hitLimitH=e}layout(e,i){this.internalSetStyleOrClass(i),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),r=getComputedStyle(this._back.dom),n=(new Gt).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(n.left+s.width/2,n.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+n.left+n.right,height:s.height+n.top+n.bottom}),this.$_layoutHit()}click(){return!1}$_layoutHit(){const t=this._back.rect,e=this.$_hitSize(t.width,this._hitLimitW),i=this.$_hitSize(t.height,this._hitLimitH);this._hit.rect={x:t.x+(t.width-e)/2,y:t.y+(t.height-i)/2,width:e,height:i}}$_hitSize(t,e){return Math.max(t,Math.min(gc.HIT_SIZE,e))}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}gc.STYLE="rm-button",gc.BACK_STYLE="rm-button-background",gc.HIT_STYLE="rm-button-hit",gc.HIT_SIZE=44;class mc extends gc{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class fc extends rh{}class bc extends fc{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new mc(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new mc(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new mc(t,"-",(()=>this.chart().body.zoomByFactor(-this.model.getZoomFactor()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,i,s){const r=this.chart().body.zoom,n=this._szBtn=e.getButtonSize(),o=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.prop("showReset"))?3:2;let h=0,l=0;return this._btnHome.setBoolData(ki,r<=100),this._btnDec.setBoolData(ki,r<=100),(this._vertical=e.vertical)?(h=n.width,l+=a*n.height+(a-1)*o):(l=n.height,h+=a*n.width+(a-1)*o),{width:h,height:l}}_doLayout(t){const e=this._szBtn,i=this._vertical?e.height+this._gap:e.width+this._gap,s=gc.HIT_SIZE;for(const t of[this._btnHome,this._btnInc,this._btnDec])t.setHitLimit(this._vertical?s:i,this._vertical?i:s);this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e);let r=this._btnHome.visible?i:0;this._btnHome.trans(0,0),this._vertical?(this._btnInc.trans(0,r),this._btnDec.trans(0,r+i)):(this._btnInc.trans(r,0),this._btnDec.trans(r+i,0))}}class yc extends fc{constructor(t){super(t,"rm-drilldown-panel")}getButton(t){return this._btnBack&&this._btnBack.containsDom(t)&&this._btnBack}click(t){const e=this._textViews;if(e)for(let i=0;i<e.count-1;i++)if(e.get(i).containsDom(t))return this.model.chart.drillup(e.get(i+1)[Ai]),!0}_doMeasure(e,i,s,r){let n=this._btnBack,o=0,a=0;if("text"===i.prop("type")){null==n||n.remove(),this._textViews||(this._textViews=new ch(this,Je,"rm-drilldown-text"),this._seperators=new ch(this,Je,"rm-drilldown-separator"));const e=i.chart.firstVisible,s=this._history=e.getHistory();this._textViews.prepare(s.length,((e,i)=>{e.text=s[i].displayName(),e.anchor=t.TextAnchor.START,e[Ai]=s[i]})),this._seperators.prepare(s.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),n||this.add(n=this._btnBack=new mc(e,"<",(()=>{i.chart.drillup()}))),n.layout();const t=n.bbox();o=t.width,a=t.height}return{width:o,height:a}}_doLayout(t){if("text"===this.model.prop("type")){const t=this.model.prop("itemGap"),e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class wc extends lh{constructor(t){super(t,wc.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new ie(t);this.add(e),e.add(this._bubbleLayer=new ie(t)),e.add(this._lineLayer=new ie(t)),e.add(this._labelLayer=new ie(t))}_doMeasure(t,e,i,s){const r=e.chart,n=this._steps=e.getSteps(r.width,r.height),o=n.map((t=>t.rd)).reduce(((t,e)=>Math.max(t,e)));let a=0,h=0;return this._checkTitle(t)&&(this._inTitle?a+=this._rTitle.width:h+=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?a+=this._rFooter.width+this._gapFooter:h+=this._rFooter.height+this._gapFooter),this.$_prepareBubbles(t,e,n),this.$_layoutBubbles(2*o,n),this._rScale=this._scaleLayer.bbox(),a+=this._rScale.width,h+=this._rScale.height,{width:a,height:h}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-n.x,g-n.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;ee.fit(t,this._bubbleLayer,this._bubbles,r,ml,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&ee.fit(t,this._lineLayer,this._lines,r,Lh,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&ee.fit(t,this._labelLayer,this._labels,r,eh,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const n=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-n.rd,n.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.prop("length")||0);this._lines.forEach(((i,n)=>{const o=e[n];i.setHLine(t-2*o.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.prop("length")+(i.tick.label.prop("offset")||0);this._labels.forEach(((s,n)=>{const o=e[n];s.setText(i.tick.label.getText(o.label)),s.trans(r,t-2*o.rd-s.bbox().height/2)}))}}}wc.SCALE_CLASS="rm-bubble-scale";class xc extends lh{constructor(t){super(t,xc.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}xc.SCALE_CLASS="rm-map-scale";class vc extends ie{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new ie(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new ie(t,"rm-mapregion-body-labels"))}prepare(t,e,i){const s=e.chart,r=s.map;if(r){const{h1:i,h2:n}=r,o=e.scroll%360;this._h1=i+o,this._h2=n,this.$_prepareSeries(t,s,o),this._seriesViews.forEach((e=>{e.prepareLayout(t)}))}}layout(t,e){const i=t.chart,s=i.map,r=this.width,n=this.height;if(s){const{wMap:e,hMap:s,scale:o,tx:a,ty:h}=t.prepareLayout(this.width,this.height);this._transformInfo={tx:a,ty:h,scale:o,vx:0,vy:0};const l=`translate(${a}px, ${h}px) scale(${o}, ${-o})`,c=e*o,d=s*o;this._seriesViews.forEach((t=>{var e,i;t._scale=o,t.model.needMapScale()?(t._pointLayer.internalSetStyle("transform",l),t._calloutContainer.visible&&t._calloutContainer.internalSetStyles({transform:l})):t.trans(a,h),t.move(a,h),t.resize(c,d),t.render(r,n,this._transformInfo),null===(e=t._labelContainer)||void 0===e||e.trans(a,h),null===(i=t.secondLabelContainer())||void 0===i||i.trans(a,h)})),i.getProjection()}const o=this._clip;o&&o.parent&&o.width===r&&o.height===n||(o&&o.dom.remove(),this._clip=this.clipRect(0,0,r,n))}$_prepareSeries(t,e,i){const s=e.visibleSeries,r=this._seriesMap,n=this._seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=!r[e.hash],h=r[e.hash]||ic(t,e);h.parent||(h.$_setInRegion(),this._seriesContainer.add(h),this._labelsContainer.add(h._labelContainer),this._labelsContainer.add(h.secondLabelContainer())),r[e.hash]=h,n.push(h),h._h1=o,h._h2=a,s&&(e._optionsDirty=!0),h.prepareModel(t,e,i)}))}}class Sc extends nh{constructor(t){super(t,Sc.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new vc(t)),this.add(this._targetView=new Xi(t,"rm-mapregion-target")),this.add(this._connectorView=new ne(t,"rm-mapregion-connector"))}update(t,e){this.measure(this.doc,this.model,t,e),this._layoutView(0,0,t,e,this._rTarget)}_layoutView(t,e,i,s,r){this._rTarget=r,this.resizeByMeasured(),this.layout(this.model.getPosition(t,e,i,s,this.width,this.height))}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=Va.defaults.width:r.width=r.height),isNaN(r.height)&&(r.height=r.width),this._deflatePaddings(r),r}_doLayout(t){const e=this._rTarget,i=t.x||0,s=t.y||0;this.trans(i,s),this._background.resize(this.width,this.height),e.x-=i,e.y-=s,this._targetView.setRect(e),this._connectorView.setPath(this.$_getConnector(e)),this._bodyView.resize(this.width-1,this.height-1),this._bodyView.prepare(this.doc,this.model,this.chart().body),this._bodyView.layout(this.model,this.chart().body)}$_getConnector(t){const e=0+this.width,i=0+this.height;let s;return s=0>t.x?i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[0,0,t.x+t.width,t.y,0,i,t.x+t.width,t.y+t.height]:i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[e,0,t.x,t.y,e,i,t.x,t.y+t.height],`M ${s[0]} ${s[1]} L ${s[2]} ${s[3]} M ${s[4]} ${s[5]} L ${s[6]} ${s[7]}`}}Sc.CLASS_NAME="rm-mapregion";class Cc extends oh{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new lc(t,!1)),this.add(this.subtitleView=new lc(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=i,u=0,g=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,g=+n.prop("titleGap")||0):d.setModel(n),n.prop("position")){case"left":case"right":u=p(h,c),_=a+g+l;break;default:u=h+g+c,_=p(_,a+l)}return u>0&&(u+=this.titleView.visible?k(r.prop("gap"),0):k(n.prop("gap"),0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.visible?this._wTitle>t.wMap||"chart"===s.prop("alignBase")?t.wChart:t.wMap:0,o=r&&r.visible?this._wSub>t.wMap||"chart"===r.prop("alignBase")?t.wChart:t.wMap:0;let a=this._wTitle>t.wMap||s&&"chart"===s.prop("alignBase")?0:t.xMap,h=this._wSub>t.wMap||r&&"chart"===r.prop("alignBase")?0:t.xMap;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=p(this._hTitle,this._hSub);u=p(u,u+t(s,e,this._hTitle)),m=p(m,m+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}},d=()=>{if(g=p(g,g+c(s,n,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":f=g;break;case"right":f=g+this._wTitle-this._wSub;break;default:f=g+(this._wTitle-this._wSub)/2}else f=p(f,f+c(r,o,this._wSub))},_=k(r.prop("titleGap"),0);let u=0,g=a,m=0,f=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"left":g=f+this._wSub+_,l();break;case"right":switch(f=g+this._wTitle+_,r.prop("align")){case"center":f=p(f,f+(o-this._wTitle-this._wSub)/2);break;case"right":f=p(f,h+o-this._wSub)}l();break;case"top":d(),u=m+this._hSub+_;break;default:d(),m=u+this._hTitle+_}break;case"right":switch(r.prop("position")){case"left":switch(g+=n-this._wTitle,r.prop("align")){case"center":f+=(n-this._wTitle-this._wSub)/2;break;case"right":f=g-_-this._wSub}l();break;case"right":f+=o-this._wSub,g=f-_-this._wTitle,l();break;case"top":d(),u=m+this._hSub+_;break;default:d(),m=u+this._hTitle+_}break;default:switch(r.prop("position")){case"left":switch(g+=(n-this._wTitle)/2,r.prop("align")){case"left":break;case"center":f+=(g-f-this._wSub)/2;break;case"right":f=g-_-this._wSub}l();break;case"right":switch(g+=(n-this._wTitle)/2,r.prop("align")){case"left":f=g+this._wTitle+_;break;case"center":f=g+this._wTitle+_,f+=(o-f-this._wSub)/2;break;case"right":f+=o-_-this._wSub}l();break;case"top":d(),u=m+this._hSub+_;break;default:d(),m=u+this._hTitle+_}}e.resizeByMeasured().layout().trans(g,u),i.resizeByMeasured().layout().trans(f,m)}else if(n>0||o>0){const t=n?s:r,l=n?e:i,c=n||o,d=n?this._wTitle:this._wSub;let _=n?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":_+=c-d;break;default:_+=(c-d)/2}l.trans(_,0)}}_doLocateInner(t,e,i){}}class Pc extends lh{constructor(t){super(t,Pc.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new ie(t,"rm-map-widget-group-widget-layer"))}getView(t){return this._dic.get(t)}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),n=this._gap=8,o=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new ht;return this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),o.forEach(((r,n)=>{r.measure(t,e.getWidget(n),i,s),this._dic.set(r.model,r)})),r?(o.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),o.length>1&&(a.height+=(o.length-1)*n)):(o.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),o.length>1&&(a.width+=(o.length-1)*n)),this._titleView.visible&&(this._inTitle?a.width+=this._rTitle.width:a.height+=this._rTitle.height),this._footerView.visible&&(this._inFooter?a.width+=this._rFooter.width+this._gapFooter:a.height+=this._rFooter.height+this._gapFooter),a}_doLayout(t){const e=this.model,i=this._titleView,s=this._footerView,r=this._margins,n=this._paddings,o=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+n.left,d=r.top+n.top;let _,u,p=this.width-c-r.right-n.right,g=this.height-d-r.bottom-n.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.prop("align")){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.prop("align")){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.prop("align")){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+o})):a.forEach((t=>{switch(t.model.prop("verticalAlign")){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+o}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return this._dic.clear(),e.forEach((e=>{let n=null==s?void 0:s.find((t=>t.model===e));n?(r.push(n),s.splice(s.indexOf(n),1)):(n=new(Mc[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}Pc.GROUP_CLASS="rm-map-widget-group";const Mc={legend:_h,colorScale:pc,bubbleScale:wc,group:Pc};class Lc extends oh{constructor(t,e){super(t),this._loc=e,this._horz=e==Q.TOP||e==Q.BOTTOM,this._vert=e==Q.LEFT||e==Q.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){let e=this._views.get(t);if(!e)for(const i of this._views.values())if(i instanceof Pc&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,i){return s(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof _h&&e.legendByDom(t);if(i)return i}}_doMeasure(t,e,i,s){const r=this._prepareViews(t,i,s);if(!this.setVisible(r.size>0))return;const n=this._gap=k(+e.general.prop("widgetGap"),0),o=new ht;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=p(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=p(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=i.mw,n=i.mh;let o=+s.prop("offsetX")||0,a=0,h=0;switch(s.prop("align")){case"right":a+=t-r-o;break;case"center":a+=(t-r)/2+o;break;default:a+=o}switch(o=+s.prop("offsetY")||0,s.prop("verticalAlign")){case"bottom":h+=e-n-o;break;case"middle":h+=(e-n)/2+o;break;default:h+=o}i.trans(a,h).resize(r,n),i.layout()}))}_prepareViews(t,e,i){const s=this._views,r=new Map;this._starts=[],this._ends=[],this._centers=[],this._models.forEach((e=>{let i=s.get(e);i?(r.set(e,i),s.delete(e)):(i=new(Mc[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.prop("align")){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.prop("verticalAlign")){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class Ac extends rh{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Je(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.prop("offsetX")||0,n=+t.prop("offsetY")||0;let o=0,a=0;switch(t.prop("verticalAlign")){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+n;break;default:a=e.y+n}switch(t.prop("align")){case"right":o=e.right-i-r;break;case"center":o=e.x+(e.width-i)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,i){const s=t.prop("location"),r=this.width,n=this.height,o=+t.prop("offsetX")||0,a=+t.prop("offsetY")||0;let h=0,l=0;switch(s){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=i-n-a}if("left"===s||"right"===s)switch(t.prop("verticalAlign")){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-n)/2+a}else switch(t.prop("align")){case"left":h=o;break;case"center":h=(e-r)/2+o;break;default:h=e-r-o}return{x:h,y:l}}_doMeasure(t,e,i,s){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.bbox()}}class kc extends ie{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this._mapRegionViews=[],this._mapRegionMap=new Map,this.add(this._annotationContainer=new ie(t,"rm-annotations")),this.add(this._bodyView=new hc(t,this)),this.add(this._mapRegionContainer=new ie(t,"rm-mapregions")),this.add(this._titleSectionView=new Cc(t)),this.add(this._widgetLayer=new ie(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new ie(t,"rm-front-annotations")),this.add(this._zoomPanelView=new bc(t)),this.add(this._drilldownPanelView=new yc(t)),this.add(this._mapScaleView=new xc(t)),this.add(this._creditView=new Ac(t)),this.add(this._tooltipView=new uc(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}getWidgetViews(t,e){return this._widgetMap[t],[]}measure(t,e,i,s){const r=(this._model=e)._credits,n=this._bodyView;let o,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible))switch(o=this._creditView.measure(t,r,a,h),r.prop("location")){case"body":break;case"right":case"left":a-=o.width+(+r.prop("offsetX")||0)+(+r.prop("gap")||0);break;default:h-=o.height+(+r.prop("offsetY")||0)+(+r.prop("gap")||0)}o=this._titleSectionView.measure(t,e,a,h),h-=o.height,n.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(Q)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Lc(t,r),this._widgetLayer.add(o),this._widgetMap[r]=o);const l=o._setWidgets(n,i,s).measure(t,e,a,h);if(l){const t=e.general.getWidgetSectionGap(r);r===Q.BOTTOM||r===Q.TOP?h-=l.height+t:r!==Q.RIGHT&&r!==Q.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this.$_prepareMapRegions(t,e.getMapRegions()),this._mapRegionViews.forEach(((e,r)=>{e.measure(t,this._mapRegions[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const n=this._bodyView;let o=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){h.resizeByMeasured();const t=h.width+(+a.prop("offsetX")||0)+(+a.prop("gap")||0),e=h.height+(+a.prop("offsetY")||0)+(+a.prop("gap")||0);switch(a.prop("location")){case"body":break;case"right":s-=t;break;case"left":s-=t,c+=t;break;case"top":r-=e,d+=e;break;default:r-=l=e}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=o=_.height);const u=this._widgetMap;for(const n in u){const o=u[n];if(o.visible){n===Q.RIGHT||n===Q.LEFT?(o.resize(o.mw,i),o.layout()):n===Q.TOP||n===Q.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.general.getWidgetSectionGap(n);switch(n){case Q.BOTTOM:r-=o.height+a;break;case Q.TOP:r-=o.height+a,d+=o.height+a;break;case Q.RIGHT:s-=o.width+a;break;case Q.LEFT:s-=o.width+a,c+=o.width+a}}}const p=_t.create(c,d,s,r);if(h.visible){const t="body"===a.prop("location")?h.locateInner(a,p):h.locateOuter(a,e,i);h.transp(t)}n.trans(p.x,p.y),n.resize(p.width,p.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case Q.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case Q.TOP:d=o+0,c=(e-s.width)/2;break;case Q.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case Q.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this.$_layoutMapRegions(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?s.x:r)-this.tx,h=(o?s.y:n)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model&&this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r,!1);let o;i instanceof Rl&&(o=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),o||(o=this._model.map.findByCoord(n)),r.coord=n,r.area=null==o?void 0:o.id,r.chart=this._model.wrapper,this._model.click(r)}}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}zoomChanged(t,e){this._bodyView.zoomChanged(t,e)}isAnimating(){}onScrollStart(){this.bodyView().onScrollStart()}onRotationStart(){this.bodyView().onRotationStart()}$_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.delete(t);n.forEach((t=>{r.get(t.model)||t.remove()})),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||sc(t,e);(!1===e.prop("front")?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,n,o,a;this._annotationViews.forEach((i=>{if("container"===i.model.prop("scope"))r=-s.left,n=-s.top,o=t+s.left+s.right,a=e+s.top+s.bottom;else r=n=0,o=t,a=e;i._layoutView(this,r,n,o,a)}))}$_prepareMapRegions(t,e){const i=this._mapRegionContainer,s=this._mapRegionMap,r=this._mapRegionViews;for(const t of s.keys())e.indexOf(t)<0&&s.delete(t);r.forEach((t=>{s.get(t.model)||t.remove()})),r.length=0,(this._mapRegions=e).forEach((e=>{const n=s.get(e)||new Sc(t);i.add(n),s.set(e,n),r.push(n)}))}$_layoutMapRegions(t,e,i){const s=this._bodyView,r=this.tx+s.tx,n=this.ty+s.ty,o=this.control._padding;let a,h,l,c;this._mapRegionViews.forEach((i=>{const d=s.boundsByCoord(i.model.prop("bounds")[0],i.model.prop("bounds")[1]);if("container"===i.model.prop("scope"))a=-o.left,h=-o.top,l=t+o.left+o.right,c=e+o.top+o.bottom;else a=h=0,l=t,c=e;d.x+=r,d.y+=n,i._layoutView(a,h,l,c,d)}))}$_layoutPanel(t,e){const i=t.model,s=i.prop("offsetX")||0,r=i.prop("offsetY")||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.prop("verticalAlign")){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.prop("align")){case"right":a+=e.width-s-n;break;case"center":a+=(e.width-n)/2+s;break;default:a+=s}t.trans(a,h)}}var Ic;!function(t){t.EXPORT="$$realmap_export"}(Ic||(Ic={}));class Ec extends te{static $_conf(t,e){!function(t,e){const i=qt(e);if(!t||!i)return;let s=Kt.get(t);s||Kt.set(t,s=new Set),s.add(i)}(t,e)}constructor(t,e){super(t,e),this._isLoading=!1,this.addElement(this._chartView=this._createChartView(t)),this.addElement(this._errorView=new Je(t,"rm-error-view")),this._chart=new Xa(null,((t,e)=>{this.changeModel(t,e)})),this._errorView.visible=!1}_createChartView(t){return new kc(t)}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e,i){this._chartView.zoomChanged(e,i),this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this.$_export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i},!1)}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearDefs(),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()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Ic.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}setLoading(t){this._isLoading=t}showErrorView(e="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=t.TextLayout.MIDDLE,this._errorView.text=e,this._errorView.stain();const{width:i,height:s}=this._errorView.bbox(),r=16+i/2,n=16+s/2;this._errorView.trans(r,n)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new sh(this)}_doBeforeRender(t){this._chart&&t.internalResetStyleOrClass(this._chart.general.prop("style"))}_doRender(t){const e=this.model,i=this._chartView,s=t.width,r=t.height;this._setBackgroundStyle(e.general.prop("backgroundStyle")),e&&(this.setData("theme",e.general.prop("theme"),!0),this.setResizeDelay(e.general.prop("resizeDelay")),e.prepareRender(),this.$_loadModules()),this.loaded||i.clean(),s>0&&r>0&&(i.measure(this.doc(),e,s,r),i.setRect(t),i.layout()),e&&e.afterRender()}_doAfterRender(){var t;if(this._chartView.bodyView().afterRender(),null===(t=this._chart)||void 0===t?void 0:t._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_updateTouchAction(){this.dom().style.touchAction=this.$_calcTouchAction()}isLoading(){return this._isLoading}_doWheel(t){return!(this.model&&!this.model.wheelable())}$_calcTouchAction(){const t=this.model;if(!(null==t?void 0:t.body))return"manipulation";const{x:e,y:i}=t.dragAxes();return e&&i?"none":e?"pan-y":i?"pan-x":t.interactive()?"pan-x pan-y":"manipulation"}$_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}$_export(t){if(!this.model||!this.chart.exporter.isCompose())return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(e,t)}}}const Tc={chartControl:Ec};class Nc{static getVersion(){return"1.1.20"}static setLicenseKey(t){Yt.code=t}static setDebugging(t){ee.DEBUGGING=t}static setLogging(t){it.LOGGING=t}static getDistance(t,e){return Ui.getDistance(t,e)}static setGlobals(t){Object.assign(Tc,t)}static createChart(t,e,i,s=!0,r){At.loadConfigAsync(i,!0);const n=new Tc.chartControl(t,e);return Nc.loadChart(n,i,s,r),n.chart[Ua]=n,n.chart}static async createChartAsync(t,e,i,s=!0,r){const n=new Ya(t,e);n.show();let o=null;try{await At.loadConfigAsync(i),o=new Tc.chartControl(t,e),o.setLoading(!0),o.chart[Ua]=o,Nc.loadChart(o,i,s,r)}catch(t){Za.handleChartInitError(t,o)}finally{null==o||o.setLoading(!1),n.hide(),n.dispose()}return o.chart}static preset(t,e){return In.createStockInset(t,e)}static loadChart(t,e,s,r){t.chart.load(i(e)?e:{},s,r)}}class Vc{constructor(){this._moduleMap=new Map}static getInstance(){return Vc.instance||(Vc.instance=new Vc),Vc.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Vc.instance=null,Vc.ModuleNames={realchart:"realchart"};const $c=Nc.getVersion,Rc=Nc.setDebugging,Dc=Nc.setLogging,Oc=Nc.setGlobals,Bc=Nc.getDistance,Fc=Nc.createChart,zc=Nc.createChartAsync,jc=Nc.preset,Gc=Nc.setLicenseKey;t.Annotation=Gi,t.AnnotationView=ph,t.BandSeriesType="band",t.BarSeries=wo,t.BarSeriesView=ol,t.Body=Fa,t.BodyView=hc,t.BubbleSeries=$s,t.BubbleSeriesView=hl,t.ChartAnnotationType="chart",t.ChartControl=Ec,t.ChartElement=rh,t.ChartItem=_i,t.ChartObject=Ga,t.ChartView=kc,t.CircleElement=ml,t.CircleGauge=Io,t.CircleGaugeView=gl,t.ClockGauge=zo,t.ClockGaugeView=yl,t.Color=ot,t.ColorRanger=Hs,t.CoordBaseSeries=vs,t.Credits=Mi,t.DEG_RAD=w,t.DataPoint=ss,t.DataPointLabel=os,t.Dom=mt,t.DragTracker=qa,t.ElementPool=ch,t.Exporter=er,t.ExternalModuleManager=Vc,t.FeatureSeriesType="feature",t.FigureSeries=Ho,t.FigureSeriesView=xl,t.GLPointSeriesType="glpoint",t.HeatmapSeriesType="heatmap",t.HtmlAnnotation=Jn,t.HtmlAnnotationView=Ql,t.HtmlSeries=Zo,t.HtmlSeriesView=ec,t.ImageAnnotation=Qn,t.ImageAnnotationView=Xh,t.ImageElement=Ha,t.ImageSeries=Ko,t.ImageSeriesView=Sl,t.LayerElement=ie,t.Legend=js,t.LineElement=Lh,t.LineSeries=ta,t.LineSeriesView=Ml,t.MapArea=Fn,t.MapAxis=gr,t.MapAxisBandGuide=dr,t.MapAxisGuide=lr,t.MapAxisLineGuide=cr,t.MapAxisRangeGuide=_r,t.MapChart=Xa,t.MapCrosshair=pr,t.MapSeries=aa,t.MapSeriesType="map",t.MapSeriesView=Rl,t.MapTool=sh,t.MarkerSeries=Cs,t.MarkerSeriesPoint=Ss,t.MarkerSeriesPointView=zh,t.MarkerSeriesView=jh,t.ORG_ANGLE=y,t.OrthogonalSparkSeries=ks,t.PI=f,t.PI_2=b,t.PanelSeries=ua,t.PanelSeriesView=zl,t.PathElement=ne,t.PieSeries=ma,t.PieSeriesView=Hl,t.PinSeries=ya,t.PinSeriesView=Yl,t.PointElement=Rh,t.PointLabelView=Eh,t.PointSeries=Pa,t.PointSeriesView=Ul,t.PointViewPool=Ih,t.PolyLineElement=Ah,t.RAD_DEG=x,t.RectElement=Xi,t.RegionSeriesType="region",t.RmElement=ee,t.RouteSeries=Aa,t.RouteSeriesType=Zi,t.RouteSeriesView=Kl,t.SVGNS=Lt,t.SankeySeriesType="sankey",t.SectionView=oh,t.SectorElement=ll,t.Series=bs,t.SeriesAnimation=Jh,t.SeriesView=Bh,t.ShapeAnnotation=to,t.ShapeAnnotationView=Kh,t.Size=ht,t.SparkSeries=Ls,t.Subtitle=Kn,t.TableSeriesType="table",t.TextAnnotation=eo,t.TextAnnotationView=qh,t.TextElement=Je,t.TiledWebSeriesType="tiledweb",t.Title=Xn,t.TrackSeriesType="track",t.Utils=it,t.ValuePoint=ws,t.ValueSeries=xs,t.VectorSeriesType="vector",t.WaffleSeries=Ia,t.WaffleSeriesView=Jl,t._isIE=L,t.absv=g,t.assignObj=h,t.calcPercent=X,t.ceil=c,t.copyObj=m,t.cos=d,t.createChart=Fc,t.createChartAsync=zc,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=li,t.fixnum=It,t.floor=l,t.getDistance=Bc,t.getVersion=$c,t.incv=N,t.isArray=s,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=i,t.isString=n,t.maxv=p,t.minv=u,t.parseCoord=Ni,t.parsePercentSize=U,t.pickNum=k,t.pickProp=E,t.pickProp3=T,t.pixel=D,t.preset=jc,t.rectToSize=ct,t.setDebugging=Rc,t.setGlobals=Oc,t.setLicenseKey=Gc,t.setLogging=Dc,t.sin=_}));