realmap 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +91 -39
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* realmap v1.0.
|
|
3
|
+
* realmap v1.0.1
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"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&&!i(t))return h({},t)},f=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):e):t},y=function(t,e){return void 0!==t?t:e},w=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},x=(t,e,s)=>t+(e-t)*s;class v{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}v._debugging=!1;var S=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))};class C{static loadConfigAsync(t,e=!1){return S(this,void 0,void 0,(function*(){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(i(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=i(t.map)?t.map:[t.map];for(const t of r)!s(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하가 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=yield fetch(t.url).then((t=>t.json())))}if(t&&t.series){const r=i(t.series)?t.series:[t.series];for(const t of r)!s(t.data)&&!i(t.data)&&n(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하가 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=yield fetch(t.dataUrl).then((t=>t.json())),delete t.dataUrl))}}))}}const L={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let P=L.ko;const k=void 0,M="%".charCodeAt(0),A=Math.PI,V=2*A,E=-A/2,N=A/180,T=180/A;function D(t){return t>V?t%V:t}function $(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function O(t){return 180*t/Math.PI}function F(t){return t+"px"}function I(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function j(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function Y(t,e){let s,i;if(null==t||Number.isNaN(t)){if(e)return null;i=0,s=!0}else if(!(s=!isNaN(i=+t))){const s=t.trim();if(s.charCodeAt(s.length-1)===M&&(i=1===s.length?NaN:parseFloat(s)),isNaN(i)){if(e)return null;q(P.invalidSizeValue,t)}}return{size:i,fixed:s}}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z={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"},X=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var U;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(U||(U={}));const q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",Q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),s=f(parseFloat(e[0]),0),i=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(i)?s:i:n,r:isNaN(i)?s:i,t:s,b:isNaN(r)?s:r}}const tt=Object.freeze([0,0]);function et(t){return isFinite(t[0]+t[1])}function st(t){let e=1/0,s=1/0,i=-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),s=u(s,...o),i=p(i,...t),r=p(r,...o)}return{h1:e,v1:s,h2:i,v2:r}}const it=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const rt="undefined"!=typeof navigator?navigator.userAgent:"",nt=rt?navigator.appVersion:"",ot=!!rt.match(/Trident.*rv\:11\./),at=-1!==nt.indexOf("MSIE 10"),ht=-1!==nt.indexOf("MSIE 9"),lt=ot||at||ht;class ct{static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&ct.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(u(s,ct.month_days[ct.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-it}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=p(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=p(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=ct.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),ct.log(t,+new Date-s+"ms")}static clamp(t,e,s){return p(e,u(s,t))}static clampEx(t,e,s){return isNaN(e)||(t=p(e,t)),isNaN(s)||(t=u(s,t)),t}static makeIntArray(t,e){const s=new Array(p(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=g(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const s=(e[0]-t[0])*N,i=(e[1]-t[1])*N,r=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t[0]*N)*Math.cos(e[0]*N)*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],s=t[0];for(let i=1;i<t.length;i++)e=u(e,t[i]),s=p(s,t[i]);return{min:e,max:s}}}ct.LOGGING=!1,ct.week_days=["일","월","화","수","목","금","토"],ct.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ct.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]];const dt=Object.freeze({x:0,y:0,width:0,height:0}),_t=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function ut(t){return{width:t.width,height:t.height}}function pt(t){return t.width<=0||t.height<=0}class gt{static create(t,e,s,i){const r=arguments.length;return ct.isObject(t)?new gt(t.x,t.y,t.width,t.height):r<2?new gt(t,t,t,t):r<3?new gt(t,e,t,e):new gt(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new gt(this.x,this.y,this.width,this.height)}getInner(){return new gt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}gt.Empty=new gt,gt.Temp=new gt;const mt={inOutSine:t=>-(d(A*t)-1)/2};class ft{constructor(){this.delay=0,this.duration=ft.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=u(1,p(0,$(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 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,s=null){this._started&&this._stop(),this.duration=f(t,ft.DURATION),this.delay=e||0,this._easing=mt[s],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}}ft.DURATION=700,ft.SHORT_DURATION=300;let bt=0;class yt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(bt++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestory(),this.$_destroyed=!0),null}_doDestory(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class wt extends yt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const xt=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),vt=.001,St=Math.PI;class Ct{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s}static lines2(...t){let e=0;const s=["M",t[e].x,t[e].y];for(;e<t.length;e++)s.push("L",t[e].x,t[e].y);return s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){return r>0?n>0?(r=u(-i/2,s/2,r),["M",t,e-(n=u(-i/2,s/2,n)),"v",i+n+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",i+(r=u(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:n>0?["M",t,e-(n=u(-i/2,s/2,n)),"v",i+n,"h",s,"v",-i-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=u(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static ellipse(t,e,s,i){return this.arc(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,!0)}static arc(t,e,s,i,r,n,o,a=!1){const h=D(g(n-r)),l=2*St-h<.01,c=h-St<.01?0:1,u=o?1:0,p=d(r),m=_(r),f=d(n-=l?u?vt:-.001:0),b=_(n),y=[];return y.push("M",t+s*p,e+i*m,"A",s,i,0,c,u,t+s*f,e+i*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,n,o,a){const h=D(g(o-n)),l=2*St-h<vt;let c=h-St<vt?0:1;const u=a?1:0,p=d(n),m=_(n),f=d(o-=l?u?vt:-.001:0),b=_(o),y=s*r,w=i*r,x=[];return x.push("M",t+s*p,e+i*m,"A",s,i,0,c,u,t+s*f,e+i*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,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*_(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,c=i/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*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,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ct[e](0,0,2*s,2*i);break;default:r=Ct.circle(s,i,u(s,i))}t.setPath(r)}static pin(t){const{rd:e,cx:s,cy:i,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",s-r,i,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}var Lt;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Lt||(Lt={}));const Pt={name:"RealMap",version:"1.0.0",license:"enterprise",code:""};class kt{static decode(t){const e=kt.CHARS,s=kt.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}kt.PAD="=",kt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Mt{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=Mt.xor,i=Mt.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=Mt.xor,i=Mt.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=Mt.kb,i=Mt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*Mt.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=c.p.length;r<o;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)i(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const s=Mt._decryptBlock;let i=Mt._init(e),r=[],n=kt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Mt.POW24|n[a+1]*Mt.POW16|n[a+2]*Mt.POW8|n[a+3],h.right=n[a+4]*Mt.POW24|n[a+5]*Mt.POW16|n[a+6]*Mt.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}Mt.POW2=Math.pow(2,2),Mt.POW3=Math.pow(2,3),Mt.POW4=Math.pow(2,4),Mt.POW8=Math.pow(2,8),Mt.POW16=Math.pow(2,16),Mt.POW24=Math.pow(2,24),Mt.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 At{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 s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}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={},s=Mt.decrypt(t,"dkdl"+this._getLDKey(Mt.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}let Vt=651212;class Et{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=s.pageYOffset||n.scrollTop||r.scrollTop,a=s.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+a-l,d=i.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,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)Et.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static removeStyles(t,e){if(e)for(const s in e)t[s]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,s){if(e!=s){if(s)for(const e in s)t[e]="";return e&&Object.assign(t,e),e}return s}static createElement(t,e,s){const i=t.createElement(e);return s&&Object.assign(i.style,s),i}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const o={},a={};return o[e]=s,a[e]=i,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+Vt++}static createBR(t,e){const s=t.createElement("br");return s.className=e,s}static createSpan(t,e){const s=t.createElement("span");return e&&Object.assign(s.style,e),s}static createCheckBox(t,e){const s=t.createElement("input");return s.type="checkbox",e&&Object.assign(s.style,e),s}static createRadio(t,e){const s=t.createElement("input");return s.type="radio",e&&Object.assign(s.style,e),s}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){v.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}const Nt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Tt extends yt{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._windowResized()},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._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._pointerDownHandler=t=>{var e;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._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t)},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)},function(){const t=location.hostname;let e;try{if(e=realMapLic,!e)return!1}catch(t){return!1}const s=At.decrypt(e);if("RealMap"!=s.name||"RealMap"!==Pt.name)return!1;const i=s.server.toLowerCase(),r=location.pathname.toLowerCase();if(Pt.license!=Lt.Developer&&!At.includedDomains(i,t.toLowerCase(),r))return!1;const n=s.lic.toLowerCase();if(!Object.values(Lt).includes(n))return!1;if(Pt.code=s.code,Pt.license=s.lic,n==Lt.Evaluation||n==Lt.Limited){const t=s.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Tt.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)):console.error("need license!")}_doDestory(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Et.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}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)}clearDefs(){Et.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(Dt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Dt.TEMP_KEY)}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)}}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 in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){return this.clip(new jt(this.doc(),t,e,s,i,r,r))}clip(t){return this._defs.appendChild(t.dom),t}_setTesting(){this._testing=!0,Dt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||q(P.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");Object.assign(n.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)"}),n.className=i,this._container.appendChild(n);const o=this._svg=r.createElementNS(t,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Rt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.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(e,s){let i=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");i.setAttribute("id",Tt.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.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(),s=this._padding=Et.getPadding(this._root.dom),i=s.left,r=s.top,n=this._svg.clientWidth-i-s.right,o=this._svg.clientHeight-r-s.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:i,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=i+(n-t.width)/2+"px",a.style.top=r+(o-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._invalidElements=[],this._doAfterRender()}ct.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(){}_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){}_windowResized(){this.invalidateLayout()}}Tt.CLASS_NAME="rm-control",Tt.SHADOW_FILTER="rm-shadow-filter";class Dt extends yt{static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,s,i){for(;e.length<s;){const s=i();t.add(s),e.push(s)}}static fit(t,e,s,i,r,n){for(;s.length>i;)s.pop().remove();for(;s.length<i;){const i=new r(t,n);e.add(i),s.push(i)}}constructor(e,s,i=k){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s)&&this.setAttr("class",s),this._doInitStyles()}_doInitStyles(){}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._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&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}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}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}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}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 j(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e).resize(s,i),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return gt.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=ct.isValidNum(t)?t:this._tx,e=ct.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)}transEx(t,e,s=0,i=!0){if(t=ct.isValidNum(t)?t:this._tx,e=ct.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(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&&ct.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ct.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==k&&(this._dom.setAttribute("style",this._saveStyle),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(X(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(X(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(X(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(X(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}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 s=!1;if(t){for(let i in t)if(i in Nt&&this._styles[i]!==t[i]){if("borderRadius"===i)this._setBackgroundBorderRadius(f(parseFloat(t[i]),0)),this._styles[i]=t[i];else if(i in Nt){const s=Nt[i];e[s]=this._styles[s]=t[i]}s=!0}s&&(this._styleDirty=!0)}return s}setStyle(t,e){let s=!1;return t in Nt||e===this._styles[t]||(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let s=!1;return t in Nt&&e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}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]=y(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 s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}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}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.$_setClip(n),n}clipPath(t){const e=this.control.clip(new zt(this.doc).setPath(t));return this.$_setClip(e),e}attachClipPath(t){this.setAttr("clip-path",this.createClipId(t))}detachClipPath(){this.unsetAttr("clip-path")}$_setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}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}}_testing(){return Dt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(ct.isValidNum(e)||ct.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),ct.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+ct.pick(this._originX,t.getAttribute("x"),0)+" "+ct.pick(this._originY,t.getAttribute("y")||0)+")");const r=ct.getNum(this._scaleX,1),n=ct.getNum(this._scaleY,1);1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length&&this._dom.setAttribute("transform",i.join(" "))}}Dt.TESTING=!1,Dt.DEBUGGING=!1,Dt.ASSET_KEY="_asset_",Dt.TEMP_KEY="_temp_";class $t extends Dt{constructor(t,e=void 0){super(t,e,"g")}}class Rt extends Dt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Ot extends Dt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Ft extends Dt{constructor(t,e,s=!1){super(t,e,s?"g":"path"),this.group=s}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 It extends Dt{constructor(t){super(t,k,"mask");const e=this._id=ct.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Bt extends Dt{constructor(t){super(t,k,"clipPath");const e=this._id=ct.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class jt extends Bt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Dt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class zt extends Bt{constructor(t,e){super(t),this._path=new Ot(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var Ht;!function(t){t.SIDO="sido"}(Ht||(Ht={}));const Gt="shuffle",Yt="random";var Wt;class Zt{constructor(t){this.source=t}hasDef(){return!0}}class Xt extends Zt{_setStops(e,s){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),o=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=i(o)?o[0]:o,l=i(o)&&o.length>1?o[1]:"white",c=i(a)?a[0]:a,d=i(a)&&a.length>1?a[1]:a;s.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),s.appendChild(r),s.appendChild(n)}}class Ut extends Xt{getElement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ut.TYPE="lineargradient";class qt extends Xt{getElement(e,s){const i=e.createElementNS(t,"radialGradient");return B(s.cx)||i.setAttribute("cx",s.cx),B(s.cy)||i.setAttribute("cy",s.cy),B(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}qt.TYPE="radialgradient";class Kt extends Zt{getElement(e,i){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,l,c,d,_=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+i.pattern>=0){const t=Kt.STOCK[+i.pattern%Kt.STOCK.length];a=t.path,l=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(i.pattern)&&(a=i.pattern,c=i.width||i.height||20,d=i.height||i.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),l&&h(o.style,l),i.style&&h(o.style,i.style),_&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(c)),s.setAttribute("height",String(d))}return i.transform&&r.setAttribute("patternTransform",i.transform),r.append(o),r}}Wt=Kt,Kt.TYPE="pattern",Kt.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}],Kt.SELECT=Object.assign(Wt.STOCK[4],{id:"rm-selected-area-fill",pattern:Wt.STOCK[4].path,transform:"scale(0.5)"});class Qt extends Zt{prepare(){const t=this.source;return this._colors=i(t.colors)?t.colors.slice():[],t.mode===Yt?this._index=-1:(t.mode===Gt&&ct.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=i(e.colors)?e.colors:[]}}Qt.TYPE="colors";class Jt extends Zt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Jt.SIZE,height:e.height||e.width||Jt.SIZE})}}Jt.TYPE="images",Jt.SIZE=20;class te{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(s(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new Kt(Kt.SELECT);const s=this._selectedFill.getElement(t,this._selectedFill.source);s.setAttribute(Dt.ASSET_KEY,"1"),e.addDef(s),this._items.forEach((s=>{const i=s.getElement(t,s.source);i.setAttribute(Dt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Kt.TYPE:i(t.colors)?e=Qt.TYPE:i(t.images)&&(e=Jt.TYPE)),e)switch(e.toLowerCase()){case Ut.TYPE:return new Ut(t);case qt.TYPE:return new qt(t);case Kt.TYPE:return new Kt(t);case Qt.TYPE:return new Qt(t);case Jt.TYPE:return new Jt(t)}}}}const ee="0".charCodeAt(0),se="#".charCodeAt(0),ie=",".charCodeAt(0),re="s".charCodeAt(0),ne="a".charCodeAt(0);class oe{static getFormatter(t){let e=oe.Formatters[t];return e||(oe.Formatters[t]=e=new oe(t)),e}static get Default(){return oe.getFormatter(oe.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 s=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,s}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===ee;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===se;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===ee;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ie){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===re){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===ne){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s}}}oe.DEFAULT_FORMAT="",oe.Formatters={};const ae=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],he=[".","/","-",":"],le="Z".charCodeAt(0),ce="z".charCodeAt(0),de="A".charCodeAt(0),_e="a".charCodeAt(0),ue="y".charCodeAt(0),pe="M".charCodeAt(0),ge="m".charCodeAt(0),me="W".charCodeAt(0),fe="w".charCodeAt(0),be="d".charCodeAt(0),ye="H".charCodeAt(0),we="h".charCodeAt(0),xe="S".charCodeAt(0),ve="s".charCodeAt(0);class Se{static getFormatter(t){let e=Se.Formatters[t];return e||(Se.Formatters[t]=e=new Se(t)),e}static get Default(){return Se.getFormatter(P.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||P.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case ue:i+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case pe:i+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case be:i+=a>1?z(t.getDate()):t.getDate();break;case me:i+=a>1?z(ct.weekOfYear(t,e)+1):ct.weekOfMonth(t,e,!0)+1;break;case fe:i+=a>1?ct.long_week_days[t.getDay()]:ct.week_days[t.getDay()];break;case ye:i+=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),i+=a>1?z(e):e}else i+=a>1?z(t.getHours()):t.getHours();break;case ge:i+=a>1?z(t.getMinutes()):t.getMinutes();break;case ve:i+=a>1?z(t.getSeconds()):t.getSeconds();break;case _e:case de:t.getHours()<12?i+=P.am:i+=P.pm;break;case xe:let s=t.getMilliseconds();i+=3==a?H(s):2==a?z(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(he.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),ae.indexOf(n)<0){let e=n.charCodeAt(0);(e>=de&&e<=le||e>=_e&&e<=ce)&&q(P.invalidDateFormat,t)}e.push(n)}if(r<i&&ct.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ct.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||P.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Se.Formatters={};const Ce=["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"],Le=["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"];class Pe{static create(t){return n(t)?new Pe(t):void 0}static isBright(t){return new Pe(t).isBright()}static getContrast(t,e,s){return new Pe(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Pe(null);return i.r=Math.ceil(t.r+(e.r-t.r)*s),i.g=Math.ceil(t.g+(e.g-t.g)*s),i.b=Math.ceil(t.b+(e.b-t.b)*s),i.a=t.a+(e.a-t.a)*s,i}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(ct.startsWith(t,"rgb(")&&ct.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(ct.startsWith(t,"rgba(")&&ct.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(ct.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Pe.COLORS[t]&&this.$_parseNumber(Pe.COLORS[t])}}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Pe(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var ke,Me,Ae;Pe.COLORS=function(){const t={};for(let e=0;e<Ce.length;e++)t[Ce[e]]=Le[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ke||(ke={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Me||(Me={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ae||(Ae={}));class Ve extends Dt{constructor(t,e=k){super(t,e,"text"),this._layout=Me.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(t){const e=this.bbox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Me.MIDDLE:i=Math.floor(s/2);break;case Me.BOTTOM:i=s-e.height;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Pe.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}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 Ee="$_TH",Ne="$_TW";class Te{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?oe.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Se.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),k),0===this._literals[2].length&&(this._literals[2]=k)}else this._literals.push(r,n,k,k);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class De extends Te{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class $e extends De{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-link")}}const Re={t:class extends De{tag(){return"</t>"}},b:class extends De{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-bold")}},i:class extends De{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-italic")}},a:$e};class Oe{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new Te).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in Re){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new Re[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const Fe=/<br.*?>|\r\n|\n/;class Ie{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,i,r,n,o){const a=e.doc,h=f(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];e.clearDom(),n=n||e;const u=e.getStyle("writing-mode"),g=u===K||u===Q;for(let i=0;i<c;i++){const r=l[i];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===i&&0===h,_=i===c-1&&h===r.words.length-1,b=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=d&&t.prefix||"",s=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+s}const y=b.getBBox();if(b[Ne]=y.width,b[Ee]=y.height,g?(u=p(u,b[Ne]),m+=b[Ee]):(u+=b[Ne],m=p(m,b[Ee])),f||(f=b),l instanceof $e){const s=a.createElementNS(t,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(b),e.appendDom(s)}}_.push(f),r[Ee]=m*h,r[Ne]=u*h,d.push(0==i?r[Ne]/2:r[Ne])}if(c>0){let t=l[0];for(let s=1;s<_.length;s++)if(_[s]){let i=0,r=0;if(g?null!=_[s-1]&&(i=Math.floor(t[Ne]-e.getAscent(t[Ne]))+e.getAscent(l[s][Ne])):r=t[Ee]-e.getAscent(t[Ee])+e.getAscent(l[s][Ee]),null==_[0]&&_[s]==_.find((t=>null!=t))){const r=e.insertElement(a,"tspan",_[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[Ne]=n.width,r[Ee]=t[Ee]=n.height,_[0]=r}switch(u){case K:_[s].setAttribute("dx",String(i)),_[s].setAttribute("y","0");break;case Q:_[s].setAttribute("dx",String(-i)),_[s].setAttribute("y","0");break;default:_[s].setAttribute("x","0"),_[s].setAttribute("dy",String(r))}t=l[s]}if(g){const t=e.parent.dom.classList.contains("rm-annotation"),s=e.bbox().width,[i]=_,r=i[Ne];if(t)i.setAttribute("dx",String(u===Q?s-r/2:r/2));else switch(u){case K:i.setAttribute("x",String((s-r)/-2));break;case Q:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(l[0][Ee])}}layout(t,e,s,i,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===K||h===Q)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=ke.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=ke.END,a=n.height-r.bottom;break;default:t.anchor=ke.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=ke.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=ke.END,o=s-r.right;break;default:t.anchor=ke.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(Fe);for(let t of s)e.push((new Oe).parse(t))}}}let Be=0;const je=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},ze=function(t,e){const r=s(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];i(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):s(n)?r[t]=ze(r[t],n):r[t]=n}return r};class He extends yt{constructor(t){super(),this.chart=t,Be++}_init(){const t=this._op=ze({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t)}saveOptions(){const t={visible:this.visible};return this._doSave(t),t}updateOptions(t,e=!0){const i=this,r=this._op;return void 0===t||this._doSetSimple(t)||ze(r,t),this.$_applyOptions(r),s(t)&&function(t){if(i._children)i._children.forEach((e=>t.hasOwnProperty(e)&&i[e].updateOptions(t[e])));else{i._children=[];for(const e in i){const s=i[e];s instanceof He&&(i._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,s=!0){if(this[t]instanceof He)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._optionChanged())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s[t]=!a(i)||!i,this.$_applyOptions(s),e&&this._optionChanged(),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t)){delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=ze({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((s=>e._op[s]=t(e[s])));else{e._children=[];for(const s in e){const i=e[s];i instanceof He&&(e._op[s]=t(i))}}return e._op}(this),t&&this._optionChanged(),this}_prepareRender(){this._doPrepareRender(this.chart)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof He?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):s(n)?t[r]=Object.assign({},n):t[r]=n)}}_doSetSimple(t){if(a(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){e.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let r=t[e];this._doLoadProp(e,r)||(this[e]instanceof He?this[e].updateOptions(r):i(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):s(r)?this[e]=h({},r):this[e]=r)}}_doPrepareRender(t){}_doAfterRender(){}}He.REFRESHED="refreshed",He.defaults={visible:!0};class Ge{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 Ye extends He{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=f(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?oe.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Ie),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(ct.isValidNum(t)){const i=this._numSymbols&&e&&ct.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,s,i){let r="";if(ct.isValidNum(t)){const n=this._numSymbols&&e&&ct.scaleNumber(t,this._numSymbols,s);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,i)+n.symbol:this._numberFormatter.toStrEx(t,i):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Ye.defaults=je(He.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class We extends Ye{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof Jt&&(this._images=e)}this._root=this._images?"":this._op.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 s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof Jt?s.getImage(i):i}return this._root+t}}}We.defaults=je(Ye.defaults,{iconPosition:"default",iconGap:2});class Ze extends He{constructor(){super(...arguments),this.index=-1}get series(){return this._series}getLocation(){return this._location}isReversed(){return"left"===this._location||"top"===this._location}_doApply(t){super._doApply(t)}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=this._op.location||"bottom",this._series=t.seriesByName(e.series)||this._getFirstSeries(t)}_getFirstSeries(t){return t.firstMapSeries}}Ze.defaults=je(He.defaults,{offsetX:0,offsetY:0});class Xe extends Ge{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t){return n(t)?this._map[t]:this._items[t]}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options.colorScale=this._items.map((t=>t.options))}$_loadItem(t,e,s){const i=this._createScale(t);return i._init(),i.index=s,i._load(e),i}}const Ue={};class qe extends He{static register(...t){t.forEach((t=>{Ue[t.type]=t}))}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this._op;let i,r;return this.inBody&&(s.x1,s.x2,s.y1,s.y2,this._x=this._y=this._w=this._h=NaN),isNaN(i)?i=W(this._widthDim,t):i<0&&(this._x+=i,i=-i),isNaN(r)?r=W(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:i,height:r}}getPosition(t,e,s,i,r,n){let o,a,h;if(isNaN(a=this._x))switch(o=this.getOffset(r,n),a=t,this._op.align){case"center":a+=(s-r)/2+o.x;break;case"right":a+=s-o.x-r;break;default:this._anchorObj?a+=(s-r)/2+o.x:a+=o.x}else o=o||this.getOffset(r,n),a=this._x+o.x;if(isNaN(h=this._y))switch(o=o||this.getOffset(r,n),h=e,this._op.verticalAlign){case"middle":h+=(i-n)/2-o.y;break;case"bottom":h+=i-o.y-n;break;default:h+=o.y}else o=o||this.getOffset(r,n),h=this._y+o.y;return{x:a,y:h}}refresh(){}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}qe.defaults=je(He.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ke extends Ge{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof qe)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e))})):s(t)&&n.push(this.$_loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a._init(),a.index=s,a._load(e),a}}const Qe="route",Je="map",ts="heatmap",es="tiledweb";class ss extends Dt{static create(t,e,s,i,r,n,o=0){return new ss(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=void 0,s=void 0){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,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)}}const is={FO:[-6.926,61.935],UM:[-161.881,5.874],US:[-100.054,38.95],JP:[137.363,36.254],SC:[55.336,-4.582],IN:[77.712,23.832],FR:[3.636,46.78],FM:[158.082,6.859],CN:[98.592,35.308],SW:[-78.538,15.86],SH:[117.621,15.128],BR:[-52.768,-8.476],EC:[-79.861,-.951],AU:[135.555,-24.588],KI:[-157.184,1.814],PH:[121.006,16.567],MX:[-102.12,23.983],ES:[-1.595,39.591],BU:[-79.893,15.769],MV:[73.421,5.526],SP:[115.707,10.82],GB:[-1.839,52.506],GR:[22.599,36.681],AS:[-170.525,-14.3],DK:[9.427,56.37],GL:[-39.018,75.593],GU:[144.57,13.448],MP:[145.575,15.13],PR:[-66.143,18.122],VI:[-64.657,17.73],CA:[-115.256,59.415],ST:[6.617,.24],TZ:[35.004,-6.367],CV:[-23.58,15.095],DM:[-61.289,15.406],NL:[6.492,53.515],JM:[-77.2,18.063],WS:[-172.316,-13.651],OM:[58.793,22.119],VC:[-61.127,13.19],TR:[32.129,39.009],BD:[91.905,22.233],SB:[159.895,-9.419],LC:[-60.92,13.905],NR:[166.755,-.527],NO:[8.419,60.753],KN:[-62.633,17.288],BH:[50.478,25.994],TO:[-174.925,-21.171],FI:[25.914,62.545],ID:[112.847,-1.004],MU:[57.54,-20.281],SE:[16.306,62.823],TT:[-61.263,10.416],MY:[116.988,5.343],BS:[-77.04,26.457],PA:[-81.679,8.405],PW:[134.398,7.472],TV:[179.008,-8.486],MH:[170.969,7.089],CL:[-71.933,-53.598],TH:[99.453,13.237],GD:[-61.602,12.116],EE:[24.023,58.725],AG:[-61.72,17.057],TW:[120.561,23.799],BB:[-59.506,13.174],IT:[12.07,42.271],MT:[14.39,35.877],PG:[144.268,-6.42],DE:[10.769,52.338],VU:[166.879,-14.948],SG:[103.716,1.336],CY:[32.94,34.876],KM:[43.265,-11.648],FJ:[177.763,-17.844],RU:[116.768,62.184],VA:[12.445,41.859],SM:[12.426,43.899],KZ:[69.685,48.81],AZ:[48.953,40.077],AM:[43.71,40.972],TJ:[70.97,38.844],LS:[28.196,-29.619],UZ:[63.788,41.154],PT:[-7.96,39.503],MA:[-7.418,32.961],CO:[-72.763,3.458],TL:[125.957,-8.667],KH:[106.595,12.595],AR:[-64.544,-31.651],SA:[43.575,24.38],PK:[65.477,27.35],YE:[46.702,14.193],AE:[54.339,23.834],KE:[40.821,-1.765],PE:[-72.624,-12.919],DO:[-70.177,18.918],HT:[-72.184,19.768],AO:[17.848,-13.567],VN:[105.093,9.209],MZ:[38.994,-15.14],CR:[-85.488,10.921],IR:[55.16,32.532],SV:[-88.819,13.763],SL:[-11.852,8.517],GW:[-15.062,11.83],HR:[15.471,44.023],BZ:[-88.588,17.17],ZA:[22.378,-31.062],CD:[23.249,-2.545],KW:[47.417,29.211],IE:[-8.492,53.326],KP:[126.253,39.576],KR:[127.616,36.448],GY:[-60.029,8.028],HN:[-84.851,15.721],MM:[93.663,19.758],GA:[10.77,-1.748],GQ:[10.388,1.604],NI:[-85.521,11.48],UG:[30.384,1.098],MW:[33.379,-11.797],SX:[47.38,9.636],TM:[57.736,39.678],ZM:[24.768,-14.824],NC:[33.685,35.192],MR:[-9.464,19.464],DZ:[4.338,28.318],LT:[22.486,56.241],ET:[39.713,8.248],SD:[30.178,15.394],ER:[37.061,16.638],GH:[-2.632,6.208],SI:[14.998,46.019],GT:[-91.228,14.582],BA:[19.032,43.715],JO:[35.197,30.08],SY:[37.367,34.605],MC:[7.398,43.693],AL:[19.948,41.178],UY:[-54.091,-33.141],CNM:[33.1,35.128],MN:[103.413,46.722],RW:[29.783,-1.991],SO:[44.948,1.869],BO:[-63.791,-17.523],CM:[10.632,5.494],CG:[12.218,-3.09],EH:[-13.634,22.764],RS:[20.629,44.144],ME:[19.218,42.7],BJ:[2.516,9.301],NG:[8.668,10.712],TG:[1.183,7.053],LA:[106.65,16.035],AF:[65.88,33.737],UA:[34.689,48.739],SK:[18.01,48.516],JK:[77.109,35.261],BG:[27.047,42.676],QA:[51.077,25.34],LI:[9.547,47.109],AT:[13.385,47.391],SZ:[31.418,-26.531],HU:[17.899,46.861],RO:[26.522,45.94],LU:[6.078,49.679],AD:[1.593,42.518],CI:[-5.559,7.414],LR:[-7.632,5.393],BN:[114.295,4.607],BE:[4.472,50.722],IQ:[43.218,33.744],GE:[41.618,42.404],GM:[-16.166,13.386],CH:[6.631,46.572],TD:[18.378,13.499],KV:[20.845,42.495],LB:[35.653,33.732],DJ:[42.603,11.707],BI:[29.98,-3.31],SR:[-54.231,5.457],IL:[35.309,32.984],ML:[-2.536,19.441],SN:[-16.115,14.461],GN:[-13.134,9.817],ZW:[31.526,-18.524],PL:[19.318,53.256],MK:[21.667,41.636],PY:[-58.484,-23.396],BY:[27.908,53.75],LV:[21.37,57.167],CZ:[15.531,49.557],BF:[-.457,12.785],NA:[16.205,-21.44],NE:[10.273,17.295],LY:[17.187,27.941],TN:[9.187,36.696],BT:[90.355,27.516],MD:[28.401,47.195],SS:[29.891,7.148],CF:[20.505,6.958],NZ:[169.191,-45.031],CU:[-77.556,21.034],VE:[-67.345,9.318],MG:[46.43,-18.577],IS:[-17.355,64.924],EG:[30.753,25.315],LK:[80.796,6.19],BW:[24.546,-23.267],KG:[74.526,41.489],NP:[84.181,28.118]};class rs{constructor(t,e){}}let ns=0;class os{constructor(t){this.source=t,this.pid=ns++,this.visible=!0}setSelected(t){this._selected=t}get lon(){return this.coord[0]}get lat(){return this.coord[1]}ariaHint(){return""}labelCount(){return 1}copy(){return Object.assign({},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:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?this._readObject(t,e):this._readSingle(e),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._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,s;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const s=t.split(/\./g);let i=null!==(e=this[s[0]])&&void 0!==e?e:this.source[s[0]];for(let t=1;t<s.length;t++)i=i[s[t]];return i}return"baseValue"===t?this.getBaseValue():null!==(s=this[t])&&void 0!==s?s:this.source[t]}getCallout(t){const e=this.callout;if(e){const s=[t];for(let t=0;t<e.length;t++)s.push([isNaN(e[t][0])?s[t][0]:e[t][0],isNaN(e[t][1])?s[t][1]:e[t][1]]);return s}const s=this.offset;if(s){const e=[t];for(let t=0;t<s.length;t++)e.push([e[t][0]+(s[t][0]||0),e[t][1]+(s[t][1]||0)]);return e}}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,source:this.source})}_readArray(t,e){}_readObject(t,e){var s;if(this.id=y(t._idFielder(e),e.id),this.name=y(t._nameFielder(e),e.name),this.color=y(t._colorFielder(e),e.color),this.className=e.className,i(e.coord))this.coord=e.coord.slice(0,2);else if(n(e.coord)){const t=e.coord.split(/s\+/);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 i=t._lonFielder(e);if(isNaN(i))return;const r=null===(s=t._latFielder)||void 0===s?void 0:s.call(t,e);if(isNaN(r))return;this.coord=[i,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=i(e.callout)&&this.$_parseCallout(e.callout),i(this.callout)||(this.offset=i(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),i(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(i(t))e.push(t.slice(0,2));else if(n(t)){const s=t.split(/s\+/);e.push([s[0],s[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class as{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){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){t<0?(this._points.push(e),e.index=this._points.length-1):(this._points.splice(t,0,e),e.index=t)}add(t){this._points.push(t),t.index=this._points.length-1}remove(t){const e=this._points,s=e.indexOf(t);if(s>=0){e.splice(s,1);for(let t=e.length-1;t>=s;t--)e[t].index=t;return!0}}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let s=0,i=e.length;s<i&&!0!==t(e[s],s);s++);}}const hs="_model_",ls="_tag_",cs="disabled",ds="rm-legend-item-marker",_s={};class us extends We{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ct.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}isVisible(){return this.visible||r(this._op.visibleCallback)}getDefaultIconPos(){return"top"}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}us.defaults=je(We.defaults,{visible:!0,position:"auto",distance:25});class ps extends He{}ps.defaults=je(He.defaults,{shape:"circle",radius:2.5});class gs extends He{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new ps(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}gs.defaults=je(He.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class ms extends ft{constructor(t,e,s){super(),this.series=t,this.point=e,this.callback=s,this.duration=500,this.point._vr=0,this.endHandler=()=>{var t;delete this.point._vr,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.point._vr=t,this.series._optionChanged(),!0}}class fs extends He{static register(...t){t.forEach((t=>{_s[t.type]=t}))}static getPointTooltipParam(t,e,s){return"series"===s?t.displayName():e.getParam(s)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._maxZindex=0,this._points=new as(this)}_doInit(t){this._pointArgs=this._createPointArgs(),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new gs(this))._init()}_createLabel(t){return new us(t)}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return fs.getPointTooltipParam(t,e,s)}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._op.label||this.name}_type(){return this.constructor.type}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}displayName(){return this._op.label||this.name||`Series${this.index}`}get data(){return this._data}setData(t){t!==this._data&&(this._data=t,this._dataSourceDirty=!0)}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isDataSeries(){return!0}getDetailed(){return this}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=t.map(((t,e)=>this.$_addPoint(t,e)));return this._zindexDirty=this._maxZindex>0,e}getPoint(t){return this._points.get(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:s}getPointCallbackArgs(t){return this._getPointCallbackArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.options.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&&!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.options.layoutOnly}getLegendSources(t){this._op.visibleInLegend&&t.push(this)}getLabelOff(){return f(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t){this._calcedColor=t}coordOfArea(t){var e,s;return is[t]||(null===(s=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===s?void 0:s.getCenter())}getCoord(t){return t.coord||this.coordOfArea(t.id)||tt}pointById(t){return this._points.pointById(t)}needRemoveAnimation(){return!1}addPoint(t,e=-1,s=500){var i,r,n,o;const a=this.$_addPoint(t,e);return this._points.insert(e,a),this._optionChanged(),this.chart._dataChanged(),s>0&&this instanceof ws?(null===(r=null===(i=a._prev)||void 0===i?void 0:i.ani)||void 0===r||r.stop(),delete a._deleting,a._prev={value:NaN},a._prev.ani=new ms(this,a,(t=>{var e,s;null===(s=(e=this._op).onPointAdded)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(s),a._prev.ani.start()):null===(o=(n=this._op).onPointAdded)||void 0===o||o.call(n,this._getPointCallbackArgs(this._pointArgs,a)),a}removePoint(t,e=500){var s,i,r,n;o(t)&&(t=this._points.get(t)),this._points.contains(t)&&(e>0&&this.needRemoveAnimation()?(null===(i=null===(s=t._prev)||void 0===s?void 0:s.ani)||void 0===i||i.stop(),t._deleting=!0,t._prev={value:NaN},t._prev.ani=new ms(this,t,(t=>{var e,s;t._deleting=!1,this._points.remove(t),null===(s=(e=this._op).onPointRemoved)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(e),t._prev.ani.start()):(this._points.remove(t),null===(n=(r=this._op).onPointRemoved)||void 0===n||n.call(r,this._getPointCallbackArgs(this._pointArgs,t))),this._optionChanged(),this.chart._dataChanged())}removeFirst(t=500){this.removePoint(this._points.first,t)}removeLast(t=500){this.removePoint(this._points.last,t)}updatePoint(t,e){if(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points[t]),t instanceof os){let s=t._prev;return delete t._deleting,s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new ms(this,t),s.ani.start())),this._optionChanged(),!!s}return!1}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(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.options.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)}$_bringToFront(t){t instanceof os&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.setData(t.data);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._dataSourceDirty){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._runPoints||(this._runPoints=this._points.getPoints()),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t){const e=this._op,s=e.pointColors;let a,h,l,c=this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;r(s)?a=s:i(s)?h=s:n(s)&&(l=this.chart._assets.get(s)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointCallbackArgs(this._pointArgs,t))||c})):l instanceof Qt?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()||c}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]||c})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),isNaN(s._zindex)||(this._maxZindex=Math.max(this._maxZindex,s._zindex)),s}_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)}_createLegendMarker(t,e){return ss.create(t,ds,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(t instanceof rs);else if(i(t))return t}$_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_createPointArgs(){return{series:this}}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,s;return t.forEach((t=>{const i=t.getValue();isNaN(i)||(e=isNaN(e)?i:u(i,e),s=isNaN(s)?i:p(i,s))})),{min:e,max:s}}}fs.defaults=je(He.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:"<b>${name}</b><br>${series}:<b> ${value}</b>",loadAnimation:"default",hoverEffect:"default",visibleInLegend:!0});class bs extends Ge{constructor(){super(...arguments),this._map={},this._visibles=[]}get internalItems(){return this._items}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},i(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):s(t)&&this.$_loadItem(r,t,0),r.options.series=this._items.map((t=>t.options))}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(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}_prepareRender(t){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){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof fs?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,s){let i=t._getSeriesType(e.type||"map");if(!i)throw new Error("Invalid series type: "+e.type);const r=new i(t);return r._init(),r.isDataSeries()&&(r.index=s,r.seriesIndex=r.chart._seriesIndex++),r._load(e),this.$_addSeries(r,s)}$_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 ys extends os{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e)}getValue(){return!isNaN(this._vr)&&this._prev?isNaN(this._prev.value)?this._deleting?x(0,this.value,1-this._vr):x(0,this.value,this._vr):x(this._prev.value,this.value,this._vr):this.value}getBaseValue(){return this.value}}class ws extends fs{_createFielders(t){super._createFielders(t),this._valueFielder=this._createFielder(t.valueField||"value"),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}}ws.defaults=je(fs.defaults,{valueField:"value"});class xs extends ys{}class vs extends ws{}vs.defaults=je(ws.defaults,{});class Ss extends ys{getPoints(t,e,s){const i=t.length,r=[];const n=s-e;for(let s=0;s<i;s++){const o=t[s],a=5+s/(i-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,s){const i=e-t;return 0+(isNaN(s)||0==i?100:100*(1-(s-t)/i))}_readObject(t,e){super._readObject(t,e);const s=this.value;this.coord=e.coord,this.values=i(s)?s.slice():isNaN(s)?[]:[s]}}class Cs{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return ss.create(t,ds,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class Ls extends ws{getMinMax(t){let e=NaN,s=NaN;for(const i of t)for(const t of i.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),s=isNaN(s)?t:Math.max(s,t));return{min:e,max:s}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}getLegendSources(t){const e=this._op;e.visibleInLegend&&(e.legendByCategory&&this._categories?t.push(...this._categories):t.push(this))}$_parseCategories(t){if(i(t))return t.map((t=>new Cs(t.name,t.color)))}}Ls.defaults=je(ws.defaults,{position:"top"});class Ps extends Ss{}class ks extends Ls{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new He(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const s=ct.getMinMax(t),i=s.base=this._op.baseValue;if(e)s.min=isNaN(i)?e.min:Math.min(e.min,i),s.max=isNaN(i)?e.max:Math.max(e.max,i);else{const t=f(this._minValue,s.min),e=f(this._maxValue,s.max);s.min=isNaN(i)?Math.min(t,s.min):Math.min(t,s.min,i),s.max=isNaN(i)?Math.max(e,s.max):Math.max(e,s.max,i)}return s}_doApply(t){super._doApply(t),this._width=f(+t.width,ks.DEF_WIDTH),this._height=f(+t.height,ks.DEF_HEIGHT),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}ks.DEF_WIDTH=80,ks.DEF_HEIGHT=50,ks.defaults=je(Ls.defaults,{width:ks.DEF_WIDTH,height:ks.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Ms extends ys{}class As extends ws{_doApply(t){super._doApply(t),this._width=f(+t.width||+t.size||+t.height,As.DEF_SIZE),this._height=f(+t.height||+t.size||+t.width,As.DEF_SIZE)}}As.DEF_SIZE=60,As.defaults=je(ws.defaults,{size:As.DEF_SIZE});class Vs extends As{getValueRate(t){return(f(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=f(this._minValue,1/0),s=f(this._maxValue,-1/0);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=u(e,i),s=p(s,i))})),this._min=e,this._max=s}}Vs.defaults=je(As.defaults,{minValue:10});class Es extends xs{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}_assignTo(t){super._assignTo(t).value=this.value}}class Ns extends us{}Ns.defaults=je(us.defaults,{visible:!1});class Ts extends vs{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new Ns(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getSubLabelOff(){return f(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Es(t)}_doPrepareRender(t){super._doPrepareRender(t);let e=f(this._minValue,Number.MAX_VALUE),s=f(this._maxValue,Number.MIN_VALUE);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=u(e,i),s=p(s,i))})),this._noSize=(this._vMin=e)===(this._vMax=s)}}Ts.type="bubble",Ts.defaults=je(vs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Ds extends He{}Ds.defaults=je(Ze.defaults,{length:10});class $s extends We{getText(t){return ct.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}$s.defaults=je(Ze.defaults,{offset:4});class Rs extends He{_doInit(t){t.line=(this._line=new Ds(this.chart))._init(),t.label=(this._label=new $s(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Rs.defaults=je(Ze.defaults,{});class Os extends Ze{_doInit(t){super._doInit(t),t.tick=(this._tick=new Rs(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const s=this._series;if(s instanceof Ts){const{min:i,max:r}=s.getPixelMinMax(u(t,e));this._steps.forEach((t=>{t.rd=s.getRadius(t.value,i,r)}))}return this._steps}_getFirstSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(i(t)&&t.length>0){const i=this.tick.label;t.forEach((t=>{s(t)?e.push({value:+t.value,label:t.label||i.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:i.getText(+t),rd:0})}))}return e}}Os.defaults=je(Ze.defaults,{});class Fs extends Xe{_createScale(t){return new Os(t)}}class Is extends He{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Is.MARKER_SIZE=10;class Bs extends He{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocation(){return this._location}isInner(){return"body"===this._location}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.maxWidth)!==e._maxWidth&&(e._maxWidth=s,e._maxWidthDim=Y(s,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=Y(t,!0))}(t.maxHeight)}_doPrepareRender(t){super._doPrepareRender(t),this._location=y(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map((t=>new Is(this,t))),this._op.reversed&&(this._items=this._items.reverse())}}Bs.defaults=je(He.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",gap:6,itemGap:8,markerVisible:!0,markerSize:Is.MARKER_SIZE,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0});class js{constructor(t){this._color1=Pe.create(t.minColor),this._color2=Pe.create(t.maxColor),this._logger=ct.getLogger(t.logBase)}getColor(t,e,s,i){const r=this._logger;if(r){const i=1-t;t=r(t+i),e=r(e+i),s=r(s+i)}if(this._color1&&this._color2)return Pe.interpolate(this._color1,this._color2,(s-t)/(e-t)).toString();return w(this._color2,i,this._color1).brighten(1-(s-t)/(e-t)).toString()}}class zs extends He{_doInit(t){t.label=(this._label=new Ye(this.chart))._init()}get label(){return this._label}getMarkerSize(){return f(this._op.size,7)}}zs.defaults=je(He.defaults,{size:7});class Hs extends He{}Hs.defaults=je(He.defaults,{length:6});class Gs extends We{getDefaultIconPos(){}}Gs.defaults=je(We.defaults,{});class Ys extends He{_doInit(t){t.line=(this._line=new Hs(this.chart))._init(),t.label=(this._label=new Gs(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ys.defaults=je(He.defaults,{});class Ws{constructor(t,e,s,i,r){this.from=t,this.to=e,this._color1=s,this._color2=i,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 s=+e||Is.MARKER_SIZE;return ss.create(t,ds,0,0,s,s,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 s=this._color1,i=this._color2;if(!s)return(i||e).toString();const r=this.from,n=this.to;if(s&&i)return Pe.interpolate(s,i,(t-r)/(n-r)).toString();return w(i,e,s).brighten(1-(t-r)/(n-r)).toString()}}class Zs extends He{}const Xs="#fff",Us="#000";class qs extends Ze{_doInit(t){const e=this.chart;t.marker=(this._marker=new zs(e))._init(),t.stepLine=(this._stepLine=new Zs(e))._init(),t.tick=(this._tick=new Ys(e))._init()}getColor(t,e,s,i){const r=this._steps;if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(s,t===e-1))return r[t].getColor(s,i);return s<=t?r[0]._color1.toString():i.toString()}return this._minColor?(this._logger&&(s=this._logger(s)),Pe.interpolate(this._minColor,this._maxColor||i,(s-this._min)/(this._max-this._min)).toString()):i.toString()}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get minColor(){return this._minColor}get maxColor(){return this._maxColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:return"left"===this._location||"right"===this._location?"vertical":"horizontal"}}getBarSize(t,e,s){let i,r;return s?(r=this._barLengthDim?W(this._barLengthDim,e):e,i=f(this._op.barWidth,12)):(i=this._barLengthDim?W(this._barLengthDim,t):t,r=f(this._op.barWidth,12)),{width:i,height:r}}getSplitPoints(t){const e=this._steps,s=this._valueSteps;let i=e?e.length:s?s.length-1:0;const r=[];if(i>1)for(let e=1;e<i;e++)r.push(e/i*t);return r}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 s=0,i=e.length;s<i;s++){const r=e[s].getPosition(t,s===i-1);if(!isNaN(r))return(s+r)/i}}getTicks(){const t=this._tick.label,e=this._steps,s=this._valueSteps,i=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=f(e[0].from,i)});for(let t=1;t<n;t++)o.push({pos:e[t].from=f(e[t].from,e[t-1].to)});o.push({pos:e[n-1].to=f(e[n-1].to,r)})}else if(s){n=s.length,o.push({pos:s[0]});for(let t=1;t<n-1;t++)o.push({pos:s[t]});o.push({pos:s[n-1]})}else o=[{pos:i},{pos:r}];return n=o.length-1,o.forEach(((e,s)=>{e.label=t.getNumberText(e.pos,!1,!1,0===s?"trunc":s===n?"ceil":void 0)})),o}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){!this._steps||"legend"!==this._op.display&&"both"!==this._op.display||this._steps.forEach((e=>t.push(e)))}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Pe.create(t.minColor||Xs),this._maxColor=Pe.create(t.maxColor||Us),this._colors=this.$_parseColorStops(t.colors)}$_parseColorStops(t){const e=[];if(i(t)){const s=t.length;if(s>1)for(let i=0;i<s;i++)e.push({stop:t[i].stop,color:Pe.create(t[i].color)});else 1===s&&e.push({stop:t[0].stop,color:Pe.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._maxColor});return(this._minColor&&e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(this._maxColor&&e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._maxColor}),e}_doPrepareRender(t){var e,s;super._doPrepareRender(t);const i=this._op,r=null===(s=null===(e=this._series)||void 0===e?void 0:e.getValueRange)||void 0===s?void 0:s.call(e);this._min=+i.minValue,this._max=+i.maxValue,this._logger=ct.getLogger(i.logBase),r&&(isNaN(this._min)&&(this._min=r.min),isNaN(this._max)&&(this._max=r.max)),this._steps=this.$_buildSteps()}$_parseValue(t,e,s){return n(t)?t.endsWith("%")?e+(s-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>l(t/e)*e?t=l(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),$(t)}$_parseColor(t){return t&&t.endsWith("%")?Pe.interpolate(this._minColor,this._maxColor,parseFloat(t)/100):Pe.create(t)}$_buildSteps(){const t=this._op,e=t.steps,s=[],r=this._max;let n=.6,o=r;if(this._valueSteps=null,i(e)&&e.length>0){let t="0%";e.forEach(((i,r)=>{var a,h;let l=this.$_parseValue(i.from,n,o),c=this.$_parseValue(i.to,n,o);0===r&&isNaN(l)&&(l=n),r===e.length-1&&isNaN(c)&&(c=o);let d=this.$_parseColor(i.fromColor||t),_=this.$_parseColor(t=(null!==(a=i.toColor)&&void 0!==a?a:i.color)||"100%");s.push(new Ws(l,c,d,_,null!==(h=i.label)&&void 0!==h?h:`${l} - ${c}`))})),this._logger=null}else if(n>=o)s.push(new Ws(n,o,this._minColor,this._maxColor,`${this._min} - ${this._max}`));else{const e=t.logBase,s=this._logger&&n>=0&&o-n>=e?this._logger:null,i=s?Math.max(0,1-n):0,a=this._valueSteps=[],h=Math.max(1,f(t.stepCount,1));let l=s?s(o-n):o-n;const d=Math.pow(10,Math.floor(Math.log10(l/h))),_=c(l/h/d)*d;if(n=this.$_normalizeMin(s?s(n+i):n+i,_),t.integralSteps){a.push(n);for(let t=1;t<=h;t++)a.push($(a[t-1]+_))}else{const t=l/h;a.push(n);for(let e=1;e<h;e++)a.push($(a[e-1]+t));a.push($(s?s(o):o))}if(this._min=a[0],this._max=a[h],s){for(let t=0;t<=h;t++)a[t]=Math.pow(e,a[t]);a[0]-=i,t.integralSteps||(a[0]=.6,a[h]=r)}}return s.length>1?s:void 0}}qs.defaults=je(He.defaults,{display:"scale",minColor:Xs,maxColor:Us,layout:"auto",barWidth:12,barLength:"40%",gap:8});class Ks extends Xe{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.options.display))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_createScale(t){return new qs(t)}}class Qs extends He{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Qs.defaults=je(He.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Js extends He{_doSetSimple(t){return ct.isValidNum(t)?(this._op.step=t,!0):super._doSetSimple(t)}}Js.defaults=je(He.defaults,{step:10});class ti extends He{_doInit(t){t.line=(this._line=new Js(this.chart))._init(),t.lonLine=(this._lonLine=new Js(this.chart))._init(),t.latLine=(this._latLine=new Js(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getStep(t){return f(this._line.options.step,this.$_defaultStep(t))}getLonStep(t){return b(this._lonLine.options.step,this._line.options.step,this.$_defaultStep(t))}getLatStep(t){return b(this._latLine.options.step,this._line.options.step,this.$_defaultStep(t))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t){super._doPrepareRender(t)}$_defaultStep(t){return 10}}ti.defaults=je(He.defaults,{visible:!1,fitTo:"map"});class ei extends He{}ei.defaults=je(He.defaults,{visible:!1});class si extends He{}si.defaults=je(He.defaults,{visible:!1});class ii extends He{_doInit(t){t.line=(this._line=new si(this.chart))._init(),t.label=(this._label=new Ye(this.chart))._init()}get line(){return this._line}get label(){return this._label}}ii.defaults=je(He.defaults,{visible:!1});class ri extends We{getDefaultIconPos(){return"left"}}ri.defaults=je(We.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ni extends He{_doInit(t){t.label=(this._label=new ri(this.chart))._init()}get label(){return this._label}}ni.defaults=je(He.defaults,{front:!0,zindex:0});class oi extends ni{}oi.defaults=je(ni.defaults,{});class ai extends ni{}ai.defaults=je(ni.defaults,{});class hi extends ni{}hi.defaults=je(ni.defaults,{});class li extends He{}li.defaults=je(He.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class ci extends He{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new li(this.chart))._init(),this._args={axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let s=oe.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(s=e.prefix+s),e.suffix&&(s+=e.suffix),s}moved(t,e,s){}_doSetSimple(t){return r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}ci.defaults=je(He.defaults,{visible:!1});class di extends He{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new ei(this.chart))._init(),this.options.leftLine=(this._leftLine=new ei(this.chart))._init(),this.options.rightLine=(this._rightLine=new ei(this.chart))._init(),this.options.topLine=(this._topLine=new ei(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new ei(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new ei(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new ei(this.chart))._init(),this.options.grid=(this._grid=new ti(this.chart))._init(),this.options.tick=(this._tick=new ii(this.chart))._init(),this.options.crosshair=(this._crosshair=new ci(this))._init()}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()}_doApply(t){if(super._doApply(t),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(i(e)?e:[e]))}}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let s;s="range"===t.type?new hi(this.chart):"line"===t.type?new oi(this.chart):"band"===t.type?new ai(this.chart):new oi(this.chart),s._init(),s._load(t),e.push(s)}))}}function _i(t,e){const[s,i]=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>i!=l>i&&s<(h-o)*(i-a)/(l-a)+o&&(r=!r)}return r}function ui(t,e){let s=!1;_i(t,e[0])&&(s=!s);for(let i=1;i<e.length;i++)_i(t,e[i])&&(s=!s);return s}di.defaults=je(He.defaults,{});class pi{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:s,maxLat:i}=this.bbox,r=(t+s)/2,n=(e+i)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:i},a={minLon:r,minLat:n,maxLon:s,maxLat:i},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:s,maxLat:n};this.children=[new pi(o,this.capacity),new pi(a,this.capacity),new pi(h,this.capacity),new pi(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 s of this.children)if(this.isContained(t.bbox,s.bbox)&&(e=s.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,s){return t>=s.minLon&&t<=s.maxLon&&e>=s.minLat&&e<=s.maxLat}queryPoint(t,e,s=[]){if(!this.containsPoint(t,e,this.bbox))return s;for(const i of this.entries)this.containsPoint(t,e,i.bbox)&&s.push(i);if(this.divided&&this.children)for(const i of this.children)i.queryPoint(t,e,s);return s}}class gi{constructor(t,e){var s;this.worldBBox=t,this.root=new pi(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!==(s=t.source.polygon)&&void 0!==s?s: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 ui(t,e.coordinates);if("MultiPolygon"===e.type){for(const s of e.coordinates)if(ui(t,s))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const mi={area:"39",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"},fi={area:"37630",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"},bi={area:"",parent:"23,23520",polygons:[[8,9],[6,7]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},yi={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},wi={area:"HI",coord:[-126,21],frame:"0.5 0.5"};function xi(t,e){const s=t.split(/[\s,]+/g),i=[],r="z"===s[s.length-1]||"Z"===s[s.length-1];r&&s.pop();for(let r=0;r<s.length/2;r++)for(let n=0;n<2;n++){const o=s[2*r+n],a=+o;if(isNaN(a)){const s=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<s.length;){const i=s[h++];if("-"===i)r=-1;else if("+"===i)r=1;else if("w"===i)a+=r*(e.h2-e.h1);else if("h"===i)a+=r*(e.v2-e.v1);else if(i.length>0){const s=parseFloat(i);if(isNaN(s))throw new Error("Invalid border expression: "+t);i.endsWith("h")?a+=r*s*(e.v2-e.v1):i.endsWith("w")?a+=r*s*(e.h2-e.h1):a+=r*s}}i.push(a+(0===n?e.h1:e.v1))}else i.push(a+(0===n?e.h1:e.v1))}return r&&i.push("z"),i}class vi{constructor(t,e){this.id=t,this.props=e}}class Si extends vi{}class Ci extends Si{constructor(t,e,s,i){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(s,1);else if(1!==e){const t=r[s],n=[];for(let e=0;e<t.length;e++){const s=[];for(let i=0;i<t[e].length;i++)s.push(t[e][i].slice());n.push(s)}r[s]=n,this.$_moveToRate(s,i,1-e)}}$_moveToRate(t,e,s){const i=st(this.polygons[t]),r=st(this.polygons[e]);let n,o,a=0,h=0;if((n=i.h1-r.h2)>0&&(o=r.v1-i.v2,n>o&&(a=-n*s,h=o*s)),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 Li extends yt{static createStockInset(t,e){let s;switch(t){case"제주":case"제주도":s=mi;break;case"울릉":case"울릉도":s=fi;break;case"백령":case"백령도":s=bi;break;default:switch(t.toLowerCase()){case"alaska":s=yi;break;case"hawaii":s=wi}}return s&&e&&(s=Object.assign({},s,e)),s}constructor(t){var e,r,n;super(),this._excludes={};const o=null!==(e=t.source)&&void 0!==e?e:t.map,a=i(t.insets)?t.insets:s(t.insets)?[t.insets]:void 0;this.name=t.name,this.enabled=t.enabled,this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=s(null==o?void 0:o.meta)?ct.deepClone(o.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(r=this.meta.dummies)||void 0===r?void 0:r.slice(),this.paddings=J(null!==(n=t.padding)&&void 0!==n?n:"0"),this._excludes={},i(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={},a&&a.length>0&&a.forEach((t=>{var e,s;t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:i(t.polygons)?t.polygons.slice():isNaN(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===(s=t.offset)||void 0===s?void 0:s.slice(0,2),border:i(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame})})),o&&(this.items=this.$_load(o))}included(t){return!this._excludes[t]}$_load(t){return this._doLoad(t)}}class Pi{constructor(){this._scroll=0}get scroll(){return this._scroll}set scroll(t){const e=t%360;this._scroll=e<0?360+e:e,this.second&&(this.second._scroll=this._scroll-360),360===this._scroll&&(this._scroll=0,this.second&&(this.second._scroll=-360))}prepareSecond(){return this.second=new this.constructor,this}getClipBounds(){const t=[],e=this.scroll;this.scroll=0;for(let e=-90;e<=90;e+=10)t.push(this.project([-180,e]));for(let e=90;e>=-90;e-=10)t.push(this.project([180,e]));return this.scroll=e,t}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}}const ki=90,Mi=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Ai extends Pi{constructor(){super(),this._rotation=[0,0],this._r=ki,this.bounds={x1:-90,x2:ki,y1:-90,y2:ki},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get isElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Mi(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Mi(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;Mi(-90-t),Mi(90-t),Mi(90+e),Mi(-90+e),this._prevCoord=null}project(t){const[e,s]=this._rotate(t),i=s*N,r=[Math.cos(i)*Math.sin(e*N)*this._r,Math.sin(i)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/ki,s=t[1]/ki,i=Math.sqrt(e*e+s*s),r=Math.asin(i),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,i*o)/N,Math.asin(i&&s*n/i)/N];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}_rotate(t){const e=this._rotation[0]*N,s=(this._rotation[1]||0)*N,i=Math.cos(s),r=Math.sin(s),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===s)return t.slice(0);const a=t[0]*N+e,h=t[1]*N,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*i+c*r;return[Math.atan2(d*n-u*o,c*i-_*r)/N,Math.asin(u*n+d*o)/N]}_unrotate(t){const e=Math.PI/180,s=180/Math.PI,i=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(i)*n,a=Math.sin(i)*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)*s,-Math.asin(g.z)*s]}}function Vi(t,e){const{atan2:s,cos:i,sin:r,sqrt:n}=Math,o=t[1]*N,a=t[0]*N,h=e[1]*N,l=e[0]*N,c=h-o,d=l-a,_=r(c/2)*r(c/2)+i(o)*i(h)*r(d/2)*r(d/2),u=2*s(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*i(o)*i(a)+c*i(h)*i(l),_=t*i(o)*r(a)+c*i(h)*r(l),p=s(t*r(o)+c*r(h),n(d*d+_*_)),g=s(_,d);m.push([g/N,p/N])}}return m}const Ei=Math.min,Ni=Math.max;class Ti extends yt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],s=t.props["ctr-lat"];isNaN(e)||isNaN(s)||(this.center=[+e,+s])}}setSelected(t){this._selected=t}get path(){return this._path}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=null}$_readBound(t,e){let s=this.h1,i=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{s=Ei(s,t[0]+e[0]),i=Ni(i,t[0]+e[0]),r=Ei(r,t[1]+e[1]),n=Ni(n,t[1]+e[1])})),this.h1=s,this.h2=i,this.v1=r,this.v2=n}$_readInset(t,e){if(!t._off){const s=t.coord,r=t.offset;let n=[0,0];i(s)&&s.length>0&&(n[0]=isNaN(s[0])?0:+s[0]-e.h1,n[1]=isNaN(s[1])?0:+s[1]-e.v1),i(r)&&r.length>0&&(n[0]+=f(r[0],0),n[1]+=f(r[1],0)),t._off=n}return t._off}$_toPath(t,e,s){const i=t.isGlobe,r=e[0].slice();if(s){for(let t=0;t<r.length;t++)r[t]=r[t].slice(0);r.forEach((t=>{t[0]+=s[0],t[1]+=s[1]}))}let n=this.x1,o=this.x2,a=this.y1,h=this.y2;const l=r.map((e=>{const s=t?t.project(e):e;return s.outside||(n=Ei(n,s[0]),o=Ni(o,s[0]),a=Ei(a,s[1]),h=Ni(h,s[1])),s}));let c;if(this.x1=n,this.x2=o,this.y1=a,this.y2=h,i){let e,s,i=!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 s=Vi(t[e],t[e+1]);s.length&&t.splice(e+1,0,...s)}}(r),c=[];for(let n=0;n<l.length;n++){const o=r[n],a=l[n];if(a.outside)i=!0;else{if(e||(e=o,r.push(o),l.push(a)),i&&s){Vi(s,o).forEach((e=>c.push(t.project(e))))}c.push(a),s=o,i=!1}}}else c=l;if(c.length>0){return`M ${c[0][0]} ${c[0][1]} L`+c.slice(1).map((t=>t.join(" "))).join(" ")+" Z"}return""}readBounds(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=Ei(e,t[0]),s=Ni(s,t[0]),i=Ei(i,t[1]),r=Ni(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Ei(e,t[0]),s=Ni(s,t[0]),i=Ei(i,t[1]),r=Ni(r,t[1])}))}));return{h1:e,v1:i,h2:s,v2:r}}readPath(t){if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset;let s,i;if(e)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=Ei(t,e[0]),i=Ei(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,tt)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,tt))):this.$_readBound(this.source.polygon,tt),s=this.$_readInset(e,this);else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,tt))):this.$_readBound(this.source.polygon,tt);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,tt)}))):(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,this.source.polygons?(i="",this._insetChilds?this.source.polygons.forEach(((e,r)=>{this._insetChilds.indexOf(r)>=0?i+=this.$_toPath(t,e,s):i+=this.$_toPath(t,e,null)})):this.source.polygons.forEach(((e,r)=>{i+=this.$_toPath(t,e,s)}))):i=this.$_toPath(t,this.source.polygon,s),this._path=i}return this._path}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Ti;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Di extends yt{constructor(t,e,s){if(super(),this.owner=t,this.source=e,this._hiddens={},!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=s,this._name=e.name,(this._second=e instanceof Di)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new gi({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,i(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const s in this._areaMap){const i=this._areaMap[s];t in i.source.props&&(e[i.source.props[t]]=i)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()})),this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}$_resetAreas(){const t=this.owner.getProjection(this._second);if(t instanceof Ai)t.getRotation(),this._areas.forEach((e=>{e.visible=this.isVisible(e.id),e.readPath(t)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=ki,this.y2=ki;else{let e=1/0,s=-1/0,i=1/0,r=-1/0,n=1/0,o=-1/0,a=1/0,h=-1/0;if(this._areas.forEach((l=>{l.visible=this.isVisible(l.id),l.readPath(t)&&(e=Ei(e,l.h1),s=Ni(s,l.h2),i=Ei(i,l.v1),r=Ni(r,l.v2),n=Ei(n,l.x1),o=Ni(o,l.x2),a=Ei(a,l.y1),h=Ni(h,l.y2))})),this.source instanceof Li){const t=this.source.paddings;i-=t.b,r+=t.t,e-=t.l,s+=t.r,a-=t.b,h+=t.t,n-=t.l,o+=t.r}this.h1=e,this.v1=i,this.h2=s,this.v2=r,this.x1=n,this.y1=a,this.x2=o,this.y2=h,this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}}$_load(t){var e;const s=t.insets,r=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",a=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._insets=[];t.items.forEach((e=>{if(e instanceof Si){const i=y(e.props[r],e.id);if(i&&t.included(i)){const t=new Ti(e,s[i]);delete s[i],h&&h.indexOf(i)>=0?(l.unshift(t),t.dummy=!0):l.push(t),c[t.id=i]=t,t.name=y(e.props[n],e[n])}}}));for(const t in s){const e=s[t];if(e.parent&&(o(e.polygons)||i(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let s=0;s<t.length;s++){const r=c[t[s]];if(r){const n=e.polygons[s];r.inset=e,r._insetChilds=i(n)?n:[n],e._base=r._insetChilds,e.parent=t[s],d.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=i(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,d.push(e))}else if(i(e.children)){const t=e._base=[],s=e.offset?e.offset.slice():[0,0];if(i(e.coord)){let t=1/0,i=1/0;for(const s of e.children){const e=c[s].readBounds(null);t=Ei(t,e.h1),i=Ei(i,e.v1)}isNaN(e.coord[0])||(s[0]=e.coord[0]-t),isNaN(e.coord[1])||(s[1]=e.coord[1]-i)}for(const i of e.children){const e=c[i];e&&(e.inset={area:i,offset:s},t.push(e))}d.push(e)}}if(a&&!isNaN(+t.dokdo)){const e=c[a.group];e&&(e.source=new Ci(e.source,+t.dokdo,+a.index,+a.parent))}this.reset()}$_copy(t){const e=this._areas=[],s=this._areaMap={};t._areas.forEach((t=>{const i=t._clone();e.push(i),s[i.id]=i})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Di(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class $i extends We{getText(t){return ct.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}$i.defaults=je(Ze.defaults,{offset:4});class Ri extends Ze{_doInit(t){super._doInit(t),t.label=(this._label=new $i(this.chart))._init()}get label(){return this._label}_getFirstSeries(t){return t.getFirstSeries("map")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Ri.defaults=je(Ze.defaults,{visible:!1});class Oi extends He{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Oi.ITEM_GAP}}Oi.ITEM_GAP=4,Oi.defaults=je(He.defaults,{offsetX:8,offsetY:8,itemGap:3});class Fi extends Oi{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,s,i;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Fi.BUTTON_SIZE,height:null!==(i=null!==(s=this._op.buttonHeight)&&void 0!==s?s:this._op.buttonWidth)&&void 0!==i?i:Fi.BUTTON_SIZE}}getZoomStep(){var t;return null!==(t=this._op.zoomStep)&&void 0!==t?t:20}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Fi.BUTTON_SIZE=24,Fi.defaults=je(Oi.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Ii extends Oi{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Ii.defaults=je(Oi.defaults,{type:"text",align:"left",verticalAlign:"top"});class Bi extends yt{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){let r;return i&&(r=this.clear()),t&&s(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const s=this._items.indexOf(e);if(s>=0)return this._items.splice(s,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 ji extends He{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}ji.defaults=je(He.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class zi extends ji{}zi.defaults=je(ji.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Hi extends He{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 s=y(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,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){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?oe.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Se.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Hi.defaults=je(He.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Gi extends qe{_isVisible(){return this._op.visible&&!j(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Gi.type="image",Gi.defaults=je(qe.defaults,{});class Yi extends qe{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||Yi.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Yi.type="shape",Yi.defaults=je(qe.defaults,{width:64,height:64,shape:"square"});class Wi extends qe{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!j(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?oe.getFormatter(s):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Se.getFormatter(t):void 0)}(t.timeFormat)}}Wi.type="text",Wi.defaults=je(qe.defaults,{text:"Text"});class Zi extends Pi{project(t){return[t[0]-this.scroll,t[1]]}backward(t){return[t[0],t[1]]}}const Xi=1.340264,Ui=-.081106,qi=893e-6,Ki=.003796,Qi=Math.sqrt(3)/2,Ji=74.03120656864502;class tr extends Pi{get isElliptic(){return!0}project(t){const e=N,s=Math.asin(Qi*Math.sin(t[1]*e)),i=s*s,r=i*i*i;return[(t[0]-this.scroll)*e*Math.cos(s)*Ji/(Qi*(Xi+3*Ui*i+r*(7*qi+9*Ki*i))),s*Ji*(Xi+Ui*i+r*(qi+Ki*i))]}backward(t){const e=t[0]/Ji,s=t[1]/Ji,i=180/Math.PI;let r,n,o,a,h,l=s;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Xi+Ui*r+n*(qi+Ki*r))-s,a=Xi+3*Ui*r+n*(7*qi+9*Ki*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=i*Qi*e*(Xi+3*Ui*r+n*(7*qi+9*Ki*r))/Math.cos(l),d=i*Math.asin(Math.sin(l)/Qi);return Math.abs(c)>180?[NaN,NaN]:[c,d]}}const er=63.78137,sr=Math.PI/180;class ir extends Pi{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]));const s=Math.sin(e*sr);return[er*(t[0]-this.scroll)*sr,er*Math.log((1+s)/(1-s))/2]}backward(t){return[t[0]/(er*sr),(2*Math.atan(Math.exp(t[1]/er))-Math.PI/2)/sr]}}const rr=Math.PI/4,nr=Math.PI/180,or=63.78137;class ar extends Pi{project(t){return[(t[0]-this.scroll)*nr*or,79.7267125*Math.log(Math.tan(rr+.4*t[1]*nr))]}backward(t){return[t[0]/or/nr,2.5*(Math.atan(Math.exp(t[1]/or*.8))-rr)/nr]}}class hr extends Ps{}class lr extends ks{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new hr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return ss.create(t,ds,0,0,e,e,2)}}lr.type="bar",lr.defaults=je(ks.defaults,{barWidth:.7});class cr extends He{constructor(t){super(t.chart),this.gauge=t}}class dr extends cr{}dr.defaults=je(He.defaults,{visible:!1});class _r extends cr{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}_r.defaults=je(He.defaults,{});class ur extends cr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}ur.defaults=je(He.defaults,{thickness:"100%",stroked:!1});class pr extends cr{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}pr.defaults=je(He.defaults,{visible:!1,radius:3,length:"100%",offset:0});class gr extends cr{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}gr.defaults=je(He.defaults,{visible:!1,radius:5});class mr extends Ye{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}mr.defaults=je(Ye.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class fr{constructor(){this.setCenterX(yr.DEF_CENTER),this.setCenterY(yr.DEF_CENTER),this.setRadius(yr.DEF_RADIUS),this.setInnerRadius(yr.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(y(t,yr.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(y(t,yr.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(y(t,yr.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(y(t,yr.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=u(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=f(t%360,0),i=p(0,u(360,f(e,360)));this._startRad=E+N*s,this._handRad=N*s,this._sweepRad=N*i}}class br extends Ms{_readObject(t,e){super._readObject(t,e)}}class yr extends Vs{_doInit(t){super._doInit(t),t.face=(this._face=new dr(this))._init(),t.rim=(this._rim=new _r(this))._init(),t.valueRim=(this._valueRim=new ur(this))._init(),t.hand=(this._hand=new pr(this))._init(),t.pin=(this._pin=new gr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new mr(this.chart))._init(),this._props=new fr}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 br(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._op.startAngle,this._op.sweepAngle)}}yr.DEF_CENTER="50%",yr.DEF_RADIUS="50%",yr.DEF_INNER="80%",yr.type="gauge",yr.defaults=je(Vs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class wr extends He{constructor(t){super(t.chart),this.gauge=t}}class xr extends wr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}xr.defaults=je(He.defaults,{thickness:3});class vr extends wr{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}vr.defaults=je(He.defaults,{thickness:1.5,length:"55%"});class Sr extends vr{}Sr.defaults=je(vr.defaults,{thickness:1,length:"80%"});class Cr extends vr{}Cr.defaults=je(vr.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Lr extends wr{}Lr.defaults=je(He.defaults,{length:5});class Pr extends wr{}Pr.defaults=je(He.defaults,{step:1,offset:0});class kr extends wr{}kr.defaults=je(He.defaults,{radius:4});class Mr extends Ye{}Mr.defaults=je(Ye.defaults,{text:"RealMap",position:"top"});class Ar extends Ms{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=f(e.time,NaN),this.timezone=f(e.timezone,NaN)}}class Vr extends As{_doInit(t){super._doInit(t),t.face=(this._face=new He(this.chart))._init(),t.rim=(this._rim=new xr(this))._init(),t.hourHand=(this._hourHand=new vr(this))._init(),t.minuteHand=(this._minuteHand=new Sr(this))._init(),t.secondHand=(this._secondHand=new Cr(this))._init(),t.tick=(this._tick=new Lr(this))._init(),t.tickLabel=(this._tickLabel=new Pr(this))._init(),t.pin=(this._pin=new kr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Mr(this.chart))._init()}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){const s=u(t,e);return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new Ar(t)}_doApply(t){const e=this;super._doApply(t),function(t,s,i){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=Y(y(e._centerX=t,Vr.DEF_CENTER),!0)),e._centerYDim&&s===e._centerY||(e._centerYDim=Y(y(e._centerY=s,Vr.DEF_CENTER),!0)),e._radiusDim&&i===e._radius||(e._radiusDim=Y(y(e._radius=i,Vr.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Vr.DEF_CENTER="50%",Vr.DEF_RADIUS="50%",Vr.type="clock",Vr.defaults=je(As.defaults,{centerX:Vr.DEF_CENTER,centerY:Vr.DEF_CENTER,radius:Vr.DEF_RADIUS,active:!0,size:70});class Er extends ys{_readObject(t,e){super._readObject(t,e),this.center=e.center,this.value=e.value}}class Nr extends us{}Nr.defaults=je(us.defaults,{hoverColor:"white"});class Tr extends ws{get areaCount(){return this._map.areaCount}get detail(){return this._detail}get color(){return this._colorObj}getValueRange(){return{min:this._minValue,max:this._maxValue}}_createLabel(t){return new Nr(t)}_doApply(t){s(t.detail)?this._detail||(this._detail=new Tr(this.chart)):t.hasOwnProperty("detail")&&(this._detail=null),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Er(t)}_prepareRender(){super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,i=this._visPoints,{min:r,max:n}=this._calcMinMax(i);if(this._minValue=r,this._maxValue=n,s(e.colorRange)){const t=m(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=n),this._colorRanger=new js(t)}else this._colorRanger=null}_doLoadPoints(t){this._useMapData&&(t=this._map._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),this._map}setCalcedColor(t){super.setCalcedColor(t),this._colorObj=new Pe(this._calcedColor),this._color=this._colorObj?this._colorObj.toString():null}getColorScale(){return this._op.colorScale}}Tr.type="feature",Tr.defaults=je(ws.defaults,{selectable:!1,detailZoom:250});class Dr extends xs{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class $r extends ws{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new us(this.chart))._init()}getFigure(t){return t.figure||this.options.figure}get innerLabel(){return this._innerLabel}_doApply(t){super._doApply(t)}_createPoint(t){return new Dr(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}$r.type="figure",$r.defaults=je(ws.defaults,{position:"top"});class Rr extends xs{_readObject(t,e){super._readObject(t,e)}}class Or extends vs{_doApply(t){super._doApply(t)}_createPoint(t){return new Rr(t)}_defLabelOff(){return 2}}Or.type=ts,Or.defaults=je(vs.defaults,{mode:"grid"});class Fr extends us{}Fr.defaults=je(us.defaults,{visible:!1});class Ir extends os{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class Br extends fs{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Fr(t)}_createPoint(t){return new Ir(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this._op.rootUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}Br.type="image",Br.defaults=je(fs.defaults,{imageWidth:24,imageHeight:24,position:"top"});class jr extends Dt{constructor(t,e){super(t,ds),this.add(this._area=new Ot(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Ot(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(s.join(" "))}}class zr extends Ps{}class Hr extends He{}Hr.defaults=je(ks.defaults,{visible:!1});class Gr extends ks{_doInit(t){super._doInit(t),t.area=(this._area=new Hr(this.chart))._init()}get area(){return this._area}_createPoint(t){return new zr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new jr(t,e)}}Gr.type="line",Gr.defaults=je(ks.defaults,{});class Yr extends ys{_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){return this.area?y(super.getParam(t),this.area.source.props[t]):super.getParam(t)}}class Wr extends us{}Wr.defaults=je(us.defaults,{visible:!1,hoverColor:"white"});class Zr extends He{}Zr.defaults=je(He.defaults,{enabled:!0,autoMapChange:!0});class Xr extends ws{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Zr(this.chart))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get color(){return this._colorObj}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){const s=this._points.getPoints();for(const i of s)if(i.area.source.props[t]===e)return i}getBounds(t){}getCenter(t){return t instanceof Yr||(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))}_createLabel(t){return new Wr(t)}$_createDetail(){return this._detail||(this._detail=new Xr(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),s(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){this.getDetailed()||(s(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Yr(t)}_getPointCallbackArgs(t,e){return super._getPointCallbackArgs(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){super._doPrepareRender(t);const e=this._op,i=this._visPoints,{min:r,max:n}=this._calcMinMax(i);if(this._minValue=r,this._maxValue=n,s(e.colorRange)){const t=m(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=n),this._colorRanger=new js(t)}else this._colorRanger=null}_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,s=(i(t)?t[0]:t)||"id",r=(i(t)?t[1]:t)||"id",n=e.getAreaMap(s),o=this._areaPts;o.clear(),this._points.forEach((t=>{t.area="id"===r?n[t[r]]:n[t.source[r]],t.area&&o.set(t.area.id,t)}))}}setCalcedColor(t){super.setCalcedColor(t),this._colorObj=new Pe(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}}Xr.type="map",Xr.defaults=je(ws.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250});class Ur extends us{}Ur.defaults=je(us.defaults,{visible:!1});class qr extends ys{}class Kr extends He{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 Ie),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,s,i){this._richTextImpl&&this._richTextImpl.build(t,e,s,void 0,i)}}Kr.defaults=je(He.defaults,{});class Qr extends Kr{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Qr.defaults=je(Kr.defaults,{text:"${name}"});class Jr extends Kr{}Jr.defaults=je(Kr.defaults,{text:"${value}"});class tn extends ws{_doInit(t){super._doInit(t),t.header=(this._header=new Qr(this))._init(),t.divider=(this._divider=new He(this.chart))._init(),t.body=(this._body=new Jr(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:f(this._width,ct.clampEx(t,this._minWidth,this._maxWidth)),height:f(this._height,ct.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new Ur(t)}_createPoint(t){return new qr(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t),this._vertical="horizontal"!==t.orientation,this._minWidth=+t.minWidth,this._minHeight=+t.minHeight}}tn.DEF_MIN_WIDTH=80,tn.DEF_MIN_HEIGHT=50,tn.type="panel",tn.defaults=je(ws.defaults,{orientation:"vertical",minWidth:tn.DEF_MIN_WIDTH,minHeight:tn.DEF_MIN_HEIGHT,position:"top"});class en extends Ss{}class sn extends Ls{getRadius(t){return f(W(this._radiusDim,t),30)}_createPoint(t){return new en(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius")}_doPrepareRender(t){super._doPrepareRender(t);let e=f(this._op.startAngle%360,0),s=p(0,u(360,f(this._op.totalAngle,360)));this._startRad=E+N*e,this._totalRad=N*s}}sn.type="pie",sn.defaults=je(Ls.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class rn extends Ot{constructor(t,e){super(t,ds),this._rd=e,this.setPath(Ct.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 nn extends xs{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class on extends vs{getExt(t,e){const s=f(t.radius,this._rd)*e;return{cx:0,cy:2*-s,rd:s,innerRd:s*this._innerRd}}_doApply(t){super._doApply(t),this._rd=f(t.radius,on.DEF_RADIUS),this._innerRd=f(t.innerRadius,0)}_createPoint(t){return new nn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new rn(t,e/2)}}on.DEF_RADIUS=9,on.type="pin",on.defaults=je(vs.defaults,{radius:on.DEF_RADIUS,innerRadius:0,position:"top"});class an extends Dt{constructor(t,e){super(t,ds),this._size=e,this.add(this._marker=new Ot(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){const e=Math.max(4,t/2);Ct.setShape(this._marker,this._shape,e,e)}}class hn extends xs{_readObject(t,e){super._readObject(t,e)}}class ln extends vs{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(t){return this._op.shape||this._shape}getRadius(){return f(this._op.radius,ln.defaults.radius)}_createPoint(t){return new hn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new an(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),u(e,2*this._op.radius)),s}}ln.type="point",ln.defaults=je(vs.defaults,{radius:5,position:"center"});class cn extends Dt{constructor(t,e){super(t,ds),this.add(this._line=new Ot(t)),this.add(this._arrow=new Ot(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],s=e[e.length-2],i=e[e.length-1],r=O(Math.atan2(i[1]-s[1],i[0]-s[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${i[0]} ${i[1]} L ${i[0]-4} ${i[1]-6} L ${i[0]+4} ${i[1]-6} Z`),this._arrow.setRotation(i[0],i[1],r)}}class dn extends os{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 s;const r=function(t){let e=[];return i(t)?t.forEach((t=>{i(t)?e=e.concat(r(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.name=e.name,this.coords=null!==(s=e.coords)&&void 0!==s?s:e.coord,this.path=null!=e.path?r(e.path):void 0}}class _n extends fs{needMapScale(){return!0}needRemoveAnimation(){return!0}_createPoint(t){return new dn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(i(t)){const e=this.chart.body._points;s(e)&&(t=t.map((t=>{const s=h({},t);if(i(s.coords)){const t=s.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),s.coords=t}return s})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new cn(t,e)}}_n.type=Qe,_n.defaults=je(fs.defaults,{lineType:"air",arrowDisplay:"always"});class un extends xs{_readObject(t,e){super._readObject(t,e),this.length=t._lengthFielder(e),this.angle=t._angleFielder(e)}}class pn extends vs{_createFielders(t){super._createFielders(t),this._lengthFielder=this._createFielder(t.lengthField||"length"),this._angleFielder=this._createFielder(t.angleField||"angle")}_createPoint(t){return new un(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){}legendMarker(t,e){}}pn.type="vector",pn.defaults=je(vs.defaults,{headType:"openArrow",lengthField:"length",angleField:"angle",startAngle:0});class gn extends Ss{}class mn extends Ls{getPointGrid(t,e,s){const i=this._runGrid=[],r=this.$_caculate(t,e,s),n={rowCount:this._rowCount,colCount:this._colCount,grid:i,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:i,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new gn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||mn.ROW_COUNT,this._colCount=t.colCount||mn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||mn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||mn.CELL_SIZE,this._gap=f(t.gap,mn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t){super._doPrepareRender(t),this._visPoints.forEach((t=>{t._sum=i(t.values)?t.values.reduce(((t,e)=>t+e)):0}))}$_caculate(t,e,s){const i=(Math.max(e.min,t._sum*f(s,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(i);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,s=e.length;for(let i=0;i<s;i++)if(isNaN(e[i][t]))return i;return s}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:s,colCount:i}=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==s-1?(h++,a=this.$_rows(h)):h===i-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:s,colCount:i}=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==i-1?(a++,h=this.$_cols(a)):a===s-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}}mn.ROW_COUNT=10,mn.COL_COUNT=10,mn.THRESHOLD=1,mn.CELL_SIZE=5,mn.GAP=2,mn.type="waffle",mn.defaults=je(Ls.defaults,{rowCount:mn.ROW_COUNT,colCount:mn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:mn.THRESHOLD,cellSize:mn.CELL_SIZE,gap:mn.GAP});class fn extends Li{static loadMap(t){return s(t)&&s(t.source)&&i(t.source.features)||s(t)&&s(t.map)&&i(t.map.features)?new fn(t):void 0}_doLoad(t){const e=t.features,s=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Si(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,s.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,s.push(e)}}})),s}}class bn extends Li{static loadMap(t){if(s(t)){const e=t.source;if(s(e)&&"Topology"===e.type&&s(e.objects)&&i(e.arcs))return new bn(t);const r=t.map;if(s(r)&&"Topology"===r.type&&s(r.objects)&&i(r.arcs))return new bn(t)}}_doLoad(t){const e=t=>t.map((t=>t.map((t=>t<0?a[~t].slice().reverse():a[t])).flat())),r=t.objects,n=t.arcs,o=t.transform,a=[],h=[];if(s(o)){const t=o.scale[0],e=o.scale[1],s=o.translate[0],i=o.translate[1];n.forEach((r=>{let n=0,o=0;const h=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+s,r[1]=(o+=r[1])*e+i,r)));a.push(h)}))}else n.forEach((t=>{a.push(t.slice())}));for(const t in r)if("GeometryCollection"===r[t].type){const s=r[t].geometries;i(s)&&s.forEach((t=>{const s=new Si(t.id,t.properties);switch(t.type){case"Polygon":s.polygon=e(t.arcs),h.push(s);break;case"MultiPolygon":s.polygons=t.arcs.map((t=>e(t))),h.push(s)}}))}return h}}var yn=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))};class wn extends ft{constructor(t,e,s,i){super(),this.view=t,this.zoom=e,this.duration=f(s,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==i||i()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class xn extends ft{constructor(t,e,s,i,r){super(),this.view=t,this.zoom=e,this.coords=s,this.duration=f(i,300),this._old=t.zoom,this.view.$_moveTo(s),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 vn extends He{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}vn.defaults=je(fs.defaults,{visible:void 0,globeFill:"lightblue"});const Sn={zoom:1,panX:1,panY:1};class Cn extends He{constructor(t){super(t),this._prj=(new Zi).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=gt.create(0),this._wMap=null,this._reCalculateFlag=!0,this._dragDistance=0,this._annotations=new Ke(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new vn(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get rotationX(){return this._prj instanceof Ai?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Ai?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){var t;return null!==(t=this._op.scroll)&&void 0!==t?t:0}set scroll(t){this.updateOption("scroll",t)}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._op.zoom}set zoom(t){t=Math.max(100,t),this.updateOption("zoom",t)}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=[this._map.cx,this._map.cy];return this._prj?this._prj.backward(t):t}get map(){return this._map}set dragDistance(t){this._dragDistance=t}isDrilldowned(){return!1}prepareLayout(t,e){var s;const i=function(t,e,s){const i=Math.max(0,(e-t)/2);return Math.max(-i,Math.min(s,i))},r=this._prj,n=this._map=this.chart.map;this._reCalculateFlag&&(this._wMap=this.$_calcWMap(),this._reCalculateFlag=!1);const o=this._wMap,a=n.y2-n.y1,h=this._wRate=t/o,l=this._hRate=e/a,c=this._zoom/100,d=this._scale=c*Math.min(h,l),_=f(this._op.panX*d,0),u=f(this._op.panY*d,0),p=i(t,o*d,_)/d;this.isScrollable()?(this.scroll+=(360*this._dragDistance||p)/(o*d),this._dragDistance=0):this._panX=p,this._panY=i(e,a*d,u)/d;const g=(this.scroll%360+360)%360*(o/360),m=t/2-(n.x1+o/2)*d-(this._panX+g)*d,b=e/2+(n.y1+a/2)*d-this._panY*d,y=h/d*o,w=l/d*a,x=n.x1+o/2-y/2+this._panX,v=n.y1+a/2-w/2-this._panY;return r&&(r.scroll=null!==(s=this._op.scroll)&&void 0!==s?s:0),this._vRect=gt.create(x,v,y,w),{scale:d,wMap:o,hMap:a,tx:m,ty:b}}$_calcWMap(){const t=new this._prj.constructor,e=this._map;let s=1/0,i=-1/0;if(t instanceof Ai||![tr].some((e=>t instanceof e)))return e.x2-e.x1;const r=e=>{e[0].forEach((e=>{const r=t.project(e);s=Math.min(s,r[0]),i=Math.max(i,r[0])}))};for(let t=0;t<e.areaCount;t++){const s=e.get(t);s.source.polygons?s.source.polygons.forEach(r):r(s.source.polygon)}return i-s}getPoint(t){return this._points[t]}isVisible(t){return this._vRect.contains(t[0],t[1])&&!this._prj.project(t).outside}isWorldMap(){const{h1:t,h2:e}=this.map;return e-t==360}isScrollable(){return this.options.scrollable&&this.isWorldMap()}setZoom(t,e=300){let i,n;o(e)?n=e:r(e)?(i=e,n=300):s(e)&&(i=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new wn(this,t,n,i).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,s=300){new xn(this,t,e,s,null).start()}zoomToArea(t,e=.7,s=300){const i=this.map.areaOf(t),r=i.getCenter(),n=(this.map.x2-this.map.x1)*e,o=(this.map.y2-this.map.y1)*e,a=n/(i.x2-i.x1)*100,h=o/(i.y2-i.y1)*100,l=Math.min(a,h);new xn(this,l,r,s,null).start()}zoomToBounds(t,e,s=300){const i=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]),n=[(t[0]+e[0])/2,(t[1]+e[1])/2];try{const t=Math.abs(this.map.x2-this.map.x1)/i*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,o=Math.min(t,e);new xn(this,o,n,s,null).start()}catch(t){console.error(t)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[s,i]=this._prj.project(t);this.isScrollable()?this.scroll=t[0]:this.panX=s-e.cx,this.panY=e.cy-i}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,s){const i=t in Sn;i&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,s)}finally{i&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let s=!0;for(const e in t)if(!(e in Sn)){s=!1;break}s&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{s&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o,a;const h=this;var l;super._doApply(t),e.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new Ai;break;case"equalearth":h._prj=(new tr).prepareSecond();break;case"miller":h._prj=(new ar).prepareSecond();break;case"mercator":h._prj=(new ir).prepareSecond();break;default:h._prj=(new Zi).prepareSecond()}return h._reCalculateFlag=!0,!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof Ai&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,f(t,100)))}(t.zoom);const u=this._points={};i(t.points)&&t.points.forEach((t=>{i(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:s(t)&&n(t.id)&&(u[t.id]=i(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Cn.defaults=je(He.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class Ln extends He{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}}Ln.defaults=je(He.defaults,{text:"RealMap v1.0",url:"http://realmap.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Pn extends Xr{}class kn extends He{}kn.defaults=je(He.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default"});class Mn extends wt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._point_shaes=xt.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new te,this._series=new bs(this),this._annotations=new Ke(this),this._colorScales=new Ks(this),this._bubbleScales=new Fs(this),(this._chartOptions=new kn(this))._init(),(this._axis=new di(this))._init(),(this._body=new Cn(this))._init(),(this._exporter=new Qs(this))._init(),(this._title=new ji(this))._init(),(this._subtitle=new zi(this))._init(),(this._legend=new Bs(this))._init(),(this._zoomPanel=new Fi(this))._init(),(this._drilldownPanel=new Ii(this))._init(),(this._mapScale=new Ri(this))._init(),(this._credits=new Ln(null))._init(),(this._tooltip=new Hi(this))._init(),this.options=Object.assign({},Mn.defaults),s(t)?this._load(t):this._initOptions(),this._selection=new Bi(this)}_initOptions(){}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}_getSeriesType(t){return n(t)&&_s[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ue[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return!0}loadAnimatable(){return this._loadAnimatable}isVisible(t){return t&&this.getProjection(!1).isVisible(t)}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var s,i;this._fireEvent("onModelChanged",t,"selection"),null===(i=(s=this._chartOptions.options).onSelectionChanged)||void 0===i||i.call(s,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(t){const e=this._body._prj;return e?t&&e.second||e:(new Zi).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this._fireEvent("onProjectionChanged",this,this.body._prj)}zoomChanged(t){this._fireEvent("onZoomChanged",this,t)}mapChanged(t){this._fireEvent("onMapChanged",this,t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,s){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this.options.type}get chartOptions(){return this._chartOptions}get legend(){return this._legend}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,s=(t instanceof Di?t:this.getMap(t))||this._maps[0];s!==e&&(this._baseMap=s,this._loading||(this._baseMap.reset(),this.mapChanged(s)))}get axis(){return this._axis}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 Xr))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Xr&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}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)}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)}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&ze(n={},r.base),s(r[i])&&(n||(n={}),ze(n,r[i])),n?ze(n,t):t}_setProperties(t,e=!0){const s=this.options;for(const e in Mn.defaults)t.hasOwnProperty(e)&&(s[e]=t[e])}_load(t){const e=this.options;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(y(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const r=i(t.map)?t.map:s(t.map)?[t.map]:null;return i(r)&&(r.forEach(((t,e)=>{const s=bn.loadMap(t)||fn.loadMap(t),i=s&&new Di(this,s,e)._prepareSecond();this._maps.push(i)})),this.setBaseMap(void 0)),e.axis=this._axis._load(t.axis),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.zoomPanel=this._zoomPanel._load(t.zoomPanel),e.drilldownPanel=this._drilldownPanel._load(t.drilldownPanel),e.credits=this._credits._load(t.credits),e.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series,Pn),this._series.get(0)instanceof Xr||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._load(t.mapScale),e.exporting=this._exporter._load(t.exporting),this._loading=!1,this}$_loadTemplates(t){const e=this._bases={axis:{},series:{},gauge:{},annotation:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=h({},i))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return ze(ze({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?ze(ze({},s),t):s}));return t}}else this.assignTemplates=void 0}prepareRender(){this._series._prepareRender(this._optionsDirty),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legend._prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof He||s instanceof Ge||s instanceof te)&&s.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(){return this._series.getLegendSources().concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&this._optionChanged(s),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._optionChanged(null),s}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.first}getBubbleScale(t){return null===t?null:this._bubbleScales.first}drilldown(t,e){return yn(this,void 0,void 0,(function*(){if(!(t instanceof Xr&&t.detail))return;const s=t.drilldown,i=t.detail;if(!s.options.enabled)return;i.options.dataUrl&&(i.updateOption("data",yield fetch(i.options.dataUrl).then((t=>t.json()))),delete i.options.dataUrl);const r=t.map,n=this.getMap(i.options.map)||r;s.options.autoMapChange&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}))}drillup(t){return yn(this,void 0,void 0,(function*(){if(!((t=t||this.firstVisible)instanceof Xr&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const s=t.parent,i=this.map;e.options.autoMapChange&&s.map!==i&&this.setBaseMap(s.map),t.showParent(),this._body.zoom=100}))}_visibleChanged(t){}_hoverAreaChanged(t,e,s){var i,r;null===(r=(i=this._body.options).onHoverArea)||void 0===r||r.call(i,{area:null==e?void 0:e.getInfo(),oldArea:null==s?void 0:s.getInfo()})}_areaClicked(t,e){var s,i;null===(i=(s=this._body.options).onClickArea)||void 0===i||i.call(s,{area:null==e?void 0:e.getInfo()})}}Mn.defaults={type:"map",startOfWeek:0},fs.register(Xr,Tr,ln,on,pn,lr,sn,$r,Ts,_n,Br,Gr,Or,tn,mn,yr,Vr),qe.register(Gi,Yi,Wi);var An=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))};const Vn="$ctrl";class En{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Mn(t,this),null==e||e(this._obj,null)}get options(){return this._obj.options}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 colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}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}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,i){var r;if(s(t)){const s="load chart ";ct.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Mn):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ct.log("chart-items:",Be),ct.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}loadAsync(t,e=!1,i){var r;return An(this,void 0,void 0,(function*(){if(s(t)){const s="load chart ";ct.LOGGING&&console.time(s),yield C.loadConfigAsync(t);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Mn):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ct.log("chart-items:",Be),ct.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}))}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,s){}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)}drilldown(t,e){return An(this,void 0,void 0,(function*(){const s=t instanceof Xr?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;s instanceof Xr&&this._obj.drilldown(s,e)}))}drillup(t){return An(this,void 0,void 0,(function*(){const e=t instanceof Xr?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Xr&&this._obj.drillup(e)}))}}class Nn{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}touchX(){return this._touchX}touchY(){return this._touchY}pointerDown(t){let e;return e=this.$_pointerToPoint(t),this._prevX=e.x,this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(this._clearTouchEffects(),s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,s=this.dragging,{x:i,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i<0||i>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?s&&this.$_stopDragTracker(e,i,r,!0):s?this.$_doDrag(t,e,i,r):(!this._dragTracker&&Math.abs(this._prevX-i)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!s)&&this.$_startMove(t,e,i,r),this._prevX=i,this._prevY=r,this._touches.push({x:i,y:r,t:t.timeStamp})):s&&this.$_stopDragTracker(e,i,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(i,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,s,i)}pointerCancel(t){const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,s,i,!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])),t.cancelable&&t.preventDefault()}else this._doTouchStart(t,t.target)}touchMove(t){if(t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);this._doPinch(e-this._distance),this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}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,s){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,s){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,s,i,r){return!1}_getDragTracker(t,e,s){return null}$_startDrag(t,e,s,i,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.dragging&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}$_pointerToPoint(t){const e=this._control.dom().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}$_checkSwipe(t,e){const s=this._touches,i=s.length;if(i<2)return;const r=s[i-1];let n=s[i-2];if(r.t-n.t<=100)for(let t=i-3;t>=0&&(n=s[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,s=Math.log(.1/c)/Math.log(d),i=c*(1-Math.pow(d,s+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?U.DOWN:n>135&&n<=225?U.LEFT:n>225&&n<=315?U.UP:U.RIGHT,this.dragging){if(e.swipe(r,1.6*s,1.3*i))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*s,1.3*i)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const s=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(s*s+i*i)}}class Tn extends yt{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,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this._dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this._dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,s){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}swipe(t,e,s){if(this._doSwipe(t,e,s))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,s){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_canAccept(t,e,s){return!0}_doCompleted(t,e,s){}_doEnded(t=-1,e=-1){}}class Dn extends Tn{_doDrag(t,e,s,i,r){const n=this.control.model.body;n.rotationX+=(i-e)/2,n.rotationY-=(r-s)/2}}class $n extends Tn{constructor(t){super(t);const e=this.$_mapView();this._oldX=e.panX,this._oldY=e.panY}_doStart(t,e,s,i,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=s,super._doStart(t,e,s,i,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,s,i,r){const n=this.$_mapView();return n.panX=this._oldX-(i-this._xStart)/n.scale,n.panY=this._oldY-(r-this._yStart)/n.scale,n.dragDistance=e-i,!0}$_mapView(){return this.control.model.body}}class Rn extends Nn{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,s){this.dragging?this.dragTracker instanceof $n&&(this._clickElement=null):0===s.buttons&&this.$_chartView().pointerMoved(t,e,s.target)}_doClick(t){const e=t.target,s=lt?t.ctrlKey:t.metaKey,i=this.$_chart(),r=this.$_chartView(),n=i.chartOptions.options.clickAction,o=r.getButton(e);let a,h,l;if(o)o.click();else if(a=r.legendByDom(e))if(a.source instanceof os){const t=a.source;i.seriesByPoint(t)}else a.source.canHide()&&(a.source.visible=!a.source.visible);else if(e===this._clickElement){if(h=r.seriesByDom(e))h.click(e);else if(l=r.creditByDom(e))l.click(e);else if(r.drilldownPanelView().click(e))return;if("select"===n)h&&h.model.canSelect()&&(s?h.toggleSelect(e):h.select(e,!0))}}_doDblClick(t){const e=this.$_chart(),s=this.$_chartView(),i=e.chartOptions.options.dblClickAction;if("drilldown"===i){const i=e.firstMapSeries;if(i){const r=t.target,n=s.bodyView().getSeries(i).pointByDom(r);n&&n.point instanceof Yr&&e.drilldown(e.firstMapSeries,n.point.area.id)}}}_doWheel(t){const e=this.$_chart().body,s=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.options.zoomable&&(e.zoom+=-s/f(Math.max(1,e.options.wheelZoomFactor),4)),t.preventDefault(),!0}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,s){return this.$_chart().isGlobe?new Dn(this.control):this.control.chartView().bodyView().canScroll()?new $n(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}}class On{static empty(){return new On}static create(t=0,e=0){return new On(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new On(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}On.EMPTY=new On;class Fn{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Fn(t,t,t,t):new Fn(t,t,e,e):new Fn(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new Fn(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=f(t.paddingLeft,0),this.right=f(t.paddingRight,0),this.top=f(t.paddingTop,0),this.bottom=f(t.paddingBottom,0),this}applyMargin(t){return this.left=f(t.marginLeft,0),this.right=f(t.marginRight,0),this.top=f(t.marginTop,0),this.bottom=f(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+"}"}}Fn.Empty=Object.freeze(new Fn),Fn.Temp=new Fn;class In extends Dt{constructor(t,e=k){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return In.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}In.IGNORE_ATTRS={width:"",height:""};class Bn extends Dt{constructor(t,e=k){super(t,e,"g"),Dt.DEBUGGING&&(this.add(this._debugRect=new ss(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,s,i);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Dt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ss(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,s,i){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class jn extends Bn{constructor(t,e,s){super(t,e),this._margins=new Fn,this._paddings=new Fn,this.add(this._background=new ss(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i){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,s,i);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 zn extends In{measure(t,e,s,i){const r=this._doMeasure(t,e,s,i);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}layoutInner(t,e,s){return this._doLayoutInner(t,e,s),this}}class Hn extends Bn{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class Gn extends yt{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e,s){const i=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(i);n.push(e),null==s||s(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._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 s of t)this.free(s,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}find(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)if(t(e[s]))return e[s]}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 s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._owner.add(e),e}_getElementId(t){}}class Yn extends Bn{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new ss(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Ve(t,"rm-legend-item-label")),this._label.anchor=ke.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i){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.options.markerVisible)?this._marker.bbox():dt,n=ut(this._label.bbox());return this._gap=f(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:p(r.height,n.height)}}_doLayout(t){const e=this._rMarker,s=f(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.bbox().height)/2)}}class Wn extends jn{constructor(t){super(t,Wn.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Gn(this,Yn)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=f(r.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==r.location?f(r.gap,0):0,o?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,o,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,d=a.top+h.top;let _,u=c,p=d;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,c=o.lineGap||0,d=h.count,_=this._rowViews=[],u=this._sizes=[];let g,m,f,b;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,+o.markerSize||Is.MARKER_SIZE)),e.measure(t,a[s],r,n)}));let y=0,w=0;if(s){for(;y<d;)b=h.get(y),w%i==0?(_.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=n?(f.push(b),w++,y++):w=0);this._wMarkers=[],g=m=0,_.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=p(s,t.mw),r=p(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=p(m,i),g+=s,u.push(s),this._wMarkers.push(r)})),g+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%i==0?(_.push(f=[b]),g=b.mw,w++,y++):(g+=l+b.mw,g<=r?(f.push(b),w++,y++):w=0);g=m=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=p(s,t.mh)})),e+=l*(t.length-1),g=p(g,e),m+=s,u.push(s)})),m+=c*(_.length-1)}return{width:g,height:m}}}Wn.LEGEND_CLASS="rm-legend";const Zn={};class Xn extends jn{static register(...t){t.forEach((t=>{Zn[t[0].type]=t[1]}))}constructor(t,e){super(t,Xn.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s),this._layoutView(t,0,0,e,s)}_layoutView(t,e,s,i,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,s,i,r,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Xn.CLASS_NAME="rm-annotation";class Un{static interpolate(t,e){if(e instanceof Ai==!1)return t;const s=[];let i=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(i||(i=a,t.push(a)),n&&r){const t=Vi(r,a);for(const i of t){const t=e.project(i);t.outside||s.push(t)}}s.push(h),r=a,n=!1}}return s}}class qn{static box(t,e,s,i,r){const n=Math.floor(Math.abs(s-t)/20),o=this.boxPoints(t,e,s,i,n);return this.coordsToPath(qn.toPixelCoord(r,o))}static ellipse(t,e,s,i,r,n=40){const o=this.arcCoords(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,n);return this.coordsToPath(qn.toPixelCoord(r,o))}static geoCircle(t,e,s,i,r,n=!1,o=40){const a=this.arcCoords(t,e,s,i,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 Ai?Un.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let s=!1;for(const i of t){if(!!i.outside){s=!1;continue}const[t,r]=i;s?e.push("L",t,r):(e.push("M",t,r),s=!0)}return e}static renderHorizontalLineToRightCoords(t,e,s,i,r){const n=[];let o=e;for(;o<=s&&(n.push([o,t]),o+r<=s);)o+=r;return 0!==n.length&&n[n.length-1][0]===s||n.push([s,t]),n}static renderHorizontalLineToLeftCoords(t,e,s,i,r){const n=[];let o=s;for(;o>=e&&(n.push([o,t]),o-r>=e);)o-=r;return 0!==n.length&&n[n.length-1][0]===e||n.push([e,t]),n}static renderVerticalLineToTopCoords(t,e,s,i,r){const n=[];let o=e;for(;o<=s&&(n.push([t,o]),o+r<=s);)o+=r;return 0!==n.length&&n[n.length-1][1]===s||n.push([t,s]),n}static renderVerticalLineToBottomCoords(t,e,s,i,r){const n=[];let o=s;for(;o>=e&&(n.push([t,o]),o-r>=e);)o-=r;return 0!==n.length&&n[n.length-1][1]===e||n.push([t,e]),n}static boxPoints(t,e,s,i,r){const n=[],[o,a]=t<=s?[t,s]:[s,t],[h,l]=e<=i?[e,i]:[i,e];r=Math.max(1,r);for(let t=o;t<=a;t+=r)n.push([t,h]);for(let t=h+r;t<=l;t+=r)n.push([a,t]);for(let t=a-r;t>=o;t-=r)n.push([t,l]);for(let t=l-r;t>h;t-=r)n.push([o,t]);return n}static arcCoords(t,e,s,i,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(s),e+Math.sin(o)*Math.abs(i)])}return u}}class Kn extends Dt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=dt,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},e&&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,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Qn extends In{constructor(t,e){super(t,e),this.add(this._text=new Ve(t,void 0)),this._text.anchor=ke.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options,n=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===n?(this._outline&&this._outline.remove(),this._back||(this._back=new ss(t,"rm-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(r.backgroundStyle)):"outline"===n?(this._back&&this._back.remove(),this._outline||(this._outline=new Ve(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(r.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new Kn(t,!1)),this._icon.url=s,this._icon.width=r.width,this._icon.height=r.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){const e=this._model.options;if(t&&e.autoContrast&&this._text.setContrast(t,e.darkStyle||"rm-label-dark",e.lightStyle||"rm-label-light"),this._outline&&this._outline.parent){const t=Pe.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._icon;let e=0;const s=this._text.bbox(),i=s.width,r=s.height;let n,o=i,a=r,h=0,l=0,c=0,d=0;if(this._box=void 0,t){const s=t.bbox();switch(e=f(this._model.options.iconGap,0),h=s.width,l=s.height,this._model.getIconPos()){case"left":case"right":o+=e+h,a=Math.max(l,r);break;default:a+=e+l,o=Math.max(h,i)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),c=parseFloat(n.paddingLeft)||0,d=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,o+c+(parseFloat(n.paddingRight)||0),a+d+(parseFloat(n.paddingBottom)||0),n.rx)),t)switch(this._model.getIconPos()){case"left":t.trans(c,(a-l)/2),c+=h+e,o-=h+e;break;case"right":t.trans(c+o-h,(a-l)/2),o-=h+e;break;case"top":t.transX((o-h)/2),d+=l+e;break;case"bottom":t.trans((o-h)/2,d+r+e)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":c+=o/2,this._text.anchor=ke.MIDDLE;break;case"right":c+=o,this._text.anchor=ke.END;break;default:this._text.anchor=ke.START}return this._text.trans(c,d),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,d)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Jn extends Ot{renderLat(t,e,s,i,r){let n=r.project([e,t]),o=et(n)?`M${n[0]},${n[1]}`:"",a=e+i;const h=t=>{n=r.project(t),et(n)&&(o+=` L${n[0]},${n[1]}`)};for(;a<=s-i;)h([a,t]),a+=i;a<=s&&h([s,t]),this.setPath(o)}renderLatGlobe(t,e,s,i,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=s;)o+=i,a=r.project([o,t]);if(o<s){let e=`M${a[0]},${a[1]}`;for(o+=i;o<=s;)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+=i;this.setPath(e)}}renderLon(t,e,s,i,r){let n=r.project([t,e]),o=et(n)?`M${n[0]},${n[1]}`:"",a=e+i;const h=t=>{n=r.project(t),et(n)&&(o+=` L${n[0]},${n[1]}`)};for(;a<=s-i;)h([t,a]),a+=i;a<=s&&h([t,s]),this.setPath(o)}renderLonGlobe(t,e,s,i,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=s;)o+=i,a=r.project([t,o]);if(o<s){let e=`M${a[0]},${a[1]}`;for(o+=i;o<=s;)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+=i;this.setPath(e)}}}class to extends Bn{constructor(t,e){super(t,"rm-map-axis-grid"),this.second=e,this._latPool=new Gn(this,Jn),this._lonPool=new Gn(this,Jn)}_doInitStyles(){this.ignorePointer()}_doMeasure(t,e,s,i){return this.$_prepareLines(e,s,i),On.create(s,i)}_doLayout(t){const e=this.model,s=e.line,i=e.lonLine,r=e.latLine,n=e.chart.getProjection(this.second),o=n.isGlobe,a=this._bounds,h=a.step,l=1/this._scale;Et.setImportantStyle(this.dom.style,"pointer-events","none"),Et.setImportantStyle(this.dom.style,"fill","none"),this.setStyle("strokeWidth",`${l}px`);let c=a.x1,d=a.x2;o?this._latPool.forEach(((t,e,i)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLatGlobe(a.y1+e*h,c,d,h,n)})):this._latPool.forEach(((t,e)=>{const i=a.y1+e*h;i>a.y2||i<a.y1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLat(i,c,d,h,n))}));let _=a.y1,u=a.y2;o?this._lonPool.forEach(((t,e,r)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLonGlobe(a.x1+e*h,_,u,h,n)})):this._lonPool.forEach(((t,e)=>{const r=a.x1+e*h;r>a.x2||r<a.x1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLon(r,_,u,h,n))}))}$_prepareLines(t,e,s){const i=t.chart.map,r=t.getStep(i),{x1:n,x2:o,y1:a,y2:h}="map"===this.model.fitTo?this.$_calcBoundary(i,r):this.$_calcFullBoundary();this._latPool.prepare(h-a+1),this._lonPool.prepare(o-n+1),this._bounds={x1:Math.max(-180,n),y1:Math.max(-90,a),x2:Math.min(180,o),y2:Math.min(90,h),step:r}}$_calcBoundary(t,e){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class eo extends Bn{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new to(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,s,i){return this._gridView.setVisible(e.grid.visible)&&this._gridView.measure(t,e.grid,s,i),On.create(s,i)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}}class so extends Qn{}class io extends Bn{constructor(t,e){super(t),this.add(this._pathView=new Ot(t)),e.add(this._labelView=new so(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,s,i){return this.setClass(e instanceof hi?"rm-axis-range-guid":"rm-axis-line-guide"),{width:s,height:i}}_doLayout(t){const e=this.model,s=e.options,i=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(i.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(s.label.text),"range"===s.type){const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(s,t,r),i.setStyle("strokeWidth",`${e}px`)}else if("band"===s.type){o||(this.add(o=this._fromView=new Ot(this.doc)),this.add(a=this._toView=new Ot(this.doc))),o.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),o.setStyle("fill","none"),o.setStyle("transform",t.trans),a.setStyle("fill","none"),a.setStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.setStyle("strokeWidth",`${h}px`),a.setStyle("strokeWidth",`${h}px`),n=this.$_renderBand(s,t,r),i.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(s,t,r),i.setStyle("fill","none"),i.setStyle("strokeWidth",`${e}px`)}i.setPath(n).setStyle("transform",t.trans)}$_renderLine(t,e,s){const{map:i,prj:r,step:n}=e;let o;if("lat"===t.axis){const a=t.position,h=i.h1,l=i.h2;o=qn.renderHorizontalLineToRightCoords(a,h,l,r,n),this.$_renderLatLabel(h,a,e,s)}else{const a=t.position,h=i.v1,l=i.v2;o=qn.renderVerticalLineToTopCoords(a,h,l,r,n),this.$_renderLonLabel(a,l,r,e.tf,s)}const a=o.map((t=>r.project(t)));return qn.coordsToPath(a)}$_renderBand(t,e,s){const{map:i,prj:r,step:n}=e;let o=[];if("lat"===t.axis){const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.h1,c=i.h2;o.push(...qn.renderHorizontalLineToRightCoords(a,l,c,r,n));const d=[...o];this._fromView.setPath(qn.coordsToPath(d.map((t=>r.project(t))))),o.push(...qn.renderVerticalLineToTopCoords(c,a,h,r,n));const _=qn.renderHorizontalLineToLeftCoords(h,l,c,r,n);o.push(..._),this._toView.setPath(qn.coordsToPath(_.map((t=>r.project(t))))),o.push(...qn.renderVerticalLineToBottomCoords(l,a,h,r,n)),this.$_renderLatLabel(l,h,e,s)}else{const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.v1,c=i.v2;o.push(...qn.renderVerticalLineToTopCoords(a,l,c,r,n));const d=[...o],_=qn.renderVerticalLineToBottomCoords(h,l,c,r,n);o.push(..._),this._fromView.setPath(qn.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(qn.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(a,c,r,e.tf,s)}return qn.coordsToPath(qn.toPixelCoord(r,o))}$_renderRange(t,e,s){const{prj:i}=e;let r;const[n,o]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(n,a),Math.min(o,h)],e=Math.abs(a-n),s=Math.abs(h-o);r=qn.ellipse(t[0],t[1],e,s,i)}else r=qn.box(n,o,a,h,i);if(s.visible){const t=Math.min(n,a),r=Math.max(o,h),l=i.project([t,r]);l.outside?s.visible=!1:s.visible||(s.visible=!0),s.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-s.bbox().height)}return r}$_renderLatLabel(t,e,s,i){if(!i.visible)return;const{prj:r,map:n,tf:o}=s;let a=0,h=0;const l=i.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?i.visible=!1:i.visible||(i.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,i.trans(a,h)}$_renderLonLabel(t,e,s,i,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=s.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*i.scale+i.tx,o=c*-i.scale+i.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,s,i,r){let n="",o=e;const a=t=>{const e=i.project(t);et(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<s-r;)a([o,t]),o+=r;return o<=s&&a([s,t]),n}$_renderHorizontalLineToLeft(t,e,s,i,r){let n="",o=s;const a=t=>{const e=i.project(t);et(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>e+r;)a([o,t]),o-=r;return o>=e&&a([e,t]),n}$_renderVerticalLineToTop(t,e,s,i,r){let n="",o=e;const a=t=>{const e=i.project(t);et(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=s-r;)a([t,o]),o+=r;return o<s&&a([t,s]),n}$_renderVerticalLineToBottom(t,e,s,i,r){let n="",o=s;const a=t=>{const e=i.project(t);et(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class ro extends In{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new ss(t,"rm-crosshair-flag-back")),this.add(this._text=new Ve(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),s=parseFloat(e.paddingLeft)||0,i=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+s+(parseFloat(e.paddingRight)||0),r.height+i+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(s+r.width/2,i)}renderLonFlag(t,e,s,i,r,n,o){const a=e.project([i,s]),h=e.project([i,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,s,i,r,n){const o=e.project([s,i]),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,s,i){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(i.tx+o[0]*i.scale,Math.min(s-r.height,Math.max(0,i.ty-o[1]*i.scale-r.height/2)))}renderGlobeLatFlag(t,e,s,i,r,n,o,a){const h=e.project([s,i]),l=e.project([o,i]),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 no extends Bn{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Jn(t,"rm-crosshair-line")),this.add(this._lonLine=new Jn(t,"rm-crosshair-line")),Et.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Et.setImportantStyle(this._latLine.dom.style,"fill","none"),Et.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Et.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new ro(t)),this.add(this._lonFlag=new ro(t))}prepare(t,e){this._latLine.internalClearStyles();const s=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${s}px`),this._lonLine.setStyle("strokeWidth",`${s}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){var s,i,r;const n=this.model,o=n.chart.map,a=t[0],h=t[1],l=this._lonLine,c=this._latLine,d=this._lonFlag,_=this._latFlag;null!==(r=null===(i=null===(s=n.chart.axis)||void 0===s?void 0:s.grid)||void 0===i?void 0:i.getStep(o))&&void 0!==r||no.DEFAULT_STEP;const u=no.LINE_STEP,p="map"===n.axis.grid.fitTo,g=p?o.h1:-180,m=p?o.h2:180,f=p?o.v1:-90,b=p?o.v2:90;this._bounds={x1:g,x2:m,y1:f,y2:b};const y=[l,d,c,_],w=y.reduce(((t,e)=>t&&e.visible),!0);if(!(g<=a&&a<=m&&f<=h&&h<=b))return void y.forEach((t=>t.setVisible(!1)));w||y.forEach((t=>t.setVisible(!0)));const x=this.model.chart.getProjection(!1),v=x instanceof Ai?x:new x.constructor;this.$_renderLon(t,u,e,v),this.$_renderLat(t,u,e,v)}$_renderLon(t,e,s,i){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=i instanceof Ai;_?l.renderLonGlobe(h,o,a,e,i):l.renderLon(h,o,a,e,i);const u=this.calcTopY(s,n,i,o),p=this.calcScrolledLon(r,h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,i,d.height,s):c.renderLonFlag(g,i,a,h,u,d.width,s)}calcScrolledLon(t,e){let s=e+t.chart.getProjection(!1).scroll;return s=(s%360+360)%360,s>180&&(s-=360),s}$_renderLat(t,e,s,i){const r=this.model,n=r.chart.map,o=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=i instanceof Ai;u?l.renderLatGlobe(h,o,a,e,i):l.renderLat(h,o,a,e,i);const p=u?90-i.rotationX:o,g=i.project(t),m=this.calcRightX(s,i,_,n,g[1]);u?c.renderGlobeLatFlag(d,i,p,h,_.width,_.height,m,s):c.renderLatFlag(d,i,p,h,_.height,s)}calcTopY(t,e,s,i){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=s.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?i:n[1]}calcRightX(t,e,s,i,r){const n=[(s.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?i.x2:o[0]}}no.LINE_STEP=1,no.DEFAULT_STEP=1;const oo="rm_map_globe_fill";class ao extends Ot{constructor(t){super(t,"rm-map-background")}render(t,e,s,i,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,s,i);else if(e.body.projection.isElliptic){const t=e.body.projection.getClipBounds();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=Ct.rectangle(s,i,r,n);if(this.setPath(c),h.isElliptic&&!(h instanceof Ai)){const{tx:t,ty:e,scale:s}=a.transformInfo;this.transEx(t,e).scale(s)}}$_renderGlobeBg(t,e,s,i,r,n,o){const a=e.options.globeFill,h=Math.max(i,r)/2;if(s=Ct.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(oo),a){const e={id:oo,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new qt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${oo})`),this.internalSetStyleOrClass(e._style),s}}class ho extends Ot{constructor(t,e,s){super(t,e),this.setLine(s)}setLine(t,e,s,i){ct.isNum(t)?this.setPath(Ct.line(t,e,s,i)):t&&this.setPath(Ct.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Ct.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Ct.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Ct.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Ct.line(e,t,s,t))}}class lo extends Ot{constructor(t,e,s,i){super(t,e),s&&this.setLines(s,i)}setLines(t,e){ct.isNum(t[0])?this.setPath(Ct.lines(...t)):this.setPath(Ct.lines2(...t))}}var co;class _o extends Gn{constructor(t,e){super(t,e,void 0,0)}_getElementId(t){return t.point.pid}}class uo extends Qn{constructor(t){super(t,"rm-point-label")}}class po extends $t{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Gn(this,uo),new Gn(this,uo)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):(e.setText(n.getText(n.getValue(i,s))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const s=e.model,i=s.getPointLabels(),r=s.pointLabelCount(),n=this._labels,o=s.getLabeledPoints(),a=this._maps,h=i[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,s,i[h]),a[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class go extends In{constructor(t){super(t),this.add(this._line=new lo(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Ot(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Ot(t,"rm-callout-anchor"))}render(t,e,s,i){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(Ct.circle(0,0,1e4)),this._dummy.trans(s[0],s[1]),o.setVisible(t.anchorPoint.visible)){const i=xo.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;o.internalClearStyleAndClass(),r.useSeriesColor&&o.internalSetStyleOrClass(n._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(i(a,a)),o.trans(s[0],s[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(s,!1),i&&r.usePointColor&&(o.visible&&o.setFill(i),a.setStroke(i)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class mo extends It{constructor(t){super(t),this.add(this._back=new ss(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Ot(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,s){return this._mask.setPath(Ct.circle(t,e,s)),this}setRects(t,e){return t&&e?this._mask.setPath(Ct.rect(t).concat(Ct.rect(e))):this._mask.setPath(Ct.rect(t)),this}}class fo extends $t{constructor(t,e){super(t,e),this._callouts=new Gn(this,go),this._map={},this.add(this._maskLayer=new $t(t)),this._masks=new Gn(this._maskLayer,mo),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,s=t.callout,i=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=s._style,a=this._map={};r.prepare(n.length,(t=>{})),i.prepare(n.length),n.forEach(((t,s)=>{const n=i.get(s);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(s).id}`),n.index=s,a[t.pid]=n)})),this.setStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const s={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},i=this._masks.get(t.index);return i.setBackground(s),i}}class bo extends Ft{constructor(t,e=!1){super(t,xo.POINT_CLASS,e)}tooltipColor(){return this.getFill()}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.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!=s;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 s=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;i.curve(s,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}i.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}}class yo extends $t{}const wo={};class xo extends Hn{static register(...t){t.forEach((t=>{wo[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof xo)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Ct[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,s=!0){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,s,i)=>({x:t-s/2,y:e-i}),bottom:(t,e,s,i)=>({x:t-s/2,y:e}),center:(t,e,s,i)=>({x:t-s/2,y:e-i/2}),left:(t,e,s,i)=>({x:t-s,y:e-i/2}),right:(t,e,s,i)=>({x:t,y:e-i/2})},this._labelPositioner={bottom:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e+=r+n}),top:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e-=r+n+s.height}),right:(t,e,s,i,r,n)=>({x:t+=i+n,y:e-=s.height/2}),left:(t,e,s,i,r,n)=>({x:t-=i+n+s.width,y:e-=s.height/2}),center:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e-=s.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointLayer=new $t(t)),this._pointLayer.add(this._pointContainer=new yo(t,"rm-series-points")),this.add(this._calloutContainer=new fo(t,"rm-series-callouts")),s&&(this._labelContainer=new po(t,e))}_setCalcedColor(t,e){let s=getComputedStyle(e)[this._legendColorProp()];"none"===s&&(s=getComputedStyle(e)[this._legendColorProp2()]),t.setCalcedColor(s)}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepare(t,e){const s=e._optionsDirty||e._dataSourceDirty||e._zindexDirty,i=this._labelContainer,r=this._calloutContainer;this.setModel(e),e instanceof Xr?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==i||i.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),null==i||i.prepare(t,this),r.prepare(t,this)):((null==i?void 0:i.isEmpty())&&i.prepare(t,this),r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,s=e._optionsDirty||e._dataSourceDirty;s&&this._doPrepeare(t,e,s)}render(t,e){this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),this._animatable&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}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){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,s){return this._doPointerMoved(t,e,s)}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}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){return this._getPointPool().elementOf(t)}click(t){const e=this.pointByDom(t);e&&(e.point?!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e):this._doPointClicked(e))}select(t,e){const s=this.pointByDom(t);s&&this.chart().selection.add(this.model,s.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_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,s){if(t.setAttrEx("aria-label",s.ariaHint()),t.internalClearStyleAndClass(),s._runColor)this._setPointColor(t,s._runColor);else{const i=e.getRangedColor(s);i&&this._setPointColor(t,i)}const i=e.getPointStyle(s);i&&t.internalSetStyleOrClass(i)}_doPointerMoved(t,e,s){return!1}_getGrowRate(){return f(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"}_legendColorProp2(){return"stroke"}_doPointClicked(t){t&&t.point&&ct.log("CLICKED: ",t.point.name,t.point.getValue())}}co=xo,xo.POINT_CLASS="rm-point",xo.DATA_HOVER="hover",xo.DATA_UNHOVER="unhover",xo.LEGEND_MARKER="rm-legend-item-marker",xo._drawers=Object.assign({circle:t=>Ct.circle(0,0,t)},co._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class vo extends bo{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class So extends xo{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class Co extends bo{prepare(t,e){return this.point=t,this._ext=ct.getMinMax(t.values),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Lo extends xo{_getSeriesExt(t,e){return Object.assign(Object.assign({},t.getMinMax(e)),{minSize:+t.options.minSize})}}class Po extends Co{constructor(t){super(t,!0),this.add(this._contentLayer=new $t(t)),this.add(this._baseLine=new ho(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,s,i){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(i,0,s)}}class ko extends Lo{_getSeriesExt(t,e){const s=super._getSeriesExt(t,e);return t._pointDomain||(s.min=Math.min(s.min,f(t._minValue,s.min)),s.max=Math.max(s.max,f(t._maxValue,s.max))),s}_doPrepeare(t,e,s){!this._ext||s?this._ext=Object.assign(Object.assign({},this._getSeriesExt(e,this._visPoints)),{width:e._width,height:e._height}):(this._ext.width=e._width,this._ext.height=e._height)}}class Mo extends bo{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class Ao extends xo{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Vo extends Xn{constructor(t){super(t,Vo.CLASS_NAME),this.add(this._imageView=new Kn(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ut(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Vo.CLASS_NAME="rm-image-annotation";class Eo extends Xn{constructor(t){super(t,Eo.CLASS_NAME),this.add(this._shapeView=new Ot(t))}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),Ct.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)}}Eo.CLASS_NAME="rm-shape-annotation";class No extends Xn{constructor(t){super(t,No.CLASS_NAME),this.add(this._textView=new Ve(t)),this._textView.anchor=ke.START,this._richText=new Ie}_doMeasure(t,e,s,i){const r=e.options,n=e.getSize(s,i),o=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(n),this._richText.setFormat(r.text),this._richText.build(o,s,i,null,e._domain);const a=ut(this._textView.bbox());return{width:f(n.width,a.width),height:f(n.height,a.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)}}No.CLASS_NAME="rm-text-annotation";class To{static reveal(t,e){new $o(t,e)}static grow(t,e){new Oo(t,e)}static spread(t,e){new Fo(t,e)}static fadeIn(t){new Do(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Do extends To{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:ft.DURATION,fill:"none"})}}let $o=class extends To{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:ft.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,s){return e.dom.firstElementChild.animate([{width:"0"},{width:F(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:F(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}};class Ro extends ft{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Dt}_stop(){super._stop(),this._series=null}}class Oo extends Ro{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Fo extends Ro{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Io extends Ot{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,s,i,r,n){this.x=t,this.setPath(Ct.bar(t-s/2,e,s,-i,r,n))}}class Bo extends Po{constructor(t){super(t),this._bars=new Gn(this._contentLayer,Io)}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,s,i,r,n){const o=t._categories||[],{min:a,max:h,base:l}=t.getPointExtents(s,e),c=i/s.length,d=c*t.options.barWidth;this._bars.forEach(((t,e)=>{const i=s[e];if(t.setVisible(!isNaN(i))){const s=c*e+(c-d)/2,l=(i-a)/(h-a)*r*n;t.setPath(Ct.bar(s,r,d,-l,0,0)),t.internalClearStyleAndClass(),o[e]&&o[e].color&&t.setFill(o[e].color)}})),this._renderBaseLine(t.baseLine,!1,i,r)}}class jo extends vo{tooltipColor(){return getComputedStyle(this.dom).fill}}class zo extends Ot{static create(t,e,s,i,r,n,o,a,h=!0){return new zo(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,n,o,a,h,l=!0){return new zo(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=k,s=k){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return Ct.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 Ct.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 Ho=function(t){return isNaN(t)?0:t};class Go{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",Ho(t),Ho(e)):this._path.push("M",Ho(t.x),Ho(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",Ho(t),Ho(e)):this._path.push("m",Ho(t.x),Ho(t.y)),this}movep(t,e){return o(t)?this._path.push("M",I(t),I(e)):this._path.push("M",I(t.x),I(t.y)),this}line(t,e){return o(t)?this._path.push("L",Ho(t),Ho(e)):this._path.push("L",Ho(t.x),Ho(t.y)),this}linep(t,e){return o(t)?this._path.push("L",I(t),I(e)):this._path.push("L",I(t.x),I(t.y)),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}q(t,e,s,i){return this._path.push("Q",t,e,s,i),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ho(t[e]),Ho(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ho(t[e].x),Ho(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}}class Yo extends Ot{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Go;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let Wo=class extends Ot{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Go).circle(0,0,s).end())),this.internalResetStyleOrClass(t._style),this}};class Zo extends Mo{constructor(t){super(t),this.add(this._faceView=new zo(t,"rm-circle-gauge-face")),this.add(this._rimView=new zo(t,"rm-circle-gauge-rim")),this.add(this._valueView=new zo(t,"rm-circle-gauge-value")),this.add(this._textView=new Ve(t,"rm-circle-gauge-text")),this.add(this._handContainer=new $t(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 Yo(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 Wo(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible)&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,s,i){const r=t._props.getCenter(e,s),n=t._props.getExtents(u(e,s));this.$_renderBackground(t,r,n),this.$_renderValue(t,this.point,i)}$_renderBackground(t,e,s){const i=this._faceView,r=this._rimView,n=t._props,o=n._startRad;this._center=e,this._exts=s,i.visible&&(i.internalResetStyleOrClass(t.face._style),i.setSector({cx:e.x,cy:e.y,rx:s.radius-s.radiusThick,ry:s.radius-s.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:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=s.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,s){const i=t.options,r=t._props,n=e.getValue(),o=t.getValueRate(n)*s,a=this._center,h=this._exts,l=t.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const e=t.valueRim,s=e.options,n=h.value+(s.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(e._style),s.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",F(l))),c.setBoolData("stroked",s.stroked),c.setSectorEx({cx:a.x,cy:a.y,rx:n,ry:n,innerRadius:(n-l)/n,start:r._startRad,angle:r._sweepRad*o,clockwise:i.clockwise},s.stroked)}if(c.visible){const e=t.gaugeLabel;c.text=e.getNumberText(n,!1,!1,void 0),e.buildSvg(c,null,NaN,NaN,t,e._domain);const s=c.bbox(),i=e.getOffset(this.width,this.height);c.trans(a.x+i.x,a.y-s.height/2+i.y)}}}class Xo extends Dt{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Uo extends ft{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 qo extends Mo{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Xo(t,"rm-clock-gauge-face")),this.add(this._rimView=new zo(t,"rm-clock-gauge-rim")),this.add(this._labelView=new Ve(t,"rm-clock-gauge-label")),this._labelView.layout=Me.MIDDLE,this.add(this._tickContainer=new $t(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new $t(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Ot(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Ot(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Ot(t,"rm-clock-gauge-second")),this.add(this._pinView=new Xo(t,"rm-clock-gauge-pin")),this._tickViews=new Gn(this._tickContainer,ho,"rm-clock-gauge-tick"),this._tickLabelViews=new Gn(this._tickLabelContainer,Ve,"rm-clock-gauge-tick-label")}prepare(t,e){const s=Math.round(12/p(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Me.MIDDLE})),this._zoneCallback=e.options.timezoneCallback}render(t,e,s){const i=this.point,r=this._exts=t.getExtents(e,s);this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+i.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.options.animatable&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,i=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.options.length||0;i.setVisible(t.face.visible)&&(i.internalResetStyleOrClass(t.face._style),i.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=E,f=V/12;if(this._tickViews.forEach(((e,s)=>{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,s=V/12*e;m=E,n.get(0).text="12",g=p-(u+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((i,r,n)=>{i.text=String(0===r?12:r*e),i.trans(a+d(m)*g,h+_(m)*g),i.internalResetStyleOrClass(t.tickLabel._style),m+=s}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),s.setVisible(t.gaugeLabel.visible)&&(s.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?s.trans(a,h+g/2):s.trans(a,h-g/2))}$_getNow(t){var e;let s=t.getTime();if(!s){s=new Date;const i=b(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=s.getMinutes()+s.getTimezoneOffset()+i;s.setMinutes(r)}return s}$_renderHands(t,e){const s=this.$_getNow(this.point),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),o=i>=12,{cx:a,cy:h,rd:l}=e,c=new Go;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=V*(i/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*T)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=V*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*T)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?V*(this._aniSec+this._secRate)/60:V*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*T),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const s=new Uo(this,t);s.duration=t.secondHand.options.duration||200,s.start()}}}const Ko="rm-map-series-id-";let Qo=class t extends bo{static idClass(t){return Ko+t.id}static getId(t){for(const e of t.classList)if(e.startsWith(Ko))return e.substring(17)}constructor(t){super(t)}render(e,s,i){const r=this.model,n=!this.point||this.point.isNull;e!==r&&this.setPath((this.model=e).path),i&&(this.setBoolData("null",n),n&&s&&this.internalSetStyleOrClass(s),this.dom.classList.add(t.idClass(e)))}reset(){this.model=null}};class Jo extends bo{constructor(t){super(t,!0),this.add(this._figure=new Ot(t)),this.add(this._textView=new Qn(t,"rm-figure-series-inner-label"))}render(t,e,s){const i=this._textView,r=s.options.text;this._figure.setPath(e),i.internalResetStyleOrClass(s._style),i.setModel(t,s,null,null),s.prepareRich(r),s.buildSvg(i._text,i._outline,NaN,NaN,s,s.getTextDomain(this.point)),i.layout();const n=this.bbox(),o=i.bbox(),a=Et.getPadding(i._text.dom),h=n.width-a.left-a.right,l=n.height-a.top-a.bottom;i.trans(a.left+(h-o.width)/2,(l-o.height)/2+a.top)}layout(){const t=this._textView,e=this.bbox(),s=t.bbox(),i=Et.getPadding(t._text.dom),r=e.width-i.left-i.right,n=e.height-i.top-i.bottom;t.trans(i.left+(r-s.width)/2,(n-s.height)/2+i.top)}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class ta extends vo{constructor(t){super(t)}}class ea extends bo{constructor(t){super(t,!0),this.add(this._imageView=new Kn(t,!1))}setImage(t,e,s){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(s)||(this._imageView.height=s)}}let sa=class extends Po{constructor(t){super(t),this._contentLayer.addAll(this._back=new ss(t),this._area=new Ot(t,"rm-line-series-area"),this._line=new Ot(t,"rm-line-series-line"),this._lowLine=new Ot(t))}render(t,e,s,i,r,n){const{min:o,max:a,base:h}=t.getPointExtents(s,e),l=this.$_getPts(s,o,a,i,r),c=s.length,d=c>2&&t.options.curved,_=new Go;if(this.resize(i,r),this._back.setVisible(!1)&&(this._back.resize(i,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,i,r)}$_getPts(t,e,s,i,r){const n=t.length,o=[];let a=.05*i,h=.1*r;const l=s-e;i-=.1*i,r-=.2*r;for(let s=0;s<n;s++){const c=t[s],d=a+s/(n-1)*i,_=h+(isNaN(c)||0==l?r:(1-(c-e)/l)*r);o.push({x:d,y:_})}return o}};class ia{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),s=this.$_left(t,e);return null==s||s.addEventListener("finish",(()=>{e.dom.remove()})),s}$_aniOptions(){return{duration:ft.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:F(t.width)}],this.$_aniOptions())}}const ra="rm-map-series-id-";class na extends bo{static idClass(t){return ra+t.id}static getId(t){for(const e of t.classList)if(e.startsWith(ra))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,s){const i=this.point;if(s){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||i.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(na.idClass(this.model))}this.setBoolData("selected",i&&i._selected)}reset(){this.model=null}}class oa extends Ot{constructor(t){super(t,"rm-map-series-inset")}render(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=J(t.frame),n=e.model,o=n.h1-r.l,a=n.h2+r.r,h=n.v2+r.t,l=n.v1-r.b,c=[s.project([o,h]),s.project([a,h]),s.project([a,l]),s.project([o,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=n(t.border)?xi(t.border,e.model):t.border,o=r.length;let a=s.project([r[0],r[1]]);i=`M${a[0]} ${a[1]}`;for(let t=2;t<o;t+=2)a=s.project([r[t],r[t+1]]),i+=` L${a[0]} ${a[1]}`;"z"===r[o-1]&&(i+=" z")}i&&this.setPath(i)}}render2(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=J(t.frame);let n=1/0,o=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;n=u(n,e.h1),o=u(o,e.v1),a=p(a,e.h2),h=p(h,e.v2)}const l=n-r.l,c=a+r.r,d=h+r.t,_=o-r.b,g=[s.project([l,d]),s.project([c,d]),s.project([c,_]),s.project([l,_])];i=`M${g[0][0]} ${g[0][1]} L${g[1][0]} ${g[1][1]} ${g[2][0]} ${g[2][1]} ${g[3][0]} ${g[3][1]} Z`}else if(t.border){let r=1/0,o=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;r=u(r,e.h1),o=u(o,e.v1),a=p(a,e.h2),h=p(h,e.v2)}const l=n(t.border)?xi(t.border,{h1:r,h2:a,v1:o,v2:h}):t.border,c=l.length;let d=s.project([l[0],l[1]]);i=`M${d[0]} ${d[1]}`;for(let t=2;t<c;t+=2)d=s.project([l[t],l[t+1]]),i+=` L${d[0]} ${d[1]}`;"z"===l[c-1]&&(i+=" z")}i&&this.setPath(i)}}render3(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=t.offset||[0,0],n=J(t.frame),o=e.h1+(r[0]||0)-n.l,a=e.h2+(r[0]||0)+n.r,h=e.v2+(r[1]||0)+n.t,l=e.v1+(r[1]||0)-n.b,c=[s.project([o,h]),s.project([a,h]),s.project([a,l]),s.project([o,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=t.offset||[0,0],o=n(t.border)?xi(t.border,e):t.border,a=o.length;let h=s.project([o[0]+(r[0]||0),o[1]+(r[1]||0)]);i=`M${h[0]} ${h[1]}`;for(let t=2;t<a;t+=2)h=s.project([o[t]+(r[0]||0),o[t+1]+(r[1]||0)]),i+=` L${h[0]} ${h[1]}`;"z"===o[a-1]&&(i+=" z")}i&&this.setPath(i)}}}class aa extends Bn{constructor(t,e,s){super(t,e),this._paddings=new Fn,this.add(this._background=new Ot(t,s)),this.add(this._textView=new Ve(t))}setPoint(t){return this._point=t,this}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const n=e.options.text;n?(e.prepareRich(n),e.buildSvg(this._textView,s,i,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;r(a)&&(a=a(e.series.getPointCallbackArgs(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,s,i);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,s=this.width;let i=0;this._renderBackgrouond(this._background,s,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":i+=s/2,e.anchor=ke.MIDDLE;break;case"right":i+=s,e.anchor=ke.END;break;default:e.anchor=ke.START}e.trans(i,this._paddings.top)}}class ha extends aa{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){this.model.options.backgroundStyle,t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,i,0))}}class la extends aa{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,0,i))}}class ca extends bo{constructor(t){super(t,!0),this.add(this._backView=new ss(t,"rm-panel-series-back")),this.add(this._headerView=new ha(t)),this.add(this._bodyView=new la(t)),this.add(this._divider=new ho(t))}render(t,e,s,i,r){const n=this.point,o=e.header,a=e.body,h=this._headerView,l=this._bodyView,c=this._divider;let d,_;h.setVisible(o.visible)&&(h.internalResetStyleOrClass(o._style),d=h.setPoint(n).measure(t,o,s,i)),this._divider.setVisible(h.visible),l.internalResetStyleOrClass(a._style),_=l.setPoint(n).measure(t,a,s,i);let u=_.width,p=_.height;h.visible&&(u=Math.max(u,d.width),p+=d.height);const g=e.getExtents(u,p);h.visible&&(h.resize(g.width,d.height),h.layout(r),c.setVisible(e.divider.visible)&&(c.trans(0,d.height),c.setHLine(0,0,g.width))),l.resize(g.width,g.height-d.height),l.transY(d.height),l.layout(r),this._backView.setBounds(0,0,g.width,g.height,r)}}class da extends zo{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class _a extends Co{constructor(t){super(t,!0),this._sectors=new Gn(this,da,null,.5),this._rdRate=1,this.add(this._circle=new Xo(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,s){const i=this.point.values;this._sectors.prepare(i.length,((t,e)=>{t.value=i[e]})),this._rd=e,this.$_layoutSectors(t,s)}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e){const s=this.point.values,i=t.options,r=s.length,n=i.clockwise?1:-1,o=s.reduce(((t,e)=>t+e),0),a=t._totalRad*e;let h=t._startRad;if(this._sectors.prepare(s.length,((t,e)=>{t.value=s[e]})),r>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=h,h+=t.angle=n*e*a}}));else if(1==r){const t=this._sectors[0];t.startAngle=h,t.angle=a}}$_layoutSectors(t,e){const s=t._categories||[],i=t.options.clockwise,r=0,n=0,o=this._cx=r,a=this._cy=n,h=this._rd;this.$_calcAngles(t,e),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this._sectors.forEach(((t,e)=>{const r=t.value;if(isNaN(r))t.setVisible(!1);else{const r=t.start;let n=0,l=0;t.trans(n,l).setVisible(!0),t.setPieSector({cx:o,cy:a,rx:h,ry:h,innerRadius:0,start:r,angle:g(t.angle),clockwise:i}),t.internalClearStyleAndClass(),s[e]&&s[e].color&&t.setFill(s[e].color)}}))}}class ua extends vo{constructor(t){super(t,!0),this.add(this._pin=new Ot(t))}render(t){this._pin.setPath(Ct.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Xo(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 pa extends vo{}class ga extends bo{constructor(t){super(t,!0),this.add(this._line=new Ot(t)),this.add(this._arrow=new Ot(t))}render(t,e,s,i){if(s.length>1){const t=s[s.length-2],r=s[s.length-1],n=O(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+s.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(i)&&(this._arrow.setPath(`M ${r[0]} ${r[1]} L ${r[0]-5*e} ${r[1]-13*e} L ${r[0]+5*e} ${r[1]-13*e} Z`),this._arrow.setRotation(r[0],r[1],n))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class ma extends vo{}class fa extends Co{constructor(t){super(t,!0),this._cells=new Gn(this,Ot)}render(t,e,s,i){const r=t.getPointGrid(this.point,e,i);this.$_prepareCells(Math.round(r.count),s.wCell,s.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,s)}$_prepareCells(t,e,s){this._cells.prepare(t,(t=>{t.setPath(Ct.square(0,0,e,s))}))}$_layoutCells(t,e,s,i,r){const n=s*r.hCell+(s-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,s,i)=>{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 ba extends Lo{constructor(t){super(t,"rm-waffle-series"),this._waffles=new _o(this._pointContainer,fa)}_getPointPool(){return this._waffles}_doPrepeare(t,e,s){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._waffles.prepare(s,((s,r)=>{const n=s.prepare(e[r],i);this._setPointStyle(s,t,n)}))}$_layoutWaffles(t,e,s){const i=this.model,r=i.getWaffleInfo(),n=i.chart.getProjection(this._second),o=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=Object.assign(Object.assign({},this._getSeriesExt(i,i._visPoints)),{gap:i.options.gap}),u=i.getCallout(),p=this._calloutViews();let g,m,f;this._waffles.forEach(((t,e)=>{const b=t.point,y=[b.lon,b.lat];if(t.setVisible(!b.isNull&&null!=(g=n.getVisible(y)))){const e=this._getPointPositioner(b.position||h,"top");let w,x,v,S,C,L;u&&(w=b.getCallout(y))&&(x=w.map((t=>n.project(t))),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=S=g[1],v*=a[0],S*=a[1],t.render(i,_,r,s),m=t.bbox(),f=e(v,S,m.width,m.height),t.trans(f.x,f.y).rotate(o),d&&(C=d.get(b,0))&&this._layoutLabel(C,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,C.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.render(u,b,x.flat().map(((t,e)=>t*a[e%2])),null)}}))}}function ya(t,e){return new(Zn[e._type()])(t)}xo.register([Xr,class extends xo{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new _o(this._pointContainer,na),this._insetPool=new Gn(this._pointContainer,oa)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,i;const r=this._hoverArea;if(t!==r){const n=this.model;if(r&&(r.setBoolData(xo.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(xo.DATA_HOVER,!1))),!t||t.point||n.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let n=e.hoverColor,o=this.model.pointLabel.options.hoverColor;!n&&s(e.hoverStyle)&&(n=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",n||""),r.style.setProperty("--map-series-hover-label-fill",o||""),t.setBoolData(xo.DATA_HOVER,!0),t.point&&(null===(i=this._labelContainer.get(t.point,0))||void 0===i||i._text.setBoolData(xo.DATA_HOVER,!0))}t!=r&&n.chart._hoverAreaChanged(n,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=na.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){const i=!lt,r=this._second,n=this._insets=[],o=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,s)=>{const a=e.get(r,s),h=t.point=e.pointOf(a);t.setModel(a),h?(a.dummy||this._setPointStyle(t,e,h),o&&o.push(t)):t.internalClearStyleAndClass(),i&&t.setStyle("vectorEffect","non-scaling-stroke"),a.inset&&n.push(a.inset)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let s,i;return(s=t.point)?(i=e.point)?isNaN(s._zindex)?isNaN(i._zindex)?0:-1:isNaN(i._zindex)?1:s._zindex-i._zindex:1:e.point?-1:0})),n.push(...e.chart.map._insets),o&&o.length!==e.areaCount&&o.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(n.length,((t,e)=>{i&&t.setStyle("vectorEffect","non-scaling-stroke")}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second,r=s.isDirty,n=s.body,o=this.model,a=o.options,h=s.getProjection(i),l=this._areas={},c=this._insets,d=a.allAreas;o.pointLabel.options.position;const _=this._labelViews(),u=a.nullStyle,p=a.dummyStyle,g=this._scale;this._areaPool.forEach(((t,e)=>{const s=t.model;if(s){const e=t.point,i=_&&e&&_.get(e,0);if(l[s.id]=t,t.setVisible(s.visible&&(d||!!e))){if(t.render(u,p,r),i){const s=h.project(o.getCenter(e));if(i.setVisible(n.isVisible(s))){i._model,r&&this._layoutLabel(i,t.dom);const n=i.bbox();let[o,a]=s;e.xPos=o,e.yPos=a,o*=g,a*=-g,o-=n.width/2,a-=n.height/2,i.trans(o,a)}}}else i&&i.setVisible(!1)}})),this._insetPool.forEach(((t,e)=>{const s=c[e],i=l[s.area];if(i)t.setVisible(i.visible)&&t.render(s,i,h);else{const e=s._base;if(e[0]instanceof Ti)t.render2(s,e.map((t=>l[t.id])),h);else if(e[0]>=0){const i=n.map.areaOf(s.parent);if(i){const r=i.readBounds(e);t.render3(s,r,h)}}}}))}}],[Tr,class extends xo{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new _o(this._pointContainer,Qo)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,i;const r=this._hoverArea;if(t!==r){const n=this.model;if(r&&(r.setBoolData(xo.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(xo.DATA_HOVER,!1))),t&&!t.point&&(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let n=e.hoverColor,o=this.model.pointLabel.options.hoverColor;!n&&s(e.hoverStyle)&&(n=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",n||""),r.style.setProperty("--map-series-hover-label-fill",o||""),t.setBoolData(xo.DATA_HOVER,!0),t.point&&(null===(i=this._labelContainer.get(t.point,0))||void 0===i||i._text.setBoolData(xo.DATA_HOVER,!0))}t!=r&&n.chart._hoverAreaChanged(n,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=Qo.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){this._second;const i=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,e)=>{})),i&&i.length!==e.areaCount&&i.forEach((t=>{t.parent.moveToLast(t)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second;s.isDirty,s.body;const r=this.model;r.options,s.getProjection(i),this._areas={},r.pointLabel,this._labelViews(),this._scale,this._areaPool.forEach(((t,e)=>{}))}}],[ln,class extends So{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new _o(t,pa)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=Math.max(0,i.getRadius()),n=[this._scale,-this._scale],o=+i.options.rotation||0,a=i.options.position,h=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),l=this._labelViews(),c=i.getLabelOff(),d=i.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(u=e.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"center"),y=(g._radius||r)*s,w=xo.getDrawer(i.getShape(f));let x,v,S,C,L,P;if(d&&(x=f.getCallout(b))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),f.xPos=S=u[0],f.xPos=C=u[1],S*=n[0],C*=n[1],p=m(S,C,2*y,2*y),p.x+=y,p.y+=y,t&&g.setPath(w(y,y)),g.trans(p.x,p.y).rotate(o),l&&(L=l.get(f,0))&&(t&&this._layoutLabel(L,g.dom),L.transp(h(p.x,p.y,L.bbox(),y,y,c))),_&&v&&(P=_.get(f))){const t=v.flat().map(((t,e)=>t*n[e%2]));_.setMask(P,t).setCircle(t[t.length-2],t[t.length-1],y),P.render(d,f,t,null)}}}))}}],[on,class extends So{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new _o(t,ua)}_doPrepeare(t,e,s){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=[this._scale,-this._scale],n=+i.options.rotation||0,o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom");i.pointLabel.options.position;const h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(_=e.getVisible(f)))){const g=this._getPointPositioner(m.position||o,"top"),b=i.getExt(m,s),y=2*b.rd,w=3*b.rd;let x,v,S,C,L,P;c&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),_=v[v.length-1]),m.xPos=S=_[0],m.yPos=C=_[1],S*=r[0],C*=r[1],u=g(S,C,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(n),h&&(L=h.get(m,0))&&(t&&this._layoutLabel(L,p.dom),L.transp(a(u.x+y/2,u.y+w/2,L.bbox(),y/2,w/2,l))),d&&v&&(P=d.get(m))&&P.render(c,m,v.flat().map(((t,e)=>t*r[e%2])),null)}}))}}],[pn,class extends So{constructor(t){super(t,"rm-Vector-series")}_createMarkers(t){return new _o(t,ma)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(){this.chart().isDirty;const t=this.model.chart.getProjection(this._second);this._getGrowRate();const e=this.model;this._scale,e.options.rotation;e.pointLabel.options.position,this._labelViews(),e.getLabelOff(),e.getCallout(),this._calloutViews(),this._markers.forEach(((e,s)=>{const i=e.point,r=[i.lon,i.lat];e.setVisible(!i.isNull&&null!=t.getVisible(r))}))}}],[lr,class extends ko{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new _o(this._pointContainer,Bo)}_getPointPool(){return this._bars}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutBars(t,e,s){const i=this.model,r=!i._pointDomain,n=this._getSeriesExt(i,this._visPoints),o=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._bars.forEach(((t,e)=>{const m=t.point,f=i.getCoord(m);if(t.setVisible(!m.isNull&&null!=(p=o.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"center"),b=t.getSizeRate(t._ext.max,n),y=this._ext.width*b,w=this._ext.height*b;let x,v,S,C,L,P;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=S=p[0],m.yPos=C=p[1],S*=a[0],C*=a[1],g=e(S,C,y,w),t.render(i,r&&n,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(P=u.get(m))&&P.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[Gr,class extends ko{constructor(t){super(t,"rm-line-series"),this._lines=new _o(this._pointContainer,sa)}_getPointPool(){return this._lines}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,1)}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new ia(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutLines(t,e,s){const i=this.model,r=!i._pointDomain,n=this._getSeriesExt(i,this._visPoints),o=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._lines.forEach(((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=o.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"top"),b=t.getSizeRate(t._ext.max,n),y=this._ext.width*b,w=this._ext.height*b;let x,v,S,C,L,P;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=S=p[0],m.yPos=C=p[1],S*=a[0],C*=a[1],g=e(S,C,y,w),t.render(i,r&&n,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(P=u.get(m))&&P.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[sn,class extends Lo{constructor(t){super(t,"rm-pie-series"),this._pies=new _o(this._pointContainer,_a)}_getPointPool(){return this._pies}_doPrepeare(t,e,s){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._pies.prepare(s,((s,r)=>{const n=s.prepare(e[r],i);this._setPointStyle(s,t,n)}))}$_layoutPies(t,e,s){const i=this.model,r=i.chart.getProjection(this._second),n=[this._scale,-this._scale],o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=i.getLabelOff(),l=this._labelViews(),c=i.getCallout(),d=this._calloutViews(),_=i.getRadius(Math.min(t,e));let u,p;this._pies.forEach(((t,e)=>{const g=t.point,m=i.getCoord(g);if(t.setVisible(!g.isNull&&null!=(u=r.getVisible(m)))){const e=this._getPointPositioner(g.position||o,"top"),f=_*t._rdRate;let b,y,w,x,v,S;c&&(b=g.getCallout(m))&&(y=b.map((t=>r.project(t))),u=y[y.length-1]),g.xPos=w=u[0],g.yPos=x=u[1],w*=n[0],x*=n[1],p=e(w,x,2*f,2*f),p.x+=f,p.y+=f,t.render(i,f,s),t.trans(p.x,p.y),l&&(v=l.get(g,0))&&v.layout().transp(a(p.x,p.y,v.bbox(),f,f,h)),d&&y&&(S=d.get(g))&&S.render(c,g,y.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[$r,class extends xo{constructor(t){super(t,"rm-lyph-series"),this._figures=new Gn(this._pointContainer,Jo)}_doPrepeare(t,e,s){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures()}_doReset(){}$_prepareFigures(t,e){const s=t.chart.isDirty,i=t.innerLabel,r=e.length;this._pointContainer.setFill(t._runColor),this._figures.prepare(r,((r,n)=>{const o=r.point=e[n];this._setPointStyle(r,t,o),s&&r.render(this.doc,t.getFigure(o),i)}))}$_layoutFigures(){this.chart();const t=this.model.chart.getProjection(this._second),e=this.model,s=[this._scale,-this._scale],i=+e.options.rotation||0,r=e.options.position,n=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),o=this._labelViews(),a=e.getLabelOff(),h=e.getCallout(),l=this._calloutViews();let c,d;this._figures.forEach(((e,_)=>{const u=e.point,p=[u.lon,u.lat];if(e.setVisible(!u.isNull&&null!=(c=t.getVisible(p)))){const _=this._getPointPositioner(u.position||r,"top");let g,m,f,b,y,w,x;if(h&&(g=u.getCallout(p))&&(m=g.map((e=>t.project(e))),c=m[m.length-1]),u.xPos=f=c[0],u.yPos=b=c[1],f*=s[0],b*=s[1],e.layout(),x=e.bbox(),d=_(f,b,x.width,x.height),e.trans(d.x,d.y).rotate(i),o&&(y=o.get(u,0))&&this._layoutLabel(y,e.dom).transp(n(d.x+x.width/2,d.y+x.height/2,y.bbox(),x.width/2,x.height/2,a)),l&&m&&(w=l.get(u))){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=e.tx,x.y=e.ty,l.setMask(w,t).setRects(x),w.render(h,u,t,e.getFill())}}}))}}],[mn,ba],[_n,class extends xo{constructor(t){super(t,"rm-route-series",!1),this._lines=new _o(this._pointContainer,ga)}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,s){s&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(NaN)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){console.log("START POINT ADDING...")}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const s=e.length,i=!lt;this._pointContainer.setStroke(t._runColor),this._lines.prepare(s,((s,r)=>{const n=s.point=e[r];this._setPointStyle(s,t,n),s._line.setFill("none"),s._arrow.setStroke("none"),i&&(s._line.setStyle("vectorEffect","non-scaling-stroke"),s._arrow.setStyle("vectorEffect","non-scaling-stroke"))}))}$_layoutLines(t){const e=this.model,s=e.chart;if(s.isDirty||!isNaN(t)){const i=s.getProjection(this._second),r=e.options.lineWidth,n=e.options.arrowDisplay;if(lt){const t=f(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=f(t,1),this._lines.forEach(((s,r)=>{this.$_layoutLine(s,e,i,t,n)}))}}$_layoutLine(t,e,s,r,o){const a=t.point;if(r=f(a._vr,r),a._deleting&&(r=1-r),t.setVisible(!a.isNull)&&t.setVisible(!0))if(i(a.path)){const e=a.path,i=[];let r=0;for(;r<e.length;)n(e[r])?(i.push(e[r]),r++):(i.push(...s.project([e[r],e[r+1]])),r+=2);t._line.setPath(i.join(" "))}else{const i=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>s.project(t))).filter((t=>!t.outside));r<1&&(i.length=i.length*r|0),t.render(e,1/this._scale,i,"none"!==o&&(r<1||"moving"!==o))}}$_genPath3(t,e,s){const i=[],r=.01*Math.log(1+(n=t[0],o=t[1],a=e[0],h=e[1],Math.sqrt(Math.pow(n-a,2)+Math.pow(o-h,2))));var n,o,a,h;const l=this._calculateControlPoint(t,e,r);for(let r=0;r<=s;r++){const n=r/s,o=this.interpolate3(t,l,n),a=this.interpolate3(l,e,n),h=this.interpolate3(o,a,n);i.push(h)}return i}interpolate3(t,e,s){const i=R(t[1]),r=R(t[0]),n=R(e[1]),o=R(e[0]),a=Math.acos(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-s)*a)/Math.sin(a),l=Math.sin(s*a)/Math.sin(a),c=h*Math.cos(i)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(i)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(i)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[O(Math.atan2(d,c)),O(p)]}_calculateControlPoint(t,e,s){const i=this.interpolate3(t,e,.5),r=R(i[1]),n=R(i[0]),o=r+s*Math.sin(Math.PI/2);return[O(n+s*Math.cos(Math.PI/2)),O(o)]}}],[Ts,class extends So{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new _o(t,jo)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e,s){const i=this.model,r=i.chart,n=r.getProjection(this._second),o=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"center"),c=this._getLabelPositioner(i.subLabel.options.position,"right"),d=this._labelViews(),_=i.getLabelOff(),p=i.getSubLabelOff(),g=i.getCallout(),m=this._calloutViews(),{min:f,max:b}=i.getPixelMinMax(u(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,u=i.getCoord(r);if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(u)))){const e=this._getPointPositioner(r.position||h,"center"),x=xo.getDrawer(i.getShape());let v,S,C,L,P,k,M=(t._radius=i.getRadius(r.getValue(),f,b))*s;g&&(v=r.getCallout(u))&&(S=v.map((t=>n.project(t))),y=S[S.length-1]),r.xPos=C=y[0],r.xPos=L=y[1],C*=a[0],L*=a[1],w=e(C,L,2*M,2*M),w.x+=M,w.y+=M;const A=()=>{t.setPath(x(M,M)),t.trans(w.x,w.y).rotate(o)},V=()=>{if(n instanceof Ai){const e=n.r,s=this.chart().width,i=u[1]*Math.PI/180,r=M/2*(360/s),o=r/Math.cos(i),a=r;n.r=ki*this._scale;const h=qn.geoCircle(u[0],u[1],o,a,n,!0);n.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else A()};if(this.model.alignToSurface?V():A(),d&&((P=d.get(r,0))&&this._layoutLabel(P,t.dom).transp(l(w.x,w.y,P.bbox(),M,M,_)),(P=d.get(r,1))&&this._layoutLabel(P,t.dom).transp(c(w.x,w.y,P.bbox(),M,M,p))),m&&S&&(k=m.get(r))){const e=S.flat().map(((t,e)=>t*a[e%2]));m.setMask(k,e).setCircle(e[e.length-2],e[e.length-1],M),k.render(g,r,e,t.getFill())}}}))}}],[Br,class extends xo{constructor(t){super(t,"rm-image-series"),this._images=new _o(this._pointContainer,ea)}_getPointPool(){return this._images}_doPrepeare(t,e,s){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,s=t.options.imageWidth,i=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),s,i),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,s=e.chart.getProjection(this._second),i=+e.options.rotation||0,r=[this._scale,-this._scale],n=e.options.position,o=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews();let d,_;this._images.forEach(((t,u)=>{const p=t.point,g=e.getCoord(p);if(t.setVisible(!p.isNull&&null!=(d=s.getVisible(g)))){const e=this._getPointPositioner(p.position||n,"top");let u,m;const f=t.bbox(),b=f.width,y=f.height;let w,x,v,S;if(l&&(u=p.getCallout(g))&&(m=u.map((t=>s.project(t))),d=m[m.length-1]),p.xPos=w=d[0],p.yPos=x=d[1],w*=r[0],x*=r[1],_=e(w,x,b,y),t.trans(_.x,_.y).rotate(i),h&&(v=h.get(p,0))&&v.layout().transp(o(_.x+b/2,_.y+y/2,v.bbox(),b/2,y/2,a)),c&&m&&(S=c.get(p))){const e=m.flat().map(((t,e)=>t*r[e%2]));f.x=t.tx,f.y=t.ty,c.setMask(S,e).setRects(f),S.render(l,p,e,t.getFill())}}}))}}],[Or,class extends So{constructor(t){super(t,"rm-Heatmap-series")}_createMarkers(t){return new _o(t,ta)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){}$_layoutMarkers(t,e){}}],[tn,class extends xo{constructor(t){super(t,"rm-panel-series"),this._panels=new _o(this._pointContainer,ca)}_doPrepeare(t,e,s){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,1)}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}$_preparePanels(t,e){const s=e.length;this._panels.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutPanels(t,e,s,i){const r=this.model,n=r.chart.getProjection(this._second),o=[this._scale,-this._scale],a=r.options.position,h=this._getLabelPositioner(r.pointLabel.options.position,"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=f(u.rx,0);let g,m,b;this._panels.forEach(((i,u)=>{const f=i.point,y=r.getCoord(f);if(i.setVisible(!f.isNull&&null!=(g=n.getVisible(y)))){const u=this._getPointPositioner(f.position||a,"top");let w,x,v,S,C,L;if(d&&(w=f.getCallout(y))&&(x=w.map((t=>n.project(t))),g=x[x.length-1]),f.xPos=v=g[0],f.yPos=S=g[1],v*=o[0],S*=o[1],i.render(t,r,e,s,p),m=i.bbox(),b=u(v,S,m.width,m.height),i.trans(b.x,b.y),l&&(C=l.get(f,0))&&this._layoutLabel(C,i.dom).transp(h(b.x+m.width/2,b.y+m.height/2,C.bbox(),m.width/2,m.height/2,c)),_&&x&&(L=_.get(f))){const t=x.flat().map(((t,e)=>t*o[e%2]));m.x=i.tx,m.y=i.ty,_.setMask(L,t).setRects(m),L.render(d,f,t,i.getFill())}}}))}}],[mn,ba],[yr,class extends Ao{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new _o(t,Zo)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e,s){const i=this.model;i.chart.isDirty;const r=this.model.chart.getProjection(this._second),n=[this._scale,-this._scale],o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u,p;this._gauges.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(_=r.getVisible(b)))){const m=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C;c&&(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],g.render(i,t,e,s),u=g.bbox(),p=m(x,v,u.width,u.height),g.trans(p.x,p.y),h&&(S=h.get(f,0))&&this._layoutLabel(S,g.dom).transp(a(p.x+u.width/2,p.y+u.height/2,S.bbox(),u.width/2,u.height/2,l)),d&&w&&(C=d.get(f))&&C.render(c,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[Vr,class extends Ao{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new _o(t,qo)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height)}_doReset(){}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e){const s=this.model;s.chart.isDirty;const i=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],n=s.options.position,o=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),a=this._labelViews(),h=s.getLabelOff(),l=s.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(d=i.getVisible(f)))){const g=this._getPointPositioner(m.position||n,"top");let b,y,w,x,v,S;l&&(b=m.getCallout(f))&&(y=b.map((t=>i.project(t))),d=y[y.length-1]),m.xPos=w=d[0],m.yPos=x=d[1],w*=r[0],x*=r[1],p.render(s,t,e),_=p.bbox(),u=g(w,x,_.width,_.height),p.trans(u.x,u.y),a&&(v=a.get(m,0))&&this._layoutLabel(v,p.dom).transp(o(u.x+_.width/2,u.y+_.height/2,v.bbox(),_.width/2,_.height/2,h)),c&&y&&(S=c.get(m))&&S.render(l,m,y.flat().map(((t,e)=>t*r[e%2])),null)}}))}}]),Xn.register([Wi,No],[Gi,Vo],[Yi,Eo]);class wa extends ft{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.setStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class xa extends ft{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class va extends $t{constructor(t,e,s){super(t,""),this.labelsContainer=e,this.second=s,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new eo(t,s))}prepare(t,e){const s=e.visibleSeries,i=this.seriesMap,r=this.seriesViews;r.forEach((t=>{var e;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),this.control.loaded?t.removeLater(200):t.remove())})),r.length=0,s.forEach((e=>{const s=!i[e.hash],n=i[e.hash]||function(t,e){return new(wo[e._type()])(t)}(t,e);n.parent||(this.add(n),this.labelsContainer.add(n._labelContainer)),i[e.hash]=n,r.push(n),n._second=this.second,s&&(e._optionsDirty=!0),n.prepare(t,e)})),this.prevViews&&ct.equalArrays(this.prevViews,r)||(this.sort(r),this.labelsContainer.sort(r.map((t=>t._labelContainer)))),this.prevViews=r.slice(0)}prepareLayout(t,e){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class Sa extends $t{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new $t(t)),this.add(this._labelLayer=new $t(t))}render(t,e,s,i,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,s,i,r)}$_prepareGuides(t,e){const s=this._guideViews,i=e.length;for(;s.length>i;)s.pop().remove();for(;s.length<i;){const e=new io(t,this._labelLayer);s.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,s,i,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],i,r),n.layout(s)}))}}class Ca extends Bn{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new ss(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new ao(t)),this.add(this._contentLayer=new $t(t,"rm-body-content")),this.add(this._crosshairView=new no(t)),this._contentLayer.add(this._annotationContainer=new $t(t)),this._contentLayer.add(this._axisGuideContainer=new Sa(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new Sa(t,!1)),this._contentLayer.add(this._seriesContainer=new va(t,new $t(t),!1)),this._contentLayer.add(this._secondContainer=new va(t,new $t(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new Sa(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new Sa(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new $t(t)),this._secondContainer.setVisible(!1),this._secondFrontAxisGuideContainer.setVisible(!1),this._secondAxisGuideContainer.setVisible(!1),this._seriesContainer.dom.classList.add("rm-series-container"),this._secondContainer.dom.classList.add("rm-second-container")}getAnnotationAnchor(t){return this._annotationMap.get(t)}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}canScroll(){return!0}prepare(t,e){this.$_prepareMeasureSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,s,i){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,s,i),On.create(s,i)}_doLayout(t){var e;const s=this.doc,i=this.model,r=i.chart,n=r.axis,o=r.map,a=this._clip,h=this.height,l=this.width;if(this._back.setBounds(0,0,l,h),this._back.internalResetStyleOrClass(i._style),o){const t=l,e=h,{wMap:a,hMap:c,scale:d,tx:_,ty:u}=i.prepareLayout(t,e);this.$_prepareLayoutSeries(s,r),this._transformInfo={tx:_,ty:u,scale:d,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const p=`translate(${_}px, ${u}px) scale(${d}, ${-d})`,g=a*d,m=c*d,f=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-g)/2-i.panX*d,e=(h-m)/2-i.panY*d;this._mapBack.render(this.doc,r,t,e,g,m)}this._secondContainer.visible&&f.push(this._secondContainer),f.forEach((t=>{const e=t.axisView;e.setScale(d),e.measure(s,n,l,h),e.resize(l,h),e.trans(_,u),t.seriesViews.forEach((t=>{var e;t._scale=d,t.model.needMapScale()?(t._pointLayer.setStyle("transform",p),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:p})):t.trans(_,u),t.move(_,u),t.resize(g,m),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(_,u)})),e.layout()}));const b=i._prj;this.$_doClipPathLayout(i,b,l,h,d),this._crosshairView.visible&&this._crosshairView.prepare(d,p);const y=n.grid.getStep(o)||10;this.$_layoutAxisGuides(s,n,{map:o,prj:b,step:y,tf:this._transformInfo,trans:p},l,h)}if(this.$_layoutAnnotations(l,h),a&&a.width===l&&a.height===h||(this._clip=this.clipRect(0,0,l,h)),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 wa(t)).start(),this._requestShow=null)}this._prevPrj=i._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.pointToMap(this._mousePos),this._transformInfo)}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset())),this._secondContainer.visible&&this._secondContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,s){let i,r;if(!this.model)return;for(const n of this._seriesContainer.seriesViews)n.pointerMoved(t,e,s)&&(i=n,r=n.getPointView(s));if(!r)for(const t of this._seriesContainer.seriesViews)if(r=t.getPointView(s),r){i=t;break}const n=this.model.chart,o=null==i?void 0:i.model,a=o&&this._owner.getScaleView(n.getColorScale(o.getColorScale()));return(null==r?void 0:r.point)?(this._owner.showTooltip(o,r,this,{x:t,y:e}),null==a||a.setValue(r.point.getValue())):(this._owner.hideTooltip(),null==a||a.setValue(NaN)),this._crosshairView.visible&&n&&this._crosshairView.render(this.pointToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!i}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 s=this.getSeries(t);s&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new xa(s)).start())}pointToMap(t){const e=this.model.chart.getProjection(!1),{tx:s,ty:i,scale:r,vx:n,vy:o}=this._transformInfo,a=[(t.x-n-s)/r,(t.y-o-i)/-r];return e.backward(a)}$_prepareMeasureSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ya(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((s=>{s._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,s,i,r){this._axisGuideContainer.render(t,e,s,i,r),this._frontAxisGuideContainer.render(t,e,s,i,r);const n=this.model.chart,o=Object.assign(Object.assign({},s),{prj:s.prj.second});this._secondFrontAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,o,i,r)),this._secondAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,o,i,r))}$_doClipPathLayout(t,e,s,i,r){const n=()=>{const t=e.getClipBounds();return`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:s}=this._transformInfo;t.path.transEx(e,s).scale(r)};if(t.isScrollable())if(e.isClipping()){const t=this._clipMap;if(t&&t.width===s&&t.height===i){if(t){if(this._prevPrj!==e){const e=n();t.setPath(e)}o(t),this._contentLayer.hasAttr("clip-path")||this._contentLayer.attachClipPath(this._clipMap.id)}}else{const t=n();this._clipMap=this._contentLayer.clipPath(t),o(this._clipMap),this._clipMap.resize(s,i)}}else this._contentLayer.detachClipPath();else this._seriesContainer.setVisible(!0),this._seriesContainer.scrollTo(0),this._secondContainer.setVisible(!1),e.isClipping()||this._contentLayer.detachClipPath()}}class La extends jn{constructor(t,e){super(t,e?La.SUBTITLE_CLASS:La.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Ve(t)),this._richText=new Ie}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null)),ut(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Pa;La.TITLE_CLASS="rm-title",La.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Pa||(Pa={}));class ka extends Dt{constructor(t){super(t,ka.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Ot(t,"rm-tooltip-back")),this.add(this._top=new Ot(t,"rm-tooltip-top")),this.add(this._textView=new Ve(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Tt.SHADOW_FILTER+")"),this._textView.anchor=ke.START,this._richText=new Ie,this.close(!0,!1)}show(t,e,s,i,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a);if(!c)return;const d=l.text||c.getTooltipText(t,a);if(!d)return;const _=this.control,g=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=p(l.minWidth||0,b.width+16),w=p(l.minHeight||0,b.height+12);this._top.setFill((null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,S=e.getBounds(),C=_.getBounds();let L;L=s-y/2-p(0,u(s-y/2,g-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(C.bottom,S.bottom);const P=Pa.TOP;this.drawTooltip(0,0,y,w,P,L),i-=w+v,s=p(0,u(s-=y/2,g-y)),i=p(0,u(i,m-w)),this.transEx(s,i,x,!1),0===x&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:Hi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,s,i,r,n){const o=null!=s?G(e,s):{},a=G(e,i),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Pa.TOP:l=l.concat(["M",t+s/2-o/2+n,e+i,"L",t+s/2+n,e+i+o,"L",t+s/2+o/2+n,e+i]);break;case Pa.BOTTOM:l=l.concat(["M",t+s/2-o/2+n,e,"L",t+s/2+n,e-o,"L",t+s/2+o/2+n,e]);break;case Pa.LEFT:l=l.concat(["M",t+s,e+i/2-o/2+n,"L",t+s+o,e+i/2+n,"L",t+s,e+i/2+o/2+n]);break;case Pa.RIGHT:l=l.concat(["M",t,e+i/2-o/2+n,"L",t-o,e+i/2+n,"L",t,e+i/2+o/2+n])}const c=r===Pa.BOTTOM,d=c?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(s-u.width)/2,e+=(i-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}ka.CLASS_NAME="rm-tooltip";class Ma extends Bn{constructor(t){super(t,Ma.SCALE_CLASS),this._gap=0,this.add(this._barLayer=new $t(t)),this._bars=new Gn(this._barLayer,ss,"rm-color-scale-bar"),this.add(this._splitLayer=new $t(t)),this._splits=new Gn(this._splitLayer,ho,"rm-color-scale-split"),this.add(this._markerLabel=new Qn(t,void 0)),this.add(this._marker=new Ot(t,"rm-color-scale-marker")),this.add(this._tickLineLayer=new $t(t,"rm-color-scale-tick-line")),this.add(this._tickLabelLayer=new $t(t,"rm-color-scale-tick-label")),this._tickLines=new Gn(this._tickLineLayer,ho),this._tickLabels=new Gn(this._tickLabelLayer,Qn),this._fills=[]}setValue(t){var e,s;e=t,s=this._value,(isNaN(e)?isNaN(s):e===s)||(this._value=t,this.$_resetMarker(this._vertical,this._reversed))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=this.chart().isDirty,n=e.options,o=e.marker,a=e.getTicks(),h=this._tickLen=+e.tick.line.options.length||0,l=e.tick.line,c=e.tick.label,d=this._vertical="vertical"===e.getLayout(),_=this._reversed=e.isReversed();let{width:u,height:p}=e.getBarSize(s,i,d);if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(l.visible&&h>0),r){const s=this._vertical?p:u,i=e.getSplitPoints(s);this.$_prepareBars(t,e,d,_),this._splitLayer.visible&&this.$_prepareSplits(t,i),this._tickLineLayer.visible&&this.$_prepareTickLines(t,i,s)}if(this._markerSize=this._labelSize=0,this._markerLabel.setVisible(o.visible)&&(this._markerSize=o.getMarkerSize(),d?u+=this._markerSize:p+=this._markerSize,r&&this.$_prepareMarker(o,d,_,this._markerSize),this._markerLabel.setVisible(o.label.visible)),this._tickLineLayer.setVisible(l.visible&&a.length>0)&&this._tickLines.forEach((t=>{t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(l._style)})),this._tickLabelLayer.setVisible(c.visible&&a.length>0)){const s=d?"width":"height";this._tickLabelSize=0,this._tickLabels.prepare(a.length,((i,r)=>{i.setModel(t,e.tick.label,null,null),i._text.internalResetStyleOrClass(c._style),i.setText(a[r].label),i.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,i.bbox()[s]),d&&(this._tickLabelSize+=1)})),d?u+=this._tickLabelSize+h:p+=this._tickLabelSize+h}return this._gap=f(+n.gap,0),this._vertical?u+=this._gap:p+=this._gap,{width:u,height:p}}_doLayout(){const t=this._vertical,e=this._reversed,s=this._tickLabelSize,i=this._markerSize,r=this._tickLen,n=this._gap;let o=this.width,a=this.height,h=0,l=0;t?(h+=e?s:n+i,o-=n+i,s>0&&(e?this._tickLabelLayer.transX(s):this._tickLabelLayer.transX(this.width-s+1),this._tickLabels.forEach(((t,s,i)=>{e&&t.transX(-t.bbox().width),t.transY(s*a/(i-1)-t.bbox().height/2)})),o-=s),o-=r,e&&(h+=r)):(l+=n+i,a-=n+i,s>0&&(e?this._tickLabelLayer.transY(0):this._tickLabelLayer.transY(this.height-s),this._tickLabels.forEach(((t,e,s)=>{t.transX(e*o/(s-1)-t.bbox().width/2)})),a-=s),a-=r,e&&(l+=r)),this._barLayer.setBounds(h,l,o,a),this._bars.forEach(((e,s,i)=>{t?e.setBounds(0,s*a/i,o,a/i):e.setBounds(s*o/i,0,o/i,a)})),this._splitLayer.visible&&this.$_layoutSplits(h,l,o,a),this._tickLineLayer.visible&&(t?e?h-=r:h+=o:e?l-=r:l+=a,this.$_layoutTickLines(h,l,r)),this.$_resetMarker(this._vertical,this._reversed)}$_getFillId(t){return`${Ma.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(e,s){const i=e.createElementNS(t,"linearGradient");return i.setAttribute("id",this.$_getFillId(s)),i.appendChild(e.createElementNS(t,"stop")),i.appendChild(e.createElementNS(t,"stop")),this.control.addDef(i),i}$_setDir(t,e,s){e?(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","0%"),t.setAttribute("y2","100%")):(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","100%"),t.setAttribute("y2","0%"))}$_fillStops(t,e,s){const i=t.childNodes[0],r=t.childNodes[1];i.setAttribute("offset","0"),i.setAttribute("stop-color",e.toString()),i.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",s.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,s,i){const r=this._fills,n=e.getSteps();if(n){let e=0;n.forEach(((s,i)=>{s._color1&&(r.length<=e&&r.push(this.$_createGradient(t,e)),r[r.length-1][hs]=s,e++)})),r.forEach((t=>{const e=t[hs];this.$_setDir(t,s,i),this.$_fillStops(t,e._color1,e._color2)})),this._bars.prepare(e,((t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))}))}else if(this._bars.prepare(1),e.minColor){let n=r.shift();if(n){for(let t=1;t<r.length;t++)this.control.removeDef(r[t]);this._fills=[n]}else n=this.$_createGradient(t,0),r.push(n);this.$_setDir(n,s,i),this.$_fillStops(n,e.minColor,e.maxColor||e.series.color),this._bars.first.setStyle("fill",this.$_getFillUrl(0))}else r.forEach((t=>this.control.removeDef(t))),this._fills=[]}$_prepareSplits(t,e){this._splits.prepare(e.length,((t,s)=>{t._userData=e[s]}))}$_prepareTickLines(t,e,s){this._tickLines.prepare(e.length+2,((t,i)=>{t._userData=0===i?0:i===e.length+1?s-1:e[i-1]}))}$_prepareMarker(t,e,s,i){e?s?this._marker.setPath(`M 0 0 L ${.8*i} -${.7*i} L ${.8*i} ${.7*i} Z`):this._marker.setPath(`M 0 0 L -${.8*i} -${.7*i} L -${.8*i} ${.7*i} Z`):s?this._marker.setPath(`M 0 0 L -${.7*i} ${i} L ${.7*i} ${i} Z`):this._marker.setPath(`M 0 0 L -${.7*i} -${i} L ${.7*i} -${i} Z`)}$_layoutSplits(t,e,s,i){this._splits.forEach((r=>{this._vertical?r.setHLine(r._userData,t,t+s):r.setVLine(r._userData,e,e+i)}))}$_layoutTickLines(t,e,s){this._tickLines.forEach((i=>{this._vertical?i.setHLine(i._userData,t,t+s):i.setVLine(i._userData,e,e+s)}))}$_resetMarker(t,e){const s=this._markerSize,i=this._gap,r=isNaN(this._value);if(this._marker.setBoolData("null",r),t){const t=e?this.width-i-s+1:s+i-1;this._marker.trans(t,r?0:this.height*this.model.getPosition(this._value))}else{this.model.getPosition(this._value)>1&&console.log(this.model.getPosition(this._value));const t=e?this.height-i-s+1:s+i;this._marker.trans(r?0:this.width*this.model.getPosition(this._value),t)}}}Ma.SCALE_CLASS="rm-color-scale",Ma.SCALE_FILL="rm-color-scale-fill";const Aa={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"};class Va extends Dt{constructor(t,e,s){super(t,Va.STYLE),this.add(this._back=new ss(t,Va.BACK_STYLE)),this.add(this._textView=new Ve(t)),s&&this.dom.classList.add(s),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Me.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),i=getComputedStyle(this._back.dom),r=(new Fn).applyPadding(i);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+s.width/2,r.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+r.left+r.right,height:s.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Va.STYLE="rm-button",Va.BACK_STYLE="rm-button-background";class Ea extends Va{constructor(t,e,s){super(t,e),this.callback=s}click(){return this.callback(),!0}}class Na extends Bn{}class Ta extends Na{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new Ea(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new Ea(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new Ea(t,"-",(()=>this.chart().body.incZoom(-this.model.getZoomStep()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,s,i){const r=this.chart().body.zoom,n=this._szBtn=e.getButtonSize(),o=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(cs,r<=100),this._btnDec.setBoolData(cs,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;if(this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e),this._vertical){let t=0;this._btnHome.visible&&(t+=e.height+this._gap),this._btnInc.transY(t),t+=e.height+this._gap,this._btnDec.transY(t)}}}class Da extends Na{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 s=0;s<e.count-1;s++)if(e.get(s).containsDom(t))return this.model.chart.drillup(e.get(s+1)[ls]),!0}_doMeasure(t,e,s,i){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new Gn(this,Ve,"rm-drilldown-text"),this._seperators=new Gn(this,Ve,"rm-drilldown-separator"));const t=e.chart.firstVisible,s=this._history=t.getHistory();this._textViews.prepare(s.length,((t,e)=>{t.text=s[e].displayName(),t.anchor=ke.START,t[ls]=s[e]})),this._seperators.prepare(s.length-1,(t=>{t.text=">",t.anchor=ke.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new Ea(t,"<",(()=>{e.chart.drillup()}))),r.layout();const s=r.bbox();n=s.width,o=s.height}return{width:n,height:o}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let s=0;for(let i=0;i<e.length;i++){const r=this._textViews.get(i);r.setBoolData("history",i<e.length-1),r.transX(s),i<e.length-1&&(s+=r.bbox().width+t,this._seperators.get(i).transX(s),s+=this._seperators.get(i).bbox().width+t)}}}}class $a extends Bn{constructor(t){super(t,$a.SCALE_CLASS),this._bubbles=[],this._lines=[],this._labels=[],this.add(this._bubbleLayer=new $t(t)),this.add(this._lineLayer=new $t(t)),this.add(this._labelLayer=new $t(t))}_doMeasure(t,e,s,i){const r=this.chart();r.isDirty,e.options;const n=this._steps=e.getSteps(r.width,r.height);return this._model=e,this.$_prepareBubbles(t,e,n),{width:100,height:100}}_doLayout(){const t=this._model,e=this.height,s=this._steps,i=s[s.length-1].rd;if(this._bubbles.forEach(((t,r)=>{const n=s[r];t.internalResetStyleOrClass(null),t.setCircle(i,e-n.rd,n.rd)})),this._lineLayer.visible){const r=2*i+(t.tick.line.options.length||0);this._lines.forEach(((t,n)=>{const o=s[n];t.setHLine(e-2*o.rd,i,r)}))}if(this._labelLayer.visible){const r=2*i+t.tick.line.options.length+(t.tick.label.options.offset||0);this._labels.forEach(((i,n)=>{const o=s[n];i.setText(t.tick.label.getText(o.label)),i.trans(r,e-2*o.rd-i.bbox().height/2)}))}}$_prepareBubbles(t,e,s){const i=e.tick,r=s.length;Dt.fit(t,this._bubbleLayer,this._bubbles,r,Xo,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(i.visible&&i.line.visible)&&Dt.fit(t,this._lineLayer,this._lines,r,ho,"rm-bubble-scale-line"),this._labelLayer.setVisible(i.visible&&i.label.visible)&&Dt.fit(t,this._labelLayer,this._labels,r,Qn,"rm-bubble-scale-label")}}$a.SCALE_CLASS="rm-bubble-scale";class Ra extends Bn{constructor(t){super(t,Ra.SCALE_CLASS)}_doMeasure(t,e,s,i){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Ra.SCALE_CLASS="rm-map-scale";class Oa extends zn{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new La(t,!1)),this.add(this.subtitleView=new La(t,!0))}_doMeasure(t,e,s,i){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=s,u=0,g=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,s,i),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,s,i),c=this._hSub=o.height,l=this._wSub=o.width,g=+n.options.titleGap||0):d.setModel(n),n.options.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?f(r.options.gap,0):f(n.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||i&&"chart"===n.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===o.alignBase?0:t.xMap;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},d=()=>{const e=p(this._hTitle,this._hSub);m=p(m,m+t(i,e,this._hTitle)),y=p(y,y+t(r,e,this._hSub))},_=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(b=p(b,b+_(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=b;break;case"right":w=b+this._wTitle-this._wSub;break;default:w=b+(this._wTitle-this._wSub)/2}else w=p(w,w+_(r,h,this._wSub))},g=f(o.titleGap,0);let m=0,b=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":b=w+this._wSub+g,d();break;case"right":switch(w=b+this._wTitle+g,o.align){case"center":w=p(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=p(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;case"right":switch(o.position){case"left":switch(b+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":w+=h-this._wSub,b=w-g-this._wTitle,d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;default:switch(o.position){case"left":switch(b+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(b-w-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":switch(b+=(a-this._wTitle)/2,o.align){case"left":w=b+this._wTitle+g;break;case"center":w=b+this._wTitle+g,w+=(h-w-this._wSub)/2;break;case"right":w+=h-g-this._wSub}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}}e.resizeByMeasured().layout().trans(b,m),s.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=o-d;break;default:_+=(o-d)/2}n.trans(_,0)}}_doLayoutInner(t,e,s){}}class Fa extends zn{_doInitChildren(t){this.add(this._legendView=new Wn(t))}_doMeasure(t,e,s,i){const r=e._legend,n=this._legendView.measure(t,r,s,i),o=this._loc=r.getLocation();return"left"===o||"right"===o?n.width+=this._legendView._gap:n.height+=this._legendView._gap,n}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._loc){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}_doLayoutInner(t,e,s){const i=this._legendView,r=i.model.options,n=this.width,o=this.height;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-n-a;break;case"center":h+=(t-n)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-o-a;break;case"middle":l+=(e-o)/2+a;break;default:l+=a}i.trans(h,l)}}class Ia extends zn{constructor(t,e){super(t),this.loc=e}getView(t){var e;return null===(e=this._views)||void 0===e?void 0:e.find((e=>e.model===t))}setScales(t,e,s){return this._scales=t,this._wChart=e,this._hChart=s,this}_doMeasure(t,e,s,i){const r=this.loc,n=this._prepareScales(t,this._wChart,this._hChart);if(!this.setVisible(n&&n.length>0))return;const o=new On;return n.forEach(((e,r)=>{e.measure(t,this._scales[r],s,i)})),r===Aa.TOP||r==Aa.BOTTOM?n.forEach((t=>{o.width+=t.mw,o.height=p(o.height,t.mh)})):r===Aa.LEFT||r===Aa.RIGHT?n.forEach((t=>{o.width=p(o.width,t.mw),o.height+=t.mh})):n.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(){const t=this.loc,e=this._views;let s=this.width,i=this.height;t===Aa.TOP||t==Aa.BOTTOM?e.forEach((t=>{t.trans(s-t.mw+0,0).resize(s,i),t.layout()})):t===Aa.LEFT||t===Aa.RIGHT?e.forEach((t=>{t.trans(0,0).resize(s,i),t.layout()})):e.forEach((t=>{t.trans(s-t.mw+0,0).resize(s,i),t.layout()}))}_doLayoutInner(t,e,s){this._views.forEach((s=>{const i=s.model.options,r=this.width,n=this.height;let o=+i.offsetX||0,a=0,h=0;switch(i.align){case"right":a+=t-r-o;break;case"center":a+=(t-r)/2+o;break;default:a+=o}switch(o=+i.offsetY||0,i.verticalAlign){case"bottom":h+=e-n-o;break;case"middle":h+=(e-n)/2+o;break;default:h+=o}s.trans(a,h).resize(r,n),s.layout()}))}_prepareScales(t,e,s){const i=this._scales.length;if(this.setVisible(i>0)){const e=this._views||(this._views=[]);for(;e.length<i;)e.push(this.add(this._createView(t)));for(;e.length>i;)e.pop().remove();return e}}}class Ba extends Ia{_createView(t){return new Ma(t)}}class ja extends Ia{_createView(t){return new $a(t)}}class za extends Bn{constructor(t){super(t,"rm-credits"),this.add(this._textView=new Ve(t)),this._textView.anchor=ke.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class Ha extends $t{constructor(t){super(t,"rm-chart"),this._colorScaleMap={},this._bubbleScaleMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new $t(t,"rm-annotations")),this.add(this._bodyView=new Ca(t,this)),this.add(this._titleSectionView=new Oa(t)),this.add(this._scaleLayer=new $t(t,"rm-scales")),this.add(this._legendSectionView=new Fa(t)),this.add(this._frontAnnotationContainer=new $t(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Ta(t)),this.add(this._drilldownPanelView=new Da(t)),this.add(this._mapScaleView=new Ra(t)),this.add(this._creditView=new za(t)),this.add(this._tooltipView=new ka(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}legendView(){return this._legendSectionView._legendView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}measure(t,e,s,i){const r=(this._model=e)._credits,n=e._legend,o=this._bodyView;let a,h=e.width=s,l=e.height=i;if(this._creditView.setVisible(r.visible)){const e=r.options;a=this._creditView.measure(t,r,h,l),r.isFloating()||("middle"!==e.verticalAlign?l-=a.height+(+e.offsetY||0)+(+e.gap||0):"center"!==e.align&&(h-=a.width+(+e.offsetX||0)+(+e.gap||0)))}if(a=this._titleSectionView.measure(t,e,h,l),l-=a.height,this._legendSectionView.setVisible(n.isVisible()))switch(a=this._legendSectionView.measure(t,e,h,l),n.getLocation()){case"top":case"bottom":l-=a.height;break;case"right":case"left":h-=a.width}o.prepare(t,e.body);for(const r of Object.values(Aa)){const n=e._colorScales.getVisibles(r);let o=this._colorScaleMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Ba(t,r),this._scaleLayer.add(o),this._colorScaleMap[r]=o);const a=this._colorScaleMap[r].setScales(n,s,i).measure(t,e,h,l);a&&(r===Aa.BOTTOM||r===Aa.TOP?l-=a.height:r!==Aa.RIGHT&&r!==Aa.LEFT||(h-=a.width))}else o&&o.setVisible(!1)}for(const r of Object.values(Aa)){const n=e._bubbleScales.getVisibles(r);let o=this._bubbleScaleMap[r];if(n.length>0){o?o.setVisible(!0):(o=new ja(t,r),this._scaleLayer.add(o),this._bubbleScaleMap[r]=o);const a=this._bubbleScaleMap[r].setScales(n,s,i).measure(t,e,h,l);a&&(r===Aa.BOTTOM||r===Aa.TOP?l-=a.height:r!==Aa.RIGHT&&r!==Aa.LEFT||(h-=a.width))}else o&&o.setVisible(!1)}o.measure(t,e.body,h,l),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,h,l),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,h,l)}layout(){const t=this._model,e=this.width,s=this.height;let i=e,r=s;const n=this._bodyView,o=t._legend,a=t._credits,h=this._creditView,l=+a.options.gap||0;let c=0,d=0,_=0,u=0,p=0,g=0;if(h.visible&&(h.resizeByMeasured(),!a.isFloating())){const t=a.options;"middle"!==t.verticalAlign?(c=+t.offsetY||0,"top"===t.verticalAlign?r-=d=h.height+c+l:r-=_=h.height+c+l):(c=+t.offsetX||0,"left"===t.align?i-=u=h.width+c+l:i-=h.width+c+l)}const m=this._titleSectionView;let f=0;const b=g+d;m.visible&&(m.resizeByMeasured(),r-=f=m.height),p=u,m.visible&&(m.layout({xMap:p,wMap:i,wChart:e}).trans(0,b),g+=f);const y=this._legendSectionView;let w,x,v=0,S=0,C=0;if(y.visible)switch(y.resizeByMeasured().layout(),v=y.height,S=y.width,y._loc){case"top":w=f+d,r-=v,g+=v;break;case"bottom":r-=v,w=g+r;break;case"right":i-=S,x=e-S;break;case"left":i-=S,p+=S,x=0}const L=this._colorScaleMap;let P=0,k=0;for(const t in L)if(L[t].visible)switch(L[t].resizeByMeasured().layout(),P=L[t].height,k=L[t].width,t){case Aa.BOTTOM:r-=P;break;case Aa.TOP:r-=P,g+=P;break;case Aa.RIGHT:i-=k;break;case Aa.LEFT:i-=k,p+=k}const M=this._bubbleScaleMap;let A=0,V=0;for(const t in M){const e=M[t];if(e.visible&&(e.resizeByMeasured(),"body"!==t))switch(e.layout(),A=e.height,V=e.width,t){case Aa.BOTTOM:r-=A;break;case Aa.TOP:r-=A,g+=A;break;case Aa.RIGHT:i-=V;break;case Aa.LEFT:i-=V,p+=V}}const E=gt.create(p,g,i,r);if(h.visible){const t=+a.options.offsetX||0,i=c;let r,n;switch(h.layout(),a.options.verticalAlign){case"top":break;case"middle":n=(s-h.height)/2+i;break;default:n=s-_+l}switch(a.options.align){case"left":r=t;break;case"center":r=(e-h.width)/2+t;break;default:r=e-h.width-t}h.trans(r,n)}n.trans(E.x,E.y),n.resize(E.width,E.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,E)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,E));let N=0,T=0;if(y.visible){const t=o.options;if(C=+t.offsetY||0,"body"===t.location)y.layoutInner(i,r);else if(isNaN(w)){const e=+t.offsetY||0;if(p=x,"chart"===t.alignBase){switch(t.verticalAlign){case"top":g=e;break;case"bottom":g=s-v-e;break;default:g=(s-v)/2+e}g+v>s&&(g=(s-v)/2)}else switch(t.verticalAlign){case"top":g+=e;break;case"bottom":g=g+r-v-e;break;default:g=g+(r-v)/2+e}g+v>s&&(g=(s-v)/2),g<0&&(g=0),N=y.width}else{const s=+t.offsetX||0;if(g=w,"chart"===t.alignBase)switch(t.align){case"left":p=s;break;case"right":p=e-S-s;break;default:p=(e-S)/2+s}else switch(t.align){case"left":p+=s;break;case"right":p=p+i-S-s;break;default:p+=(i-S)/2+s}p+S>e&&(p=(e-S)/2),p<0&&(p=0),T=y.height+C}y.trans(p,g)}for(const t in L){const i=L[t];if(i.visible)if("body"===t)i.layoutInner(E.width,E.height).trans(E.x,E.y);else{switch(t){case Aa.BOTTOM:g=s-_-T-P,p=(e-i.width)/2;break;case Aa.TOP:g=T,p=(e-i.width)/2;break;case Aa.RIGHT:g=(s-i.height)/2,p=e-N-i.width;break;case Aa.LEFT:g=(s-i.height)/2,p=N}i.trans(p,g)}}for(const t in M){const i=M[t];if(i.visible)if("body"===t)i.layoutInner(E.width,E.height).trans(E.x,E.y);else{switch(t){case Aa.BOTTOM:g=s-_-T-A,p=(e-i.width)/2;break;case Aa.TOP:g=T,p=(e-i.width)/2;break;case Aa.RIGHT:g=(s-i.height)/2,p=e-N-i.width;break;case Aa.LEFT:g=(s-i.height)/2,p=N}i.trans(p,g)}}this.$_layoutAnnotations(e,s,E),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:i.x,y:i.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?i.x:r)-this.tx,h=(o?i.y:n)-this.ty;this._tooltipView.show(t,e,a,h,s,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getScaleView(t){for(const e in this._colorScaleMap){const s=this._colorScaleMap[e].getView(t);if(s)return s}}pointerMoved(t,e,s){this._bodyView.pointerMoved(t,e,s)}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)}isAnimating(){}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ya(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s){const i=this.control._padding;let r,n,o,a;this._annotationViews.forEach((s=>{if("container"===s.model.options.scope)r=-i.left,n=-i.top,o=t+i.left+i.right,a=e+i.top+i.bottom;else r=n=0,o=t,a=e;s._layoutView(this,r,n,o,a)}))}$_layoutPanel(t,e){const s=t.model.options,i=s.offsetX||0,r=s.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(s.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(s.align){case"right":a+=e.width-i-n;break;case"center":a+=(e.width-n)/2+i;break;default:a+=i}t.trans(a,h)}}var Ga;!function(t){t.EXPORT="$$realmap_export"}(Ga||(Ga={}));class Ya extends Tt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Ha(t))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new En(null,((t,e)=>{this.changeModel(t,e)}))}onModelChanged(t,e,s){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,s,i){i&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(s)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,s){const i=this._chartView.bodyView();s?i.showSeries(e):i.hideSeries(e)}onExportRequest(t,e){this._export(e)}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.clearAssetDefs(),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===Ga.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_creatDefaultTool(){return new Rn(this)}_doBeforeRender(t){t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const s=this.model,i=this._chartView;this._setBackgroundStyle(s.options.chart.backgroundStyle),s&&(s.prepareRender(),this._loadModules()),this.loaded||i.clean();const r=t.width,n=t.height;i.measure(this.doc(),s,r,n),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0)}_doAfterRender(){this._chartView.bodyView().afterRender()}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}}var Wa=function(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))};class Za{static getVersion(){return"1.0.0"}static setDebugging(t){Dt.DEBUGGING=t}static setLogging(t){ct.LOGGING=t}static getDistance(t,e){return ct.getDistance(t,e)}static createChart(t,e,i,r=!0,n){C.loadConfigAsync(i,!0);const o=new Ya(t,e);return s(i)&&o.chart.load(i,r,n),o.chart[Vn]=o,o.chart}static createChartAsync(t,e,i,r=!0,n){return Wa(this,void 0,void 0,(function*(){yield C.loadConfigAsync(i);const o=new Ya(t,e);return s(i)&&o.chart.load(i,r,n),o.chart[Vn]=o,o.chart}))}static preset(t,e){return Li.createStockInset(t,e)}}const Xa=Za.getVersion,Ua=Za.setDebugging,qa=Za.setLogging,Ka=Za.getDistance,Qa=Za.createChart,Ja=Za.createChartAsync,th=Za.preset;export{qe as Annotation,lr as BarSeries,Cn as Body,Ca as BodyView,Ts as BubbleSeries,Ya as ChartControl,Bn as ChartElement,He as ChartItem,Ha as ChartView,Xo as CircleElement,yr as CircleGauge,Vr as ClockGauge,Pe as Color,Hn as ContentView,us as DataPointLabel,Gn as ElementPool,$r as FigureSeries,Or as HeatmapSeries,ts as HeatmapSeriesType,Gi as ImageAnnotation,Br as ImageSeries,Bs as Legend,ho as LineElement,Gr as LineSeries,di as MapAxis,ai as MapAxisBandGuide,ni as MapAxisGuide,oi as MapAxisLineGuide,hi as MapAxisRangeGuide,En as MapChart,ci as MapCrosshair,Xr as MapSeries,Je as MapSeriesType,vs as MarkerSeries,vo as MarkerSeriesPointView,So as MarkerSeriesView,E as ORG_ANGLE,ks as OrthogonalSparkSeries,V as PI_2,tn as PanelSeries,sn as PieSeries,on as PinSeries,bo as PointElement,uo as PointLabelView,ln as PointSeries,T as RAD_DEG,ss as RectElement,_n as RouteSeries,Qe as RouteSeriesType,zn as SectionView,zo as SectorElement,fs as Series,To as SeriesAnimation,xo as SeriesView,Yi as ShapeAnnotation,On as Size,Ls as SparkSeries,zi as Subtitle,ke as TextAnchor,Wi as TextAnnotation,Ve as TextElement,Me as TextLayout,es as TiledWebSeriesType,ji as Title,ct as Utils,ws as ValueSeries,pn as VectorSeries,mn as WaffleSeries,lt as _isIE,g as absv,h as assignObj,W as calcPercent,m as copyObj,d as cos,Qa as createChart,Ja as createChartAsync,_t as createRect,$ as fixnum,Ka as getDistance,Xa as getVersion,x as incv,i as isArray,pt as isEmptyRect,s as isObject,n as isString,p as maxv,u as minv,Y as parsePercentSize,f as pickNum,y as pickProp,w as pickProp3,F as pixel,th as preset,ut as rectToSize,Ua as setDebugging,qa as setLogging,_ as sin};
|
|
7
|
+
function t(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,c=Math.floor,d=Math.ceil,_=Math.cos,u=Math.sin,p=Math.min,g=Math.max,m=Math.abs,f=function(t){if(t&&"object"==typeof t&&!r(t))return l({},t)},b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},y=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):e):t},w=function(t,e){return void 0!==t?t:e},x=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},v=(t,e,s)=>t+(e-t)*s;class S{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}S._debugging=!1;class C{static loadConfigAsync(e,s=!1){return t(this,void 0,void 0,(function*(){if(e&&e.map){if(o(e.map))e.map={url:e.map};else if(r(e.map))for(let t=0;t<e.map.length;t++)o(e.map[t])&&(e.map[t]={url:e.map[t]});const t=r(e.map)?e.map:[e.map];for(const e of t)!i(e.source)&&o(e.url)&&e.url&&(s?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+e.url):e.source=yield fetch(e.url).then((t=>t.json())))}if(e&&e.series){const t=r(e.series)?e.series:[e.series];for(const e of t)!i(e.data)&&!r(e.data)&&o(e.dataUrl)&&e.dataUrl&&(s?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+e.dataUrl):(e.data=yield fetch(e.dataUrl).then((t=>t.json())),delete e.dataUrl))}}))}}const L={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let k=L.ko;const P=void 0,M="%".charCodeAt(0),A=Math.PI,E=2*A,V=-A/2,T=A/180,N=180/A;function D(t){return t>E?t%E:t}function R(t){return parseFloat(t.toPrecision(12))}function $(t){return t*Math.PI/180}function O(t){return 180*t/Math.PI}function F(t){return t+"px"}function I(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function j(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function Y(t,e){let s,i;if(null==t||Number.isNaN(t)){if(e)return null;i=0,s=!0}else if(!(s=!isNaN(i=+t))){const s=t.trim();if(s.charCodeAt(s.length-1)===M&&(i=1===s.length?NaN:parseFloat(s)),isNaN(i)){if(e)return null;q(k.invalidSizeValue,t)}}return{size:i,fixed:s}}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z={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"},U=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var X;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(X||(X={}));const q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",Q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),s=b(parseFloat(e[0]),0),i=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(i)?s:i:n,r:isNaN(i)?s:i,t:s,b:isNaN(r)?s:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=Object.freeze([0,0]);function st(t){return isFinite(t[0]+t[1])}function it(t){let e=1/0,s=1/0,i=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=p(e,...t),s=p(s,...o),i=g(i,...t),r=g(r,...o)}return{h1:e,v1:s,h2:i,v2:r}}const rt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const nt="undefined"!=typeof navigator?navigator.userAgent:"",ot=nt?navigator.appVersion:"",at=!!nt.match(/Trident.*rv\:11\./),ht=-1!==ot.indexOf("MSIE 10"),lt=-1!==ot.indexOf("MSIE 9"),ct=at||ht||lt;class dt{static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&dt.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(s,dt.month_days[dt.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!r(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(r(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 r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=dt.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),dt.log(t,+new Date-s+"ms")}static clamp(t,e,s){return g(e,p(s,t))}static clampEx(t,e,s){return isNaN(e)||(t=g(e,t)),isNaN(s)||(t=p(s,t)),t}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=m(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const s=(e[0]-t[0])*T,i=(e[1]-t[1])*T,r=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t[0]*T)*Math.cos(e[0]*T)*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],s=t[0];for(let i=1;i<t.length;i++)e=p(e,t[i]),s=g(s,t[i]);return{min:e,max:s}}}dt.LOGGING=!1,dt.week_days=["일","월","화","수","목","금","토"],dt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],dt.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]];const _t=Object.freeze({x:0,y:0,width:0,height:0}),ut=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function pt(t){return{width:t.width,height:t.height}}function gt(t){return t.width<=0||t.height<=0}class mt{static create(t,e,s,i){const r=arguments.length;return dt.isObject(t)?new mt(t.x,t.y,t.width,t.height):r<2?new mt(t,t,t,t):r<3?new mt(t,e,t,e):new mt(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new mt(this.x,this.y,this.width,this.height)}getInner(){return new mt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}mt.Empty=new mt,mt.Temp=new mt;const ft={inOutSine:t=>-(_(A*t)-1)/2};class bt{constructor(){this.delay=0,this.duration=bt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=p(1,g(0,R(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 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,s=null){this._started&&this._stop(),this.duration=b(t,bt.DURATION),this.delay=e||0,this._easing=ft[s],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}}bt.DURATION=700,bt.SHORT_DURATION=300;let yt=0;class wt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(yt++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestory(),this.$_destroyed=!0),null}_doDestory(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class xt extends wt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const vt=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),St=.001,Ct=Math.PI;class Lt{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s}static lines2(...t){let e=0;const s=["M",t[e].x,t[e].y];for(;e<t.length;e++)s.push("L",t[e].x,t[e].y);return s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){return r>0?n>0?(r=p(-i/2,s/2,r),["M",t,e-(n=p(-i/2,s/2,n)),"v",i+n+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",i+(r=p(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:n>0?["M",t,e-(n=p(-i/2,s/2,n)),"v",i+n,"h",s,"v",-i-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=p(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static ellipse(t,e,s,i){return this.arc(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,!0)}static arc(t,e,s,i,r,n,o,a=!1){const h=D(m(n-r)),l=2*Ct-h<.01,c=h-Ct<.01?0:1,d=o?1:0,p=_(r),g=u(r),f=_(n-=l?d?St:-.001:0),b=u(n),y=[];return y.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,n,o,a){const h=D(m(o-n)),l=2*Ct-h<St;let c=h-Ct<St?0:1;const d=a?1:0,p=_(n),g=u(n),f=_(o-=l?d?St:-.001:0),b=u(o),y=s*r,w=i*r,x=[];return x.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*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-d,t+y*p,e+w*g),x.push("Z"),x}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,o=e+i/2+(i/2-i/2*u(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,c=i/4,d=2*Math.PI/5,p=d/2,g=[];g.push("M",n+a*_(r),o+h*u(r));for(let t=0;t<5;t++)g.push("L",n+a*_(r),o+h*u(r),"L",n+l*_(r+p),o+c*u(r+p)),r+=d;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Lt[e](0,0,2*s,2*i);break;default:r=Lt.circle(s,i,p(s,i))}t.setPath(r)}static pin(t){const{rd:e,cx:s,cy:i,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",s-r,i,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}var kt;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(kt||(kt={}));const Pt={name:"RealMap",version:"1.0.1",license:"enterprise",code:""};class Mt{static decode(t){const e=Mt.CHARS,s=Mt.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}Mt.PAD="=",Mt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class At{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=At.xor,i=At.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=At.xor,i=At.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=At.kb,i=At._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*At.POW8|e[a++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,o=c.p.length;r<o;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)i(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const s=At._decryptBlock;let i=At._init(e),r=[],n=Mt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*At.POW24|n[a+1]*At.POW16|n[a+2]*At.POW8|n[a+3],h.right=n[a+4]*At.POW24|n[a+5]*At.POW16|n[a+6]*At.POW8|n[a+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}At.POW2=Math.pow(2,2),At.POW3=Math.pow(2,3),At.POW4=Math.pow(2,4),At.POW8=Math.pow(2,8),At.POW16=Math.pow(2,16),At.POW24=Math.pow(2,24),At.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 Et{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 s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}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={},s=At.decrypt(t,"dkdl"+this._getLDKey(At.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}let Vt=651212;class Tt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=s.pageYOffset||n.scrollTop||r.scrollTop,a=s.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=i.left+a-l,d=i.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,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)Tt.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static removeStyles(t,e){if(e)for(const s in e)t[s]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,s){if(e!=s){if(s)for(const e in s)t[e]="";return e&&Object.assign(t,e),e}return s}static createElement(t,e,s){const i=t.createElement(e);return s&&Object.assign(i.style,s),i}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const o={},a={};return o[e]=s,a[e]=i,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+Vt++}static createBR(t,e){const s=t.createElement("br");return s.className=e,s}static createSpan(t,e){const s=t.createElement("span");return e&&Object.assign(s.style,e),s}static createCheckBox(t,e){const s=t.createElement("input");return s.type="checkbox",e&&Object.assign(s.style,e),s}static createRadio(t,e){const s=t.createElement("input");return s.type="radio",e&&Object.assign(s.style,e),s}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){S.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}const Nt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Dt extends wt{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._windowResized()},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._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._pointerDownHandler=t=>{var e;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._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t)},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)},function(){const t=location.hostname;let e;try{if(e=realMapLic,!e)return!1}catch(t){return!1}const s=Et.decrypt(e);if("RealMap"!=s.name||"RealMap"!==Pt.name)return!1;const i=s.server.toLowerCase(),r=location.pathname.toLowerCase();if(Pt.license!=kt.Developer&&!Et.includedDomains(i,t.toLowerCase(),r))return!1;const n=s.lic.toLowerCase();if(!Object.values(kt).includes(n))return!1;if(Pt.code=s.code,Pt.license=s.lic,n==kt.Evaluation||n==kt.Limited){const t=s.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Dt.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)):console.error("need license!")}_doDestory(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Tt.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}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)}clearDefs(){Tt.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(Rt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Rt.TEMP_KEY)}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)}}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(o(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){return this.clip(new zt(this.doc(),t,e,s,i,r,r))}clip(t){return this._defs.appendChild(t.dom),t}_setTesting(){this._testing=!0,Rt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),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,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||q(k.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");Object.assign(n.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)"}),n.className=i,this._container.appendChild(n);const o=this._svg=r.createElementNS(e,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Ot(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.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,s){let i=t.createElementNS(e,"filter");const r=t.createElementNS(e,"feDropShadow");i.setAttribute("id",Dt.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.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(),s=this._padding=Tt.getPadding(this._root.dom),i=s.left,r=s.top,n=this._svg.clientWidth-i-s.right,o=this._svg.clientHeight-r-s.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:i,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=i+(n-t.width)/2+"px",a.style.top=r+(o-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._invalidElements=[],this._doAfterRender()}dt.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(){}_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){}_windowResized(){this.invalidateLayout()}}Dt.CLASS_NAME="rm-control",Dt.SHADOW_FILTER="rm-shadow-filter";class Rt extends wt{static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,s,i){for(;e.length<s;){const s=i();t.add(s),e.push(s)}}static fit(t,e,s,i,r,n){for(;s.length>i;)s.pop().remove();for(;s.length<i;){const i=new r(t,n);e.add(i),s.push(i)}}constructor(t,s,i=P){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(e,i||"g"),(this._styleName=s)&&this.setAttr("class",s),this._doInitStyles()}_doInitStyles(){}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._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&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}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}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}appendElement(t,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,s);return this._dom.insertBefore(r,i),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}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 j(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e).resize(s,i),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return mt.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=dt.isValidNum(t)?t:this._tx,e=dt.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)}transEx(t,e,s=0,i=!0){if(t=dt.isValidNum(t)?t:this._tx,e=dt.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(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&&dt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&dt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==P&&(this._dom.setAttribute("style",this._saveStyle),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(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(U(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(U(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(o(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(U(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){o(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),o(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let s=!1;if(t){for(let i in t)if(i in Nt&&this._styles[i]!==t[i]){if("borderRadius"===i)this._setBackgroundBorderRadius(b(parseFloat(t[i]),0)),this._styles[i]=t[i];else if(i in Nt){const s=Nt[i];e[s]=this._styles[s]=t[i]}s=!0}s&&(this._styleDirty=!0)}return s}setStyle(t,e){let s=!1;return t in Nt||e===this._styles[t]||(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let s=!1;return t in Nt&&e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}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]=w(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 s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}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}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.$_setClip(n),n}clipPath(t){const e=this.control.clip(new Ht(this.doc).setPath(t));return this.$_setClip(e),e}attachClipPath(t){this.setAttr("clip-path",this.createClipId(t))}detachClipPath(){this.unsetAttr("clip-path")}$_setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}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}}_testing(){return Rt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(dt.isValidNum(e)||dt.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),dt.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+dt.pick(this._originX,t.getAttribute("x"),0)+" "+dt.pick(this._originY,t.getAttribute("y")||0)+")");const r=dt.getNum(this._scaleX,1),n=dt.getNum(this._scaleY,1);1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length&&this._dom.setAttribute("transform",i.join(" "))}}Rt.TESTING=!1,Rt.DEBUGGING=!1,Rt.ASSET_KEY="_asset_",Rt.TEMP_KEY="_temp_";class $t extends Rt{constructor(t,e=void 0){super(t,e,"g")}}class Ot extends Rt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Ft extends Rt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=o(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class It extends Rt{constructor(t,e,s=!1){super(t,e,s?"g":"path"),this.group=s}path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Bt extends Rt{constructor(t){super(t,P,"mask");const e=this._id=dt.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class jt extends Rt{constructor(t){super(t,P,"clipPath");const e=this._id=dt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class zt extends jt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Rt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Ht extends jt{constructor(t,e){super(t),this._path=new Ft(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var Gt;!function(t){t.SIDO="sido"}(Gt||(Gt={}));const Yt="shuffle",Wt="random";var Zt;class Ut{constructor(t){this.source=t}hasDef(){return!0}}class Xt extends Ut{_setStops(t,s){const i=t.createElementNS(e,"stop"),n=t.createElementNS(e,"stop"),o=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=r(o)?o[0]:o,l=r(o)&&o.length>1?o[1]:"white",c=r(a)?a[0]:a,d=r(a)&&a.length>1?a[1]:a;s.setAttribute("id",this.source.id),i.setAttribute("offset","0"),i.setAttribute("stop-color",h),i.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),s.appendChild(i),s.appendChild(n)}}class qt extends Xt{getElement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}qt.TYPE="lineargradient";class Kt extends Xt{getElement(t,s){const i=t.createElementNS(e,"radialGradient");return B(s.cx)||i.setAttribute("cx",s.cx),B(s.cy)||i.setAttribute("cy",s.cy),B(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}Kt.TYPE="radialgradient";class Qt extends Ut{getElement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rm-pattern"),+s.pattern>=0){const t=Qt.STOCK[+s.pattern%Qt.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else o(s.pattern)&&(a=s.pattern,c=s.width||s.height||20,d=s.height||s.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),n.setAttribute("d",a),h&&l(n.style,h),s.style&&l(n.style,s.style),_&&(n.style.fill="none");let u=s.backgroundStyle;if(o(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(u)?u:u.fill,s.setAttribute("width",String(c)),s.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(n),r}}Zt=Qt,Qt.TYPE="pattern",Qt.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}],Qt.SELECT=Object.assign(Zt.STOCK[4],{id:"rm-selected-area-fill",pattern:Zt.STOCK[4].path,transform:"scale(0.5)"});class Jt extends Ut{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===Wt?this._index=-1:(t.mode===Yt&&dt.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=r(e.colors)?e.colors:[]}}Jt.TYPE="colors";class te extends Ut{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||te.SIZE,height:e.height||e.width||te.SIZE})}}te.TYPE="images",te.SIZE=20;class ee{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(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 Qt(Qt.SELECT);const s=this._selectedFill.getElement(t,this._selectedFill.source);s.setAttribute(Rt.ASSET_KEY,"1"),e.addDef(s),this._items.forEach((s=>{const i=s.getElement(t,s.source);i.setAttribute(Rt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Qt.TYPE:r(t.colors)?e=Jt.TYPE:r(t.images)&&(e=te.TYPE)),e)switch(e.toLowerCase()){case qt.TYPE:return new qt(t);case Kt.TYPE:return new Kt(t);case Qt.TYPE:return new Qt(t);case Jt.TYPE:return new Jt(t);case te.TYPE:return new te(t)}}}}const se="0".charCodeAt(0),ie="#".charCodeAt(0),re=",".charCodeAt(0),ne="s".charCodeAt(0),oe="a".charCodeAt(0);class ae{static getFormatter(t){let e=ae.Formatters[t];return e||(ae.Formatters[t]=e=new ae(t)),e}static get Default(){return ae.getFormatter(ae.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 s=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,s}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===se;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ie;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===se;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===re){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ne){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===oe){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s}}}ae.DEFAULT_FORMAT="",ae.Formatters={};const he=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],le=[".","/","-",":"],ce="Z".charCodeAt(0),de="z".charCodeAt(0),_e="A".charCodeAt(0),ue="a".charCodeAt(0),pe="y".charCodeAt(0),ge="M".charCodeAt(0),me="m".charCodeAt(0),fe="W".charCodeAt(0),be="w".charCodeAt(0),ye="d".charCodeAt(0),we="H".charCodeAt(0),xe="h".charCodeAt(0),ve="S".charCodeAt(0),Se="s".charCodeAt(0);class Ce{static getFormatter(t){let e=Ce.Formatters[t];return e||(Ce.Formatters[t]=e=new Ce(t)),e}static get Default(){return Ce.getFormatter(k.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||k.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var o=s[r],a=o.length;switch(o.charCodeAt(0)){case pe:i+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case ge:i+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case ye:i+=a>1?z(t.getDate()):t.getDate();break;case fe:i+=a>1?z(dt.weekOfYear(t,e)+1):dt.weekOfMonth(t,e,!0)+1;break;case be:i+=a>1?dt.long_week_days[t.getDay()]:dt.week_days[t.getDay()];break;case we:i+=a>1?z(t.getHours()):t.getHours();break;case xe:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?z(e):e}else i+=a>1?z(t.getHours()):t.getHours();break;case me:i+=a>1?z(t.getMinutes()):t.getMinutes();break;case Se:i+=a>1?z(t.getSeconds()):t.getSeconds();break;case ue:case _e:t.getHours()<12?i+=k.am:i+=k.pm;break;case ve:let s=t.getMilliseconds();i+=3==a?H(s):2==a?z(s):s.toString().substring(0,a);break;default:i+=o}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(le.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),he.indexOf(n)<0){let e=n.charCodeAt(0);(e>=_e&&e<=ce||e>=ue&&e<=de)&&q(k.invalidDateFormat,t)}e.push(n)}if(r<i&&dt.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&dt.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||k.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Ce.Formatters={};const Le=["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"],ke=["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"];class Pe{static create(t){return o(t)?new Pe(t):void 0}static isBright(t){return new Pe(t).isBright()}static getContrast(t,e,s){return new Pe(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Pe(null);return i.r=Math.ceil(t.r+(e.r-t.r)*s),i.g=Math.ceil(t.g+(e.g-t.g)*s),i.b=Math.ceil(t.b+(e.b-t.b)*s),i.a=t.a+(e.a-t.a)*s,i}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(dt.startsWith(t,"rgb(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(dt.startsWith(t,"rgba(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(dt.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Pe.COLORS[t]&&this.$_parseNumber(Pe.COLORS[t])}}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Pe(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var Me,Ae,Ee;Pe.COLORS=function(){const t={};for(let e=0;e<Le.length;e++)t[Le[e]]=ke[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Me||(Me={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Ae||(Ae={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ee||(Ee={}));class Ve extends Rt{constructor(t,e=P){super(t,e,"text"),this._layout=Ae.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(t){const e=this.bbox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Ae.MIDDLE:i=Math.floor(s/2);break;case Ae.BOTTOM:i=s-e.height;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Pe.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}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 Te="$_TH",Ne="$_TW";class De{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?ae.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Ce.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),P),0===this._literals[2].length&&(this._literals[2]=P)}else this._literals.push(r,n,P,P);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Re extends De{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class $e extends Re{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-link")}}const Oe={t:class extends Re{tag(){return"</t>"}},b:class extends Re{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-bold")}},i:class extends Re{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-italic")}},a:$e};class Fe{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new De).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in Oe){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new Oe[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const Ie=/<br.*?>|\r\n|\n/;class Be{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,s,r,n,o){const a=t.doc,h=b(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];t.clearDom(),n=n||t;const u=t.getStyle("writing-mode"),p=u===K||u===Q;for(let s=0;s<c;s++){const r=l[s];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,_=s===c-1&&h===r.words.length-1,b=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=d&&t.prefix||"",s=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+s}const y=b.getBBox();if(b[Ne]=y.width,b[Te]=y.height,p?(u=g(u,b[Ne]),m+=b[Te]):(u+=b[Ne],m=g(m,b[Te])),f||(f=b),l instanceof $e){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(b),t.appendDom(s)}}_.push(f),r[Te]=m*h,r[Ne]=u*h,d.push(0==s?r[Ne]/2:r[Ne])}if(c>0){let e=l[0];for(let s=1;s<_.length;s++)if(_[s]){let i=0,r=0;if(p?null!=_[s-1]&&(i=Math.floor(e[Ne]-t.getAscent(e[Ne]))+t.getAscent(l[s][Ne])):r=e[Te]-t.getAscent(e[Te])+t.getAscent(l[s][Te]),null==_[0]&&_[s]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[Ne]=n.width,r[Te]=e[Te]=n.height,_[0]=r}switch(u){case K:_[s].setAttribute("dx",String(i)),_[s].setAttribute("y","0");break;case Q:_[s].setAttribute("dx",String(-i)),_[s].setAttribute("y","0");break;default:_[s].setAttribute("x","0"),_[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),s=t.bbox().width,[i]=_,r=i[Ne];if(e)i.setAttribute("dx",String(u===Q?s-r/2:r/2));else switch(u){case K:i.setAttribute("x",String((s-r)/-2));break;case Q:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][Te])}}layout(t,e,s,i,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===K||h===Q)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=Me.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=Me.END,a=n.height-r.bottom;break;default:t.anchor=Me.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Me.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=Me.END,o=s-r.right;break;default:t.anchor=Me.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(Ie);for(let t of s)e.push((new Fe).parse(t))}}}let je=0;const ze=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},He=function(t,e){const s=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];r(n)?s[t]=n.slice(0):n instanceof Date?s[t]=new Date(n):i(n)?s[t]=He(s[t],n):s[t]=n}return s};class Ge extends wt{constructor(t){super(),this.chart=t,je++}_init(){const t=this._op=He({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t)}saveOptions(){const t={visible:this.visible};return this._doSave(t),t}updateOptions(t,e=!0){const s=this,r=this._op;return void 0===t||this._doSetSimple(t)||He(r,t),this.$_applyOptions(r),i(t)&&function(t){if(s._children)s._children.forEach((e=>t.hasOwnProperty(e)&&s[e].updateOptions(t[e])));else{s._children=[];for(const e in s){const i=s[e];i instanceof Ge&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,s=!0){if(this[t]instanceof Ge)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._optionChanged())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._optionChanged(),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t)){delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=He({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((s=>e._op[s]=t(e[s])));else{e._children=[];for(const s in e){const i=e[s];i instanceof Ge&&(e._op[s]=t(i))}}return e._op}(this),t&&this._optionChanged(),this}_prepareRender(){this._doPrepareRender(this.chart)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Ge?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):n instanceof Date?t[s]=new Date(n):i(n)?t[s]=Object.assign({},n):t[s]=n)}}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){s.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof Ge?this[e].updateOptions(s):r(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):i(s)?this[e]=l({},s):this[e]=s)}}_doPrepareRender(t){}_doAfterRender(){}}Ge.REFRESHED="refreshed",Ge.defaults={visible:!0};class Ye{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 We extends Ge{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=b(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?ae.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Be),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(dt.isValidNum(t)){const i=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=o(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,s,i){let r="";if(dt.isValidNum(t)){const n=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,i)+n.symbol:this._numberFormatter.toStrEx(t,i):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}We.defaults=ze(Ge.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ze extends We{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof te&&(this._images=e)}this._root=this._images?"":this._op.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 s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof te?s.getImage(i):i}return this._root+t}}}Ze.defaults=ze(We.defaults,{iconPosition:"default",iconGap:2});class Ue extends Ge{constructor(){super(...arguments),this.index=-1}get series(){return this._series}getLocation(){return this._location}isReversed(){return"left"===this._location||"top"===this._location}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=e.location||"bottom",this._series=t.seriesByName(e.series)||this._getFirstSeries(t)}_getFirstSeries(t){return t.firstMapSeries}}Ue.defaults=ze(Ge.defaults,{offsetX:0,offsetY:0});class Xe extends Ye{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t){return o(t)?this._map[t]:this._items[t]}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options.colorScale=this._items.map((t=>t.options))}$_loadItem(t,e,s){const i=this._createScale(t);return i._init(),i.index=s,i._load(e),i}}const qe={};class Ke extends Ge{static register(...t){t.forEach((t=>{qe[t.type]=t}))}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this._op;let i,r;return this.inBody&&(s.x1,s.x2,s.y1,s.y2,this._x=this._y=this._w=this._h=NaN),isNaN(i)?i=W(this._widthDim,t):i<0&&(this._x+=i,i=-i),isNaN(r)?r=W(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:i,height:r}}getPosition(t,e,s,i,r,n){let o,a,h;if(isNaN(a=this._x))switch(o=this.getOffset(r,n),a=t,this._op.align){case"center":a+=(s-r)/2+o.x;break;case"right":a+=s-o.x-r;break;default:this._anchorObj?a+=(s-r)/2+o.x:a+=o.x}else o=o||this.getOffset(r,n),a=this._x+o.x;if(isNaN(h=this._y))switch(o=o||this.getOffset(r,n),h=e,this._op.verticalAlign){case"middle":h+=(i-n)/2-o.y;break;case"bottom":h+=i-o.y-n;break;default:h+=o.y}else o=o||this.getOffset(r,n),h=this._y+o.y;return{x:a,y:h}}refresh(){}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}Ke.defaults=ze(Ge.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Qe extends Ye{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof Ke)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e))})):i(t)&&n.push(this.$_loadItem(s,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a._init(),a.index=s,a._load(e),a}}const Je="route",ts="map",es="heatmap",ss="tiledweb";class is extends Rt{static create(t,e,s,i,r,n,o=0){return new is(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=void 0,s=void 0){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,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)}}const rs={FO:[-6.926,61.935],UM:[-161.881,5.874],US:[-100.054,38.95],JP:[137.363,36.254],SC:[55.336,-4.582],IN:[77.712,23.832],FR:[3.636,46.78],FM:[158.082,6.859],CN:[98.592,35.308],SW:[-78.538,15.86],SH:[117.621,15.128],BR:[-52.768,-8.476],EC:[-79.861,-.951],AU:[135.555,-24.588],KI:[-157.184,1.814],PH:[121.006,16.567],MX:[-102.12,23.983],ES:[-1.595,39.591],BU:[-79.893,15.769],MV:[73.421,5.526],SP:[115.707,10.82],GB:[-1.839,52.506],GR:[22.599,36.681],AS:[-170.525,-14.3],DK:[9.427,56.37],GL:[-39.018,75.593],GU:[144.57,13.448],MP:[145.575,15.13],PR:[-66.143,18.122],VI:[-64.657,17.73],CA:[-115.256,59.415],ST:[6.617,.24],TZ:[35.004,-6.367],CV:[-23.58,15.095],DM:[-61.289,15.406],NL:[6.492,53.515],JM:[-77.2,18.063],WS:[-172.316,-13.651],OM:[58.793,22.119],VC:[-61.127,13.19],TR:[32.129,39.009],BD:[91.905,22.233],SB:[159.895,-9.419],LC:[-60.92,13.905],NR:[166.755,-.527],NO:[8.419,60.753],KN:[-62.633,17.288],BH:[50.478,25.994],TO:[-174.925,-21.171],FI:[25.914,62.545],ID:[112.847,-1.004],MU:[57.54,-20.281],SE:[16.306,62.823],TT:[-61.263,10.416],MY:[116.988,5.343],BS:[-77.04,26.457],PA:[-81.679,8.405],PW:[134.398,7.472],TV:[179.008,-8.486],MH:[170.969,7.089],CL:[-71.933,-53.598],TH:[99.453,13.237],GD:[-61.602,12.116],EE:[24.023,58.725],AG:[-61.72,17.057],TW:[120.561,23.799],BB:[-59.506,13.174],IT:[12.07,42.271],MT:[14.39,35.877],PG:[144.268,-6.42],DE:[10.769,52.338],VU:[166.879,-14.948],SG:[103.716,1.336],CY:[32.94,34.876],KM:[43.265,-11.648],FJ:[177.763,-17.844],RU:[116.768,62.184],VA:[12.445,41.859],SM:[12.426,43.899],KZ:[69.685,48.81],AZ:[48.953,40.077],AM:[43.71,40.972],TJ:[70.97,38.844],LS:[28.196,-29.619],UZ:[63.788,41.154],PT:[-7.96,39.503],MA:[-7.418,32.961],CO:[-72.763,3.458],TL:[125.957,-8.667],KH:[106.595,12.595],AR:[-64.544,-31.651],SA:[43.575,24.38],PK:[65.477,27.35],YE:[46.702,14.193],AE:[54.339,23.834],KE:[40.821,-1.765],PE:[-72.624,-12.919],DO:[-70.177,18.918],HT:[-72.184,19.768],AO:[17.848,-13.567],VN:[105.093,9.209],MZ:[38.994,-15.14],CR:[-85.488,10.921],IR:[55.16,32.532],SV:[-88.819,13.763],SL:[-11.852,8.517],GW:[-15.062,11.83],HR:[15.471,44.023],BZ:[-88.588,17.17],ZA:[22.378,-31.062],CD:[23.249,-2.545],KW:[47.417,29.211],IE:[-8.492,53.326],KP:[126.253,39.576],KR:[127.616,36.448],GY:[-60.029,8.028],HN:[-84.851,15.721],MM:[93.663,19.758],GA:[10.77,-1.748],GQ:[10.388,1.604],NI:[-85.521,11.48],UG:[30.384,1.098],MW:[33.379,-11.797],SX:[47.38,9.636],TM:[57.736,39.678],ZM:[24.768,-14.824],NC:[33.685,35.192],MR:[-9.464,19.464],DZ:[4.338,28.318],LT:[22.486,56.241],ET:[39.713,8.248],SD:[30.178,15.394],ER:[37.061,16.638],GH:[-2.632,6.208],SI:[14.998,46.019],GT:[-91.228,14.582],BA:[19.032,43.715],JO:[35.197,30.08],SY:[37.367,34.605],MC:[7.398,43.693],AL:[19.948,41.178],UY:[-54.091,-33.141],CNM:[33.1,35.128],MN:[103.413,46.722],RW:[29.783,-1.991],SO:[44.948,1.869],BO:[-63.791,-17.523],CM:[10.632,5.494],CG:[12.218,-3.09],EH:[-13.634,22.764],RS:[20.629,44.144],ME:[19.218,42.7],BJ:[2.516,9.301],NG:[8.668,10.712],TG:[1.183,7.053],LA:[106.65,16.035],AF:[65.88,33.737],UA:[34.689,48.739],SK:[18.01,48.516],JK:[77.109,35.261],BG:[27.047,42.676],QA:[51.077,25.34],LI:[9.547,47.109],AT:[13.385,47.391],SZ:[31.418,-26.531],HU:[17.899,46.861],RO:[26.522,45.94],LU:[6.078,49.679],AD:[1.593,42.518],CI:[-5.559,7.414],LR:[-7.632,5.393],BN:[114.295,4.607],BE:[4.472,50.722],IQ:[43.218,33.744],GE:[41.618,42.404],GM:[-16.166,13.386],CH:[6.631,46.572],TD:[18.378,13.499],KV:[20.845,42.495],LB:[35.653,33.732],DJ:[42.603,11.707],BI:[29.98,-3.31],SR:[-54.231,5.457],IL:[35.309,32.984],ML:[-2.536,19.441],SN:[-16.115,14.461],GN:[-13.134,9.817],ZW:[31.526,-18.524],PL:[19.318,53.256],MK:[21.667,41.636],PY:[-58.484,-23.396],BY:[27.908,53.75],LV:[21.37,57.167],CZ:[15.531,49.557],BF:[-.457,12.785],NA:[16.205,-21.44],NE:[10.273,17.295],LY:[17.187,27.941],TN:[9.187,36.696],BT:[90.355,27.516],MD:[28.401,47.195],SS:[29.891,7.148],CF:[20.505,6.958],NZ:[169.191,-45.031],CU:[-77.556,21.034],VE:[-67.345,9.318],MG:[46.43,-18.577],IS:[-17.355,64.924],EG:[30.753,25.315],LK:[80.796,6.19],BW:[24.546,-23.267],KG:[74.526,41.489],NP:[84.181,28.118]};class ns{constructor(t,e){}}let os=0;class as{constructor(t){this.source=t,this.pid=os++,this.visible=!0}setSelected(t){this._selected=t}get lon(){return this.coord[0]}get lat(){return this.coord[1]}ariaHint(){return""}labelCount(){return 1}copy(){return Object.assign({},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:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(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,s;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const s=t.split(/\./g);let i=null!==(e=this[s[0]])&&void 0!==e?e:this.source[s[0]];for(let t=1;t<s.length;t++)i=i[s[t]];return i}return"baseValue"===t?this.getBaseValue():null!==(s=this[t])&&void 0!==s?s:this.source[t]}getCallout(t){const e=this.callout;if(e){const s=[t];for(let t=0;t<e.length;t++)s.push([isNaN(e[t][0])?s[t][0]:e[t][0],isNaN(e[t][1])?s[t][1]:e[t][1]]);return s}const s=this.offset;if(s){const e=[t];for(let t=0;t<s.length;t++)e.push([e[t][0]+(s[t][0]||0),e[t][1]+(s[t][1]||0)]);return e}}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,source:this.source})}_readArray(t,e){}_readObject(t,e){var s;if(this.id=w(t._idFielder(e),e.id),this.name=w(t._nameFielder(e),e.name),this.color=w(t._colorFielder(e),e.color),this.className=e.className,r(e.coord))this.coord=e.coord.slice(0,2);else if(o(e.coord)){const t=e.coord.split(/s\+/);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 i=t._lonFielder(e);if(isNaN(i))return;const r=null===(s=t._latFielder)||void 0===s?void 0:s.call(t,e);if(isNaN(r))return;this.coord=[i,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=r(e.callout)&&this.$_parseCallout(e.callout),r(this.callout)||(this.offset=r(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return o(t)&&(t=t.split(",")),r(t)&&(e=[],a(t[0])?e.push(t):t.forEach((t=>{if(r(t))e.push(t.slice(0,2));else if(o(t)){const s=t.split(/s\+/);e.push([s[0],s[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){o(t)&&(this.id=t)}}class hs{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){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){t<0?(this._points.push(e),e.index=this._points.length-1):(this._points.splice(t,0,e),e.index=t)}add(t){this._points.push(t),t.index=this._points.length-1}remove(t){const e=this._points,s=e.indexOf(t);if(s>=0){e.splice(s,1);for(let t=e.length-1;t>=s;t--)e[t].index=t;return!0}}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let s=0,i=e.length;s<i&&!0!==t(e[s],s);s++);}}const ls="_model_",cs="_tag_",ds="disabled",_s="rm-legend-item-marker",us={};class ps extends Ze{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}isVisible(){return this.visible||n(this._op.visibleCallback)}getDefaultIconPos(){return"top"}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ps.defaults=ze(Ze.defaults,{visible:!0,position:"auto",distance:25});class gs extends Ge{}gs.defaults=ze(Ge.defaults,{shape:"circle",radius:2.5});class ms extends Ge{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new gs(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}ms.defaults=ze(Ge.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class fs extends bt{constructor(t,e,s){super(),this.series=t,this.point=e,this.callback=s,this.duration=500,this.point._vr=0,this.endHandler=()=>{var t;delete this.point._vr,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.point._vr=t,this.series._optionChanged(),!0}}class bs extends Ge{static register(...t){t.forEach((t=>{us[t.type]=t}))}static getPointTooltipParam(t,e,s){return"series"===s?t.displayName():e.getParam(s)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._maxZindex=0,this._points=new hs(this)}_doInit(t){this._pointArgs=this._createPointArgs(),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new ms(this))._init()}_createLabel(t){return new ps(t)}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return bs.getPointTooltipParam(t,e,s)}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._op.label||this.name}_type(){return this.constructor.type}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}displayName(){return this._op.label||this.name||`Series${this.index}`}get data(){return this._data}setData(t){t!==this._data&&(this._data=t,this._dataSourceDirty=!0)}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isDataSeries(){return!0}getDetailed(){return this}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=t.map(((t,e)=>this.$_addPoint(t,e)));return this._zindexDirty=this._maxZindex>0,e}getPoint(t){return this._points.get(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:s}getPointCallbackArgs(t){return this._getPointCallbackArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.options.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&&!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.options.layoutOnly}getLegendSources(t){this._op.visibleInLegend&&t.push(this)}getLabelOff(){return b(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}coordOfArea(t){var e,s;return rs[t]||(null===(s=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===s?void 0:s.getCenter())}getCoord(t){return t.coord||this.coordOfArea(t.id)||et}pointById(t){return this._points.pointById(t)}needRemoveAnimation(){return!1}addPoint(t,e=-1,s=500){var i,r,n,o;const a=this.$_addPoint(t,e);return this._points.insert(e,a),this._optionChanged(),this.chart._dataChanged(),s>0&&this instanceof xs?(null===(r=null===(i=a._prev)||void 0===i?void 0:i.ani)||void 0===r||r.stop(),delete a._deleting,a._prev={value:NaN},a._prev.ani=new fs(this,a,(t=>{var e,s;null===(s=(e=this._op).onPointAdded)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(s),a._prev.ani.start()):null===(o=(n=this._op).onPointAdded)||void 0===o||o.call(n,this._getPointCallbackArgs(this._pointArgs,a)),a}removePoint(t,e=500){var s,i,r,n;a(t)&&(t=this._points.get(t)),this._points.contains(t)&&(e>0&&this.needRemoveAnimation()?(null===(i=null===(s=t._prev)||void 0===s?void 0:s.ani)||void 0===i||i.stop(),t._deleting=!0,t._prev={value:NaN},t._prev.ani=new fs(this,t,(t=>{var e,s;t._deleting=!1,this._points.remove(t),null===(s=(e=this._op).onPointRemoved)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(e),t._prev.ani.start()):(this._points.remove(t),null===(n=(r=this._op).onPointRemoved)||void 0===n||n.call(r,this._getPointCallbackArgs(this._pointArgs,t))),this._optionChanged(),this.chart._dataChanged())}removeFirst(t=500){this.removePoint(this._points.first,t)}removeLast(t=500){this.removePoint(this._points.last,t)}updatePoint(t,e){if(o(t)?t=this._points.pointById(t):a(t)&&(t=this._points[t]),t instanceof as){let s=t._prev;return delete t._deleting,s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new fs(this,t),s.ani.start())),this._optionChanged(),!!s}return!1}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(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.options.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)}$_bringToFront(t){t instanceof as&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.setData(t.data);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._dataSourceDirty){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._runPoints||(this._runPoints=this._points.getPoints()),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t){const e=this._op,s=e.pointColors;let i,h,l,c=this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;n(s)?i=s:r(s)?h=s:o(s)&&(l=this.chart._assets.get(s)),i?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||i(this._getPointCallbackArgs(this._pointArgs,t))||c})):l instanceof Jt?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()||c}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]||c})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),isNaN(s._zindex)||(this._maxZindex=Math.max(this._maxZindex,s._zindex)),s}_createFielder(t){return n(t)?e=>t(e):o(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)}_createLegendMarker(t,e){return is.create(t,_s,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(t instanceof ns);else if(r(t))return t}$_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_createPointArgs(){return{series:this}}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,s;return t.forEach((t=>{const i=t.getValue();isNaN(i)||(e=isNaN(e)?i:p(i,e),s=isNaN(s)?i:g(i,s))})),{min:e,max:s}}}bs.defaults=ze(Ge.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:"<b>${name}</b><br>${series}:<b> ${value}</b>",loadAnimation:"default",hoverEffect:"default",visibleInLegend:!0});class ys extends Ye{constructor(){super(...arguments),this._map={},this._visibles=[]}get internalItems(){return this._items}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const s=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(s,t,e)})):i(t)&&this.$_loadItem(s,t,0),s.options.series=this._items.map((t=>t.options))}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(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}_prepareRender(t){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){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof bs?e=t:o(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,s){let i=t._getSeriesType(e.type||"map");if(!i)throw new Error("Invalid series type: "+e.type);const r=new i(t);return r._init(),r.isDataSeries()&&(r.index=s,r.seriesIndex=r.chart._seriesIndex++),r._load(e),this.$_addSeries(r,s)}$_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 as{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e)}getValue(){return!isNaN(this._vr)&&this._prev?isNaN(this._prev.value)?this._deleting?v(0,this.value,1-this._vr):v(0,this.value,this._vr):v(this._prev.value,this.value,this._vr):this.value}getBaseValue(){return this.value}}class xs extends bs{_createFielders(t){super._createFielders(t),this._valueFielder=this._createFielder(t.valueField||"value"),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}}xs.defaults=ze(bs.defaults,{valueField:"value"});class vs extends ws{}class Ss extends xs{}Ss.defaults=ze(xs.defaults,{});class Cs extends ws{getPoints(t,e,s){const i=t.length,r=[];const n=s-e;for(let s=0;s<i;s++){const o=t[s],a=5+s/(i-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,s){const i=e-t;return 0+(isNaN(s)||0==i?100:100*(1-(s-t)/i))}_readObject(t,e){super._readObject(t,e);const s=this.value;this.coord=e.coord,this.values=r(s)?s.slice():isNaN(s)?[]:[s]}}class Ls{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return is.create(t,_s,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class ks extends xs{getMinMax(t){let e=NaN,s=NaN;for(const i of t)for(const t of i.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),s=isNaN(s)?t:Math.max(s,t));return{min:e,max:s}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}getLegendSources(t){const e=this._op;e.visibleInLegend&&(e.legendByCategory&&this._categories?t.push(...this._categories):t.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new Ls(t.name,t.color)))}}ks.defaults=ze(xs.defaults,{position:"top"});class Ps extends Cs{}class Ms extends ks{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Ge(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const s=dt.getMinMax(t),i=s.base=this._op.baseValue;if(e)s.min=isNaN(i)?e.min:Math.min(e.min,i),s.max=isNaN(i)?e.max:Math.max(e.max,i);else{const t=b(this._minValue,s.min),e=b(this._maxValue,s.max);s.min=isNaN(i)?Math.min(t,s.min):Math.min(t,s.min,i),s.max=isNaN(i)?Math.max(e,s.max):Math.max(e,s.max,i)}return s}_doApply(t){super._doApply(t),this._width=b(+t.width,Ms.DEF_WIDTH),this._height=b(+t.height,Ms.DEF_HEIGHT),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}Ms.DEF_WIDTH=80,Ms.DEF_HEIGHT=50,Ms.defaults=ze(ks.defaults,{width:Ms.DEF_WIDTH,height:Ms.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class As extends ws{}class Es extends xs{_doApply(t){super._doApply(t),this._width=b(+t.width||+t.size||+t.height,Es.DEF_SIZE),this._height=b(+t.height||+t.size||+t.width,Es.DEF_SIZE)}}Es.DEF_SIZE=60,Es.defaults=ze(xs.defaults,{size:Es.DEF_SIZE});class Vs extends Es{getValueRate(t){return(b(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=b(this._minValue,1/0),s=b(this._maxValue,-1/0);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))})),this._min=e,this._max=s}}Vs.defaults=ze(Es.defaults,{minValue:10});class Ts extends vs{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}_assignTo(t){super._assignTo(t).value=this.value}}class Ns extends ps{}Ns.defaults=ze(ps.defaults,{visible:!1});class Ds extends Ss{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new Ns(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getSubLabelOff(){return b(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ts(t)}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._minValue,Number.MAX_VALUE),s=b(this._maxValue,Number.MIN_VALUE);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))})),this._noSize=(this._vMin=e)===(this._vMax=s)}}Ds.type="bubble",Ds.defaults=ze(Ss.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Rs extends Ge{}Rs.defaults=ze(Ue.defaults,{length:10});class $s extends Ze{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}$s.defaults=ze(Ue.defaults,{offset:4});class Os extends Ge{_doInit(t){t.line=(this._line=new Rs(this.chart))._init(),t.label=(this._label=new $s(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Os.defaults=ze(Ue.defaults,{});class Fs extends Ue{_doInit(t){super._doInit(t),t.tick=(this._tick=new Os(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const s=this._series;if(s instanceof Ds){const{min:i,max:r}=s.getPixelMinMax(p(t,e));this._steps.forEach((t=>{t.rd=s.getRadius(t.value,i,r)}))}return this._steps}_getFirstSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(r(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}}Fs.defaults=ze(Ue.defaults,{});class Is extends Xe{_createScale(t){return new Fs(t)}}class Bs extends Ge{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Bs.MARKER_SIZE=10;class js extends Ge{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocation(){return this._location}isInner(){return"body"===this._location}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.maxWidth)!==e._maxWidth&&(e._maxWidth=s,e._maxWidthDim=Y(s,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=Y(t,!0))}(t.maxHeight)}_doPrepareRender(t){super._doPrepareRender(t),this._location=w(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map((t=>new Bs(this,t))),this._op.reversed&&(this._items=this._items.reverse())}}js.defaults=ze(Ge.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",gap:6,itemGap:8,markerVisible:!0,markerSize:Bs.MARKER_SIZE,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0});class zs{constructor(t){this._color1=Pe.create(t.minColor),this._color2=Pe.create(t.maxColor),this._logger=dt.getLogger(t.logBase)}getColor(t,e,s,i){const r=this._logger;if(r){const i=1-t;t=r(t+i),e=r(e+i),s=r(s+i)}if(this._color1&&this._color2)return Pe.interpolate(this._color1,this._color2,(s-t)/(e-t)).toString();return x(this._color2,i,this._color1).brighten(1-(s-t)/(e-t)).toString()}}class Hs extends Ge{_doInit(t){t.label=(this._label=new We(this.chart))._init()}get label(){return this._label}getMarkerSize(){return b(this._op.size,7)}}Hs.defaults=ze(Ge.defaults,{size:7});class Gs extends Ge{}Gs.defaults=ze(Ge.defaults,{length:6});class Ys extends Ze{getDefaultIconPos(){}}Ys.defaults=ze(Ze.defaults,{});class Ws extends Ge{_doInit(t){t.line=(this._line=new Gs(this.chart))._init(),t.label=(this._label=new Ys(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ws.defaults=ze(Ge.defaults,{});class Zs{constructor(t,e,s,i,r){this.from=t,this.to=e,this._color1=s,this._color2=i,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 s=+e||Bs.MARKER_SIZE;return is.create(t,_s,0,0,s,s,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 s=this._color1,i=this._color2;if(!s)return(i||e).toString();const r=this.from,n=this.to;if(s&&i)return Pe.interpolate(s,i,(t-r)/(n-r)).toString();return x(i,e,s).brighten(1-(t-r)/(n-r)).toString()}}class Us extends Ge{}const Xs="#fff",qs="#000";class Ks extends Ue{_doInit(t){const e=this.chart;t.marker=(this._marker=new Hs(e))._init(),t.stepLine=(this._stepLine=new Us(e))._init(),t.tick=(this._tick=new Ws(e))._init()}getColor(t,e,s,i){const r=this._steps;if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(s,t===e-1))return r[t].getColor(s,i);return s<=t?r[0]._color1.toString():i.toString()}return this._minColor?(this._logger&&(s=this._logger(s)),Pe.interpolate(this._minColor,this._maxColor||i,(s-this._min)/(this._max-this._min)).toString()):i.toString()}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get minColor(){return this._minColor}get maxColor(){return this._maxColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:return"left"===this._location||"right"===this._location?"vertical":"horizontal"}}getBarSize(t,e,s){let i,r;return s?(r=this._barLengthDim?W(this._barLengthDim,e):e,i=b(this._op.barWidth,12)):(i=this._barLengthDim?W(this._barLengthDim,t):t,r=b(this._op.barWidth,12)),{width:i,height:r}}getSplitPoints(t){const e=this._steps,s=this._valueSteps;let i=e?e.length:s?s.length-1:0;const r=[];if(i>1)for(let e=1;e<i;e++)r.push(e/i*t);return r}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 s=0,i=e.length;s<i;s++){const r=e[s].getPosition(t,s===i-1);if(!isNaN(r))return(s+r)/i}}getTicks(){const t=this._tick.label,e=this._steps,s=this._valueSteps,i=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=b(e[0].from,i)});for(let t=1;t<n;t++)o.push({pos:e[t].from=b(e[t].from,e[t-1].to)});o.push({pos:e[n-1].to=b(e[n-1].to,r)})}else if(s){n=s.length,o.push({pos:s[0]});for(let t=1;t<n-1;t++)o.push({pos:s[t]});o.push({pos:s[n-1]})}else o=[{pos:i},{pos:r}];return n=o.length-1,o.forEach(((e,s)=>{e.label=t.getNumberText(e.pos,!1,!1,0===s?"trunc":s===n?"ceil":void 0)})),o}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){!this._steps||"legend"!==this._op.display&&"both"!==this._op.display||this._steps.forEach((e=>t.push(e)))}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Pe.create(t.minColor||Xs),this._maxColor=Pe.create(t.maxColor||qs),this._colors=this.$_parseColorStops(t.colors)}$_parseColorStops(t){const e=[];if(r(t)){const s=t.length;if(s>1)for(let i=0;i<s;i++)e.push({stop:t[i].stop,color:Pe.create(t[i].color)});else 1===s&&e.push({stop:t[0].stop,color:Pe.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._maxColor});return(this._minColor&&e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(this._maxColor&&e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._maxColor}),e}_doPrepareRender(t){var e,s;super._doPrepareRender(t);const i=this._op,r=null===(s=null===(e=this._series)||void 0===e?void 0:e.getValueRange)||void 0===s?void 0:s.call(e);this._min=+i.minValue,this._max=+i.maxValue,this._logger=dt.getLogger(i.logBase),r&&(isNaN(this._min)&&(this._min=r.min),isNaN(this._max)&&(this._max=r.max)),this._steps=this.$_buildSteps()}$_parseValue(t,e,s){return o(t)?t.endsWith("%")?e+(s-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),R(t)}$_parseColor(t){return t&&t.endsWith("%")?Pe.interpolate(this._minColor,this._maxColor,parseFloat(t)/100):Pe.create(t)}$_buildSteps(){const t=this._op,e=t.steps,s=[],i=this._max;let n=.6,o=i;if(this._valueSteps=null,r(e)&&e.length>0){let t="0%";e.forEach(((i,r)=>{var a,h;let l=this.$_parseValue(i.from,n,o),c=this.$_parseValue(i.to,n,o);0===r&&isNaN(l)&&(l=n),r===e.length-1&&isNaN(c)&&(c=o);let d=this.$_parseColor(i.fromColor||t),_=this.$_parseColor(t=(null!==(a=i.toColor)&&void 0!==a?a:i.color)||"100%");s.push(new Zs(l,c,d,_,null!==(h=i.label)&&void 0!==h?h:`${l} - ${c}`))})),this._logger=null}else if(n>=o)s.push(new Zs(n,o,this._minColor,this._maxColor,`${this._min} - ${this._max}`));else{const e=t.logBase,s=this._logger&&n>=0&&o-n>=e?this._logger:null,r=s?Math.max(0,1-n):0,a=this._valueSteps=[],h=Math.max(1,b(t.stepCount,1));let l=s?s(o-n):o-n;const c=Math.pow(10,Math.floor(Math.log10(l/h))),_=d(l/h/c)*c;if(n=this.$_normalizeMin(s?s(n+r):n+r,_),t.integralSteps){a.push(n);for(let t=1;t<=h;t++)a.push(R(a[t-1]+_))}else{const t=l/h;a.push(n);for(let e=1;e<h;e++)a.push(R(a[e-1]+t));a.push(R(s?s(o):o))}if(this._min=a[0],this._max=a[h],s){for(let t=0;t<=h;t++)a[t]=Math.pow(e,a[t]);a[0]-=r,t.integralSteps||(a[0]=.6,a[h]=i)}}return s.length>1?s:void 0}}Ks.defaults=ze(Ge.defaults,{display:"scale",minColor:Xs,maxColor:qs,layout:"auto",barWidth:12,barLength:"40%",gap:8});class Qs extends Xe{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.options.display))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_createScale(t){return new Ks(t)}}class Js extends Ge{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}Js.defaults=ze(Ge.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ti extends Ge{_doSetSimple(t){return dt.isValidNum(t)?(this._op.step=t,!0):super._doSetSimple(t)}}ti.defaults=ze(Ge.defaults,{step:10});class ei extends Ge{_doInit(t){t.line=(this._line=new ti(this.chart))._init(),t.lonLine=(this._lonLine=new ti(this.chart))._init(),t.latLine=(this._latLine=new ti(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getStep(t){return b(this._line.options.step,this.$_defaultStep(t))}getLonStep(t){return y(this._lonLine.options.step,this._line.options.step,this.$_defaultStep(t))}getLatStep(t){return y(this._latLine.options.step,this._line.options.step,this.$_defaultStep(t))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t){super._doPrepareRender(t)}$_defaultStep(t){return 10}}ei.defaults=ze(Ge.defaults,{visible:!1,fitTo:"map"});class si extends Ge{}si.defaults=ze(Ge.defaults,{visible:!1});class ii extends Ge{}ii.defaults=ze(Ge.defaults,{visible:!1});class ri extends Ge{_doInit(t){t.line=(this._line=new ii(this.chart))._init(),t.label=(this._label=new We(this.chart))._init()}get line(){return this._line}get label(){return this._label}}ri.defaults=ze(Ge.defaults,{visible:!1});class ni extends Ze{getDefaultIconPos(){return"left"}}ni.defaults=ze(Ze.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class oi extends Ge{_doInit(t){t.label=(this._label=new ni(this.chart))._init()}get label(){return this._label}}oi.defaults=ze(Ge.defaults,{front:!0,zindex:0});class ai extends oi{}ai.defaults=ze(oi.defaults,{});class hi extends oi{}hi.defaults=ze(oi.defaults,{});class li extends oi{}li.defaults=ze(oi.defaults,{});class ci extends Ge{}ci.defaults=ze(Ge.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class di extends Ge{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new ci(this.chart))._init(),this._args={axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let s=ae.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(s=e.prefix+s),e.suffix&&(s+=e.suffix),s}moved(t,e,s){}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}di.defaults=ze(Ge.defaults,{visible:!1});class _i extends Ge{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new si(this.chart))._init(),this.options.leftLine=(this._leftLine=new si(this.chart))._init(),this.options.rightLine=(this._rightLine=new si(this.chart))._init(),this.options.topLine=(this._topLine=new si(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new si(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new si(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new si(this.chart))._init(),this.options.grid=(this._grid=new ei(this.chart))._init(),this.options.tick=(this._tick=new ri(this.chart))._init(),this.options.crosshair=(this._crosshair=new di(this))._init()}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()}_doApply(t){if(super._doApply(t),s.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let s;s="range"===t.type?new li(this.chart):"line"===t.type?new ai(this.chart):"band"===t.type?new hi(this.chart):new ai(this.chart),s._init(),s._load(t),e.push(s)}))}}function ui(t,e){const[s,i]=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>i!=l>i&&s<(h-o)*(i-a)/(l-a)+o&&(r=!r)}return r}function pi(t,e){let s=!1;ui(t,e[0])&&(s=!s);for(let i=1;i<e.length;i++)ui(t,e[i])&&(s=!s);return s}_i.defaults=ze(Ge.defaults,{});class gi{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:s,maxLat:i}=this.bbox,r=(t+s)/2,n=(e+i)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:i},a={minLon:r,minLat:n,maxLon:s,maxLat:i},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:s,maxLat:n};this.children=[new gi(o,this.capacity),new gi(a,this.capacity),new gi(h,this.capacity),new gi(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 s of this.children)if(this.isContained(t.bbox,s.bbox)&&(e=s.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,s){return t>=s.minLon&&t<=s.maxLon&&e>=s.minLat&&e<=s.maxLat}queryPoint(t,e,s=[]){if(!this.containsPoint(t,e,this.bbox))return s;for(const i of this.entries)this.containsPoint(t,e,i.bbox)&&s.push(i);if(this.divided&&this.children)for(const i of this.children)i.queryPoint(t,e,s);return s}}class mi{constructor(t,e){var s;this.worldBBox=t,this.root=new gi(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!==(s=t.source.polygon)&&void 0!==s?s: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 pi(t,e.coordinates);if("MultiPolygon"===e.type){for(const s of e.coordinates)if(pi(t,s))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const fi={area:"39",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"},bi={area:"37630",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"},yi={area:"",parent:"23,23520",polygons:[[8,9],[6,7]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},wi={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},xi={area:"HI",coord:[-126,21],frame:"0.5 0.5"};function vi(t,e){const s=t.split(/[\s,]+/g),i=[],r="z"===s[s.length-1]||"Z"===s[s.length-1];r&&s.pop();for(let r=0;r<s.length/2;r++)for(let n=0;n<2;n++){const o=s[2*r+n],a=+o;if(isNaN(a)){const s=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<s.length;){const i=s[h++];if("-"===i)r=-1;else if("+"===i)r=1;else if("w"===i)a+=r*(e.h2-e.h1);else if("h"===i)a+=r*(e.v2-e.v1);else if(i.length>0){const s=parseFloat(i);if(isNaN(s))throw new Error("Invalid border expression: "+t);i.endsWith("h")?a+=r*s*(e.v2-e.v1):i.endsWith("w")?a+=r*s*(e.h2-e.h1):a+=r*s}}i.push(a+(0===n?e.h1:e.v1))}else i.push(a+(0===n?e.h1:e.v1))}return r&&i.push("z"),i}class Si{constructor(t,e){this.id=t,this.props=e}}class Ci extends Si{}class Li extends Ci{constructor(t,e,s,i){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(s,1);else if(1!==e){const t=r[s],n=[];for(let e=0;e<t.length;e++){const s=[];for(let i=0;i<t[e].length;i++)s.push(t[e][i].slice());n.push(s)}r[s]=n,this.$_moveToRate(s,i,1-e)}}$_moveToRate(t,e,s){const i=it(this.polygons[t]),r=it(this.polygons[e]);let n,o,a=0,h=0;if((n=i.h1-r.h2)>0&&(o=r.v1-i.v2,n>o&&(a=-n*s,h=o*s)),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 ki extends wt{static createStockInset(t,e){let s;switch(t){case"제주":case"제주도":s=fi;break;case"울릉":case"울릉도":s=bi;break;case"백령":case"백령도":s=yi;break;default:switch(t.toLowerCase()){case"alaska":s=wi;break;case"hawaii":s=xi}}return s&&e&&(s=Object.assign({},s,e)),s}constructor(t){var e,s,n;super(),this._excludes={};const o=null!==(e=t.source)&&void 0!==e?e:t.map,a=r(t.insets)?t.insets:i(t.insets)?[t.insets]:void 0;this.name=t.name,this.enabled=w(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==o?void 0:o.meta)?dt.deepClone(o.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(s=this.meta.dummies)||void 0===s?void 0:s.slice(),this.paddings=J(null!==(n=t.padding)&&void 0!==n?n:"0"),this._excludes={},r(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={},a&&a.length>0&&a.forEach((t=>{var e,s;t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():isNaN(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===(s=t.offset)||void 0===s?void 0:s.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame})})),o&&(this.items=this.$_load(o))}included(t){return!this._excludes[t]}$_load(t){return this._doLoad(t)}}class Pi{constructor(){this._scroll=0}get scroll(){return this._scroll}set scroll(t){const e=t%360;this._scroll=e<0?360+e:e,this.second&&(this.second._scroll=this._scroll-360),360===this._scroll&&(this._scroll=0,this.second&&(this.second._scroll=-360))}prepareSecond(){return this.second=new this.constructor,this}getClipBounds(){const t=[],e=this.scroll;this.scroll=0;for(let e=-90;e<=90;e+=10)t.push(this.project([-180,e]));for(let e=90;e>=-90;e-=10)t.push(this.project([180,e]));return this.scroll=e,t}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}}const Mi=90,Ai=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Ei extends Pi{constructor(){super(),this._rotation=[0,0],this._r=Mi,this.bounds={x1:-90,x2:Mi,y1:-90,y2:Mi},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get isElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Ai(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Ai(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;Ai(-90-t),Ai(90-t),Ai(90+e),Ai(-90+e),this._prevCoord=null}project(t){const[e,s]=this._rotate(t),i=s*T,r=[Math.cos(i)*Math.sin(e*T)*this._r,Math.sin(i)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Mi,s=t[1]/Mi,i=Math.sqrt(e*e+s*s),r=Math.asin(i),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,i*o)/T,Math.asin(i&&s*n/i)/T];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}_rotate(t){const e=this._rotation[0]*T,s=(this._rotation[1]||0)*T,i=Math.cos(s),r=Math.sin(s),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===s)return t.slice(0);const a=t[0]*T+e,h=t[1]*T,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*i+c*r;return[Math.atan2(d*n-u*o,c*i-_*r)/T,Math.asin(u*n+d*o)/T]}_unrotate(t){const e=Math.PI/180,s=180/Math.PI,i=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(i)*n,a=Math.sin(i)*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)*s,-Math.asin(g.z)*s]}}function Vi(t,e){const{atan2:s,cos:i,sin:r,sqrt:n}=Math,o=t[1]*T,a=t[0]*T,h=e[1]*T,l=e[0]*T,c=h-o,d=l-a,_=r(c/2)*r(c/2)+i(o)*i(h)*r(d/2)*r(d/2),u=2*s(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*i(o)*i(a)+c*i(h)*i(l),_=t*i(o)*r(a)+c*i(h)*r(l),p=s(t*r(o)+c*r(h),n(d*d+_*_)),g=s(_,d);m.push([g/T,p/T])}}return m}const Ti=Math.min,Ni=Math.max;class Di extends wt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],s=t.props["ctr-lat"];isNaN(e)||isNaN(s)||(this.center=[+e,+s])}}setSelected(t){this._selected=t}get path(){return this._path}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=null}$_readBound(t,e){let s=this.h1,i=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{s=Ti(s,t[0]+e[0]),i=Ni(i,t[0]+e[0]),r=Ti(r,t[1]+e[1]),n=Ni(n,t[1]+e[1])})),this.h1=s,this.h2=i,this.v1=r,this.v2=n}$_readInset(t,e){if(!t._off){const s=t.coord,i=t.offset;let n=[0,0];r(s)&&s.length>0&&(n[0]=isNaN(s[0])?0:+s[0]-e.h1,n[1]=isNaN(s[1])?0:+s[1]-e.v1),r(i)&&i.length>0&&(n[0]+=b(i[0],0),n[1]+=b(i[1],0)),t._off=n}return t._off}$_toPath(t,e,s){const i=t.isGlobe,r=e[0].slice();if(s){for(let t=0;t<r.length;t++)r[t]=r[t].slice(0);r.forEach((t=>{t[0]+=s[0],t[1]+=s[1]}))}let n=this.x1,o=this.x2,a=this.y1,h=this.y2;const l=r.map((e=>{const s=t?t.project(e):e;return s.outside||(n=Ti(n,s[0]),o=Ni(o,s[0]),a=Ti(a,s[1]),h=Ni(h,s[1])),s}));let c;if(this.x1=n,this.x2=o,this.y1=a,this.y2=h,i){let e,s,i=!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 s=Vi(t[e],t[e+1]);s.length&&t.splice(e+1,0,...s)}}(r),c=[];for(let n=0;n<l.length;n++){const o=r[n],a=l[n];if(a.outside)i=!0;else{if(e||(e=o,r.push(o),l.push(a)),i&&s){Vi(s,o).forEach((e=>c.push(t.project(e))))}c.push(a),s=o,i=!1}}}else c=l;if(c.length>0){return`M ${c[0][0]} ${c[0][1]} L`+c.slice(1).map((t=>t.join(" "))).join(" ")+" Z"}return""}readBounds(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=Ti(e,t[0]),s=Ni(s,t[0]),i=Ti(i,t[1]),r=Ni(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Ti(e,t[0]),s=Ni(s,t[0]),i=Ti(i,t[1]),r=Ni(r,t[1])}))}));return{h1:e,v1:i,h2:s,v2:r}}readPath(t){if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset;let s,i;if(e)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=Ti(t,e[0]),i=Ti(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,et)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,et))):this.$_readBound(this.source.polygon,et),s=this.$_readInset(e,this);else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,et))):this.$_readBound(this.source.polygon,et);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,et)}))):(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,this.source.polygons?(i="",this._insetChilds?this.source.polygons.forEach(((e,r)=>{this._insetChilds.indexOf(r)>=0?i+=this.$_toPath(t,e,s):i+=this.$_toPath(t,e,null)})):this.source.polygons.forEach(((e,r)=>{i+=this.$_toPath(t,e,s)}))):i=this.$_toPath(t,this.source.polygon,s),this._path=i}return this._path}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Di;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Ri extends wt{constructor(t,e,s){if(super(),this.owner=t,this.source=e,this._hiddens={},!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=s,this._name=e.name,(this._second=e instanceof Ri)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new mi({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,r(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const s in this._areaMap){const i=this._areaMap[s];t in i.source.props&&(e[i.source.props[t]]=i)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()})),this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}$_resetAreas(){const t=this.owner.getProjection(this._second);if(t instanceof Ei)t.getRotation(),this._areas.forEach((e=>{e.visible=this.isVisible(e.id),e.readPath(t)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=Mi,this.y2=Mi;else{let e=1/0,s=-1/0,i=1/0,r=-1/0,n=1/0,o=-1/0,a=1/0,h=-1/0;if(this._areas.forEach((l=>{l.visible=this.isVisible(l.id),l.readPath(t)&&(e=Ti(e,l.h1),s=Ni(s,l.h2),i=Ti(i,l.v1),r=Ni(r,l.v2),n=Ti(n,l.x1),o=Ni(o,l.x2),a=Ti(a,l.y1),h=Ni(h,l.y2))})),this.source instanceof ki){const t=this.source.paddings;i-=t.b,r+=t.t,e-=t.l,s+=t.r,a-=t.b,h+=t.t,n-=t.l,o+=t.r}this.h1=e,this.v1=i,this.h2=s,this.v2=r,this.x1=n,this.y1=a,this.x2=o,this.y2=h,this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}}$_load(t){var e;const s=t.insets,i=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",o=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._insets=[];t.items.forEach((e=>{if(e instanceof Ci){const r=w(e.props[i],e.id);if(r&&t.included(r)){const t=new Di(e,s[r]);delete s[r],h&&h.indexOf(r)>=0?(l.unshift(t),t.dummy=!0):l.push(t),c[t.id=r]=t,t.name=w(e.props[n],e[n])}}}));for(const t in s){const e=s[t];if(e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let s=0;s<t.length;s++){const i=c[t[s]];if(i){const n=e.polygons[s];i.inset=e,i._insetChilds=r(n)?n:[n],e._base=i._insetChilds,e.parent=t[s],d.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=r(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,d.push(e))}else if(r(e.children)){const t=e._base=[],s=e.offset?e.offset.slice():[0,0];if(r(e.coord)){let t=1/0,i=1/0;for(const s of e.children){const e=c[s].readBounds(null);t=Ti(t,e.h1),i=Ti(i,e.v1)}isNaN(e.coord[0])||(s[0]=e.coord[0]-t),isNaN(e.coord[1])||(s[1]=e.coord[1]-i)}for(const i of e.children){const e=c[i];e&&(e.inset={area:i,offset:s},t.push(e))}d.push(e)}}if(o&&!isNaN(+t.dokdo)){const e=c[o.group];e&&(e.source=new Li(e.source,+t.dokdo,+o.index,+o.parent))}this.reset()}$_copy(t){const e=this._areas=[],s=this._areaMap={};t._areas.forEach((t=>{const i=t._clone();e.push(i),s[i.id]=i})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Ri(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class $i extends Ze{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}$i.defaults=ze(Ue.defaults,{offset:4});class Oi extends Ue{_doInit(t){super._doInit(t),t.label=(this._label=new $i(this.chart))._init()}get label(){return this._label}_getFirstSeries(t){return t.getFirstSeries("map")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Oi.defaults=ze(Ue.defaults,{visible:!1});class Fi extends Ge{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Fi.ITEM_GAP}}Fi.ITEM_GAP=4,Fi.defaults=ze(Ge.defaults,{offsetX:8,offsetY:8,itemGap:3});class Ii extends Fi{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,s,i;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Ii.BUTTON_SIZE,height:null!==(i=null!==(s=this._op.buttonHeight)&&void 0!==s?s:this._op.buttonWidth)&&void 0!==i?i:Ii.BUTTON_SIZE}}getZoomStep(){var t;return null!==(t=this._op.zoomStep)&&void 0!==t?t:20}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Ii.BUTTON_SIZE=24,Ii.defaults=ze(Fi.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Bi extends Fi{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Bi.defaults=ze(Fi.defaults,{type:"text",align:"left",verticalAlign:"top"});class ji extends wt{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,s=!1){let r;return s&&(r=this.clear()),t&&i(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const s=this._items.indexOf(e);if(s>=0)return this._items.splice(s,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 zi extends Ge{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}zi.defaults=ze(Ge.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Hi extends zi{}Hi.defaults=ze(zi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Gi extends Ge{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 s=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,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){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?ae.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ce.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Gi.defaults=ze(Ge.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Yi extends Ke{_isVisible(){return this._op.visible&&!j(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Yi.type="image",Yi.defaults=ze(Ke.defaults,{});class Wi extends Ke{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||Wi.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Wi.type="shape",Wi.defaults=ze(Ke.defaults,{width:64,height:64,shape:"square"});class Zi extends Ke{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!j(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?ae.getFormatter(s):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ce.getFormatter(t):void 0)}(t.timeFormat)}}Zi.type="text",Zi.defaults=ze(Ke.defaults,{text:"Text"});class Ui extends Pi{project(t){return[t[0]-this.scroll,t[1]]}backward(t){return[t[0],t[1]]}}const Xi=1.340264,qi=-.081106,Ki=893e-6,Qi=.003796,Ji=Math.sqrt(3)/2,tr=74.03120656864502;class er extends Pi{get isElliptic(){return!0}project(t){const e=T,s=Math.asin(Ji*Math.sin(t[1]*e)),i=s*s,r=i*i*i;return[(t[0]-this.scroll)*e*Math.cos(s)*tr/(Ji*(Xi+3*qi*i+r*(7*Ki+9*Qi*i))),s*tr*(Xi+qi*i+r*(Ki+Qi*i))]}backward(t){const e=t[0]/tr,s=t[1]/tr,i=180/Math.PI;let r,n,o,a,h,l=s;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Xi+qi*r+n*(Ki+Qi*r))-s,a=Xi+3*qi*r+n*(7*Ki+9*Qi*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=i*Ji*e*(Xi+3*qi*r+n*(7*Ki+9*Qi*r))/Math.cos(l),d=i*Math.asin(Math.sin(l)/Ji);return Math.abs(c)>180?[NaN,NaN]:[c,d]}}const sr=63.78137,ir=Math.PI/180;class rr extends Pi{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]));const s=Math.sin(e*ir);return[sr*(t[0]-this.scroll)*ir,sr*Math.log((1+s)/(1-s))/2]}backward(t){return[t[0]/(sr*ir),(2*Math.atan(Math.exp(t[1]/sr))-Math.PI/2)/ir]}}const nr=Math.PI/4,or=Math.PI/180,ar=63.78137;class hr extends Pi{project(t){return[(t[0]-this.scroll)*or*ar,79.7267125*Math.log(Math.tan(nr+.4*t[1]*or))]}backward(t){return[t[0]/ar/or,2.5*(Math.atan(Math.exp(t[1]/ar*.8))-nr)/or]}}class lr extends Ps{}class cr extends Ms{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new lr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return is.create(t,_s,0,0,e,e,2)}}cr.type="bar",cr.defaults=ze(Ms.defaults,{barWidth:.7});class dr extends Ge{constructor(t){super(t.chart),this.gauge=t}}class _r extends dr{}_r.defaults=ze(Ge.defaults,{visible:!1});class ur extends dr{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}ur.defaults=ze(Ge.defaults,{});class pr extends dr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}pr.defaults=ze(Ge.defaults,{thickness:"100%",stroked:!1});class gr extends dr{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}gr.defaults=ze(Ge.defaults,{visible:!1,radius:3,length:"100%",offset:0});class mr extends dr{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}mr.defaults=ze(Ge.defaults,{visible:!1,radius:5});class fr extends We{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}fr.defaults=ze(We.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class br{constructor(){this.setCenterX(wr.DEF_CENTER),this.setCenterY(wr.DEF_CENTER),this.setRadius(wr.DEF_RADIUS),this.setInnerRadius(wr.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(w(t,wr.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(w(t,wr.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(w(t,wr.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(w(t,wr.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=p(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=b(t%360,0),i=g(0,p(360,b(e,360)));this._startRad=V+T*s,this._handRad=T*s,this._sweepRad=T*i}}class yr extends As{_readObject(t,e){super._readObject(t,e)}}class wr extends Vs{_doInit(t){super._doInit(t),t.face=(this._face=new _r(this))._init(),t.rim=(this._rim=new ur(this))._init(),t.valueRim=(this._valueRim=new pr(this))._init(),t.hand=(this._hand=new gr(this))._init(),t.pin=(this._pin=new mr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new fr(this.chart))._init(),this._props=new br}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 yr(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._op.startAngle,this._op.sweepAngle)}}wr.DEF_CENTER="50%",wr.DEF_RADIUS="50%",wr.DEF_INNER="80%",wr.type="gauge",wr.defaults=ze(Vs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class xr extends Ge{constructor(t){super(t.chart),this.gauge=t}}class vr extends xr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}vr.defaults=ze(Ge.defaults,{thickness:3});class Sr extends xr{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}Sr.defaults=ze(Ge.defaults,{thickness:1.5,length:"55%"});class Cr extends Sr{}Cr.defaults=ze(Sr.defaults,{thickness:1,length:"80%"});class Lr extends Sr{}Lr.defaults=ze(Sr.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class kr extends xr{}kr.defaults=ze(Ge.defaults,{length:5});class Pr extends xr{}Pr.defaults=ze(Ge.defaults,{step:1,offset:0});class Mr extends xr{}Mr.defaults=ze(Ge.defaults,{radius:4});class Ar extends We{}Ar.defaults=ze(We.defaults,{text:"RealMap",position:"top"});class Er extends As{getTime(){const t=this.time;return t instanceof Date?t:o(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=b(e.time,NaN),this.timezone=b(e.timezone,NaN)}}class Vr extends Es{_doInit(t){super._doInit(t),t.face=(this._face=new Ge(this.chart))._init(),t.rim=(this._rim=new vr(this))._init(),t.hourHand=(this._hourHand=new Sr(this))._init(),t.minuteHand=(this._minuteHand=new Cr(this))._init(),t.secondHand=(this._secondHand=new Lr(this))._init(),t.tick=(this._tick=new kr(this))._init(),t.tickLabel=(this._tickLabel=new Pr(this))._init(),t.pin=(this._pin=new Mr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Ar(this.chart))._init()}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){const s=p(t,e);return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new Er(t)}_doApply(t){const e=this;super._doApply(t),function(t,s,i){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=Y(w(e._centerX=t,Vr.DEF_CENTER),!0)),e._centerYDim&&s===e._centerY||(e._centerYDim=Y(w(e._centerY=s,Vr.DEF_CENTER),!0)),e._radiusDim&&i===e._radius||(e._radiusDim=Y(w(e._radius=i,Vr.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Vr.DEF_CENTER="50%",Vr.DEF_RADIUS="50%",Vr.type="clock",Vr.defaults=ze(Es.defaults,{centerX:Vr.DEF_CENTER,centerY:Vr.DEF_CENTER,radius:Vr.DEF_RADIUS,active:!0,size:70});class Tr extends ws{_readObject(t,e){super._readObject(t,e),this.center=e.center,this.value=e.value}}class Nr extends ps{}Nr.defaults=ze(ps.defaults,{hoverColor:"white"});class Dr extends xs{get areaCount(){return this._map.areaCount}get detail(){return this._detail}get color(){return this._colorObj}getValueRange(){return{min:this._minValue,max:this._maxValue}}_createLabel(t){return new Nr(t)}_doApply(t){i(t.detail)?this._detail||(this._detail=new Dr(this.chart)):t.hasOwnProperty("detail")&&(this._detail=null),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Tr(t)}_prepareRender(){super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=n,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=n),this._colorRanger=new zs(t)}else this._colorRanger=null}_doLoadPoints(t){this._useMapData&&(t=this._map._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),this._map}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Pe(this._calcedColor),this._color=this._colorObj?this._colorObj.toString():null}getColorScale(){return this._op.colorScale}}Dr.type="feature",Dr.defaults=ze(xs.defaults,{selectable:!1,detailZoom:250});class Rr extends vs{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class $r extends xs{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new ps(this.chart))._init()}getFigure(t){return t.figure||this.options.figure}get innerLabel(){return this._innerLabel}_doApply(t){super._doApply(t)}_createPoint(t){return new Rr(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}$r.type="figure",$r.defaults=ze(xs.defaults,{position:"top"});class Or extends vs{_readObject(t,e){super._readObject(t,e)}}class Fr extends Ss{_doApply(t){super._doApply(t)}_createPoint(t){return new Or(t)}_defLabelOff(){return 2}}Fr.type=es,Fr.defaults=ze(Ss.defaults,{mode:"grid"});class Ir extends ps{}Ir.defaults=ze(ps.defaults,{visible:!1});class Br extends as{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class jr extends bs{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Ir(t)}_createPoint(t){return new Br(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this._op.rootUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}jr.type="image",jr.defaults=ze(bs.defaults,{imageWidth:24,imageHeight:24,position:"top"});class zr extends Rt{constructor(t,e){super(t,_s),this.add(this._area=new Ft(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Ft(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(s.join(" "))}}class Hr extends Ps{}class Gr extends Ge{}Gr.defaults=ze(Ms.defaults,{visible:!1});class Yr extends Ms{_doInit(t){super._doInit(t),t.area=(this._area=new Gr(this.chart))._init()}get area(){return this._area}_createPoint(t){return new Hr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new zr(t,e)}}Yr.type="line",Yr.defaults=ze(Ms.defaults,{});class Wr 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){return this.area?w(super.getParam(t),this.area.source.props[t]):super.getParam(t)}}class Zr extends ps{}Zr.defaults=ze(ps.defaults,{visible:!1,hoverColor:"white"});class Ur extends Ge{}Ur.defaults=ze(Ge.defaults,{enabled:!0,autoMapChange:!0});class Xr extends xs{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Ur(this.chart))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get color(){return this._colorObj}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){const s=this._points.getPoints();for(const i of s)if(i.area.source.props[t]===e)return i}getBounds(t){}getCenter(t){return t instanceof Wr||(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))}_createLabel(t){return new Zr(t)}$_createDetail(){return this._detail||(this._detail=new Xr(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Wr(t)}_getPointCallbackArgs(t,e){return super._getPointCallbackArgs(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){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=n,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=n),this._colorRanger=new zs(t)}else this._colorRanger=null}_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,s=(r(t)?t[0]:t)||"id",i=(r(t)?t[1]:t)||"id",n=e.getAreaMap(s),o=this._areaPts;o.clear(),this._points.forEach((t=>{t.area="id"===i?n[t[i]]:n[t.source[i]],t.area&&o.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Pe(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}}Xr.type="map",Xr.defaults=ze(xs.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250});class qr extends ps{}qr.defaults=ze(ps.defaults,{visible:!1});class Kr extends ws{}class Qr extends Ge{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 Be),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,s,i){this._richTextImpl&&this._richTextImpl.build(t,e,s,void 0,i)}}Qr.defaults=ze(Ge.defaults,{});class Jr extends Qr{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Jr.defaults=ze(Qr.defaults,{text:"${name}"});class tn extends Qr{}tn.defaults=ze(Qr.defaults,{text:"${value}"});class en extends xs{_doInit(t){super._doInit(t),t.header=(this._header=new Jr(this))._init(),t.divider=(this._divider=new Ge(this.chart))._init(),t.body=(this._body=new tn(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:b(this._width,dt.clampEx(t,this._minWidth,this._maxWidth)),height:b(this._height,dt.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new qr(t)}_createPoint(t){return new Kr(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t),this._vertical="horizontal"!==t.orientation,this._minWidth=+t.minWidth,this._minHeight=+t.minHeight}}en.DEF_MIN_WIDTH=80,en.DEF_MIN_HEIGHT=50,en.type="panel",en.defaults=ze(xs.defaults,{orientation:"vertical",minWidth:en.DEF_MIN_WIDTH,minHeight:en.DEF_MIN_HEIGHT,position:"top"});class sn extends Cs{}class rn extends ks{getRadius(t){return b(W(this._radiusDim,t),30)}_createPoint(t){return new sn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius")}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._op.startAngle%360,0),s=g(0,p(360,b(this._op.totalAngle,360)));this._startRad=V+T*e,this._totalRad=T*s}}rn.type="pie",rn.defaults=ze(ks.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class nn extends Ft{constructor(t,e){super(t,_s),this._rd=e,this.setPath(Lt.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 on extends vs{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class an extends Ss{getExt(t,e){const s=b(t.radius,this._rd)*e;return{cx:0,cy:2*-s,rd:s,innerRd:s*this._innerRd}}_doApply(t){super._doApply(t),this._rd=b(t.radius,an.DEF_RADIUS),this._innerRd=b(t.innerRadius,0)}_createPoint(t){return new on(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new nn(t,e/2)}}an.DEF_RADIUS=9,an.type="pin",an.defaults=ze(Ss.defaults,{radius:an.DEF_RADIUS,innerRadius:0,position:"top"});class hn extends Rt{constructor(t,e){super(t,_s),this._size=e,this.add(this._marker=new Ft(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);Lt.setShape(this._marker,this._shape,e,e)}}class ln extends vs{_readObject(t,e){super._readObject(t,e)}}class cn extends Ss{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(t){return this._op.shape||this._shape}getRadius(){return b(this._op.radius,cn.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new ln(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new hn(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),p(e,2*this._op.radius)),s}}cn.type="point",cn.defaults=ze(Ss.defaults,{radius:5,position:"center"});class dn extends Rt{constructor(t,e){super(t,_s),this.add(this._line=new Ft(t)),this.add(this._arrow=new Ft(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],s=e[e.length-2],i=e[e.length-1],r=O(Math.atan2(i[1]-s[1],i[0]-s[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${i[0]} ${i[1]} L ${i[0]-4} ${i[1]-6} L ${i[0]+4} ${i[1]-6} Z`),this._arrow.setRotation(i[0],i[1],r)}}class _n extends as{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 l(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var s;const i=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(i(t)):e.push(t)})):o(t)&&e.push(t),e};super._readObject(t,e),this.name=e.name,this.coords=null!==(s=e.coords)&&void 0!==s?s:e.coord,this.path=null!=e.path?i(e.path):void 0}}class un extends bs{needMapScale(){return!0}needRemoveAnimation(){return!0}_createPoint(t){return new _n(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const s=l({},t);if(r(s.coords)){const t=s.coords.slice();o(t[0])&&(t[0]=e[t[0]]),o(t[1])&&(t[1]=e[t[1]]),s.coords=t}return s})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new dn(t,e)}}un.type=Je,un.defaults=ze(bs.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class pn extends vs{_readObject(t,e){super._readObject(t,e),this.length=t._lengthFielder(e),this.angle=t._angleFielder(e)}}class gn extends Ss{_createFielders(t){super._createFielders(t),this._lengthFielder=this._createFielder(t.lengthField||"length"),this._angleFielder=this._createFielder(t.angleField||"angle")}_createPoint(t){return new pn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){}legendMarker(t,e){}}gn.type="vector",gn.defaults=ze(Ss.defaults,{headType:"openArrow",lengthField:"length",angleField:"angle",startAngle:0});class mn extends Cs{}class fn extends ks{getPointGrid(t,e,s){const i=this._runGrid=[],r=this.$_caculate(t,e,s),n={rowCount:this._rowCount,colCount:this._colCount,grid:i,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:i,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new mn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||fn.ROW_COUNT,this._colCount=t.colCount||fn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||fn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||fn.CELL_SIZE,this._gap=b(t.gap,fn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t){super._doPrepareRender(t),this._visPoints.forEach((t=>{t._sum=r(t.values)?t.values.reduce(((t,e)=>t+e)):0}))}$_caculate(t,e,s){const i=(Math.max(e.min,t._sum*b(s,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(i);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,s=e.length;for(let i=0;i<s;i++)if(isNaN(e[i][t]))return i;return s}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:s,colCount:i}=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==s-1?(h++,a=this.$_rows(h)):h===i-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:s,colCount:i}=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==i-1?(a++,h=this.$_cols(a)):a===s-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}}fn.ROW_COUNT=10,fn.COL_COUNT=10,fn.THRESHOLD=1,fn.CELL_SIZE=5,fn.GAP=2,fn.type="waffle",fn.defaults=ze(ks.defaults,{rowCount:fn.ROW_COUNT,colCount:fn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:fn.THRESHOLD,cellSize:fn.CELL_SIZE,gap:fn.GAP});class bn extends ki{static loadMap(t){return i(t)&&i(t.source)&&r(t.source.features)||i(t)&&i(t.map)&&r(t.map.features)?new bn(t):void 0}_doLoad(t){const e=t.features,s=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Ci(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,s.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,s.push(e)}}})),s}}class yn extends ki{static loadMap(t){if(i(t)){const e=t.source;if(i(e)&&"Topology"===e.type&&i(e.objects)&&r(e.arcs))return new yn(t);const s=t.map;if(i(s)&&"Topology"===s.type&&i(s.objects)&&r(s.arcs))return new yn(t)}}_doLoad(t){const e=t=>t.map((t=>t.map((t=>t<0?a[~t].slice().reverse():a[t])).flat())),s=t.objects,n=t.arcs,o=t.transform,a=[],h=[];if(i(o)){const t=o.scale[0],e=o.scale[1],s=o.translate[0],i=o.translate[1];n.forEach((r=>{let n=0,o=0;const h=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+s,r[1]=(o+=r[1])*e+i,r)));a.push(h)}))}else n.forEach((t=>{a.push(t.slice())}));for(const t in s)if("GeometryCollection"===s[t].type){const i=s[t].geometries;r(i)&&i.forEach((t=>{const s=new Ci(t.id,t.properties);switch(t.type){case"Polygon":s.polygon=e(t.arcs),h.push(s);break;case"MultiPolygon":s.polygons=t.arcs.map((t=>e(t))),h.push(s)}}))}return h}}class wn extends bt{constructor(t,e,s,i){super(),this.view=t,this.zoom=e,this.duration=b(s,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==i||i()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class xn extends bt{constructor(t,e,s,i,r){super(),this.view=t,this.zoom=e,this.coords=s,this.duration=b(i,300),this._old=t.zoom,this.view.$_moveTo(s),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 vn extends Ge{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}vn.defaults=ze(bs.defaults,{visible:void 0,globeFill:"lightblue"});const Sn={zoom:1,panX:1,panY:1};class Cn extends Ge{constructor(t){super(t),this._prj=(new Ui).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=mt.create(0),this._wMap=null,this._reCalculateFlag=!0,this._dragDistance=0,this._annotations=new Qe(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new vn(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get rotationX(){return this._prj instanceof Ei?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Ei?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){var t;return null!==(t=this._op.scroll)&&void 0!==t?t:0}set scroll(t){this.updateOption("scroll",t)}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._op.zoom}set zoom(t){t=Math.max(100,t),this.updateOption("zoom",t)}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=[this._map.cx,this._map.cy];return this._prj?this._prj.backward(t):t}get map(){return this._map}set dragDistance(t){this._dragDistance=t}isDrilldowned(){return!1}prepareLayout(t,e){var s;const i=function(t,e,s){const i=Math.max(0,(e-t)/2);return Math.max(-i,Math.min(s,i))},r=this._prj,n=this._map=this.chart.map;this._reCalculateFlag&&(this._wMap=this.$_calcWMap(),this._reCalculateFlag=!1);const o=this._wMap,a=n.y2-n.y1,h=this._wRate=t/o,l=this._hRate=e/a,c=this._zoom/100,d=this._scale=c*Math.min(h,l),_=b(this._op.panX*d,0),u=b(this._op.panY*d,0),p=i(t,o*d,_)/d;this.isScrollable()?(this.scroll+=(360*this._dragDistance||p)/(o*d),this._dragDistance=0):this._panX=p,this._panY=i(e,a*d,u)/d;const g=(this.scroll%360+360)%360*(o/360),m=t/2-(n.x1+o/2)*d-(this._panX+g)*d,f=e/2+(n.y1+a/2)*d-this._panY*d,y=h/d*o,w=l/d*a,x=n.x1+o/2-y/2+this._panX,v=n.y1+a/2-w/2-this._panY;return r&&(r.scroll=null!==(s=this._op.scroll)&&void 0!==s?s:0),this._vRect=mt.create(x,v,y,w),{scale:d,wMap:o,hMap:a,tx:m,ty:f}}$_calcWMap(){const t=new this._prj.constructor,e=this._map;let s=1/0,i=-1/0;if(t instanceof Ei||![er].some((e=>t instanceof e)))return e.x2-e.x1;const r=e=>{e[0].forEach((e=>{const r=t.project(e);s=Math.min(s,r[0]),i=Math.max(i,r[0])}))};for(let t=0;t<e.areaCount;t++){const s=e.get(t);s.source.polygons?s.source.polygons.forEach(r):r(s.source.polygon)}return i-s}getPoint(t){return this._points[t]}isVisible(t){return this._vRect.contains(t[0],t[1])&&!this._prj.project(t).outside}isWorldMap(){const{h1:t,h2:e}=this.map;return e-t==360}isScrollable(){return this.options.scrollable&&this.isWorldMap()}setZoom(t,e=300){let s,r;a(e)?r=e:n(e)?(s=e,r=300):i(e)&&(s=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new wn(this,t,r,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,s=300){new xn(this,t,e,s,null).start()}zoomToArea(t,e=.7,s=300){const i=this.map.areaOf(t),r=i.getCenter(),n=(this.map.x2-this.map.x1)*e,o=(this.map.y2-this.map.y1)*e,a=n/(i.x2-i.x1)*100,h=o/(i.y2-i.y1)*100,l=Math.min(a,h);new xn(this,l,r,s,null).start()}zoomToBounds(t,e,s=300){const i=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]),n=[(t[0]+e[0])/2,(t[1]+e[1])/2];try{const t=Math.abs(this.map.x2-this.map.x1)/i*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,o=Math.min(t,e);new xn(this,o,n,s,null).start()}catch(t){console.error(t)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[s,i]=this._prj.project(t);this.isScrollable()?this.scroll=t[0]:this.panX=s-e.cx,this.panY=e.cy-i}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,s){const i=t in Sn;i&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,s)}finally{i&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let s=!0;for(const e in t)if(!(e in Sn)){s=!1;break}s&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{s&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,n,a;const h=this;var l;super._doApply(t),s.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new Ei;break;case"equalearth":h._prj=(new er).prepareSecond();break;case"miller":h._prj=(new hr).prepareSecond();break;case"mercator":h._prj=(new rr).prepareSecond();break;default:h._prj=(new Ui).prepareSecond()}return h._reCalculateFlag=!0,!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(e=this.chart)||void 0===e?void 0:e.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof Ei&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,b(t,100)))}(t.zoom);const u=this._points={};r(t.points)&&t.points.forEach((t=>{r(t)&&t.length>=3&&o(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&o(t.id)&&(u[t.id]=r(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(n=this._op).onZoomChanged)||void 0===a||a.call(n,{zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Cn.defaults=ze(Ge.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class Ln extends Ge{getAlign(t){this._op.align}}Ln.defaults=ze(Ge.defaults,{text:"RealMap v1.0",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});class kn extends Xr{}class Pn extends Ge{}Pn.defaults=ze(Ge.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default"});class Mn extends xt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._point_shaes=vt.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new ee,this._series=new ys(this),this._annotations=new Qe(this),this._colorScales=new Qs(this),this._bubbleScales=new Is(this),(this._chartOptions=new Pn(this))._init(),(this._axis=new _i(this))._init(),(this._body=new Cn(this))._init(),(this._exporter=new Js(this))._init(),(this._title=new zi(this))._init(),(this._subtitle=new Hi(this))._init(),(this._legend=new js(this))._init(),(this._zoomPanel=new Ii(this))._init(),(this._drilldownPanel=new Bi(this))._init(),(this._mapScale=new Oi(this))._init(),(this._credits=new Ln(this))._init(),(this._tooltip=new Gi(this))._init(),this.options=Object.assign({},Mn.defaults),i(t)?this._load(t):this._initOptions(),this._selection=new ji(this)}_initOptions(){}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}_getSeriesType(t){return o(t)&&us[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&qe[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return!0}loadAnimatable(){return this._loadAnimatable}isVisible(t){return t&&this.getProjection(!1).isVisible(t)}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var s,i;this._fireEvent("onModelChanged",t,"selection"),null===(i=(s=this._chartOptions.options).onSelectionChanged)||void 0===i||i.call(s,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(t){const e=this._body._prj;return e?t&&e.second||e:(new Ui).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this._fireEvent("onProjectionChanged",this,this.body._prj)}zoomChanged(t){this._fireEvent("onZoomChanged",this,t)}mapChanged(t){this._fireEvent("onMapChanged",this,t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,s){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this.options.type}get chartOptions(){return this._chartOptions}get legend(){return this._legend}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,s=(t instanceof Ri?t:this.getMap(t))||this._maps[0];s!==e&&(this._baseMap=s,this._loading||(this._baseMap.reset(),this.mapChanged(s)))}get axis(){return this._axis}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 Xr))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Xr&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}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 o(t)?this.mapByName(t):this.mapAt(+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)}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&He(n={},r.base),i(r[s])&&(n||(n={}),He(n,r[s])),n?He(n,t):t}_setProperties(t,e=!0){const s=this.options;for(const e in Mn.defaults)t.hasOwnProperty(e)&&(s[e]=t[e])}_load(t){const e=this.options;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(w(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const s=r(t.map)?t.map:i(t.map)?[t.map]:null;return r(s)&&(s.forEach(((t,e)=>{if(!1!==t.enabled){const s=yn.loadMap(t)||bn.loadMap(t),i=s&&new Ri(this,s,e)._prepareSecond();this._maps.push(i)}})),this.setBaseMap(void 0)),e.axis=this._axis._load(t.axis),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.zoomPanel=this._zoomPanel._load(t.zoomPanel),e.drilldownPanel=this._drilldownPanel._load(t.drilldownPanel),e.credits=this._credits._load(t.credits),e.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series,kn),this._series.get(0)instanceof Xr||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._load(t.mapScale),e.exporting=this._exporter._load(t.exporting),this._loading=!1,this}$_loadTemplates(t){const e=this._bases={axis:{},series:{},gauge:{},annotation:{}};if(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=l({},r))}["@series","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return He(He({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?He(He({},s),t):s}));return t}}else this.assignTemplates=void 0}prepareRender(){this._series._prepareRender(this._optionsDirty),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legend._prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Ge||s instanceof Ye||s instanceof ee)&&s.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(){return this._series.getLegendSources().concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&this._optionChanged(s),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._optionChanged(null),s}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.first}getBubbleScale(t){return null===t?null:this._bubbleScales.first}drilldown(e,s){return t(this,void 0,void 0,(function*(){if(!(e instanceof Xr&&e.detail))return;const t=e.drilldown,i=e.detail;if(!t.options.enabled)return;i.options.dataUrl&&(i.updateOption("data",yield fetch(i.options.dataUrl).then((t=>t.json()))),delete i.options.dataUrl);const r=e.map,n=this.getMap(i.options.map)||r;t.options.autoMapChange&&n!==r&&this.setBaseMap(n),e.showDetail(),s&&this._body.zoomToArea(s)}))}drillup(e){return t(this,void 0,void 0,(function*(){if(!((e=e||this.firstVisible)instanceof Xr&&e.parent))return;const t=e.drilldown;if(!t.options.enabled)return;const s=e.parent,i=this.map;t.options.autoMapChange&&s.map!==i&&this.setBaseMap(s.map),e.showParent(),this._body.zoom=100}))}_visibleChanged(t){}_hoverAreaChanged(t,e,s){var i,r;null===(r=(i=this._body.options).onHoverArea)||void 0===r||r.call(i,{area:null==e?void 0:e.getInfo(),oldArea:null==s?void 0:s.getInfo()})}_areaClicked(t,e){var s,i;null===(i=(s=this._body.options).onClickArea)||void 0===i||i.call(s,{area:null==e?void 0:e.getInfo()})}}Mn.defaults={type:"map",startOfWeek:0},bs.register(Xr,Dr,cn,an,gn,cr,rn,$r,Ds,un,jr,Yr,Fr,en,fn,wr,Vr),Ke.register(Yi,Wi,Zi);const An="$ctrl";class En{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Mn(t,this),null==e||e(this._obj,null)}get options(){return this._obj.options}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 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}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return o(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return o(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 ";dt.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Mn):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,dt.log("chart-items:",je),dt.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}loadAsync(e,s=!1,r){var n;return t(this,void 0,void 0,(function*(){if(i(e)){const t="load chart ";dt.LOGGING&&console.time(t),yield C.loadConfigAsync(e);let i=this._obj,o=i;this._loaded?(i.destroy(),o=this._obj=new Mn):(this._loaded=!0,i=null),o._load(e),o._loadAnimatable=s,this._loadCallback=r,dt.log("chart-items:",je),dt.LOGGING&&console.timeEnd(t),null===(n=this._modelCallback)||void 0===n||n.call(this,o,i)}return this}))}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,s){}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)}drilldown(e,s){return t(this,void 0,void 0,(function*(){const t=e instanceof Xr?e:(a(e)?this._obj.seriesAt(e):this._obj.seriesByName(e))||this._obj.firstMapSeries;t instanceof Xr&&this._obj.drilldown(t,s)}))}drillup(e){return t(this,void 0,void 0,(function*(){const t=e instanceof Xr?e:(a(e)?this._obj.seriesAt(e):this._obj.seriesByName(e))||this._obj.firstMapSeries;t instanceof Xr&&this._obj.drillup(t)}))}}class Vn{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}touchX(){return this._touchX}touchY(){return this._touchY}pointerDown(t){let e;return e=this.$_pointerToPoint(t),this._prevX=e.x,this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(this._clearTouchEffects(),s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,s=this.dragging,{x:i,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i<0||i>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?s&&this.$_stopDragTracker(e,i,r,!0):s?this.$_doDrag(t,e,i,r):(!this._dragTracker&&Math.abs(this._prevX-i)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!s)&&this.$_startMove(t,e,i,r),this._prevX=i,this._prevY=r,this._touches.push({x:i,y:r,t:t.timeStamp})):s&&this.$_stopDragTracker(e,i,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(i,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,s,i)}pointerCancel(t){const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,s,i,!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])),t.cancelable&&t.preventDefault()}else this._doTouchStart(t,t.target)}touchMove(t){if(t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);this._doPinch(e-this._distance),this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}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,s){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,s){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,s,i,r){return!1}_getDragTracker(t,e,s){return null}$_startDrag(t,e,s,i,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.dragging&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}$_pointerToPoint(t){const e=this._control.dom().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}$_checkSwipe(t,e){const s=this._touches,i=s.length;if(i<2)return;const r=s[i-1];let n=s[i-2];if(r.t-n.t<=100)for(let t=i-3;t>=0&&(n=s[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,s=Math.log(.1/c)/Math.log(d),i=c*(1-Math.pow(d,s+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?X.DOWN:n>135&&n<=225?X.LEFT:n>225&&n<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*s,1.3*i))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*s,1.3*i)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const s=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(s*s+i*i)}}class Tn extends wt{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,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this._dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this._dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,s){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}swipe(t,e,s){if(this._doSwipe(t,e,s))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,s){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_canAccept(t,e,s){return!0}_doCompleted(t,e,s){}_doEnded(t=-1,e=-1){}}class Nn extends Tn{_doDrag(t,e,s,i,r){const n=this.control.model.body;n.rotationX+=(i-e)/2,n.rotationY-=(r-s)/2}}class Dn extends Tn{constructor(t){super(t);const e=this.$_mapView();this._oldX=e.panX,this._oldY=e.panY}_doStart(t,e,s,i,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=s,super._doStart(t,e,s,i,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,s,i,r){const n=this.$_mapView();return n.panX=this._oldX-(i-this._xStart)/n.scale,n.panY=this._oldY-(r-this._yStart)/n.scale,n.dragDistance=e-i,!0}$_mapView(){return this.control.model.body}}class Rn extends Vn{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,s){this.dragging?this.dragTracker instanceof Dn&&(this._clickElement=null):0===s.buttons&&this.$_chartView().pointerMoved(t,e,s.target)}_doClick(t){const e=t.target,s=ct?t.ctrlKey:t.metaKey,i=this.$_chart(),r=this.$_chartView(),n=i.chartOptions.options.clickAction,o=r.getButton(e);let a,h,l;if(o)o.click();else if(a=r.legendByDom(e))if(a.source instanceof as){const t=a.source;i.seriesByPoint(t)}else a.source.canHide()&&(a.source.visible=!a.source.visible);else if(e===this._clickElement){if(h=r.seriesByDom(e))h.click(e);else if(l=r.creditByDom(e))l.click(e);else if(r.drilldownPanelView().click(e))return;if("select"===n)h&&h.model.canSelect()&&(s?h.toggleSelect(e):h.select(e,!0))}}_doDblClick(t){const e=this.$_chart(),s=this.$_chartView(),i=e.chartOptions.options.dblClickAction;if("drilldown"===i){const i=e.firstMapSeries;if(i){const r=t.target,n=s.bodyView().getSeries(i).pointByDom(r);n&&n.point instanceof Wr&&e.drilldown(e.firstMapSeries,n.point.area.id)}}}_doWheel(t){const e=this.$_chart().body,s=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.options.zoomable&&(e.zoom+=-s/b(Math.max(1,e.options.wheelZoomFactor),4)),t.preventDefault(),!0}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,s){return this.$_chart().isGlobe?new Nn(this.control):this.control.chartView().bodyView().canScroll()?new Dn(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}}class $n{static empty(){return new $n}static create(t=0,e=0){return new $n(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new $n(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}$n.EMPTY=new $n;class On{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new On(t,t,t,t):new On(t,t,e,e):new On(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new On(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=b(t.paddingLeft,0),this.right=b(t.paddingRight,0),this.top=b(t.paddingTop,0),this.bottom=b(t.paddingBottom,0),this}applyMargin(t){return this.left=b(t.marginLeft,0),this.right=b(t.marginRight,0),this.top=b(t.marginTop,0),this.bottom=b(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+"}"}}On.Empty=Object.freeze(new On),On.Temp=new On;class Fn extends Rt{constructor(t,e=P){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Fn.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Fn.IGNORE_ATTRS={width:"",height:""};class In extends Rt{constructor(t,e=P){super(t,e,"g"),Rt.DEBUGGING&&(this.add(this._debugRect=new is(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,s,i);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Rt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new is(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,s,i){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Bn extends In{constructor(t,e,s){super(t,e),this._margins=new On,this._paddings=new On,this.add(this._background=new is(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i){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,s,i);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 jn extends Fn{measure(t,e,s,i){const r=this._doMeasure(t,e,s,i);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,s){return this._doLocateInner(t,e,s),this}}class zn extends In{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class Hn extends wt{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e,s){const i=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(i);n.push(e),null==s||s(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._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 s of t)this.free(s,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}find(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)if(t(e[s]))return e[s]}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 s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._owner.add(e),e}_getElementId(t){}}class Gn extends In{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new is(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Ve(t,"rm-legend-item-label")),this._label.anchor=Me.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i){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.options.markerVisible)?this._marker.bbox():_t,n=pt(this._label.bbox());return this._gap=b(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:g(r.height,n.height)}}_doLayout(t){const e=this._rMarker,s=b(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.bbox().height)/2)}}class Yn extends Bn{constructor(t){super(t,Yn.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Hn(this,Gn)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=b(r.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==r.location?b(r.gap,0):0,o?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,o,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.sameTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,d=a.top+h.top;let _,u=c,p=d;this._itemViews.forEach((t=>{var e;const i=t.model.source,r=i.legendColor();t._marker.setColor(r),null===(e=i.setLegendMarkerStyle)||void 0===e||e.call(i,t._marker),s&&i.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,c=o.lineGap||0,d=h.count,_=this._rowViews=[],u=this._sizes=[];let p,m,f,b;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,+o.markerSize||Bs.MARKER_SIZE)),e.measure(t,a[s],r,n)}));let y=0,w=0;if(s){for(;y<d;)b=h.get(y),w%i==0?(_.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=n?(f.push(b),w++,y++):w=0);this._wMarkers=[],p=m=0,_.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=g(s,t.mw),r=g(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=g(m,i),p+=s,u.push(s),this._wMarkers.push(r)})),p+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%i==0?(_.push(f=[b]),p=b.mw,w++,y++):(p+=l+b.mw,p<=r?(f.push(b),w++,y++):w=0);p=m=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=g(s,t.mh)})),e+=l*(t.length-1),p=g(p,e),m+=s,u.push(s)})),m+=c*(_.length-1)}return{width:p,height:m}}}Yn.LEGEND_CLASS="rm-legend";const Wn={};class Zn extends Bn{static register(...t){t.forEach((t=>{Wn[t[0].type]=t[1]}))}constructor(t,e){super(t,Zn.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s),this._layoutView(t,0,0,e,s)}_layoutView(t,e,s,i,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,s,i,r,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,o=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Zn.CLASS_NAME="rm-annotation";class Un{static interpolate(t,e){if(e instanceof Ei==!1)return t;const s=[];let i=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(i||(i=a,t.push(a)),n&&r){const t=Vi(r,a);for(const i of t){const t=e.project(i);t.outside||s.push(t)}}s.push(h),r=a,n=!1}}return s}}class Xn{static box(t,e,s,i,r){const n=Math.floor(Math.abs(s-t)/20),o=this.boxPoints(t,e,s,i,n);return this.coordsToPath(Xn.toPixelCoord(r,o))}static ellipse(t,e,s,i,r,n=40){const o=this.arcCoords(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,n);return this.coordsToPath(Xn.toPixelCoord(r,o))}static geoCircle(t,e,s,i,r,n=!1,o=40){const a=this.arcCoords(t,e,s,i,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 Ei?Un.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let s=!1;for(const i of t){if(!!i.outside){s=!1;continue}const[t,r]=i;s?e.push("L",t,r):(e.push("M",t,r),s=!0)}return e}static horizontalLineToRight(t,e,s,i){const r=[];let n=e;for(;n<=s&&(r.push([n,t]),n+i<=s);)n+=i;return 0!==r.length&&r[r.length-1][0]===s||r.push([s,t]),r}static horizontalLineToLeft(t,e,s,i){const r=[];let n=s;for(;n>=e&&(r.push([n,t]),n-i>=e);)n-=i;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,s,i){const r=[];let n=e;for(;n<=s&&(r.push([t,n]),n+i<=s);)n+=i;return 0!==r.length&&r[r.length-1][1]===s||r.push([t,s]),r}static verticalLineToDown(t,e,s,i){const r=[];let n=s;for(;n>=e&&(r.push([t,n]),n-i>=e);)n-=i;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,s,i,r){const n=[],[o,a]=t<=s?[t,s]:[s,t],[h,l]=e<=i?[e,i]:[i,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,s,i,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(s),e+Math.sin(o)*Math.abs(i)])}return u}}class qn extends Rt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=_t,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},e&&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,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Kn extends Fn{constructor(t,e){super(t,e),this.add(this._text=new Ve(t,void 0)),this._text.anchor=Me.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options,n=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===n?(this._outline&&this._outline.remove(),this._back||(this._back=new is(t,"rm-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(r.backgroundStyle)):"outline"===n?(this._back&&this._back.remove(),this._outline||(this._outline=new Ve(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(r.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new qn(t,!1)),this._icon.url=s,this._icon.width=r.width,this._icon.height=r.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){const e=this._model.options;if(t&&e.autoContrast&&this._text.setContrast(t,e.darkStyle||"rm-label-dark",e.lightStyle||"rm-label-light"),this._outline&&this._outline.parent){const t=Pe.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._icon;let e=0;const s=this._text.bbox(),i=s.width,r=s.height;let n,o=i,a=r,h=0,l=0,c=0,d=0;if(this._box=void 0,t){const s=t.bbox();switch(e=b(this._model.options.iconGap,0),h=s.width,l=s.height,this._model.getIconPos()){case"left":case"right":o+=e+h,a=Math.max(l,r);break;default:a+=e+l,o=Math.max(h,i)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),c=parseFloat(n.paddingLeft)||0,d=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,o+c+(parseFloat(n.paddingRight)||0),a+d+(parseFloat(n.paddingBottom)||0),n.rx)),t)switch(this._model.getIconPos()){case"left":t.trans(c,(a-l)/2),c+=h+e,o-=h+e;break;case"right":t.trans(c+o-h,(a-l)/2),o-=h+e;break;case"top":t.transX((o-h)/2),d+=l+e;break;case"bottom":t.trans((o-h)/2,d+r+e)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":c+=o/2,this._text.anchor=Me.MIDDLE;break;case"right":c+=o,this._text.anchor=Me.END;break;default:this._text.anchor=Me.START}return this._text.trans(c,d),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,d)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Qn extends Ft{renderLat(t,e,s,i,r){let n=r.project([e,t]),o=st(n)?`M${n[0]},${n[1]}`:"",a=e+i;const h=t=>{n=r.project(t),st(n)&&(o+=` L${n[0]},${n[1]}`)};for(;a<=s-i;)h([a,t]),a+=i;a<=s&&h([s,t]),this.setPath(o)}renderLatGlobe(t,e,s,i,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=s;)o+=i,a=r.project([o,t]);if(o<s){let e=`M${a[0]},${a[1]}`;for(o+=i;o<=s;)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+=i;this.setPath(e)}}renderLon(t,e,s,i,r){let n=r.project([t,e]),o=st(n)?`M${n[0]},${n[1]}`:"",a=e+i;const h=t=>{n=r.project(t),st(n)&&(o+=` L${n[0]},${n[1]}`)};for(;a<=s-i;)h([t,a]),a+=i;a<=s&&h([t,s]),this.setPath(o)}renderLonGlobe(t,e,s,i,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=s;)o+=i,a=r.project([t,o]);if(o<s){let e=`M${a[0]},${a[1]}`;for(o+=i;o<=s;)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+=i;this.setPath(e)}}}class Jn extends In{constructor(t,e){super(t,"rm-map-axis-grid"),this.second=e,this._latPool=new Hn(this,Qn),this._lonPool=new Hn(this,Qn)}_doInitStyles(){this.ignorePointer()}_doMeasure(t,e,s,i){return this.$_prepareLines(e,s,i),$n.create(s,i)}_doLayout(t){const e=this.model,s=e.line,i=e.lonLine,r=e.latLine,n=e.chart.getProjection(this.second),o=n.isGlobe,a=this._bounds,h=a.step,l=1/this._scale;Tt.setImportantStyle(this.dom.style,"pointer-events","none"),Tt.setImportantStyle(this.dom.style,"fill","none"),this.setStyle("strokeWidth",`${l}px`);let c=a.x1,d=a.x2;o?this._latPool.forEach(((t,e,i)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLatGlobe(a.y1+e*h,c,d,h,n)})):this._latPool.forEach(((t,e)=>{const i=a.y1+e*h;i>a.y2||i<a.y1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLat(i,c,d,h,n))}));let _=a.y1,u=a.y2;o?this._lonPool.forEach(((t,e,r)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLonGlobe(a.x1+e*h,_,u,h,n)})):this._lonPool.forEach(((t,e)=>{const r=a.x1+e*h;r>a.x2||r<a.x1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLon(r,_,u,h,n))}))}$_prepareLines(t,e,s){const i=t.chart.map,r=t.getStep(i),{x1:n,x2:o,y1:a,y2:h}="map"===this.model.fitTo?this.$_calcBoundary(i,r):this.$_calcFullBoundary();this._latPool.prepare(h-a+1),this._lonPool.prepare(o-n+1),this._bounds={x1:Math.max(-180,n),y1:Math.max(-90,a),x2:Math.min(180,o),y2:Math.min(90,h),step:r}}$_calcBoundary(t,e){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class to extends In{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Jn(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,s,i){return this._gridView.setVisible(e.grid.visible)&&this._gridView.measure(t,e.grid,s,i),$n.create(s,i)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}}class eo extends Kn{}class so extends In{constructor(t,e){super(t),this.add(this._pathView=new Ft(t)),e.add(this._labelView=new eo(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,s,i){return this.setClass(e instanceof li?"rm-axis-range-guid":"rm-axis-line-guide"),{width:s,height:i}}_doLayout(t){const e=this.model,s=e.options,i=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(i.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(s.label.text),"range"===s.type){const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(s,t,r),i.setStyle("strokeWidth",`${e}px`)}else if("band"===s.type){o||(this.add(o=this._fromView=new Ft(this.doc)),this.add(a=this._toView=new Ft(this.doc))),o.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),o.setStyle("fill","none"),o.setStyle("transform",t.trans),a.setStyle("fill","none"),a.setStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.setStyle("strokeWidth",`${h}px`),a.setStyle("strokeWidth",`${h}px`),n=this.$_renderBand(s,t,r),i.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(s,t,r),i.setStyle("fill","none"),i.setStyle("strokeWidth",`${e}px`)}i.setPath(n).setStyle("transform",t.trans)}$_renderLine(t,e,s){const{map:i,prj:r,step:n}=e;let o;if("lat"===t.axis){const r=t.position,a=i.h1,h=i.h2;o=Xn.horizontalLineToRight(r,a,h,n),this.$_renderLatLabel(a,r,e,s)}else{const a=t.position,h=i.v1,l=i.v2;o=Xn.verticalLineToUp(a,h,l,n),this.$_renderLonLabel(a,l,r,e.tf,s)}const a=o.map((t=>r.project(t)));return Xn.coordsToPath(a)}$_renderBand(t,e,s){const{map:i,prj:r,step:n}=e;let o=[];if("lat"===t.axis){const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.h1,c=i.h2;o.push(...Xn.horizontalLineToRight(a,l,c,n));const d=[...o];this._fromView.setPath(Xn.coordsToPath(d.map((t=>r.project(t))))),o.push(...Xn.verticalLineToUp(c,a,h,n));const _=Xn.horizontalLineToLeft(h,l,c,n);o.push(..._),this._toView.setPath(Xn.coordsToPath(_.map((t=>r.project(t))))),o.push(...Xn.verticalLineToDown(l,a,h,n)),this.$_renderLatLabel(l,h,e,s)}else{const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.v1,c=i.v2;o.push(...Xn.verticalLineToUp(a,l,c,n));const d=[...o],_=Xn.verticalLineToDown(h,l,c,n);o.push(..._),this._fromView.setPath(Xn.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(Xn.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(a,c,r,e.tf,s)}return Xn.coordsToPath(Xn.toPixelCoord(r,o))}$_renderRange(t,e,s){const{prj:i}=e;let r;const[n,o]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(n,a),Math.min(o,h)],e=Math.abs(a-n),s=Math.abs(h-o);r=Xn.ellipse(t[0],t[1],e,s,i)}else r=Xn.box(n,o,a,h,i);if(s.visible){const t=Math.min(n,a),r=Math.max(o,h),l=i.project([t,r]);l.outside?s.visible=!1:s.visible||(s.visible=!0),s.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-s.bbox().height)}return r}$_renderLatLabel(t,e,s,i){if(!i.visible)return;const{prj:r,map:n,tf:o}=s;let a=0,h=0;const l=i.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?i.visible=!1:i.visible||(i.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,i.trans(a,h)}$_renderLonLabel(t,e,s,i,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=s.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*i.scale+i.tx,o=c*-i.scale+i.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,s,i,r){let n="",o=e;const a=t=>{const e=i.project(t);st(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<s-r;)a([o,t]),o+=r;return o<=s&&a([s,t]),n}$_renderHorizontalLineToLeft(t,e,s,i,r){let n="",o=s;const a=t=>{const e=i.project(t);st(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>e+r;)a([o,t]),o-=r;return o>=e&&a([e,t]),n}$_renderVerticalLineToTop(t,e,s,i,r){let n="",o=e;const a=t=>{const e=i.project(t);st(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=s-r;)a([t,o]),o+=r;return o<s&&a([t,s]),n}$_renderVerticalLineToBottom(t,e,s,i,r){let n="",o=s;const a=t=>{const e=i.project(t);st(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class io extends Fn{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new is(t,"rm-crosshair-flag-back")),this.add(this._text=new Ve(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),s=parseFloat(e.paddingLeft)||0,i=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+s+(parseFloat(e.paddingRight)||0),r.height+i+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(s+r.width/2,i)}renderLonFlag(t,e,s,i,r,n,o){const a=e.project([i,s]),h=e.project([i,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,s,i,r,n){const o=e.project([s,i]),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,s,i){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(i.tx+o[0]*i.scale,Math.min(s-r.height,Math.max(0,i.ty-o[1]*i.scale-r.height/2)))}renderGlobeLatFlag(t,e,s,i,r,n,o,a){const h=e.project([s,i]),l=e.project([o,i]),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 ro extends In{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Qn(t,"rm-crosshair-line")),this.add(this._lonLine=new Qn(t,"rm-crosshair-line")),Tt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Tt.setImportantStyle(this._latLine.dom.style,"fill","none"),Tt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Tt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new io(t)),this.add(this._lonFlag=new io(t))}prepare(t,e){this._latLine.internalClearStyles();const s=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${s}px`),this._lonLine.setStyle("strokeWidth",`${s}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){var s,i,r;const n=this.model,o=n.chart.map,a=t[0],h=t[1],l=this._lonLine,c=this._latLine,d=this._lonFlag,_=this._latFlag;null!==(r=null===(i=null===(s=n.chart.axis)||void 0===s?void 0:s.grid)||void 0===i?void 0:i.getStep(o))&&void 0!==r||ro.DEFAULT_STEP;const u=ro.LINE_STEP,p="map"===n.axis.grid.fitTo,g=p?o.h1:-180,m=p?o.h2:180,f=p?o.v1:-90,b=p?o.v2:90;this._bounds={x1:g,x2:m,y1:f,y2:b};const y=[l,d,c,_],w=y.reduce(((t,e)=>t&&e.visible),!0);if(!(g<=a&&a<=m&&f<=h&&h<=b))return void y.forEach((t=>t.setVisible(!1)));w||y.forEach((t=>t.setVisible(!0)));const x=this.model.chart.getProjection(!1),v=x instanceof Ei?x:new x.constructor;this.$_renderLon(t,u,e,v),this.$_renderLat(t,u,e,v)}$_renderLon(t,e,s,i){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=i instanceof Ei;_?l.renderLonGlobe(h,o,a,e,i):l.renderLon(h,o,a,e,i);const u=this.calcTopY(s,n,i,o),p=this.calcScrolledLon(r,h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,i,d.height,s):c.renderLonFlag(g,i,a,h,u,d.width,s)}calcScrolledLon(t,e){let s=e+t.chart.getProjection(!1).scroll;return s=(s%360+360)%360,s>180&&(s-=360),s}$_renderLat(t,e,s,i){const r=this.model,n=r.chart.map,o=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=i instanceof Ei;u?l.renderLatGlobe(h,o,a,e,i):l.renderLat(h,o,a,e,i);const p=u?90-i.rotationX:o,g=i.project(t),m=this.calcRightX(s,i,_,n,g[1]);u?c.renderGlobeLatFlag(d,i,p,h,_.width,_.height,m,s):c.renderLatFlag(d,i,p,h,_.height,s)}calcTopY(t,e,s,i){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=s.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?i:n[1]}calcRightX(t,e,s,i,r){const n=[(s.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?i.x2:o[0]}}ro.LINE_STEP=1,ro.DEFAULT_STEP=1;const no="rm_map_globe_fill";class oo extends Ft{constructor(t){super(t,"rm-map-background")}render(t,e,s,i,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,s,i);else if(e.body.projection.isElliptic){const t=e.body.projection.getClipBounds();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=Lt.rectangle(s,i,r,n);if(this.setPath(c),h.isElliptic&&!(h instanceof Ei)){const{tx:t,ty:e,scale:s}=a.transformInfo;this.transEx(t,e).scale(s)}}$_renderGlobeBg(t,e,s,i,r,n,o){const a=e.options.globeFill,h=Math.max(i,r)/2;if(s=Lt.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(no),a){const e={id:no,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Kt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${no})`),this.internalSetStyleOrClass(e._style),s}}class ao extends Ft{constructor(t,e,s){super(t,e),this.setLine(s)}setLine(t,e,s,i){dt.isNum(t)?this.setPath(Lt.line(t,e,s,i)):t&&this.setPath(Lt.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Lt.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Lt.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Lt.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(Lt.line(e,t,s,t))}}class ho extends Ft{constructor(t,e,s,i){super(t,e),s&&this.setLines(s,i)}setLines(t,e){dt.isNum(t[0])?this.setPath(Lt.lines(...t)):this.setPath(Lt.lines2(...t))}}var lo;class co extends Hn{constructor(t,e){super(t,e,void 0,0)}_getElementId(t){return t.point.pid}}class _o extends Kn{constructor(t){super(t,"rm-point-label")}}class uo extends $t{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Hn(this,_o),new Hn(this,_o)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):(e.setText(n.getText(n.getValue(i,s))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const s=e.model,i=s.getPointLabels(),r=s.pointLabelCount(),n=this._labels,o=s.getLabeledPoints(),a=this._maps,h=i[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,s,i[h]),a[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class po extends Fn{constructor(t){super(t),this.add(this._line=new ho(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Ft(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Ft(t,"rm-callout-anchor"))}render(t,e,s,i){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(Lt.circle(0,0,1e4)),this._dummy.trans(s[0],s[1]),o.setVisible(t.anchorPoint.visible)){const i=wo.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;o.internalClearStyleAndClass(),r.useSeriesColor&&o.internalSetStyleOrClass(n._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(i(a,a)),o.trans(s[0],s[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(s,!1),i&&r.usePointColor&&(o.visible&&o.setFill(i),a.setStroke(i)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class go extends Bt{constructor(t){super(t),this.add(this._back=new is(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Ft(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,s){return this._mask.setPath(Lt.circle(t,e,s)),this}setRects(t,e){return t&&e?this._mask.setPath(Lt.rect(t).concat(Lt.rect(e))):this._mask.setPath(Lt.rect(t)),this}}class mo extends $t{constructor(t,e){super(t,e),this._callouts=new Hn(this,po),this._map={},this.add(this._maskLayer=new $t(t)),this._masks=new Hn(this._maskLayer,go),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,s=t.callout,i=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=s._style,a=this._map={};r.prepare(n.length,(t=>{})),i.prepare(n.length),n.forEach(((t,s)=>{const n=i.get(s);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(s).id}`),n.index=s,a[t.pid]=n)})),this.setStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const s={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},i=this._masks.get(t.index);return i.setBackground(s),i}}class fo extends It{constructor(t,e=!1){super(t,wo.POINT_CLASS,e)}tooltipColor(){return this.getFill()}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.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!=s;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 s=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;i.curve(s,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}i.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}}class bo extends $t{}const yo={};class wo extends zn{static register(...t){t.forEach((t=>{yo[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof wo)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Lt[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,s=!0){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,s,i)=>({x:t-s/2,y:e-i}),bottom:(t,e,s,i)=>({x:t-s/2,y:e}),center:(t,e,s,i)=>({x:t-s/2,y:e-i/2}),left:(t,e,s,i)=>({x:t-s,y:e-i/2}),right:(t,e,s,i)=>({x:t,y:e-i/2})},this._labelPositioner={bottom:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e+=r+n}),top:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e-=r+n+s.height}),right:(t,e,s,i,r,n)=>({x:t+=i+n,y:e-=s.height/2}),left:(t,e,s,i,r,n)=>({x:t-=i+n+s.width,y:e-=s.height/2}),center:(t,e,s,i,r,n)=>({x:t-=s.width/2,y:e-=s.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointLayer=new $t(t)),this._pointLayer.add(this._pointContainer=new bo(t,"rm-series-points")),this.add(this._calloutContainer=new mo(t,"rm-series-callouts")),s&&(this._labelContainer=new uo(t,e))}_setCalcedColor(t,e){const s=getComputedStyle(e);t.setCalcedColor(s,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepare(t,e){const s=e._optionsDirty||e._dataSourceDirty||e._zindexDirty,i=this._labelContainer,r=this._calloutContainer;this.setModel(e),e instanceof Xr?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==i||i.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),null==i||i.prepare(t,this),r.prepare(t,this)):((null==i?void 0:i.isEmpty())&&i.prepare(t,this),r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,s=e._optionsDirty||e._dataSourceDirty;s&&this._doPrepeare(t,e,s)}render(t,e){this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),this._animatable&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}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){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,s){return this._doPointerMoved(t,e,s)}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}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){return this._getPointPool().elementOf(t)}click(t){const e=this.pointByDom(t);e&&(e.point?!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e):this._doPointClicked(e))}select(t,e){const s=this.pointByDom(t);s&&this.chart().selection.add(this.model,s.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_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,s){if(t.setAttrEx("aria-label",s.ariaHint()),t.internalClearStyleAndClass(),s._runColor)this._setPointColor(t,s._runColor);else{const i=e.getRangedColor(s);i&&this._setPointColor(t,i)}const i=e.getPointStyle(s);i&&t.internalSetStyleOrClass(i)}_doPointerMoved(t,e,s){return!1}_getGrowRate(){return b(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&&dt.log("CLICKED: ",t.point.name,t.point.getValue())}}lo=wo,wo.POINT_CLASS="rm-point",wo.DATA_HOVER="hover",wo.DATA_UNHOVER="unhover",wo.LEGEND_MARKER="rm-legend-item-marker",wo._drawers=Object.assign({circle:t=>Lt.circle(0,0,t)},lo._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class xo extends fo{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class vo extends wo{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class So extends fo{prepare(t,e){return this.point=t,this._ext=dt.getMinMax(t.values),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Co extends wo{_getSeriesExt(t,e){return Object.assign(Object.assign({},t.getMinMax(e)),{minSize:+t.options.minSize})}}class Lo extends So{constructor(t){super(t,!0),this.add(this._contentLayer=new $t(t)),this.add(this._baseLine=new ao(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,s,i){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(i,0,s)}}class ko extends Co{_getSeriesExt(t,e){const s=super._getSeriesExt(t,e);return t._pointDomain||(s.min=Math.min(s.min,b(t._minValue,s.min)),s.max=Math.max(s.max,b(t._maxValue,s.max))),s}_doPrepeare(t,e,s){!this._ext||s?this._ext=Object.assign(Object.assign({},this._getSeriesExt(e,this._visPoints)),{width:e._width,height:e._height}):(this._ext.width=e._width,this._ext.height=e._height)}}class Po extends fo{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class Mo extends wo{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Ao extends Zn{constructor(t){super(t,Ao.CLASS_NAME),this.add(this._imageView=new qn(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),pt(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ao.CLASS_NAME="rm-image-annotation";class Eo extends Zn{constructor(t){super(t,Eo.CLASS_NAME),this.add(this._shapeView=new Ft(t))}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),Lt.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)}}Eo.CLASS_NAME="rm-shape-annotation";class Vo extends Zn{constructor(t){super(t,Vo.CLASS_NAME),this.add(this._textView=new Ve(t)),this._textView.anchor=Me.START,this._richText=new Be}_doMeasure(t,e,s,i){const r=e.options,n=e.getSize(s,i),o=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(n),this._richText.setFormat(r.text),this._richText.build(o,s,i,null,e._domain);const a=pt(this._textView.bbox());return{width:b(n.width,a.width),height:b(n.height,a.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)}}Vo.CLASS_NAME="rm-text-annotation";class To{static reveal(t,e){new Do(t,e)}static grow(t,e){new $o(t,e)}static spread(t,e){new Oo(t,e)}static fadeIn(t){new No(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class No extends To{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:bt.DURATION,fill:"none"})}}let Do=class extends To{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:bt.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,s){return e.dom.firstElementChild.animate([{width:"0"},{width:F(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:F(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}};class Ro extends bt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Rt}_stop(){super._stop(),this._series=null}}class $o extends Ro{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Oo extends Ro{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Fo extends Ft{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,s,i,r,n){this.x=t,this.setPath(Lt.bar(t-s/2,e,s,-i,r,n))}}class Io extends Lo{constructor(t){super(t),this._bars=new Hn(this._contentLayer,Fo)}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,s,i,r,n){const o=t._categories||[],{min:a,max:h,base:l}=t.getPointExtents(s,e),c=i/s.length,d=c*t.options.barWidth;this._bars.forEach(((t,e)=>{const i=s[e];if(t.setVisible(!isNaN(i))){const s=c*e+(c-d)/2,l=(i-a)/(h-a)*r*n;t.setPath(Lt.bar(s,r,d,-l,0,0)),t.internalClearStyleAndClass(),o[e]&&o[e].color&&t.setFill(o[e].color)}})),this._renderBaseLine(t.baseLine,!1,i,r)}}class Bo extends xo{tooltipColor(){return getComputedStyle(this.dom).fill}}class jo extends Ft{static create(t,e,s,i,r,n,o,a,h=!0){return new jo(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,n,o,a,h,l=!0){return new jo(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=P,s=P){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return Lt.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 Lt.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 zo=function(t){return isNaN(t)?0:t};class Ho{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 a(t)?this._path.push("M",zo(t),zo(e)):this._path.push("M",zo(t.x),zo(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",zo(t),zo(e)):this._path.push("m",zo(t.x),zo(t.y)),this}movep(t,e){return a(t)?this._path.push("M",I(t),I(e)):this._path.push("M",I(t.x),I(t.y)),this}line(t,e){return a(t)?this._path.push("L",zo(t),zo(e)):this._path.push("L",zo(t.x),zo(t.y)),this}linep(t,e){return a(t)?this._path.push("L",I(t),I(e)):this._path.push("L",I(t.x),I(t.y)),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}q(t,e,s,i){return this._path.push("Q",t,e,s,i),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",zo(t[e]),zo(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",zo(t[e].x),zo(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}}class Go extends Ft{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Ho;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let Yo=class extends Ft{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Ho).circle(0,0,s).end())),this.internalResetStyleOrClass(t._style),this}};class Wo extends Po{constructor(t){super(t),this.add(this._faceView=new jo(t,"rm-circle-gauge-face")),this.add(this._rimView=new jo(t,"rm-circle-gauge-rim")),this.add(this._valueView=new jo(t,"rm-circle-gauge-value")),this.add(this._textView=new Ve(t,"rm-circle-gauge-text")),this.add(this._handContainer=new $t(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 Go(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 Yo(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible)&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,s,i){const r=t._props.getCenter(e,s),n=t._props.getExtents(p(e,s));this.$_renderBackground(t,r,n),this.$_renderValue(t,this.point,i)}$_renderBackground(t,e,s){const i=this._faceView,r=this._rimView,n=t._props,o=n._startRad;this._center=e,this._exts=s,i.visible&&(i.internalResetStyleOrClass(t.face._style),i.setSector({cx:e.x,cy:e.y,rx:s.radius-s.radiusThick,ry:s.radius-s.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:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=s.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,s){const i=t.options,r=t._props,n=e.getValue(),o=t.getValueRate(n)*s,a=this._center,h=this._exts,l=t.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const e=t.valueRim,s=e.options,n=h.value+(s.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(e._style),s.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",F(l))),c.setBoolData("stroked",s.stroked),c.setSectorEx({cx:a.x,cy:a.y,rx:n,ry:n,innerRadius:(n-l)/n,start:r._startRad,angle:r._sweepRad*o,clockwise:i.clockwise},s.stroked)}if(c.visible){const e=t.gaugeLabel;c.text=e.getNumberText(n,!1,!1,void 0),e.buildSvg(c,null,NaN,NaN,t,e._domain);const s=c.bbox(),i=e.getOffset(this.width,this.height);c.trans(a.x+i.x,a.y-s.height/2+i.y)}}}class Zo extends Rt{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Uo extends bt{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 Xo extends Po{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Zo(t,"rm-clock-gauge-face")),this.add(this._rimView=new jo(t,"rm-clock-gauge-rim")),this.add(this._labelView=new Ve(t,"rm-clock-gauge-label")),this._labelView.layout=Ae.MIDDLE,this.add(this._tickContainer=new $t(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new $t(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Ft(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Ft(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Ft(t,"rm-clock-gauge-second")),this.add(this._pinView=new Zo(t,"rm-clock-gauge-pin")),this._tickViews=new Hn(this._tickContainer,ao,"rm-clock-gauge-tick"),this._tickLabelViews=new Hn(this._tickLabelContainer,Ve,"rm-clock-gauge-tick-label")}prepare(t,e){const s=Math.round(12/g(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Ae.MIDDLE})),this._zoneCallback=e.options.timezoneCallback}render(t,e,s){const i=this.point,r=this._exts=t.getExtents(e,s);this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+i.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),m(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.options.animatable&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,i=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,d=t.tick.options.length||0;i.setVisible(t.face.visible)&&(i.internalResetStyleOrClass(t.face._style),i.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-d,m=V,f=E/12;if(this._tickViews.forEach(((e,s)=>{e.setLine(a+_(m)*p,h+u(m)*p,a+_(m)*g,h+u(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,s=E/12*e;m=V,n.get(0).text="12",g=p-(d+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((i,r,n)=>{i.text=String(0===r?12:r*e),i.trans(a+_(m)*g,h+u(m)*g),i.internalResetStyleOrClass(t.tickLabel._style),m+=s}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),s.setVisible(t.gaugeLabel.visible)&&(s.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?s.trans(a,h+g/2):s.trans(a,h-g/2))}$_getNow(t){var e;let s=t.getTime();if(!s){s=new Date;const i=y(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=s.getMinutes()+s.getTimezoneOffset()+i;s.setMinutes(r)}return s}$_renderHands(t,e){const s=this.$_getNow(this.point),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),o=i>=12,{cx:a,cy:h,rd:l}=e,c=new Ho;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=E*(i/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=E*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?E*(this._aniSec+this._secRate)/60:E*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*N),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const s=new Uo(this,t);s.duration=t.secondHand.options.duration||200,s.start()}}}const qo="rm-map-series-id-";let Ko=class t extends fo{static idClass(t){return qo+t.id}static getId(t){for(const e of t.classList)if(e.startsWith(qo))return e.substring(17)}constructor(t){super(t)}render(e,s,i){const r=this.model,n=!this.point||this.point.isNull;e!==r&&this.setPath((this.model=e).path),i&&(this.setBoolData("null",n),n&&s&&this.internalSetStyleOrClass(s),this.dom.classList.add(t.idClass(e)))}reset(){this.model=null}};class Qo extends fo{constructor(t){super(t,!0),this.add(this._figure=new Ft(t)),this.add(this._textView=new Kn(t,"rm-figure-series-inner-label"))}render(t,e,s){const i=this._textView,r=s.options.text;this._figure.setPath(e),i.internalResetStyleOrClass(s._style),i.setModel(t,s,null,null),s.prepareRich(r),s.buildSvg(i._text,i._outline,NaN,NaN,s,s.getTextDomain(this.point)),i.layout();const n=this.bbox(),o=i.bbox(),a=Tt.getPadding(i._text.dom),h=n.width-a.left-a.right,l=n.height-a.top-a.bottom;i.trans(a.left+(h-o.width)/2,(l-o.height)/2+a.top)}layout(){const t=this._textView,e=this.bbox(),s=t.bbox(),i=Tt.getPadding(t._text.dom),r=e.width-i.left-i.right,n=e.height-i.top-i.bottom;t.trans(i.left+(r-s.width)/2,(n-s.height)/2+i.top)}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Jo extends xo{constructor(t){super(t)}}class ta extends fo{constructor(t){super(t,!0),this.add(this._imageView=new qn(t,!1))}setImage(t,e,s){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(s)||(this._imageView.height=s)}}let ea=class extends Lo{constructor(t){super(t),this._contentLayer.addAll(this._back=new is(t),this._area=new Ft(t,"rm-line-series-area"),this._line=new Ft(t,"rm-line-series-line"),this._lowLine=new Ft(t))}render(t,e,s,i,r,n){const{min:o,max:a,base:h}=t.getPointExtents(s,e),l=this.$_getPts(s,o,a,i,r),c=s.length,d=c>2&&t.options.curved,_=new Ho;if(this.resize(i,r),this._back.setVisible(!1)&&(this._back.resize(i,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,i,r)}$_getPts(t,e,s,i,r){const n=t.length,o=[];let a=.05*i,h=.1*r;const l=s-e;i-=.1*i,r-=.2*r;for(let s=0;s<n;s++){const c=t[s],d=a+s/(n-1)*i,_=h+(isNaN(c)||0==l?r:(1-(c-e)/l)*r);o.push({x:d,y:_})}return o}};class sa{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),s=this.$_left(t,e);return null==s||s.addEventListener("finish",(()=>{e.dom.remove()})),s}$_aniOptions(){return{duration:bt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:F(t.width)}],this.$_aniOptions())}}const ia="rm-map-series-id-";class ra extends fo{static idClass(t){return ia+t.id}static getId(t){for(const e of t.classList)if(e.startsWith(ia))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,s){const i=this.point;if(s){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||i.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(ra.idClass(this.model))}this.setBoolData("selected",i&&i._selected)}reset(){this.model=null}}class na extends Ft{constructor(t){super(t,"rm-map-series-inset")}render(t,e,s){if(t!==this.model){let i;if(this.model=t,o(t.frame)&&t.frame.length>0){const r=J(t.frame),n=e.model,o=n.h1-r.l,a=n.h2+r.r,h=n.v2+r.t,l=n.v1-r.b,c=[s.project([o,h]),s.project([a,h]),s.project([a,l]),s.project([o,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=o(t.border)?vi(t.border,e.model):t.border,n=r.length;let a=s.project([r[0],r[1]]);i=`M${a[0]} ${a[1]}`;for(let t=2;t<n;t+=2)a=s.project([r[t],r[t+1]]),i+=` L${a[0]} ${a[1]}`;"z"===r[n-1]&&(i+=" z")}i&&this.setPath(i)}}render2(t,e,s){if(t!==this.model){let i;if(this.model=t,o(t.frame)&&t.frame.length>0){const r=J(t.frame);let n=1/0,o=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;n=p(n,e.h1),o=p(o,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=n-r.l,c=a+r.r,d=h+r.t,_=o-r.b,u=[s.project([l,d]),s.project([c,d]),s.project([c,_]),s.project([l,_])];i=`M${u[0][0]} ${u[0][1]} L${u[1][0]} ${u[1][1]} ${u[2][0]} ${u[2][1]} ${u[3][0]} ${u[3][1]} Z`}else if(t.border){let r=1/0,n=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;r=p(r,e.h1),n=p(n,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=o(t.border)?vi(t.border,{h1:r,h2:a,v1:n,v2:h}):t.border,c=l.length;let d=s.project([l[0],l[1]]);i=`M${d[0]} ${d[1]}`;for(let t=2;t<c;t+=2)d=s.project([l[t],l[t+1]]),i+=` L${d[0]} ${d[1]}`;"z"===l[c-1]&&(i+=" z")}i&&this.setPath(i)}}render3(t,e,s){if(t!==this.model){let i;if(this.model=t,o(t.frame)&&t.frame.length>0){const r=t.offset||[0,0],n=J(t.frame),o=e.h1+(r[0]||0)-n.l,a=e.h2+(r[0]||0)+n.r,h=e.v2+(r[1]||0)+n.t,l=e.v1+(r[1]||0)-n.b,c=[s.project([o,h]),s.project([a,h]),s.project([a,l]),s.project([o,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=t.offset||[0,0],n=o(t.border)?vi(t.border,e):t.border,a=n.length;let h=s.project([n[0]+(r[0]||0),n[1]+(r[1]||0)]);i=`M${h[0]} ${h[1]}`;for(let t=2;t<a;t+=2)h=s.project([n[t]+(r[0]||0),n[t+1]+(r[1]||0)]),i+=` L${h[0]} ${h[1]}`;"z"===n[a-1]&&(i+=" z")}i&&this.setPath(i)}}}class oa extends In{constructor(t,e,s){super(t,e),this._paddings=new On,this.add(this._background=new Ft(t,s)),this.add(this._textView=new Ve(t))}setPoint(t){return this._point=t,this}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=e.options.text;r?(e.prepareRich(r),e.buildSvg(this._textView,s,i,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;n(a)&&(a=a(e.series.getPointCallbackArgs(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,s,i);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,s=this.width;let i=0;this._renderBackgrouond(this._background,s,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":i+=s/2,e.anchor=Me.MIDDLE;break;case"right":i+=s,e.anchor=Me.END;break;default:e.anchor=Me.START}e.trans(i,this._paddings.top)}}class aa extends oa{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){this.model.options.backgroundStyle,t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Lt.bar(0,s,e,-s,i,0))}}class ha extends oa{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Lt.bar(0,s,e,-s,0,i))}}class la extends fo{constructor(t){super(t,!0),this.add(this._backView=new is(t,"rm-panel-series-back")),this.add(this._headerView=new aa(t)),this.add(this._bodyView=new ha(t)),this.add(this._divider=new ao(t))}render(t,e,s,i,r){const n=this.point,o=e.header,a=e.body,h=this._headerView,l=this._bodyView,c=this._divider;let d,_;h.setVisible(o.visible)&&(h.internalResetStyleOrClass(o._style),d=h.setPoint(n).measure(t,o,s,i)),this._divider.setVisible(h.visible),l.internalResetStyleOrClass(a._style),_=l.setPoint(n).measure(t,a,s,i);let u=_.width,p=_.height;h.visible&&(u=Math.max(u,d.width),p+=d.height);const g=e.getExtents(u,p);h.visible&&(h.resize(g.width,d.height),h.layout(r),c.setVisible(e.divider.visible)&&(c.trans(0,d.height),c.setHLine(0,0,g.width))),l.resize(g.width,g.height-d.height),l.transY(d.height),l.layout(r),this._backView.setBounds(0,0,g.width,g.height,r)}}class ca extends jo{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class da extends So{constructor(t){super(t,!0),this._sectors=new Hn(this,ca,null,.5),this._rdRate=1,this.add(this._circle=new Zo(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,s){const i=this.point.values;this._sectors.prepare(i.length,((t,e)=>{t.value=i[e]})),this._rd=e,this.$_layoutSectors(t,s)}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e){const s=this.point.values,i=t.options,r=s.length,n=i.clockwise?1:-1,o=s.reduce(((t,e)=>t+e),0),a=t._totalRad*e;let h=t._startRad;if(this._sectors.prepare(s.length,((t,e)=>{t.value=s[e]})),r>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=h,h+=t.angle=n*e*a}}));else if(1==r){const t=this._sectors[0];t.startAngle=h,t.angle=a}}$_layoutSectors(t,e){const s=t._categories||[],i=t.options.clockwise,r=0,n=0,o=this._cx=r,a=this._cy=n,h=this._rd;this.$_calcAngles(t,e),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this._sectors.forEach(((t,e)=>{const r=t.value;if(isNaN(r))t.setVisible(!1);else{const r=t.start;let n=0,l=0;t.trans(n,l).setVisible(!0),t.setPieSector({cx:o,cy:a,rx:h,ry:h,innerRadius:0,start:r,angle:m(t.angle),clockwise:i}),t.internalClearStyleAndClass(),s[e]&&s[e].color&&t.setFill(s[e].color)}}))}}class _a extends xo{constructor(t){super(t,!0),this.add(this._pin=new Ft(t))}render(t){this._pin.setPath(Lt.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Zo(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 ua extends xo{}class pa extends fo{constructor(t){super(t,!0),this.add(this._line=new Ft(t)),this.add(this._arrow=new Ft(t))}render(t,e,s,i){if(s.length>1){const t=s[s.length-2],r=s[s.length-1],n=O(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+s.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(i)&&(this._arrow.setPath(`M ${r[0]} ${r[1]} L ${r[0]-5*e} ${r[1]-13*e} L ${r[0]+5*e} ${r[1]-13*e} Z`),this._arrow.setRotation(r[0],r[1],n))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class ga extends xo{}class ma extends So{constructor(t){super(t,!0),this._cells=new Hn(this,Ft)}render(t,e,s,i){const r=t.getPointGrid(this.point,e,i);this.$_prepareCells(Math.round(r.count),s.wCell,s.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,s)}$_prepareCells(t,e,s){this._cells.prepare(t,(t=>{t.setPath(Lt.square(0,0,e,s))}))}$_layoutCells(t,e,s,i,r){const n=s*r.hCell+(s-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,s,i)=>{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 fa extends Co{constructor(t){super(t,"rm-waffle-series"),this._waffles=new co(this._pointContainer,ma)}_getPointPool(){return this._waffles}_doPrepeare(t,e,s){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._waffles.prepare(s,((s,r)=>{const n=s.prepare(e[r],i);this._setPointStyle(s,t,n)}))}$_layoutWaffles(t,e,s){const i=this.model,r=i.getWaffleInfo(),n=i.chart.getProjection(this._second),o=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=Object.assign(Object.assign({},this._getSeriesExt(i,i._visPoints)),{gap:i.options.gap}),u=i.getCallout(),p=this._calloutViews();let g,m,f;this._waffles.forEach(((t,e)=>{const b=t.point,y=[b.lon,b.lat];if(t.setVisible(!b.isNull&&null!=(g=n.getVisible(y)))){const e=this._getPointPositioner(b.position||h,"top");let w,x,v,S,C,L;u&&(w=b.getCallout(y))&&(x=w.map((t=>n.project(t))),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=S=g[1],v*=a[0],S*=a[1],t.render(i,_,r,s),m=t.bbox(),f=e(v,S,m.width,m.height),t.trans(f.x,f.y).rotate(o),d&&(C=d.get(b,0))&&this._layoutLabel(C,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,C.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.render(u,b,x.flat().map(((t,e)=>t*a[e%2])),null)}}))}}function ba(t,e){return new(Wn[e._type()])(t)}wo.register([Xr,class extends wo{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new co(this._pointContainer,ra),this._insetPool=new Hn(this._pointContainer,na)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const n=this.model;if(r&&(r.setBoolData(wo.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(wo.DATA_HOVER,!1))),!t||t.point||n.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let n=e.hoverColor,o=this.model.pointLabel.options.hoverColor;!n&&i(e.hoverStyle)&&(n=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",n||""),r.style.setProperty("--map-series-hover-label-fill",o||""),t.setBoolData(wo.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(wo.DATA_HOVER,!0))}t!=r&&n.chart._hoverAreaChanged(n,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=ra.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){const i=!ct,r=this._second,n=this._insets=[],o=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,s)=>{const a=e.get(r,s),h=t.point=e.pointOf(a);t.setModel(a),h?(a.dummy||this._setPointStyle(t,e,h),o&&o.push(t)):t.internalClearStyleAndClass(),i&&t.setStyle("vectorEffect","non-scaling-stroke"),a.inset&&n.push(a.inset)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let s,i;return(s=t.point)?(i=e.point)?isNaN(s._zindex)?isNaN(i._zindex)?0:-1:isNaN(i._zindex)?1:s._zindex-i._zindex:1:e.point?-1:0})),n.push(...e.chart.map._insets),o&&o.length!==e.areaCount&&o.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(n.length,((t,e)=>{i&&t.setStyle("vectorEffect","non-scaling-stroke")}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second,r=s.isDirty,n=s.body,o=this.model,a=o.options,h=s.getProjection(i),l=this._areas={},c=this._insets,d=a.allAreas;o.pointLabel.options.position;const _=this._labelViews(),u=a.nullStyle,p=a.dummyStyle,g=this._scale;this._areaPool.forEach(((t,e)=>{const s=t.model;if(s){const e=t.point,i=_&&e&&_.get(e,0);if(l[s.id]=t,t.setVisible(s.visible&&(d||!!e))){if(t.render(u,p,r),i){const s=h.project(o.getCenter(e));if(i.setVisible(n.isVisible(s))){i._model,r&&this._layoutLabel(i,t.dom);const n=i.bbox();let[o,a]=s;e.xPos=o,e.yPos=a,o*=g,a*=-g,o-=n.width/2,a-=n.height/2,i.trans(o,a)}}}else i&&i.setVisible(!1)}})),this._insetPool.forEach(((t,e)=>{const s=c[e],i=l[s.area];if(i)t.setVisible(i.visible)&&t.render(s,i,h);else{const e=s._base;if(e[0]instanceof Di)t.render2(s,e.map((t=>l[t.id])),h);else if(e[0]>=0){const i=n.map.areaOf(s.parent);if(i){const r=i.readBounds(e);t.render3(s,r,h)}}}}))}}],[Dr,class extends wo{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new co(this._pointContainer,Ko)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const n=this.model;if(r&&(r.setBoolData(wo.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(wo.DATA_HOVER,!1))),t&&!t.point&&(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let n=e.hoverColor,o=this.model.pointLabel.options.hoverColor;!n&&i(e.hoverStyle)&&(n=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",n||""),r.style.setProperty("--map-series-hover-label-fill",o||""),t.setBoolData(wo.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(wo.DATA_HOVER,!0))}t!=r&&n.chart._hoverAreaChanged(n,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=Ko.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){this._second;const i=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,e)=>{})),i&&i.length!==e.areaCount&&i.forEach((t=>{t.parent.moveToLast(t)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second;s.isDirty,s.body;const r=this.model;r.options,s.getProjection(i),this._areas={},r.pointLabel,this._labelViews(),this._scale,this._areaPool.forEach(((t,e)=>{}))}}],[cn,class extends vo{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new co(t,ua)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=Math.max(0,i.getRadius()),n=[this._scale,-this._scale],o=+i.options.rotation||0,a=i.options.position,h=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),l=this._labelViews(),c=i.getLabelOff(),d=i.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(u=e.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"center"),y=(g._radius||r)*s,w=wo.getDrawer(i.getShape(f));let x,v,S,C,L,k;if(d&&(x=f.getCallout(b))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),f.xPos=S=u[0],f.xPos=C=u[1],S*=n[0],C*=n[1],p=m(S,C,2*y,2*y),p.x+=y,p.y+=y,t&&g.setPath(w(y,y)),g.trans(p.x,p.y).rotate(o),l&&(L=l.get(f,0))&&(t&&this._layoutLabel(L,g.dom),L.transp(h(p.x,p.y,L.bbox(),y,y,c))),_&&v&&(k=_.get(f))){const t=v.flat().map(((t,e)=>t*n[e%2]));_.setMask(k,t).setCircle(t[t.length-2],t[t.length-1],y),k.render(d,f,t,null)}}}))}}],[an,class extends vo{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new co(t,_a)}_doPrepeare(t,e,s){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=[this._scale,-this._scale],n=+i.options.rotation||0,o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom");i.pointLabel.options.position;const h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(_=e.getVisible(f)))){const g=this._getPointPositioner(m.position||o,"top"),b=i.getExt(m,s),y=2*b.rd,w=3*b.rd;let x,v,S,C,L,k;c&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),_=v[v.length-1]),m.xPos=S=_[0],m.yPos=C=_[1],S*=r[0],C*=r[1],u=g(S,C,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(n),h&&(L=h.get(m,0))&&(t&&this._layoutLabel(L,p.dom),L.transp(a(u.x+y/2,u.y+w/2,L.bbox(),y/2,w/2,l))),d&&v&&(k=d.get(m))&&k.render(c,m,v.flat().map(((t,e)=>t*r[e%2])),null)}}))}}],[gn,class extends vo{constructor(t){super(t,"rm-Vector-series")}_createMarkers(t){return new co(t,ga)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(){this.chart().isDirty;const t=this.model.chart.getProjection(this._second);this._getGrowRate();const e=this.model;this._scale,e.options.rotation;e.pointLabel.options.position,this._labelViews(),e.getLabelOff(),e.getCallout(),this._calloutViews(),this._markers.forEach(((e,s)=>{const i=e.point,r=[i.lon,i.lat];e.setVisible(!i.isNull&&null!=t.getVisible(r))}))}}],[cr,class extends ko{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new co(this._pointContainer,Io)}_getPointPool(){return this._bars}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutBars(t,e,s){const i=this.model,r=!i._pointDomain,n=this._getSeriesExt(i,this._visPoints),o=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._bars.forEach(((t,e)=>{const m=t.point,f=i.getCoord(m);if(t.setVisible(!m.isNull&&null!=(p=o.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"center"),b=t.getSizeRate(t._ext.max,n),y=this._ext.width*b,w=this._ext.height*b;let x,v,S,C,L,k;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=S=p[0],m.yPos=C=p[1],S*=a[0],C*=a[1],g=e(S,C,y,w),t.render(i,r&&n,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(k=u.get(m))&&k.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[Yr,class extends ko{constructor(t){super(t,"rm-line-series"),this._lines=new co(this._pointContainer,ea)}_getPointPool(){return this._lines}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,1)}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new sa(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutLines(t,e,s){const i=this.model,r=!i._pointDomain,n=this._getSeriesExt(i,this._visPoints),o=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._lines.forEach(((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=o.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"top"),b=t.getSizeRate(t._ext.max,n),y=this._ext.width*b,w=this._ext.height*b;let x,v,S,C,L,k;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=S=p[0],m.yPos=C=p[1],S*=a[0],C*=a[1],g=e(S,C,y,w),t.render(i,r&&n,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(k=u.get(m))&&k.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[rn,class extends Co{constructor(t){super(t,"rm-pie-series"),this._pies=new co(this._pointContainer,da)}_getPointPool(){return this._pies}_doPrepeare(t,e,s){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._pies.prepare(s,((s,r)=>{const n=s.prepare(e[r],i);this._setPointStyle(s,t,n)}))}$_layoutPies(t,e,s){const i=this.model,r=i.chart.getProjection(this._second),n=[this._scale,-this._scale],o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=i.getLabelOff(),l=this._labelViews(),c=i.getCallout(),d=this._calloutViews(),_=i.getRadius(Math.min(t,e));let u,p;this._pies.forEach(((t,e)=>{const g=t.point,m=i.getCoord(g);if(t.setVisible(!g.isNull&&null!=(u=r.getVisible(m)))){const e=this._getPointPositioner(g.position||o,"top"),f=_*t._rdRate;let b,y,w,x,v,S;c&&(b=g.getCallout(m))&&(y=b.map((t=>r.project(t))),u=y[y.length-1]),g.xPos=w=u[0],g.yPos=x=u[1],w*=n[0],x*=n[1],p=e(w,x,2*f,2*f),p.x+=f,p.y+=f,t.render(i,f,s),t.trans(p.x,p.y),l&&(v=l.get(g,0))&&v.layout().transp(a(p.x,p.y,v.bbox(),f,f,h)),d&&y&&(S=d.get(g))&&S.render(c,g,y.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[$r,class extends wo{constructor(t){super(t,"rm-lyph-series"),this._figures=new Hn(this._pointContainer,Qo)}_doPrepeare(t,e,s){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures()}_doReset(){}$_prepareFigures(t,e){const s=t.chart.isDirty,i=t.innerLabel,r=e.length;this._pointContainer.setFill(t._runColor),this._figures.prepare(r,((r,n)=>{const o=r.point=e[n];this._setPointStyle(r,t,o),s&&r.render(this.doc,t.getFigure(o),i)}))}$_layoutFigures(){this.chart();const t=this.model.chart.getProjection(this._second),e=this.model,s=[this._scale,-this._scale],i=+e.options.rotation||0,r=e.options.position,n=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),o=this._labelViews(),a=e.getLabelOff(),h=e.getCallout(),l=this._calloutViews();let c,d;this._figures.forEach(((e,_)=>{const u=e.point,p=[u.lon,u.lat];if(e.setVisible(!u.isNull&&null!=(c=t.getVisible(p)))){const _=this._getPointPositioner(u.position||r,"top");let g,m,f,b,y,w,x;if(h&&(g=u.getCallout(p))&&(m=g.map((e=>t.project(e))),c=m[m.length-1]),u.xPos=f=c[0],u.yPos=b=c[1],f*=s[0],b*=s[1],e.layout(),x=e.bbox(),d=_(f,b,x.width,x.height),e.trans(d.x,d.y).rotate(i),o&&(y=o.get(u,0))&&this._layoutLabel(y,e.dom).transp(n(d.x+x.width/2,d.y+x.height/2,y.bbox(),x.width/2,x.height/2,a)),l&&m&&(w=l.get(u))){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=e.tx,x.y=e.ty,l.setMask(w,t).setRects(x),w.render(h,u,t,e.getFill())}}}))}}],[fn,fa],[un,class extends wo{constructor(t){super(t,"rm-route-series",!1),this._lines=new co(this._pointContainer,pa)}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,s){s&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(NaN)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){console.log("START POINT ADDING...")}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const s=e.length,i=!ct;this._pointContainer.setStroke(t._runColor),this._lines.prepare(s,((s,r)=>{const n=s.point=e[r];this._setPointStyle(s,t,n),s._line.setFill("none"),s._arrow.setStroke("none"),i&&(s._line.setStyle("vectorEffect","non-scaling-stroke"),s._arrow.setStyle("vectorEffect","non-scaling-stroke"))}))}$_layoutLines(t){const e=this.model,s=e.chart;if(s.isDirty||!isNaN(t)){const i=s.getProjection(this._second),r=e.options.lineWidth,n=e.options.arrowDisplay;if(ct){const t=b(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=b(t,1),this._lines.forEach(((s,r)=>{this.$_layoutLine(s,e,i,t,n)}))}}$_layoutLine(t,e,s,i,n){const a=t.point;if(i=b(a._vr,i),a._deleting&&(i=1-i),t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,i=[];let r=0;for(;r<e.length;)o(e[r])?(i.push(e[r]),r++):(i.push(...s.project([e[r],e[r+1]])),r+=2);t._line.setPath(i.join(" "))}else{const r=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>s.project(t))).filter((t=>!t.outside));i<1&&(r.length=r.length*i|0),t.render(e,1/this._scale,r,"none"!==n&&(i<1||"moving"!==n))}}$_genPath3(t,e,s){const i=[],r=Math.min(.1,Math.max(0,this.model.options.bendFactor)),n=Math.log(1+(o=t[0],a=t[1],h=e[0],l=e[1],Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))))*r;var o,a,h,l;const c=this._calculateControlPoint(t,e,n);for(let r=0;r<=s;r++){const n=r/s,o=this.interpolate3(t,c,n),a=this.interpolate3(c,e,n),h=this.interpolate3(o,a,n);i.push(h)}return i}interpolate3(t,e,s){const i=$(t[1]),r=$(t[0]),n=$(e[1]),o=$(e[0]),a=Math.acos(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-s)*a)/Math.sin(a),l=Math.sin(s*a)/Math.sin(a),c=h*Math.cos(i)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(i)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(i)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[O(Math.atan2(d,c)),O(p)]}_calculateControlPoint(t,e,s){const i=s,r=this.interpolate3(t,e,.5),n=$(r[1]),o=$(r[0]),a=n+i*Math.sin(Math.PI/2);return[O(o+i*Math.cos(Math.PI/2)),O(a)]}}],[Ds,class extends vo{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new co(t,Bo)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutMarkers(t,e,s){const i=this.model,r=i.chart,n=r.getProjection(this._second),o=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"center"),c=this._getLabelPositioner(i.subLabel.options.position,"right"),d=this._labelViews(),_=i.getLabelOff(),u=i.getSubLabelOff(),g=i.getCallout(),m=this._calloutViews(),{min:f,max:b}=i.getPixelMinMax(p(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,p=i.getCoord(r);if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(p)))){const e=this._getPointPositioner(r.position||h,"center"),x=wo.getDrawer(i.getShape());let v,S,C,L,k,P,M=(t._radius=i.getRadius(r.getValue(),f,b))*s;g&&(v=r.getCallout(p))&&(S=v.map((t=>n.project(t))),y=S[S.length-1]),r.xPos=C=y[0],r.xPos=L=y[1],C*=a[0],L*=a[1],w=e(C,L,2*M,2*M),w.x+=M,w.y+=M;const A=()=>{t.setPath(x(M,M)),t.trans(w.x,w.y).rotate(o)},E=()=>{if(n instanceof Ei){const e=n.r,s=this.chart().width,i=p[1]*Math.PI/180,r=M/2*(360/s),o=r/Math.cos(i),a=r;n.r=Mi*this._scale;const h=Xn.geoCircle(p[0],p[1],o,a,n,!0);n.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else A()};if(this.model.alignToSurface?E():A(),d&&((k=d.get(r,0))&&this._layoutLabel(k,t.dom).transp(l(w.x,w.y,k.bbox(),M,M,_)),(k=d.get(r,1))&&this._layoutLabel(k,t.dom).transp(c(w.x,w.y,k.bbox(),M,M,u))),m&&S&&(P=m.get(r))){const e=S.flat().map(((t,e)=>t*a[e%2]));m.setMask(P,e).setCircle(e[e.length-2],e[e.length-1],M),P.render(g,r,e,t.getFill())}}}))}}],[jr,class extends wo{constructor(t){super(t,"rm-image-series"),this._images=new co(this._pointContainer,ta)}_getPointPool(){return this._images}_doPrepeare(t,e,s){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,s=t.options.imageWidth,i=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),s,i),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,s=e.chart.getProjection(this._second),i=+e.options.rotation||0,r=[this._scale,-this._scale],n=e.options.position,o=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews();let d,_;this._images.forEach(((t,u)=>{const p=t.point,g=e.getCoord(p);if(t.setVisible(!p.isNull&&null!=(d=s.getVisible(g)))){const e=this._getPointPositioner(p.position||n,"top");let u,m;const f=t.bbox(),b=f.width,y=f.height;let w,x,v,S;if(l&&(u=p.getCallout(g))&&(m=u.map((t=>s.project(t))),d=m[m.length-1]),p.xPos=w=d[0],p.yPos=x=d[1],w*=r[0],x*=r[1],_=e(w,x,b,y),t.trans(_.x,_.y).rotate(i),h&&(v=h.get(p,0))&&v.layout().transp(o(_.x+b/2,_.y+y/2,v.bbox(),b/2,y/2,a)),c&&m&&(S=c.get(p))){const e=m.flat().map(((t,e)=>t*r[e%2]));f.x=t.tx,f.y=t.ty,c.setMask(S,e).setRects(f),S.render(l,p,e,t.getFill())}}}))}}],[Fr,class extends vo{constructor(t){super(t,"rm-Heatmap-series")}_createMarkers(t){return new co(t,Jo)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){}$_layoutMarkers(t,e){}}],[en,class extends wo{constructor(t){super(t,"rm-panel-series"),this._panels=new co(this._pointContainer,la)}_doPrepeare(t,e,s){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,1)}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}$_preparePanels(t,e){const s=e.length;this._panels.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutPanels(t,e,s,i){const r=this.model,n=r.chart.getProjection(this._second),o=[this._scale,-this._scale],a=r.options.position,h=this._getLabelPositioner(r.pointLabel.options.position,"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=b(u.rx,0);let g,m,f;this._panels.forEach(((i,u)=>{const b=i.point,y=r.getCoord(b);if(i.setVisible(!b.isNull&&null!=(g=n.getVisible(y)))){const u=this._getPointPositioner(b.position||a,"top");let w,x,v,S,C,L;if(d&&(w=b.getCallout(y))&&(x=w.map((t=>n.project(t))),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=S=g[1],v*=o[0],S*=o[1],i.render(t,r,e,s,p),m=i.bbox(),f=u(v,S,m.width,m.height),i.trans(f.x,f.y),l&&(C=l.get(b,0))&&this._layoutLabel(C,i.dom).transp(h(f.x+m.width/2,f.y+m.height/2,C.bbox(),m.width/2,m.height/2,c)),_&&x&&(L=_.get(b))){const t=x.flat().map(((t,e)=>t*o[e%2]));m.x=i.tx,m.y=i.ty,_.setMask(L,t).setRects(m),L.render(d,b,t,i.getFill())}}}))}}],[fn,fa],[wr,class extends Mo{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new co(t,Wo)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height,1)}_doReset(){}_runShowEffect(t){t&&To.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e,s){const i=this.model;i.chart.isDirty;const r=this.model.chart.getProjection(this._second),n=[this._scale,-this._scale],o=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u,p;this._gauges.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(_=r.getVisible(b)))){const m=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C;c&&(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],g.render(i,t,e,s),u=g.bbox(),p=m(x,v,u.width,u.height),g.trans(p.x,p.y),h&&(S=h.get(f,0))&&this._layoutLabel(S,g.dom).transp(a(p.x+u.width/2,p.y+u.height/2,S.bbox(),u.width/2,u.height/2,l)),d&&w&&(C=d.get(f))&&C.render(c,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[Vr,class extends Mo{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new co(t,Xo)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height)}_doReset(){}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e){const s=this.model;s.chart.isDirty;const i=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],n=s.options.position,o=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),a=this._labelViews(),h=s.getLabelOff(),l=s.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(d=i.getVisible(f)))){const g=this._getPointPositioner(m.position||n,"top");let b,y,w,x,v,S;l&&(b=m.getCallout(f))&&(y=b.map((t=>i.project(t))),d=y[y.length-1]),m.xPos=w=d[0],m.yPos=x=d[1],w*=r[0],x*=r[1],p.render(s,t,e),_=p.bbox(),u=g(w,x,_.width,_.height),p.trans(u.x,u.y),a&&(v=a.get(m,0))&&this._layoutLabel(v,p.dom).transp(o(u.x+_.width/2,u.y+_.height/2,v.bbox(),_.width/2,_.height/2,h)),c&&y&&(S=c.get(m))&&S.render(l,m,y.flat().map(((t,e)=>t*r[e%2])),null)}}))}}]),Zn.register([Zi,Vo],[Yi,Ao],[Wi,Eo]);class ya extends bt{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.setStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class wa extends bt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class xa extends $t{constructor(t,e,s){super(t,""),this.labelsContainer=e,this.second=s,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new to(t,s))}prepare(t,e){const s=e.visibleSeries,i=this.seriesMap,r=this.seriesViews;r.forEach((t=>{var e;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),this.control.loaded?t.removeLater(200):t.remove())})),r.length=0,s.forEach((e=>{const s=!i[e.hash],n=i[e.hash]||function(t,e){return new(yo[e._type()])(t)}(t,e);n.parent||(this.add(n),this.labelsContainer.add(n._labelContainer)),i[e.hash]=n,r.push(n),n._second=this.second,s&&(e._optionsDirty=!0),n.prepare(t,e)})),this.prevViews&&dt.equalArrays(this.prevViews,r)||(this.sort(r),this.labelsContainer.sort(r.map((t=>t._labelContainer)))),this.prevViews=r.slice(0)}prepareLayout(t,e){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class va extends $t{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new $t(t)),this.add(this._labelLayer=new $t(t))}render(t,e,s,i,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,s,i,r)}$_prepareGuides(t,e){const s=this._guideViews,i=e.length;for(;s.length>i;)s.pop().remove();for(;s.length<i;){const e=new so(t,this._labelLayer);s.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,s,i,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],i,r),n.layout(s)}))}}class Sa extends In{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new is(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new oo(t)),this.add(this._contentLayer=new $t(t,"rm-body-content")),this.add(this._crosshairView=new ro(t)),this._contentLayer.add(this._annotationContainer=new $t(t)),this._contentLayer.add(this._axisGuideContainer=new va(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new va(t,!1)),this._contentLayer.add(this._seriesContainer=new xa(t,new $t(t),!1)),this._contentLayer.add(this._secondContainer=new xa(t,new $t(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new va(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new va(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new $t(t)),this._secondContainer.setVisible(!1),this._secondFrontAxisGuideContainer.setVisible(!1),this._secondAxisGuideContainer.setVisible(!1),this._seriesContainer.dom.classList.add("rm-series-container"),this._secondContainer.dom.classList.add("rm-second-container")}getAnnotationAnchor(t){return this._annotationMap.get(t)}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}canScroll(){return!0}prepare(t,e){this.$_prepareMeasureSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,s,i){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,s,i),$n.create(s,i)}_doLayout(t){var e;const s=this.doc,i=this.model,r=i.chart,n=r.axis,o=r.map,a=this._clip,h=this.height,l=this.width;if(this._back.setBounds(0,0,l,h),this._back.internalResetStyleOrClass(i._style),o){const t=l,e=h,{wMap:a,hMap:c,scale:d,tx:_,ty:u}=i.prepareLayout(t,e);this.$_prepareLayoutSeries(s,r),this._transformInfo={tx:_,ty:u,scale:d,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const p=`translate(${_}px, ${u}px) scale(${d}, ${-d})`,g=a*d,m=c*d,f=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-g)/2-i.panX*d,e=(h-m)/2-i.panY*d;this._mapBack.render(this.doc,r,t,e,g,m)}this._secondContainer.visible&&f.push(this._secondContainer),f.forEach((t=>{const e=t.axisView;e.setScale(d),e.measure(s,n,l,h),e.resize(l,h),e.trans(_,u),t.seriesViews.forEach((t=>{var e;t._scale=d,t.model.needMapScale()?(t._pointLayer.setStyle("transform",p),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:p})):t.trans(_,u),t.move(_,u),t.resize(g,m),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(_,u)})),e.layout()}));const b=i._prj;this.$_doClipPathLayout(i,b,l,h,d),this._crosshairView.visible&&this._crosshairView.prepare(d,p);const y=n.grid.getStep(o)||10;this.$_layoutAxisGuides(s,n,{map:o,prj:b,step:y,tf:this._transformInfo,trans:p},l,h)}if(this.$_layoutAnnotations(l,h),a&&a.width===l&&a.height===h||(this._clip=this.clipRect(0,0,l,h)),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 ya(t)).start(),this._requestShow=null)}this._prevPrj=i._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.pointToMap(this._mousePos),this._transformInfo)}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset())),this._secondContainer.visible&&this._secondContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,s){let i,r;if(!this.model)return;for(const n of this._seriesContainer.seriesViews)n.pointerMoved(t,e,s)&&(i=n,r=n.getPointView(s));if(!r)for(const t of this._seriesContainer.seriesViews)if(r=t.getPointView(s),r){i=t;break}const n=this.model.chart,o=null==i?void 0:i.model,a=o&&this._owner.getScaleView(n.getColorScale(o.getColorScale()));return(null==r?void 0:r.point)?(this._owner.showTooltip(o,r,this,{x:t,y:e}),null==a||a.setValue(r.point.getValue())):(this._owner.hideTooltip(),null==a||a.setValue(NaN)),this._crosshairView.visible&&n&&this._crosshairView.render(this.pointToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!i}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 s=this.getSeries(t);s&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new wa(s)).start())}pointToMap(t){const e=this.model.chart.getProjection(!1),{tx:s,ty:i,scale:r,vx:n,vy:o}=this._transformInfo,a=[(t.x-n-s)/r,(t.y-o-i)/-r];return e.backward(a)}$_prepareMeasureSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ba(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((s=>{s._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,s,i,r){this._axisGuideContainer.render(t,e,s,i,r),this._frontAxisGuideContainer.render(t,e,s,i,r);const n=this.model.chart,o=Object.assign(Object.assign({},s),{prj:s.prj.second});this._secondFrontAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,o,i,r)),this._secondAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,o,i,r))}$_doClipPathLayout(t,e,s,i,r){const n=()=>{const t=e.getClipBounds();return`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:s}=this._transformInfo;t.path.transEx(e,s).scale(r)};if(t.isScrollable())if(e.isClipping()){const t=this._clipMap;if(t&&t.width===s&&t.height===i){if(t){if(this._prevPrj!==e){const e=n();t.setPath(e)}o(t),this._contentLayer.hasAttr("clip-path")||this._contentLayer.attachClipPath(this._clipMap.id)}}else{const t=n();this._clipMap=this._contentLayer.clipPath(t),o(this._clipMap),this._clipMap.resize(s,i)}}else this._contentLayer.detachClipPath();else this._seriesContainer.setVisible(!0),this._seriesContainer.scrollTo(0),this._secondContainer.setVisible(!1),e.isClipping()||this._contentLayer.detachClipPath()}}class Ca extends Bn{constructor(t,e){super(t,e?Ca.SUBTITLE_CLASS:Ca.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Ve(t)),this._richText=new Be}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null)),pt(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var La,ka;Ca.TITLE_CLASS="rm-title",Ca.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(La||(La={}));class Pa extends Rt{constructor(t){super(t,Pa.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Ft(t,"rm-tooltip-back")),this.add(this._top=new Ft(t,"rm-tooltip-top")),this.add(this._textView=new Ve(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Dt.SHADOW_FILTER+")"),this._textView.anchor=Me.START,this._richText=new Be,this.close(!0,!1)}show(t,e,s,i,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a);if(!c)return;const d=l.text||c.getTooltipText(t,a);if(!d)return;const _=this.control,u=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=g(l.minWidth||0,b.width+16),w=g(l.minHeight||0,b.height+12);this._top.setFill((null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,S=e.getBounds(),C=_.getBounds();let L;L=s-y/2-g(0,p(s-y/2,u-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(C.bottom,S.bottom);const k=La.TOP;this.drawTooltip(0,0,y,w,k,L),i-=w+v,s=g(0,p(s-=y/2,u-y)),i=g(0,p(i,m-w)),this.transEx(s,i,x,!1),0===x&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:Gi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,s,i,r,n){const o=null!=s?G(e,s):{},a=G(e,i),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case La.TOP:l=l.concat(["M",t+s/2-o/2+n,e+i,"L",t+s/2+n,e+i+o,"L",t+s/2+o/2+n,e+i]);break;case La.BOTTOM:l=l.concat(["M",t+s/2-o/2+n,e,"L",t+s/2+n,e-o,"L",t+s/2+o/2+n,e]);break;case La.LEFT:l=l.concat(["M",t+s,e+i/2-o/2+n,"L",t+s+o,e+i/2+n,"L",t+s,e+i/2+o/2+n]);break;case La.RIGHT:l=l.concat(["M",t,e+i/2-o/2+n,"L",t-o,e+i/2+n,"L",t,e+i/2+o/2+n])}const c=r===La.BOTTOM,d=c?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(s-u.width)/2,e+=(i-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}Pa.CLASS_NAME="rm-tooltip";class Ma extends In{constructor(t){super(t,Ma.SCALE_CLASS),this._gap=0,this.add(this._barLayer=new $t(t)),this._bars=new Hn(this._barLayer,is,"rm-color-scale-bar"),this.add(this._splitLayer=new $t(t)),this._splits=new Hn(this._splitLayer,ao,"rm-color-scale-split"),this.add(this._markerLabel=new Kn(t,void 0)),this.add(this._marker=new Ft(t,"rm-color-scale-marker")),this.add(this._tickLineLayer=new $t(t,"rm-color-scale-tick-line")),this.add(this._tickLabelLayer=new $t(t,"rm-color-scale-tick-label")),this._tickLines=new Hn(this._tickLineLayer,ao),this._tickLabels=new Hn(this._tickLabelLayer,Kn),this._fills=[]}setValue(t){var e,s;e=t,s=this._value,(isNaN(e)?isNaN(s):e===s)||(this._value=t,this.$_resetMarker(this._vertical,this._reversed))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=this.chart().isDirty,n=e.options,o=e.marker,a=e.getTicks(),h=this._tickLen=+e.tick.line.options.length||0,l=e.tick.line,c=e.tick.label,d=this._vertical="vertical"===e.getLayout(),_=this._reversed=e.isReversed();let{width:u,height:p}=e.getBarSize(s,i,d);if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(l.visible&&h>0),r){const s=this._vertical?p:u,i=e.getSplitPoints(s);this.$_prepareBars(t,e,d,_),this._splitLayer.visible&&this.$_prepareSplits(t,i),this._tickLineLayer.visible&&this.$_prepareTickLines(t,i,s)}if(this._markerSize=this._labelSize=0,this._markerLabel.setVisible(o.visible)&&(this._markerSize=o.getMarkerSize(),d?u+=this._markerSize:p+=this._markerSize,r&&this.$_prepareMarker(o,d,_,this._markerSize),this._markerLabel.setVisible(o.label.visible)),this._tickLineLayer.setVisible(l.visible&&a.length>0)&&this._tickLines.forEach((t=>{t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(l._style)})),this._tickLabelLayer.setVisible(c.visible&&a.length>0)){const s=d?"width":"height";this._tickLabelSize=0,this._tickLabels.prepare(a.length,((i,r)=>{i.setModel(t,e.tick.label,null,null),i._text.internalResetStyleOrClass(c._style),i.setText(a[r].label),i.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,i.bbox()[s]),d&&(this._tickLabelSize+=1)})),d?u+=this._tickLabelSize+h:p+=this._tickLabelSize+h}return this._gap=b(+n.gap,0),this._vertical?u+=this._gap:p+=this._gap,{width:u,height:p}}_doLayout(){const t=this._vertical,e=this._reversed,s=this._tickLabelSize,i=this._markerSize,r=this._tickLen,n=this._gap;let o=this.width,a=this.height,h=0,l=0;t?(h+=e?s:n+i,o-=n+i,s>0&&(e?this._tickLabelLayer.transX(s):this._tickLabelLayer.transX(this.width-s+1),this._tickLabels.forEach(((t,s,i)=>{e&&t.transX(-t.bbox().width),t.transY(s*a/(i-1)-t.bbox().height/2)})),o-=s),o-=r,e&&(h+=r)):(l+=n+i,a-=n+i,s>0&&(e?this._tickLabelLayer.transY(0):this._tickLabelLayer.transY(this.height-s),this._tickLabels.forEach(((t,e,s)=>{t.transX(e*o/(s-1)-t.bbox().width/2)})),a-=s),a-=r,e&&(l+=r)),this._barLayer.setBounds(h,l,o,a),this._bars.forEach(((e,s,i)=>{t?e.setBounds(0,s*a/i,o,a/i):e.setBounds(s*o/i,0,o/i,a)})),this._splitLayer.visible&&this.$_layoutSplits(h,l,o,a),this._tickLineLayer.visible&&(t?e?h-=r:h+=o:e?l-=r:l+=a,this.$_layoutTickLines(h,l,r)),this.$_resetMarker(this._vertical,this._reversed)}$_getFillId(t){return`${Ma.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,s){const i=t.createElementNS(e,"linearGradient");return i.setAttribute("id",this.$_getFillId(s)),i.appendChild(t.createElementNS(e,"stop")),i.appendChild(t.createElementNS(e,"stop")),this.control.addDef(i),i}$_setDir(t,e,s){e?(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","0%"),t.setAttribute("y2","100%")):(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","100%"),t.setAttribute("y2","0%"))}$_fillStops(t,e,s){const i=t.childNodes[0],r=t.childNodes[1];i.setAttribute("offset","0"),i.setAttribute("stop-color",e.toString()),i.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",s.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,s,i){const r=this._fills,n=e.getSteps();if(n){let e=0;n.forEach(((s,i)=>{s._color1&&(r.length<=e&&r.push(this.$_createGradient(t,e)),r[r.length-1][ls]=s,e++)})),r.forEach((t=>{const e=t[ls];this.$_setDir(t,s,i),this.$_fillStops(t,e._color1,e._color2)})),this._bars.prepare(e,((t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))}))}else if(this._bars.prepare(1),e.minColor){let n=r.shift();if(n){for(let t=1;t<r.length;t++)this.control.removeDef(r[t]);this._fills=[n]}else n=this.$_createGradient(t,0),r.push(n);this.$_setDir(n,s,i),this.$_fillStops(n,e.minColor,e.maxColor||e.series.color),this._bars.first.setStyle("fill",this.$_getFillUrl(0))}else r.forEach((t=>this.control.removeDef(t))),this._fills=[]}$_prepareSplits(t,e){this._splits.prepare(e.length,((t,s)=>{t._userData=e[s]}))}$_prepareTickLines(t,e,s){this._tickLines.prepare(e.length+2,((t,i)=>{t._userData=0===i?0:i===e.length+1?s-1:e[i-1]}))}$_prepareMarker(t,e,s,i){e?s?this._marker.setPath(`M 0 0 L ${.8*i} -${.7*i} L ${.8*i} ${.7*i} Z`):this._marker.setPath(`M 0 0 L -${.8*i} -${.7*i} L -${.8*i} ${.7*i} Z`):s?this._marker.setPath(`M 0 0 L -${.7*i} ${i} L ${.7*i} ${i} Z`):this._marker.setPath(`M 0 0 L -${.7*i} -${i} L ${.7*i} -${i} Z`)}$_layoutSplits(t,e,s,i){this._splits.forEach((r=>{this._vertical?r.setHLine(r._userData,t,t+s):r.setVLine(r._userData,e,e+i)}))}$_layoutTickLines(t,e,s){this._tickLines.forEach((i=>{this._vertical?i.setHLine(i._userData,t,t+s):i.setVLine(i._userData,e,e+s)}))}$_resetMarker(t,e){const s=this._markerSize,i=this._gap,r=isNaN(this._value);if(this._marker.setBoolData("null",r),t){const t=e?this.width-i-s+1:s+i-1;this._marker.trans(t,r?0:this.height*this.model.getPosition(this._value))}else{this.model.getPosition(this._value)>1&&console.log(this.model.getPosition(this._value));const t=e?this.height-i-s+1:s+i;this._marker.trans(r?0:this.width*this.model.getPosition(this._value),t)}}}Ma.SCALE_CLASS="rm-color-scale",Ma.SCALE_FILL="rm-color-scale-fill";class Aa extends Rt{constructor(t,e,s){super(t,Aa.STYLE),this.add(this._back=new is(t,Aa.BACK_STYLE)),this.add(this._textView=new Ve(t)),s&&this.dom.classList.add(s),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Ae.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),i=getComputedStyle(this._back.dom),r=(new On).applyPadding(i);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+s.width/2,r.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+r.left+r.right,height:s.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Aa.STYLE="rm-button",Aa.BACK_STYLE="rm-button-background";class Ea extends Aa{constructor(t,e,s){super(t,e),this.callback=s}click(){return this.callback(),!0}}class Va extends In{}class Ta extends Va{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new Ea(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new Ea(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new Ea(t,"-",(()=>this.chart().body.incZoom(-this.model.getZoomStep()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,s,i){const r=this.chart().body.zoom,n=this._szBtn=e.getButtonSize(),o=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(ds,r<=100),this._btnDec.setBoolData(ds,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;if(this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e),this._vertical){let t=0;this._btnHome.visible&&(t+=e.height+this._gap),this._btnInc.transY(t),t+=e.height+this._gap,this._btnDec.transY(t)}}}class Na extends Va{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 s=0;s<e.count-1;s++)if(e.get(s).containsDom(t))return this.model.chart.drillup(e.get(s+1)[cs]),!0}_doMeasure(t,e,s,i){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new Hn(this,Ve,"rm-drilldown-text"),this._seperators=new Hn(this,Ve,"rm-drilldown-separator"));const t=e.chart.firstVisible,s=this._history=t.getHistory();this._textViews.prepare(s.length,((t,e)=>{t.text=s[e].displayName(),t.anchor=Me.START,t[cs]=s[e]})),this._seperators.prepare(s.length-1,(t=>{t.text=">",t.anchor=Me.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new Ea(t,"<",(()=>{e.chart.drillup()}))),r.layout();const s=r.bbox();n=s.width,o=s.height}return{width:n,height:o}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let s=0;for(let i=0;i<e.length;i++){const r=this._textViews.get(i);r.setBoolData("history",i<e.length-1),r.transX(s),i<e.length-1&&(s+=r.bbox().width+t,this._seperators.get(i).transX(s),s+=this._seperators.get(i).bbox().width+t)}}}}class Da extends In{constructor(t){super(t,Da.SCALE_CLASS),this._bubbles=[],this._lines=[],this._labels=[],this.add(this._bubbleLayer=new $t(t)),this.add(this._lineLayer=new $t(t)),this.add(this._labelLayer=new $t(t))}_doMeasure(t,e,s,i){const r=this.chart();r.isDirty,e.options;const n=this._steps=e.getSteps(r.width,r.height);return this._model=e,this.$_prepareBubbles(t,e,n),{width:100,height:100}}_doLayout(){const t=this._model,e=this.height,s=this._steps,i=s[s.length-1].rd;if(this._bubbles.forEach(((t,r)=>{const n=s[r];t.internalResetStyleOrClass(null),t.setCircle(i,e-n.rd,n.rd)})),this._lineLayer.visible){const r=2*i+(t.tick.line.options.length||0);this._lines.forEach(((t,n)=>{const o=s[n];t.setHLine(e-2*o.rd,i,r)}))}if(this._labelLayer.visible){const r=2*i+t.tick.line.options.length+(t.tick.label.options.offset||0);this._labels.forEach(((i,n)=>{const o=s[n];i.setText(t.tick.label.getText(o.label)),i.trans(r,e-2*o.rd-i.bbox().height/2)}))}}$_prepareBubbles(t,e,s){const i=e.tick,r=s.length;Rt.fit(t,this._bubbleLayer,this._bubbles,r,Zo,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(i.visible&&i.line.visible)&&Rt.fit(t,this._lineLayer,this._lines,r,ao,"rm-bubble-scale-line"),this._labelLayer.setVisible(i.visible&&i.label.visible)&&Rt.fit(t,this._labelLayer,this._labels,r,Kn,"rm-bubble-scale-label")}}Da.SCALE_CLASS="rm-bubble-scale";class Ra extends In{constructor(t){super(t,Ra.SCALE_CLASS)}_doMeasure(t,e,s,i){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Ra.SCALE_CLASS="rm-map-scale";class $a extends jn{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Ca(t,!1)),this.add(this.subtitleView=new Ca(t,!0))}_doMeasure(t,e,s,i){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=s,u=0,p=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,s,i),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,s,i),c=this._hSub=o.height,l=this._wSub=o.width,p=+n.options.titleGap||0):d.setModel(n),n.options.position){case"left":case"right":u=g(h,c),_=a+p+l;break;default:u=h+p+c,_=g(_,a+l)}return u>0&&(u+=this.titleView.visible?b(r.options.gap,0):b(n.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||i&&"chart"===n.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===o.alignBase?0:t.xMap;if(a>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},d=()=>{const e=g(this._hTitle,this._hSub);m=g(m,m+t(i,e,this._hTitle)),y=g(y,y+t(r,e,this._hSub))},_=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=g(f,f+_(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=f;break;case"right":w=f+this._wTitle-this._wSub;break;default:w=f+(this._wTitle-this._wSub)/2}else w=g(w,w+_(r,h,this._wSub))},p=b(o.titleGap,0);let m=0,f=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":f=w+this._wSub+p,d();break;case"right":switch(w=f+this._wTitle+p,o.align){case"center":w=g(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=g(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;case"right":switch(o.position){case"left":switch(f+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":w+=h-this._wSub,f=w-p-this._wTitle,d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;default:switch(o.position){case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(f-w-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":w=f+this._wTitle+p;break;case"center":w=f+this._wTitle+p,w+=(h-w-this._wSub)/2;break;case"right":w+=h-p-this._wSub}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}}e.resizeByMeasured().layout().trans(f,m),s.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=o-d;break;default:_+=(o-d)/2}n.trans(_,0)}}_doLocateInner(t,e,s){}}class Oa extends jn{_doInitChildren(t){this.add(this._legendView=new Yn(t))}_doMeasure(t,e,s,i){const r=e._legend,n=this._legendView.measure(t,r,s,i),o=this._loc=r.getLocation();return"left"===o||"right"===o?n.width+=this._legendView._gap:n.height+=this._legendView._gap,n}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._loc){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}_doLocateInner(t,e,s){const i=this._legendView,r=i.model.options,n=this.width,o=this.height;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-n-a;break;case"center":h+=(t-n)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-o-a;break;case"middle":l+=(e-o)/2+a;break;default:l+=a}i.trans(h,l)}}class Fa extends jn{constructor(t,e){super(t),this.loc=e}getView(t){var e;return null===(e=this._views)||void 0===e?void 0:e.find((e=>e.model===t))}setScales(t,e,s){return this._scales=t,this._wChart=e,this._hChart=s,this}_doMeasure(t,e,s,i){const r=this.loc,n=this._prepareScales(t,this._wChart,this._hChart);if(!this.setVisible(n&&n.length>0))return;const o=new $n;return n.forEach(((e,r)=>{e.measure(t,this._scales[r],s,i)})),r===tt.TOP||r==tt.BOTTOM?n.forEach((t=>{o.width+=t.mw,o.height=g(o.height,t.mh)})):r===tt.LEFT||r===tt.RIGHT?n.forEach((t=>{o.width=g(o.width,t.mw),o.height+=t.mh})):n.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(){const t=this.loc,e=this._views;let s=this.width,i=this.height,r=0,n=0;e.forEach((t=>{t.resizeByMeasured(),t.layout()})),t===tt.LEFT||t===tt.RIGHT?e.forEach((t=>{const e=t.model.options,s=+e.offsetY||0;switch(e.verticalAlign){case"bottom":n+=i-t.height-s;break;case"top":n+=s;break;default:n+=(i-t.height)/2+s}t.trans(r,n)})):e.forEach((t=>{const e=t.model.options,i=+e.offsetX||0;switch(e.align){case"right":r+=s-t.width-i;break;case"left":r+=i;break;default:r+=(s-t.width)/2+i}t.trans(r,n)}))}_doLocateInner(t,e,s){this._views.forEach((s=>{const i=s.model.options,r=this.width,n=this.height;let o=+i.offsetX||0,a=0,h=0;switch(i.align){case"right":a+=t-r-o;break;case"center":a+=(t-r)/2+o;break;default:a+=o}switch(o=+i.offsetY||0,i.verticalAlign){case"bottom":h+=e-n-o;break;case"middle":h+=(e-n)/2+o;break;default:h+=o}s.trans(a,h).resize(r,n),s.layout()}))}_prepareScales(t,e,s){const i=this._scales.length;if(this.setVisible(i>0)){const e=this._views||(this._views=[]);for(;e.length<i;)e.push(this.add(this._createView(t)));for(;e.length>i;)e.pop().remove();return e}}}class Ia extends Fa{_createView(t){return new Ma(t)}}class Ba extends Fa{_createView(t){return new Da(t)}}class ja extends In{constructor(t){super(t,"rm-credits"),this.add(this._textView=new Ve(t)),this._textView.anchor=Me.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const s=this.width,i=this.height,r=+t.offsetX||0,n=+t.offsetY||0;let o=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-i;break;case"middle":a=e.y+(e.height-i)/2+n;break;default:a=e.y+n}switch(t.align){case"right":o=e.right-s-r;break;case"center":o=e.x+(e.width-s)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,s){const i=t.location,r=this.width,n=this.height,o=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(i){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=s-n-a}if("left"===i||"right"===i)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=s-n;break;default:l=(s-n)/2+a}else switch(t.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,s,i){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class za extends $t{constructor(t){super(t,"rm-chart"),this._colorScaleMap={},this._bubbleScaleMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new $t(t,"rm-annotations")),this.add(this._bodyView=new Sa(t,this)),this.add(this._titleSectionView=new $a(t)),this.add(this._scaleLayer=new $t(t,"rm-scales")),this.add(this._legendSectionView=new Oa(t)),this.add(this._frontAnnotationContainer=new $t(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Ta(t)),this.add(this._drilldownPanelView=new Na(t)),this.add(this._mapScaleView=new Ra(t)),this.add(this._creditView=new ja(t)),this.add(this._tooltipView=new Pa(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}legendView(){return this._legendSectionView._legendView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}measure(t,e,s,i){const r=(this._model=e)._credits,n=e._legend,o=this._bodyView;let a,h=e.width=s,l=e.height=i;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(a=this._creditView.measure(t,r,h,l),e.location){case"body":break;case"right":case"left":h-=a.width+(+e.offsetX||0)+(+e.gap||0);break;default:l-=a.height+(+e.offsetY||0)+(+e.gap||0)}}if(a=this._titleSectionView.measure(t,e,h,l),l-=a.height,this._legendSectionView.setVisible(n.isVisible()))switch(a=this._legendSectionView.measure(t,e,h,l),n.getLocation()){case"top":case"bottom":l-=a.height;break;case"right":case"left":h-=a.width}o.prepare(t,e.body);for(const r of Object.values(tt)){const n=e._colorScales.getVisibles(r);let o=this._colorScaleMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Ia(t,r),this._scaleLayer.add(o),this._colorScaleMap[r]=o);const a=this._colorScaleMap[r].setScales(n,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else o&&o.setVisible(!1)}for(const r of Object.values(tt)){const n=e._bubbleScales.getVisibles(r);let o=this._bubbleScaleMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Ba(t,r),this._scaleLayer.add(o),this._bubbleScaleMap[r]=o);const a=this._bubbleScaleMap[r].setScales(n,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else o&&o.setVisible(!1)}o.measure(t,e.body,h,l),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,h,l),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,h,l)}layout(){const t=this._model,e=this.width,s=this.height;let i=e,r=s;const n=this._bodyView;let o=0;const a=t._legend,h=t._credits,l=this._creditView;h.options.gap;let c=0,d=0,_=0,u=0,p=0;if(l.visible){const t=h.options;l.resizeByMeasured();const e=l.width+(+t.offsetX||0)+(+t.gap||0),s=l.height+(+t.offsetY||0)+(+t.gap||0);switch(h.options.location){case"body":break;case"right":i-=_=e;break;case"left":i-=c=e,u+=e;break;case"top":r-=s,p+=s;break;default:r-=d=s}}const g=this._titleSectionView;g.visible&&(g.resizeByMeasured(),g.layout({xMap:u,wMap:i,wChart:e}).trans(0,p),p+=g.height,r-=o=g.height);const m=this._legendSectionView;let f,b,y=0,w=0;if(m.visible)switch(m.resizeByMeasured().layout(),y=m.height,w=m.width,m._loc){case"top":f=p,r-=y,p+=y;break;case"bottom":r-=y,f=p+r;break;case"right":i-=w,b=e-_-w;break;case"left":i-=w,u+=w,b=c}const x=this._colorScaleMap;let v=0,S=0;for(const t in x){const n=x[t];if(n.visible)switch(t===tt.RIGHT||t===tt.LEFT?n.resize(n.mw,s):t===tt.TOP||t===tt.BOTTOM?n.resize(e,n.mh):n.resize(n.mw,n.mh),n.layout(),v=n.height,S=n.width,t){case tt.BOTTOM:r-=v;break;case tt.TOP:r-=v,p+=v;break;case tt.RIGHT:i-=S;break;case tt.LEFT:i-=S,u+=S}}const C=this._bubbleScaleMap;let L=0,k=0;for(const t in C){const e=C[t];if(e.visible&&(e.resizeByMeasured(),"body"!==t))switch(e.layout(),L=e.height,k=e.width,t){case tt.BOTTOM:r-=L;break;case tt.TOP:r-=L,p+=L;break;case tt.RIGHT:i-=k;break;case tt.LEFT:i-=k,u+=k}}const P=mt.create(u,p,i,r);if(l.visible){const t=h.options,i="body"===t.location?l.locateInner(t,P):l.locateOuter(t,e,s);l.transp(i)}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));let M=0,A=0;if(m.visible){const t=a.options,n=+t.offsetY||0,o=+t.offsetX||0;if("body"===t.location)m.locateInner(i,r);else if(isNaN(f)){if(u=b,"chart"===t.alignBase){switch(t.verticalAlign){case"top":p=n;break;case"bottom":p=s-y-n;break;default:p=(s-y)/2+n}p+y>s&&(p=(s-y)/2)}else switch(t.verticalAlign){case"top":p+=n;break;case"bottom":p=p+r-y-n;break;default:p=p+(r-y)/2+n}p+y>s&&(p=(s-y)/2),p<0&&(p=0),M=m.width}else{if(p=f,"chart"===t.alignBase)switch(t.align){case"left":u=o;break;case"right":u=e-w-o;break;default:u=(e-w)/2+o}else switch(t.align){case"left":u+=o;break;case"right":u=u+i-w-o;break;default:u+=(i-w)/2+o}u+w>e&&(u=(e-w)/2),u<0&&(u=0),A=m.height+n}m.trans(u,p)}for(const t in x){const i=x[t];if(i.visible)if("body"===t)i.locateInner(P.width,P.height).trans(P.x,P.y);else{switch(t){case tt.BOTTOM:default:p=s-d-A-v,u=(e-i.width)/2;break;case tt.TOP:p=o+A,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-M-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=M}i.trans(u,p)}}for(const t in C){const i=C[t];if(i.visible)if("body"===t)i.locateInner(P.width,P.height).trans(P.x,P.y);else{switch(t){case tt.BOTTOM:default:p=s-d-A-L,u=(e-i.width)/2;break;case tt.TOP:p=o+A,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-M-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=M}i.trans(u,p)}}this.$_layoutAnnotations(e,s,P),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:i.x,y:i.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?i.x:r)-this.tx,h=(o?i.y:n)-this.ty;this._tooltipView.show(t,e,a,h,s,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getScaleView(t){for(const e in this._colorScaleMap){const s=this._colorScaleMap[e].getView(t);if(s)return s}}pointerMoved(t,e,s){this._bodyView.pointerMoved(t,e,s)}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)}isAnimating(){}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ba(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s){const i=this.control._padding;let r,n,o,a;this._annotationViews.forEach((s=>{if("container"===s.model.options.scope)r=-i.left,n=-i.top,o=t+i.left+i.right,a=e+i.top+i.bottom;else r=n=0,o=t,a=e;s._layoutView(this,r,n,o,a)}))}$_layoutPanel(t,e){const s=t.model.options,i=s.offsetX||0,r=s.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(s.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(s.align){case"right":a+=e.width-i-n;break;case"center":a+=(e.width-n)/2+i;break;default:a+=i}t.trans(a,h)}}!function(t){t.EXPORT="$$realmap_export"}(ka||(ka={}));class Ha extends Dt{constructor(t,e){super(t,e),this.addElement(this._chartView=new za(t))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new En(null,((t,e)=>{this.changeModel(t,e)}))}onModelChanged(t,e,s){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,s,i){i&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(s)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,s){const i=this._chartView.bodyView();s?i.showSeries(e):i.hideSeries(e)}onExportRequest(t,e){this._export(e)}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.clearAssetDefs(),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===ka.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_creatDefaultTool(){return new Rn(this)}_doBeforeRender(t){t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const s=this.model,i=this._chartView;this._setBackgroundStyle(s.options.chart.backgroundStyle),s&&(s.prepareRender(),this._loadModules()),this.loaded||i.clean();const r=t.width,n=t.height;i.measure(this.doc(),s,r,n),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0)}_doAfterRender(){this._chartView.bodyView().afterRender()}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}}class Ga{static getVersion(){return"1.0.1"}static setDebugging(t){Rt.DEBUGGING=t}static setLogging(t){dt.LOGGING=t}static getDistance(t,e){return dt.getDistance(t,e)}static createChart(t,e,s,r=!0,n){C.loadConfigAsync(s,!0);const o=new Ha(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[An]=o,o.chart}static createChartAsync(e,s,r,n=!0,o){return t(this,void 0,void 0,(function*(){yield C.loadConfigAsync(r);const t=new Ha(e,s);return i(r)&&t.chart.load(r,n,o),t.chart[An]=t,t.chart}))}static preset(t,e){return ki.createStockInset(t,e)}}const Ya=Ga.getVersion,Wa=Ga.setDebugging,Za=Ga.setLogging,Ua=Ga.getDistance,Xa=Ga.createChart,qa=Ga.createChartAsync,Ka=Ga.preset;export{Ke as Annotation,cr as BarSeries,Cn as Body,Sa as BodyView,Ds as BubbleSeries,Ha as ChartControl,In as ChartElement,Ge as ChartItem,za as ChartView,Zo as CircleElement,wr as CircleGauge,Vr as ClockGauge,Pe as Color,zn as ContentView,ps as DataPointLabel,Hn as ElementPool,Js as Exporter,$r as FigureSeries,Fr as HeatmapSeries,es as HeatmapSeriesType,Yi as ImageAnnotation,jr as ImageSeries,js as Legend,ao as LineElement,Yr as LineSeries,_i as MapAxis,hi as MapAxisBandGuide,oi as MapAxisGuide,ai as MapAxisLineGuide,li as MapAxisRangeGuide,En as MapChart,di as MapCrosshair,Xr as MapSeries,ts as MapSeriesType,Ss as MarkerSeries,xo as MarkerSeriesPointView,vo as MarkerSeriesView,V as ORG_ANGLE,Ms as OrthogonalSparkSeries,E as PI_2,en as PanelSeries,rn as PieSeries,an as PinSeries,fo as PointElement,_o as PointLabelView,cn as PointSeries,N as RAD_DEG,is as RectElement,un as RouteSeries,Je as RouteSeriesType,jn as SectionView,jo as SectorElement,bs as Series,To as SeriesAnimation,wo as SeriesView,Wi as ShapeAnnotation,$n as Size,ks as SparkSeries,Hi as Subtitle,Me as TextAnchor,Zi as TextAnnotation,Ve as TextElement,Ae as TextLayout,ss as TiledWebSeriesType,zi as Title,dt as Utils,xs as ValueSeries,gn as VectorSeries,fn as WaffleSeries,ct as _isIE,m as absv,l as assignObj,W as calcPercent,f as copyObj,_ as cos,Xa as createChart,qa as createChartAsync,ut as createRect,R as fixnum,Ua as getDistance,Ya as getVersion,v as incv,r as isArray,gt as isEmptyRect,i as isObject,o as isString,g as maxv,p as minv,Y as parsePercentSize,b as pickNum,w as pickProp,x as pickProp3,F as pixel,Ka as preset,pt as rectToSize,Wa as setDebugging,Za as setLogging,u as sin};
|