realmap 1.0.11 → 1.0.12
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/band.js +2 -2
- package/band.mjs +2 -2
- package/chart.js +1 -1
- package/chart.mjs +1 -1
- package/editing.js +1 -1
- package/editing.mjs +1 -1
- package/export.js +1 -1
- package/export.mjs +1 -1
- package/feature.js +2 -2
- package/feature.mjs +2 -2
- package/heatmap.js +2 -2
- package/heatmap.mjs +2 -2
- package/index.d.ts +169 -24
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/sankey.js +2 -2
- package/sankey.mjs +2 -2
- package/table.js +2 -2
- package/table.mjs +2 -2
- package/tiledweb.js +1 -1
- package/tiledweb.mjs +1 -1
- package/track.js +2 -2
- package/track.mjs +2 -2
- package/vector.js +2 -2
- package/vector.mjs +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Realmap v1.0.
|
|
3
|
+
* Realmap v1.0.12
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",i=Object.prototype.hasOwnProperty,s=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,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},w=function(t,e){return void 0!==t?t:e},x=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},v=(t,e,i)=>t+(e-t)*i;class C{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}C._debugging=!1;class S{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(o(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)o(t.map[e])&&(t.map[e]={url:t.map[e]});const i=r(t.map)?t.map:[t.map];for(const t of i)!s(t.source)&&o(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const i=r(t.series)?t.series:[t.series];for(const t of i)!s(t.data)&&!r(t.data)&&o(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=await this.fetchJson(t.dataUrl),delete t.dataUrl))}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const 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 A=L.ko;const M=void 0,P="%".charCodeAt(0),k=Math.PI,I=2*k,N=-k/2,T=k/180,E=180/k;function V(t){return t>I?t%I:t}function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function F(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const i={};return i[t]=e,i}function W(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===P&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;K(A.invalidSizeValue,t)}}return{size:s,fixed:i}}function Y(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}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 K=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},q="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),i=b(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const it="undefined"!=typeof navigator?navigator.userAgent:"",st=it?navigator.appVersion:"",rt=!!it.match(/Trident.*rv\:11\./),nt=-1!==st.indexOf("MSIE 10"),ot=-1!==st.indexOf("MSIE 9"),at=rt||nt||ot;class ht{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&ht.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(i,ht.month_days[ht.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!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 i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}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 i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-et}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=g(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=g(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let i of Object.keys(t))e[i]=ht.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const i=+new Date;e(),ht.log(t,+new Date-i+"ms")}static clamp(t,e,i){return g(e,p(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=g(e,t)),isNaN(i)||(t=p(i,t)),t}static makeIntArray(t,e){const i=new Array(g(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*T,s=(e[1]-t[1])*T,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*T)*Math.cos(e[0]*T)*Math.sin(s/2)*Math.sin(s/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],i=t[0];for(let s=1;s<t.length;s++)e=p(e,t[s]),i=g(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||r(t))){const i=e.split(".");let s=t;for(let t of i)s=s[t];return s}return t}static normalizeToSteps(t,e){if(t.length<2)return t;const i=Math.min(...t),s=Math.max(...t);if(i===s)return[i];const r=(s-i)/(e-1),n=10**Math.floor(Math.log10(r)),o=r/n;let a;a=o<=1?1:o<=2?2:o<=5?5:10,a*=n;const h=Math.floor(i/a)*a,l=[];a=(Math.ceil(s/a)*a-h)/(e-1);for(let t=0;t<e;t++)l.push(h+t*a);return l}}ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];const lt=Object.freeze({x:0,y:0,width:0,height:0});function ct(t){return{width:t.width,height:t.height}}class dt{static create(t,e,i,s){const r=arguments.length;return ht.isObject(t)?new dt(t.x,t.y,t.width,t.height):r<2?new dt(t,t,t,t):r<3?new dt(t,e,t,e):new dt(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}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 dt(this.x,this.y,this.width,this.height)}getInner(){return new dt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}dt.Empty=new dt,dt.Temp=new dt;const _t={inOutSine:t=>-(_(k*t)-1)/2};class ut{constructor(){this.delay=0,this.duration=ut.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=p(1,g(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return isNaN(t)||(this.duration=t),this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,i=null){this._started&&this._stop(),this.duration=b(t,ut.DURATION),this.delay=e||0,this._easing=_t[i],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}ut.DURATION=700,ut.SHORT_DURATION=300;let pt=0;class gt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(pt++))}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 mt extends gt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}class ft{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new ft(t,t,t,t):new ft(t,t,e,e):new ft(t,e,i,s)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new ft(this.top,this.bottom,this.left,this.right)}set(...t){for(const e of t)if(isNaN(e))return;const e=t.length;1===e?this.top=this.bottom=this.left=this.right=t[0]:2===e?(this.top=this.bottom=t[0],this.left=this.right=t[1]):3===e?(this.top=t[0],this.bottom=t[1],this.left=this.right=t[2]):e>3&&(this.top=t[0],this.right=t[1],this.bottom=t[2],this.left=t[3])}applyPadding(t){return this.left=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+"}"}}var bt;ft.Empty=Object.freeze(new ft),ft.Temp=new ft,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(bt||(bt={}));const yt={name:"RealMap",version:"1.0.11",license:"enterprise",code:""},wt={name:"RealMap",version:"1.0.11",license:"enterprise",code:null};class xt{static decode(t){const e=xt.CHARS,i=xt.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}xt.PAD="=",xt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class vt{static union(t,e){const i=e.s3[255&t];t>>=8;const s=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=vt.xor,s=vt.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=vt.xor,s=vt.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=vt.kb,s=vt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map((function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*vt.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=vt._decryptBlock;let s=vt._init(e),r=[],n=xt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*vt.POW24|n[a+1]*vt.POW16|n[a+2]*vt.POW8|n[a+3],h.right=n[a+4]*vt.POW24|n[a+5]*vt.POW16|n[a+6]*vt.POW8|n[a+7],i(h,s);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}vt.POW2=Math.pow(2,2),vt.POW3=Math.pow(2,3),vt.POW4=Math.pow(2,4),vt.POW8=Math.pow(2,8),vt.POW16=Math.pow(2,16),vt.POW24=Math.pow(2,24),vt.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 Ct{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==t)}static _getLDKey(t){let e="";for(let i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}const n=r.split(".").length,o=r.indexOf("*");if(n>=2&&n<=4&&o>=2){const t=r.substring(0,o);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=vt.decrypt(t,"dkdl"+this._getLDKey(vt.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}let St=651212;class Lt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=i.pageYOffset||n.scrollTop||r.scrollTop,a=i.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+o-h;return{x:Math.round(c),y:Math.round(d)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,i){t.style.left=e+"px",t.style.top=i+"px"}static moveI(t,e,i){t.style.left=(e>>>0)+"px",t.style.top=(i>>>0)+"px"}static resize(t,e,i){t.style.width=e+"px",t.style.height=i+"px"}static resizeSVG(t,e,i){t.setAttribute("viewBox",`0 0 ${e} ${i}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,i=e.defaultView;return{width:i.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:i.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const i=t.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}static setBounds(t,e,i,s,r){const n=t.style;n.left=e+"px",n.top=i+"px",n.width=s+"px",n.height=r+"px"}static setBoundsEx(t,e,i,s,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(i)&&(n.top=i+"px"),!isNaN(e)&&(n.width=s+"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 i=e.children;for(let e=i.length;e--;)if(i[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;)Lt.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 i in e)t[i]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,i){if(e!=i){if(i)for(const e in i)t[e]="";return e&&Object.assign(t,e),e}return i}static createElement(t,e,i){const s=t.createElement(e);return i&&Object.assign(s.style,i),s}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,i){null==i||""===i?delete t.dataset[e]:t.dataset[e]=i}static toggleData(t,e,i){i?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,i){t.style.setProperty(e,i)}static animate(t,e,i,s,r=150,n="none"){const o={},a={};return o[e]=i,a[e]=s,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e)t.setAttribute(i,e[i])}static getDomId(){return"-rtc-"+St++}static createBR(t,e){const i=t.createElement("br");return i.className=e,i}static createSpan(t,e){const i=t.createElement("span");return e&&Object.assign(i.style,e),i}static createCheckBox(t,e){const i=t.createElement("input");return i.type="checkbox",e&&Object.assign(i.style,e),i}static createRadio(t,e){const i=t.createElement("input");return i.type="radio",e&&Object.assign(i.style,e),i}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){C.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!at&&t.setAttribute("vector-effect","non-scaling-stroke")}}const At={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Mt extends gt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this._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=wt.code||realMapLic,!e)return!1}catch(t){return!1}const i=Ct.decrypt(e);if("RealMap"!=i.name||"RealMap"!==yt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(yt.license!=bt.Developer&&!Ct.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(bt).includes(n))return!1;if(yt.code=i.code,yt.license=i.lic,n==bt.Evaluation||n==bt.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||Mt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(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),Lt.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(){Lt.clearChildren(this._defs)}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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new Dt(this.doc(),t,e,i,s,r,r))}clip(t){return this._defs.appendChild(t.dom),t}pointerToPoint(t){const e=this._dom.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_setTesting(){this._testing=!0,Pt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_registerEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),this.$_addListener(t,"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){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("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,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=t.getElementById(i),this._container instanceof HTMLDivElement||K(A.invalidOuterDiv,i);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=s,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 It(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,i){let s=t.createElementNS(e,"filter");const r=t.createElementNS(e,"feDropShadow");s.setAttribute("id",Mt.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"),s.appendChild(r),i.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._padding=Lt.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:s,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(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()}ht.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){}_domResized(){this.invalidateLayout()}}Mt.CLASS_NAME="rm-control",Mt.SHADOW_FILTER="rm-shadow-filter",Mt._animatable=!0;class Pt extends gt{static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,n){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,n);e.add(s),i.push(s)}}constructor(t,i,s=M){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,s||"g"),(this._styleName=i)&&this.setAttr("class",i),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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}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,i){const s=t.createElementNS(e,i);return this._dom.appendChild(s),s}insertElement(t,i,s){const r=t.createElementNS(e,i);return this._dom.insertBefore(r,s),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}setAttrEx(t,e){return z(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return dt.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=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==M&&(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 i in this._styles)t.removeProperty(U(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const i=this.dom.style;for(let s of t)s in this._styles&&(i.removeProperty(U(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(o(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let i in t)e.setProperty(U(i),this._styles[i]=t[i],"important")}}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this._dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}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 i=!1;if(t){for(let s in t)if(s in At&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(b(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in At){const i=At[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}setStyle(t,e){let i=!1;return t in At||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let i=!1;return t in At&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}putStyles(t,e){if(e=e||{},t)for(let i in t)e[i]=t[i];return e}putStyle(t,e,i){return(i=i||{})[t]=e,i}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=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 i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,r);return this.$_setClip(n),n}clipPath(t){const e=this.control.clip(new Rt(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 Pt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(ht.isValidNum(e)||ht.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),ht.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")");const r=ht.getNum(this._scaleX,1),n=ht.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}Pt.TESTING=!1,Pt.DEBUGGING=!1,Pt.ASSET_KEY="_asset_",Pt.TEMP_KEY="_temp_";class kt extends Pt{constructor(t,e=void 0){super(t,e,"g")}}class It extends Pt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Nt extends Pt{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}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 Tt extends Pt{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}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 Et extends Pt{constructor(t){super(t,M,"mask");const e=this._id=ht.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Vt extends Pt{constructor(t){super(t,M,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Dt extends Vt{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Pt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.move(t,e),this._rect.resize(i,s),this}resize(t,e,i){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Rt extends Vt{constructor(t,e){super(t),this._path=new Nt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var $t;!function(t){t.SIDO="sido"}($t||($t={}));const Ot="shuffle",Ft="random";var Bt;class zt{constructor(t){this.source=t}hasDef(){return!0}}class jt extends zt{_setStops(t,i){const s=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;i.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",h),s.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(s),i.appendChild(n)}}class Gt extends jt{getElement(t,i){const s=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,s),i.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",o),s.setAttribute("x2",n),s.setAttribute("y2",a),s}}Gt.TYPE="lineargradient";class Ht extends jt{getElement(t,i){const s=t.createElementNS(e,"radialGradient");return B(i.cx)||s.setAttribute("cx",i.cx),B(i.cy)||s.setAttribute("cy",i.cy),B(i.r)||s.setAttribute("r",i.r),this._setStops(t,s),s}}Ht.TYPE="radialgradient";class Wt extends zt{getElement(t,i){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rm-pattern"),+i.pattern>=0){const t=Bt.STOCK[+i.pattern%Bt.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else o(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)),n.setAttribute("d",a),h&&l(n.style,h),i.style&&l(n.style,i.style),_&&(n.style.fill="none");let u=i.backgroundStyle;if(o(u)||s(u)){const i=t.createElementNS(e,"rect");r.append(i),i.style.fill=o(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return i.transform&&r.setAttribute("patternTransform",i.transform),r.append(n),r}}Bt=Wt,Wt.TYPE="pattern",Wt.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}],Wt.SELECT=Object.assign(Bt.STOCK[4],{id:"rm-selected-area-fill",pattern:Bt.STOCK[4].path,transform:"scale(0.5)"});class Yt extends zt{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===Ft?this._index=-1:(t.mode===Ot&&ht.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:[]}}Yt.TYPE="colors";class Zt extends zt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Zt.SIZE,height:e.height||e.width||Zt.SIZE})}}Zt.TYPE="images",Zt.SIZE=20;class Ut{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(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 Wt(Wt.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(Pt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(Pt.ASSET_KEY,"1"),e.addDef(s)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Wt.TYPE:r(t.colors)?e=Yt.TYPE:r(t.images)&&(e=Zt.TYPE)),e)switch(e.toLowerCase()){case Gt.TYPE:return new Gt(t);case Ht.TYPE:return new Ht(t);case Wt.TYPE:return new Wt(t);case Yt.TYPE:return new Yt(t);case Zt.TYPE:return new Zt(t)}}}}const Xt="0".charCodeAt(0),Kt="#".charCodeAt(0),qt=",".charCodeAt(0),Jt="s".charCodeAt(0),Qt="a".charCodeAt(0);class te{static getFormatter(t){let e=te.Formatters[t];return e||(te.Formatters[t]=e=new te(t)),e}static get Default(){return te.getFormatter(te.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===Xt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Kt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Xt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===qt){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===Jt){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===Qt){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}te.DEFAULT_FORMAT="",te.Formatters={};const ee=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ie=[".","/","-",":"],se="Z".charCodeAt(0),re="z".charCodeAt(0),ne="A".charCodeAt(0),oe="a".charCodeAt(0),ae="y".charCodeAt(0),he="M".charCodeAt(0),le="m".charCodeAt(0),ce="W".charCodeAt(0),de="w".charCodeAt(0),_e="d".charCodeAt(0),ue="H".charCodeAt(0),pe="h".charCodeAt(0),ge="S".charCodeAt(0),me="s".charCodeAt(0);class fe{static getFormatter(t){let e=fe.Formatters[t];return e||(fe.Formatters[t]=e=new fe(t)),e}static get Default(){return fe.getFormatter(A.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||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case ae:s+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case he:s+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case _e:s+=a>1?j(t.getDate()):t.getDate();break;case ce:s+=a>1?j(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case de:s+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case ue:s+=a>1?j(t.getHours()):t.getHours();break;case pe:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?j(e):e}else s+=a>1?j(t.getHours()):t.getHours();break;case le:s+=a>1?j(t.getMinutes()):t.getMinutes();break;case me:s+=a>1?j(t.getSeconds()):t.getSeconds();break;case oe:case ne:t.getHours()<12?s+=A.am:s+=A.pm;break;case ge:let i=t.getMilliseconds();s+=3==a?G(i):2==a?j(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(ie.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),ee.indexOf(n)<0){let e=n.charCodeAt(0);(e>=ne&&e<=se||e>=oe&&e<=re)&&K(A.invalidDateFormat,t)}e.push(n)}if(r<s&&ht.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&ht.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}fe.Formatters={};const be=["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"],ye=["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 we{static create(t){return o(t)?new we(t):void 0}static isBright(t){return new we(t).isBright()}static getContrast(t,e,i){return new we(t).getContrast(e,i)}static interpolate(t,e,i){const s=new we(null);return s.r=Math.ceil(t.r+(e.r-t.r)*i),s.g=Math.ceil(t.g+(e.g-t.g)*i),s.b=Math.ceil(t.b+(e.b-t.b)*i),s.a=t.a+(e.a-t.a)*i,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(ht.startsWith(t,"rgba(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(ht.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{we.COLORS[t]&&this.$_parseNumber(we.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 we(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}var xe,ve,Ce;we.COLORS=function(){const t={};for(let e=0;e<be.length;e++)t[be[e]]=ye[e];return t}(),t.TextAnchor=void 0,(xe=t.TextAnchor||(t.TextAnchor={})).START="start",xe.MIDDLE="middle",xe.END="end",t.TextLayout=void 0,(ve=t.TextLayout||(t.TextLayout={})).TOP="top",ve.MIDDLE="middle",ve.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ce||(Ce={}));class Se extends Pt{constructor(e,i=M){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.bbox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=s-i.height;break;default:r=Math.ceil(s)}this.setAttr("y",r)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.setStyleOrClass(we.isBright(getComputedStyle(t).fill)?e:i),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let i=super.setStyle(t,e);return i&&this.layoutText(),i}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 Le="$_TH",Ae="$_TW";class Me{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?te.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?fe.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=i[r+2]||"");s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),M),0===this._literals[2].length&&(this._literals[2]=M)}else this._literals.push(r,n,M,M);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Pe extends Me{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class ke extends Pe{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-link")}}const Ie={t:class extends Pe{tag(){return"</t>"}},b:class extends Pe{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Pe{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:ke};class Ne{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new Me).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in Ie){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new Ie[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const Te=/<br.*?>|\r\n|\n/;class Ee{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,i,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===q||u===J;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(t.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=d&&t.prefix||"",i=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+i}const y=b.getBBox();if(b[Ae]=y.width,b[Le]=y.height,p?(u=g(u,b[Ae]),m+=b[Le]):(u+=b[Ae],m=g(m,b[Le])),f||(f=b),l instanceof ke){const i=a.createElementNS(e,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),t.appendDom(i)}}_.push(f),r[Le]=m*h,r[Ae]=u*h,d.push(0==i?r[Ae]/2:r[Ae])}if(c>0){let e=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(p?null!=_[i-1]&&(s=Math.floor(e[Ae]-t.getAscent(e[Ae]))+t.getAscent(l[i][Ae])):r=e[Le]-t.getAscent(e[Le])+t.getAscent(l[i][Le]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[Ae]=n.width,r[Le]=e[Le]=n.height,_[0]=r}switch(u){case q:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case J:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}e=l[i]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=_,r=s[Ae];if(e)s.setAttribute("dx",String(u===J?i-r/2:r/2));else switch(u){case q:s.setAttribute("x",String((i-r)/-2));break;case J:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(l[0][Le])}}layout(e,i,s,r,n){const o=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===q||l===J)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(Te);for(let t of i)e.push((new Ne).parse(t))}}}let Ve=0;const De=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},Re=function(t,e){const i=s(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];r(n)?i[t]=n.slice(0):n instanceof Date?i[t]=new Date(n):s(n)?i[t]=Re(i[t],n):i[t]=n}return i};class $e extends gt{constructor(t){super(),this.chart=t,Ve++}_init(){const t=this._op=Re({},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(e,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(r,t)||Re(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 $e&&(i._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0){if(this[t]instanceof $e)this[t]._doSetSimple(e);else{const s=this._op;e!==s[t]&&(s[t]=e,this.$_applyOptions(s),i&&this._optionChanged())}return this}toggleOption(t,e=!0){const i=this._op,s=i[t];return i[t]=!h(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,e=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;i.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),e&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=Re({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((i=>e._op[i]=t(e[i])));else{e._children=[];for(const i in e){const s=e[i];s instanceof $e&&(e._op[i]=t(s))}}return e._op}(this),t&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,i=!0){let s=this._op.style;return t&&(s||(s=this._op.style={}),null!=e&&""!==e||(e=void 0),s[t]!==e&&(void 0===e?delete s[t]:s[t]=e),this.$_applyOptions(this._op),i&&this._optionChanged()),this}setStyles(t,e=!0){let i=this._op.style;if(s(t)){let s=!1;i||(i=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),i[e]!==r&&(void 0===r?delete i[e]:i[e]=r,s=!0)}s&&(this.$_applyOptions(this._op),e&&this._optionChanged())}return this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const i in e)if(e.hasOwnProperty(i)){let n=e[i];this._doLoadProp(i,n)||(this[i]instanceof $e?t[i]=this[i]._load(n):r(n)?t[i]=n.slice(0):n instanceof Date?t[i]=new Date(n):s(n)?t[i]=Object.assign({},n):t[i]=n)}}_doSetSimple(t,e){if(h(e))return t.visible=e,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`;t[e]!==this[i]&&(this[`${i}Dim`]=W(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){i.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 i=t[e];this._doLoadProp(e,i)||(this[e]instanceof $e?this[e].updateOptions(i):r(i)?this[e]=i.slice(0):i instanceof Date?this[e]=new Date(i):s(i)?this[e]=l({},i):this[e]=i)}}_doPrepareRender(t,e){}_doAfterRender(){}}$e.REFRESHED="refreshed",$e.defaults={visible:!0};class Oe{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 Fe extends $e{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?te.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,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Ee),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(ht.isValidNum(t)){const s=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=o(t)?t:this.$_getNumberText(e,i,s)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,i,s){let r="";if(ht.isValidNum(t)){const n=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,s)+n.symbol:this._numberFormatter.toStrEx(t,s):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Fe.defaults=De($e.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Be extends Fe{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof Zt&&(this._images=i)}this._root=this._images?"":e.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2);return i instanceof Zt?i.getImage(s):s}return this._root+t}}}Be.defaults=De(Fe.defaults,{iconPosition:"default",iconGap:2});class ze extends $e{}ze.defaults=De(Fe.defaults,{});class je extends Be{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return b(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}je.defaults=De(Be.defaults,{display:"auto"});class Ge extends $e{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){return isNaN(this.options.order)?1/0:this.options.order}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){t.background=(this._background=new ze(this.chart))._init(),t.title=(this._title=new je(this.chart))._init(),t.footer=(this._footer=new je(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=w(e.location,"bottom")}}Ge.defaults=De($e.defaults,{offsetX:0,offsetY:0});class He extends Ge{}class We extends Ge{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this._op.direction}}We.defaults=De(Ge.defaults,{direction:"vertical"});class Ye extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=o(t)?this._map[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=o(t)?this._map[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,i=this._items=[],n=this._map={};if(r(t))t.forEach(((t,s)=>{i.push(this.$_loadItem(e,t,s))}));else if(s(t))i.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const s={};h(t)&&(s.visible=t),i.push(this.$_loadItem(e,s,0))}i.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options[this._collectionProp()]=this._items.map((t=>t.options))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s._init(),s._setIndex(i),s._load(e),s}}class Ze extends Ye{_collectionProp(){return"widgetGroup"}_createWidget(t){return new We(t)}}class Ue extends He{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Ue.defaults=De(Ge.defaults,{});class Xe extends $e{_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Xe.defaults=De($e.defaults,{text:"RealMap v1.0.11",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const Ke=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),qe=.001,Je=Math.PI;class Qe{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=p(-s/2,i/2,r),["M",t,e-(n=p(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=p(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=p(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=p(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=V(m(n-r)),l=2*Je-h<.01,c=h-Je<.01?0:1,d=o?1:0,p=_(r),g=u(r),f=_(n-=l?d?qe:-.001:0),b=u(n),y=[];return y.push("M",t+i*p,e+s*g,"A",i,s,0,c,d,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=V(m(o-n)),l=2*Je-h<qe;let c=h-Je<qe?0:1;const d=a?1:0,p=_(n),g=u(n),f=_(o-=l?d?qe:-.001:0),b=u(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*p,e+s*g,"A",i,s,0,c,d,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-d,t+y*p,e+w*g),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*u(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/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,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Qe[e](0,0,2*i,2*s);break;default:r=Qe.circle(i,s,p(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const ti={minimumZoom:200,maximumZoom:1600},ei={};class ii extends $e{static register(...t){t.forEach((t=>{ei[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 i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const i=this._op;let s,r;return this.inBody&&(i.x1,i.x2,i.y1,i.y2,this._x=this._y=this._w=this._h=NaN),isNaN(s)?s=Y(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=Y(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:s,height:r}}getPosition(t,e,i,s,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+=(i-r)/2+o.x;break;case"right":a+=i-o.x-r;break;default:this._anchorObj?a+=(i-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+=(s-n)/2-o.y;break;case"bottom":h+=s-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,i=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t,e){}}ii.defaults=De($e.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class si extends Oe{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 ii)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const i=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(i,t,s,e))})):s(t)&&n.push(this.$_loadItem(i,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,i,s){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,s);return a._init(),a.index=i,a._load(e),a}}const ri="route";class ni extends Pt{static create(t,e,i,s,r,n,o=0){return new ni(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}const oi={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 ai{constructor(t,e){}}const hi="_model_",li="_tag_",ci="disabled",di="rm-legend-item-marker",_i=Object.freeze([0,0]);function ui(t){return isFinite(t[0]+t[1])}function pi(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function gi(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=p(e,...t),i=p(i,...o),s=g(s,...t),r=g(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const mi="@_rm_state_",fi="@_rm_add_",bi="@_rm_update_",yi="@_rm_delete_";let wi=0;const xi=[0,0];class vi{constructor(t){this.source=t,this.inset=xi,this.pid=wi++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.coordOfArea(this.id)||_i),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(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,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[mi]=t:delete this[mi]}_isAdding(){return this[mi]===fi}_isUpdating(){return this[mi]===bi}_isDeleting(){return this[mi]===yi}_isStatic(){const t=this[mi];return t!==fi&&t!==yi}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){}_readObject(t,e){var i;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 s=t._lonFielder(e);if(isNaN(s))return;const r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);if(isNaN(r))return;this.coord=[s,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=t.coordOfArea(this.id)||_i),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 i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){o(t)&&(this.id=t)}}class Ci{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){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Si={};class Li extends Be{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 ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return n(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}}Li.defaults=De(Be.defaults,{visible:!0,position:"auto",distance:25});class Ai extends $e{}Ai.defaults=De($e.defaults,{shape:"circle",radius:2.5});class Mi extends $e{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new Ai(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}Mi.defaults=De($e.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class Pi{constructor(t,e){this._args=t,this._chart=e}get chart(){return this._chart}get count(){return this._points.length}get(t){if(t>=0&&t<this._points.length)return this._points[t].assignTo(this._args),this._args}}class ki extends ut{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class Ii extends ut{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class Ni extends ki{_init(t){super._init(t),t._setState(fi)}}class Ti extends ki{_init(t){super._init(t),t._setState(yi),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Ei extends ki{_init(t){super._init(t),t._setState(bi)}}class Vi extends Ii{_init(t){t.forEach((t=>{t._setState(fi),t._setVrate(0)}))}}class Di extends Ii{_init(t){t.forEach((t=>{t._setState(yi),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class Ri extends Ii{_init(t){t.forEach((t=>{t._setState(bi),t._setVrate(0)}))}}class $i extends $e{static register(...t){t.forEach((t=>{Si[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._dataDirty=!1,this._maxZindex=0,this._points=new Ci(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new Pi(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new Mi(this))._init()}_createLabel(t){return new Li(t)}getTooltipText(t,e){if(this._op.tooltipCallback)return this._getPointArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs);{const t=this._op.tooltipText;return"boolean"==typeof t?t?$i.defaultTooltipText:null:t}}getTooltipParam(t,e,i){return $i.getPointTooltipParam(t,e,i)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this._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,e){if(t!==this._data||e!==this._dataPath)return this._data=ht.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}isDataSeries(){return!0}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?s:i}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointArgs(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&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!0===e.visible)}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.options.layoutOnly}getLegendSources(t,e){this._legend===t&&e.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,i;return oi[t]||(null===(i=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===i?void 0:i.getCenter())}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){this.$_setData(t,this._op.dataPath)&&(this._dataLoaded=e,this.$_dataPointsChanged())}addPoint(t,e=-1,i=500){var s,r;const n=this.$_addPoint(t,-1);return this._points.insert(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(n._prev={},n._prev.ani=new Ni(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointAdded)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(r=(s=this._op).onPointAdded)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,n)),n}addPointList(t,e=-1,i=500){var s,n;if(!r(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new Vi(this,o,(t=>{var e,i;null===(i=(e=this._op).onPointListAdded)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(n=(s=this._op).onPointListAdded)||void 0===n||n.call(s,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,n;a(t)?t=this._points.get(t):o(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new Ti(this,t,(t=>{var e,i;this._points.remove(t),null===(i=(e=this._op).onPointRemoved)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(n=(r=this._op).onPointRemoved)||void 0===n||n.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];a(i)?t[e]=this._points.get(+i):o(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Di(this,t,(t=>{var e,i;this._points.removeAll(t),null===(i=(e=this._op).onPointListRemoved)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(s=(i=this._op).onPointListRemoved)||void 0===s||s.call(i,this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s,r;if(o(t)?t=this._points.pointById(t):a(t)&&(t=this._points.get(t)),t instanceof vi&&this._points.contains(t)){let n=t._prev;return n&&n.ani&&n.ani.stop(),n=t.updateValues(this,e),n&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?n.ani=new Ei(this,t,(t=>{var e,i;null===(i=(e=this._op).onPointUpdated)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(r=(s=this._op).onPointUpdated)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,t))),!!n}return!1}updatePointList(t,e,i=300){var s,r;const n=this.$_points(t).filter((t=>this._points.contains(t)));n.length>0&&(n.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new Ri(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointListUpdated)||void 0===i||i.call(e,this._getPointListArgs(t))})).setDuration(i).start():null===(r=(s=this._op).onPointListUpdated)||void 0===r||r.call(s,this._getPointListArgs(n)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointArgs(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 vi&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_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._dataDirty?(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._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let s,h,l,c=this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;n(i)?s=i:r(i)?h=i:o(i)&&(l=this.chart._assets.get(i)),s?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||s(this._getPointArgs(this._pointArgs,t))||c})):l instanceof Yt?(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 i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return 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 ni.create(t,di,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 ai);else if(r(t))return t}$_loadPoints(t){var e,i;this._doLoadPoints(t),null===(i=(e=this._op).onPointsLoaded)||void 0===i||i.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._pointLabelVisCallback=this._pointLabel.options.visibleCallback,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:p(s,e),i=isNaN(i)?s:g(s,i))})),{min:e,max:i}}}$i.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",$i.defaults=De($e.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:$i.defaultTooltipText,loadAnimation:"default",hoverEffect:"default",legend:0});class Oi extends Oe{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const i=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(i,t,e)})):s(t)&&this.$_loadItem(i,t,0),i.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(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.options.legend,null)))),this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof $i?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,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t);return n._init(),n.isDataSeries()&&(n.index=i,n.seriesIndex=n.chart._seriesIndex++),n._load(e),this.$_addSeries(n,i)}$_addSeries(t,e){return e>=0?this._items.splice(Math.min(e,this._items.length),0,t):this._items.push(t),t.name&&(this._map[t.name]=t),t}}class Fi extends vi{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:v(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class Bi extends $i{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}Bi.defaults=De($i.defaults,{valueField:"value"});class zi extends Fi{}class ji extends Bi{}ji.defaults=De(Bi.defaults,{});class Gi extends Fi{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=r(this.values)?this.values.reduce(((t,e)=>t+b(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=r(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class Hi{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return ni.create(t,di,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class Wi extends Bi{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}_createValueFielder(t){const e=t.valueFields;return r(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this._op.legendByCategory&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new Hi(t.name,t.color)))}}Wi.defaults=De(Bi.defaults,{position:"top"});class Yi extends Gi{}class Zi extends Wi{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new $e(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=ht.getMinMax(t),s=i.base=this._op.baseValue;if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=b(this._minValue,i.min),e=b(this._maxValue,i.max);i.min=isNaN(s)?Math.min(t,i.min):Math.min(t,i.min,s),i.max=isNaN(s)?Math.max(e,i.max):Math.max(e,i.max,s)}return i}getPadding(t){return b(Y(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=b(+t.width,Zi.DEF_WIDTH),this._height=b(+t.height,Zi.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}Zi.DEF_WIDTH=80,Zi.DEF_HEIGHT=50,Zi.defaults=De(Wi.defaults,{width:Zi.DEF_WIDTH,height:Zi.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Ui extends Fi{}class Xi extends Bi{_doApply(t){super._doApply(t),this._width=b(+t.width||+t.size||+t.height,Xi.DEF_SIZE),this._height=b(+t.height||+t.size||+t.width,Xi.DEF_SIZE)}}Xi.DEF_SIZE=60,Xi.defaults=De(Bi.defaults,{size:Xi.DEF_SIZE});class Ki extends Xi{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),i=b(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=p(e,s),i=g(i,s))})),this._min=e,this._max=i}}Ki.defaults=De(Xi.defaults,{minValue:10});class qi extends zi{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class Ji extends Li{}Ji.defaults=De(Li.defaults,{visible:!1});class Qi extends ji{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new Ji(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:Y(this._minSizeDim,t),max:Y(this._maxSizeDim,t)}}getRadius(t,e,i){let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return b(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._extMin=+t.minValue,this._extMax=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new qi(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._extMin,s=this._extMax;if(!isNaN(i)&&!isNaN(s)&&this._runPoints.length>0)this._noSize=i>s||(this._vMin=i)===(this._vMax=s);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((r=>{const n=r.getValue();r.isNull||isNaN(n)||(isNaN(i)&&(t=p(t,n)),isNaN(s)&&(e=g(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}Qi.type="bubble",Qi.defaults=De(ji.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class ts extends $e{}ts.defaults=De(Ue.defaults,{length:10});class es extends Be{getText(t){return ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}es.defaults=De(Ue.defaults,{offset:4});class is extends $e{_doInit(t){t.line=(this._line=new ts(this.chart))._init(),t.label=(this._label=new es(this.chart))._init()}get line(){return this._line}get label(){return this._label}}is.defaults=De(Ue.defaults,{});class ss extends Ue{_doInit(t){super._doInit(t),t.tick=(this._tick=new is(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof Qi){let{min:n,max:o}=s.getPixelMinMax(p(t,e));isNaN(i.minRadius)||(n=i.minRadius),isNaN(i.maxRadius)||(o=i.maxRadius),r.forEach((t=>{t.rd=s.getRadius(t.value,n,o)}))}else if(r.length>0){const t=b(i.minRadius,10),e=b(i.maxRadius,50)-t,s=r[0].value,n=r[r.length-1].value-s;r.forEach((i=>{i.rd=t+e*(i.value-s)/n}))}return r}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(r(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}}ss.defaults=De(Ue.defaults,{});class rs extends Ye{_collectionProp(){return"bubbleScale"}_createWidget(t){return new ss(t)}beforeRender(){this._collectVisibles()}}class ns extends $e{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}ns.MARKER_SIZE=10;class os extends He{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this._op.layout||"body"===t)return this._op.layout;switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.maxWidth)!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=W(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=W(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new ns(this,t))),e.reversed&&(this._items=this._items.reverse())}}os.defaults=De(Ge.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:ns.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class as extends Ye{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new os(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class hs{constructor(t){this._color1=we.create(t.minColor),this._color2=we.create(t.maxColor),this._logger=ht.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return we.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return x(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class ls extends $e{_doInit(t){t.label=(this._label=new Fe(this.chart))._init()}get label(){return this._label}getMarkerSize(){return b(this._op.size,7)}}ls.defaults=De($e.defaults,{size:7});class cs extends $e{}cs.defaults=De($e.defaults,{length:6});class ds extends Be{getDefaultIconPos(){}}ds.defaults=De(Be.defaults,{});class _s extends $e{_doInit(t){t.line=(this._line=new cs(this.chart))._init(),t.label=(this._label=new ds(this.chart))._init()}get line(){return this._line}get label(){return this._label}}_s.defaults=De($e.defaults,{});class us{constructor(t,e,i,s,r){this.from=t,this.to=e,this._color1=i,this._color2=s,this.label=r,this.visible=!0}get color(){return this._color2.toString()}canHide(){return!0}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this.$_createLegendMarker(t,e))}$_createLegendMarker(t,e){const i=+e||ns.MARKER_SIZE;return ni.create(t,di,0,0,i,i,0)}legendColor(){return this._color2.toString()}legendLabel(){return this.label}constains(t,e){return t>=this.from&&(e?t<=this.to:t<this.to)}getPosition(t,e){if(this.constains(t,e))return(t-this.from)/(this.to-this.from)}getColor(t,e){const i=this._color1,s=this._color2;if(!i)return(s||e).toString();const r=this.from,n=this.to;if(i&&s)return we.interpolate(i,s,(t-r)/(n-r)).toString();return x(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class ps extends $e{}ps.defaults=De($e.defaults,{});class gs extends $e{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return b(+this._op.gap,0)}}gs.defaults=De($e.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const ms="#fff",fs=we.create("#000");class bs extends Ue{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new ls(e))._init(),t.stepLine=(this._stepLine=new ps(e))._init(),t.tick=(this._tick=new _s(e))._init(),t.nullStep=(this._nullStep=new gs(e))._init()}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=t?r[0]._color1.toString():s.toString()}return this._minColor?(this._logger&&(i=this._logger(i)),we.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()):s.toString()}if(this._op.nullStep.visible)return this._op.nullStep.color}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get maxColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?Y(this._barLengthDim,e):e,s=b(this._op.barWidth,12)):(s=this._barLengthDim?Y(this._barLengthDim,t):t,r=b(this._op.barWidth,12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,n=s?s.length:r?r.length-1:0,o=e?n+1:n,a=[];if(e&&(t-=i),n>0)for(let e=0;e<n;e++)a.push((e+1)/o*t);return a}getPosition(t){const e=this._steps;if(!e){const e=this._logger;return e&&(t=e(t)),(t-this._min)/(this._max-this._min)}for(let i=0,s=e.length;i<s;i++){const r=e[i].getPosition(t,i===s-1);if(!isNaN(r))return(i+r)/s}}getTicks(){const t=this._tick.label,e=this._steps,i=this._valueSteps,s=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=b(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=b(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=b(e[n-1].to,r)})}else if(i){n=i.length,o.push({pos:i[0]});for(let t=1;t<n-1;t++)o.push({pos:i[t]});o.push({pos:i[n-1]})}else o=[{pos:s},{pos:r}];return n=o.length-1,o.forEach(((e,i)=>{var s;e.label=null!==(s=e.label)&&void 0!==s?s:t.getNumberText(e.pos,!1,!1,0===i?"trunc":i===n?"ceil":void 0)})),o}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){"legend"!==this._op.display&&"both"!==this._op.display||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=we.create(t.minColor||ms),this._maxColor=t.maxColor&&we.create(t.maxColor),this._colors=this.$_parseColorStops(t.colors)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this._op.name}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(r(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:we.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:we.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+e.minValue,this._max=+e.maxValue,this._logger=ht.getLogger(e.logBase),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||fs,this._steps=this.$_buildSteps()}$_parseValue(t,e,i){return o(t)?t.endsWith("%")?e+(i-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),D(t)}$_parseColor(t){return t&&t.endsWith("%")?we.interpolate(this._minColor,this._endColor,parseFloat(t)/100):we.create(t)}$_buildSteps(){const t=this._op,e=t.steps,i=[],s=this._min,n=this._max;let o=s,a=n;if(this._valueSteps=null,r(e)&&e.length>0){let t="0%";e.forEach(((s,r)=>{var n;let h=this.$_parseValue(s.from,o,a),l=this.$_parseValue(s.to,o,a);0===r&&isNaN(h)&&(h=o),r===e.length-1&&isNaN(l)&&(l=a);let c=this.$_parseColor(s.fromColor||t),d=this.$_parseColor(t=(null!==(n=s.toColor)&&void 0!==n?n:s.color)||"100%");i.push(new us(h,l,c,d,s.label))})),this._logger=null}else if(o>=a)i.push(new us(o,a,this._minColor,this._endColor,void 0));else if(!isNaN(o)&&!isNaN(a)){const e=t.logBase,i=this._logger&&o>=0&&a-o>=e?this._logger:null,r=i?Math.max(0,1-o):0,h=this._valueSteps=[],l=Math.max(1,b(t.stepCount,1));if(t.integralSteps)i&&(o=i(o),a=i(a)),h.push(...ht.normalizeToSteps([o,a],l+1));else{const t=(i?i(a)-i(o):a-o)/l;h.push(o);for(let e=1;e<l;e++)h.push(D(h[e-1]+t));h.push(D(i?i(a):a))}if(this._min=h[0],this._max=h[l],i){for(let t=0;t<=l;t++)h[t]=Math.pow(e,h[t]);h[0]-=r,t.integralSteps||(h[0]=s,h[l]=n)}}return i.length>1?i:void 0}}bs.defaults=De($e.defaults,{display:"scale",minColor:ms,layout:"auto",barWidth:12,barLength:"40%"});class ys extends Ye{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.options.display))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new bs(t)}beforeRender(){this._collectVisibles()}}class ws extends $e{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e,i){this._module&&this._module.exportToImage(t,e,i)}}ws.defaults=De($e.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class xs extends $e{_doSetSimple(t,e){return ht.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}xs.defaults=De($e.defaults,{});class vs extends $e{_doInit(t){t.line=(this._line=new xs(this.chart))._init(),t.lonLine=(this._lonLine=new xs(this.chart))._init(),t.latLine=(this._latLine=new xs(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getLonStep(){return Math.max(0,y(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,y(this._latLine.options.step,this._line.options.step,this.$_defaultStep()))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t,e){super._doPrepareRender(t,e)}$_defaultStep(){return 10}}vs.defaults=De($e.defaults,{visible:!1,fitTo:"map"});class Cs extends $e{}Cs.defaults=De($e.defaults,{visible:!1});class Ss extends $e{}Ss.defaults=De($e.defaults,{visible:!1});class Ls extends Fe{getText(t,e){let i=this._op.suffix;if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this._op.prefix&&(i=this._op.prefix+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=t.dirSymbols||Ls.defaults.dirSymbols}}Ls.defaults=De(Fe.defaults,{dirSymbols:"NSEW",suffix:"°°"});class As extends $e{_doInit(t){t.line=(this._line=new Ss(this.chart))._init(),t.label=(this._label=new Ls(this.chart))._init()}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,y(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,y(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=r(t.positions)?t.positions:[]}}As.defaults=De($e.defaults,{visible:!1,positions:["top","right"],interval:1});class Ms extends Be{getDefaultIconPos(){return"left"}}Ms.defaults=De(Be.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Ps extends $e{_doInit(t){t.label=(this._label=new Ms(this.chart))._init()}get label(){return this._label}}Ps.defaults=De($e.defaults,{front:!0,zindex:0});class ks extends Ps{}ks.defaults=De(Ps.defaults,{});class Is extends Ps{}Is.defaults=De(Ps.defaults,{});class Ns extends Ps{}Ns.defaults=De(Ps.defaults,{});class Ts extends $e{}Ts.defaults=De($e.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Es extends $e{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new Ts(this.chart))._init(),this._args={chart:this.chart.wrapper,axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let i=te.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}moved(t,e,i){}_doSetSimple(t,e){return n(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Es.defaults=De($e.defaults,{visible:!1});class Vs extends $e{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new Cs(this.chart))._init(),this.options.leftLine=(this._leftLine=new Cs(this.chart))._init(),this.options.rightLine=(this._rightLine=new Cs(this.chart))._init(),this.options.topLine=(this._topLine=new Cs(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new Cs(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new Cs(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new Cs(this.chart))._init(),this.options.grid=(this._grid=new vs(this.chart))._init(),this.options.tick=(this._tick=new As(this.chart))._init(),this.options.crosshair=(this._crosshair=new Es(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()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),i.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}this._lonInterval=Math.max(1,y(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,y(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Ns(this.chart):"line"===t.type?new ks(this.chart):"band"===t.type?new Is(this.chart):new ks(this.chart),i._init(),i._load(t),e.push(i)}))}}function Ds(t,e){const[i,s]=t;let r=!1;for(let t=0,n=e.length-1;t<e.length;n=t++){const[o,a]=e[t],[h,l]=e[n];a>s!=l>s&&i<(h-o)*(s-a)/(l-a)+o&&(r=!r)}return r}function Rs(t,e){let i=!1;Ds(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Ds(t,e[s])&&(i=!i);return i}Vs.defaults=De($e.defaults,{interval:5});class $s{constructor(t,e=4){this.bbox=t,this.capacity=e,this.entries=[],this.children=null,this.divided=!1}subdivide(){const{minLon:t,minLat:e,maxLon:i,maxLat:s}=this.bbox,r=(t+i)/2,n=(e+s)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:s},a={minLon:r,minLat:n,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:i,maxLat:n};this.children=[new $s(o,this.capacity),new $s(a,this.capacity),new $s(h,this.capacity),new $s(l,this.capacity)],this.divided=!0}intersects(t,e){return!(t.minLon>e.maxLon||t.maxLon<e.minLon||t.minLat>e.maxLat||t.maxLat<e.minLat)}isContained(t,e){return t.minLon>=e.minLon&&t.maxLon<=e.maxLon&&t.minLat>=e.minLat&&t.maxLat<=e.maxLat}insert(t){if(!this.intersects(t.bbox,this.bbox))return!1;if(this.divided&&this.children){let e=!1;for(const i of this.children)if(this.isContained(t.bbox,i.bbox)&&(e=i.insert(t),e))break;return e||(this.entries.push(t),e=!0),e}return this.entries.length<this.capacity?(this.entries.push(t),!0):(this.subdivide(),this.insert(t))}containsPoint(t,e,i){return t>=i.minLon&&t<=i.maxLon&&e>=i.minLat&&e<=i.maxLat}queryPoint(t,e,i=[]){if(!this.containsPoint(t,e,this.bbox))return i;for(const s of this.entries)this.containsPoint(t,e,s.bbox)&&i.push(s);if(this.divided&&this.children)for(const s of this.children)s.queryPoint(t,e,i);return i}}class Os{constructor(t,e){var i;this.worldBBox=t,this.root=new $s(t);for(const t of e)this.root.insert({featureId:t.id,originalFeature:{id:t.id,geometry:{type:t.source.polygon?"Polygon":"MultiPolygon",coordinates:null!==(i=t.source.polygon)&&void 0!==i?i:t.source.polygons}},bbox:{minLon:t.h1,minLat:t.v1,maxLon:t.h2,maxLat:t.v2}})}find(t){const e=this.root.queryPoint(t[0],t[1]).find((e=>function(t,e){if("Polygon"===e.type)return Rs(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(Rs(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const Fs="37630",Bs={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"},zs={area:Fs,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"},js={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"},Gs={area:"39",children:["39010110","39010120","39010130","39010140","39010310","39010620","39010630","39010640","39010330","39010510","39010520","39010530","39010540","39010550","39010560","39010570","39010580","39010590","39010600","39010610","39010650","39010660","39010670","39010680","39010690","39020110","39020120","39020130","39020310","39020320","39020510","39020520","39020530","39020540","39020550","39020560","39020570","39020580","39020590","39020600","39020610","39020620"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},Hs={area:Fs,children:["37630110","37630310","37630320"],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},Ws={area:"23520",children:["23520330","23520340"],coord:[125.4,37.7],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},Ys={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},Zs={area:"HI",coord:[-126,21],frame:"0.5 0.5"},Us={area:"JPN-3502",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};class Xs{constructor(t){this.id=t}}class Ks extends Xs{constructor(t,e){super(t),this.props=e}}class qs extends Ks{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(i,1);else if(1!==e){const t=r[i],n=[];for(let e=0;e<t.length;e++){const i=[];for(let s=0;s<t[e].length;s++)i.push(t[e][s].slice());n.push(i)}r[i]=n,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=gi(this.polygons[t]),r=gi(this.polygons[e]);let n,o,a=0,h=0;if((n=s.h1-r.h2)>0&&(o=r.v1-s.v2,n>o&&(a=-n*i,h=o*i)),0!==a)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][0]+=a;if(0!==h)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][1]+=h}}class Js{constructor(t,e,i){this.name=t,this.closed=i,r(e)&&e.length>=2&&(this.border=[ht.makeArray(e[0]),ht.makeArray(e[1])])}}class Qs extends Xs{constructor(t,e){super(t),this.polygon=e}}class tr extends gt{static createStockInset(t,e){let i,r=!1;switch(t){case"제주":case"제주도":i=Bs;break;case"제주_B":case"제주도_B":i=Bs,r=!0;break;case"울릉":case"울릉도":i=zs;break;case"울릉_B":case"울릉도_B":i=zs,r=!0;break;case"백령":case"백령도":i=js;break;case"백령_B":case"백령도_B":i=js,r=!0;break;case"읍면동_제주":case"읍면동_제주도":i=Gs;break;case"읍면동_제주_B":case"읍면동_제주도_B":i=Gs,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":i=Hs;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":i=Hs,r=!0;break;case"읍면동_백령":case"읍면동_백령도":i=Ws;break;case"읍면동_백령_B":case"읍면동_백령도_B":i=Ws,r=!0;break;default:switch(t.toLowerCase()){case"alaska":i=Ys;break;case"hawaii":i=Zs;break;case"okinawa":i=Us;break;case"okinawa_b":i=Us,r=!0}}return i&&(h(e)?i=Object.assign({visible:e},i):s(e)&&(i=Object.assign({},i,e)),r&&i.border&&delete i.frame),i}constructor(t,e){var i,n,a;super(),this._excludes={};const h=null!==(i=t.source)&&void 0!==i?i:t.map,l=t.insets,c=r(l)?l:s(l)||o(l)?[l]: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=s(null==h?void 0:h.meta)?ht.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(n=this.meta.dummies)||void 0===n?void 0:n.slice(),this.paddings=Q(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,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={},c&&c.length>0&&c.forEach((t=>{var e,i;if(o(t)){const e=t.startsWith("-")?tr.createStockInset(t.substring(1),!1):tr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&ht.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new Js(t.name,t.border,!0===t.closed))})),h&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(h,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class er{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}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))}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this.second&&(this.second._offset=this._offset)}prepareSecond(){return this.second=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}getScrolledLon(t){return(t=((t+=this._scroll)%360+360)%360)>180&&(t-=360),t}}const ir=90,sr=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class rr extends er{constructor(){super(),this._rotation=[0,0],this._r=ir,this.bounds={x1:-90,x2:ir,y1:-90,y2:ir},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=sr(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=sr(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;sr(-90-t),sr(90-t),sr(90+e),sr(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*T,r=[Math.cos(s)*Math.sin(e*T)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/ir,i=t[1]/ir,s=Math.sqrt(e*e+i*i),r=Math.asin(s),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,s*o)/T,Math.asin(s&&i*n/s)/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,i=(this._rotation[1]||0)*T,s=Math.cos(i),r=Math.sin(i),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*T+e,h=t[1]*T,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*s+c*r;return[Math.atan2(d*n-u*o,c*s-_*r)/T,Math.asin(u*n+d*o)/T]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(s)*n,a=Math.sin(s)*n,h=Math.sin(r);const l=this._rotation[0]*e,c=this._rotation[1]*e,d=Math.cos(l),_=Math.sin(l),u=Math.cos(c),p=Math.sin(c),g={x:u*d*o+_*a-p*d*h,y:-u*_*o+d*a+p*_*h,z:p*o+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class nr extends tr{static loadMap(t,e){if(s(t)){const i=t.source;if(s(i)&&"Topology"===i.type&&s(i.objects)&&r(i.arcs))return new nr(t,e);const n=t.map;if(s(n)&&"Topology"===n.type&&s(n.objects)&&r(n.arcs))return new nr(t,e)}}_doLoad(t,e){const i=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),n=t=>t.map((t=>i(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(s(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const s=d[t].geometries;if(r(s)&&s.forEach((t=>{const e=new Ks(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=i(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=n(t.arcs),g.push(e)}})),m){const t={},i={};r(e.excludeInternal)?e.excludeInternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":o(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),ht.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};r(e.excludeExternal)?e.excludeExternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":o(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),ht.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,n=[],o=[];e.forEach((t=>{t instanceof Ks&&(i[0].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)))}));const a=n.flat(1/0),h=o.flat(1/0),l=[];if(a.forEach((t=>{h.forEach((e=>{(t===e||t<0&&~t===e||e<0&&t===~e)&&l.push(t)}))})),l.length>0){const e=l.map((e=>e<0?t[~e].slice().reverse():t[e]));s.push(new Qs(r.name,e))}}e.push(...s)}}function or(t,e){const{atan2:i,cos:s,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)+s(o)*s(h)*r(d/2)*r(d/2),u=2*i(n(_),n(1-_)),p=6371e3*u,g=Math.round(p/5e5),m=[];if(g>1){const t=1/g;for(let e=t;e<.999;e+=t){const t=r((1-e)*u)/r(u),c=r(e*u)/r(u),d=t*s(o)*s(a)+c*s(h)*s(l),_=t*s(o)*r(a)+c*s(h)*r(l),p=i(t*r(o)+c*r(h),n(d*d+_*_)),g=i(_,d);m.push([g/T,p/T])}}return m}function ar(t,e){const i=t._base,s=t.off;let n,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof cr?n=i:i[0]>=0&&(l=e.readBounds(i),h=s||h)}if(o(t.frame)&&t.frame.length>0){const e=Q(t.frame);let{h1:i,v1:r,h2:o,v2:a}=n?n[0]:l;if(n)for(let t=1;t<n.length;t++)i=p(i,n[t].h1),r=p(r,n[t].v1),o=g(o,n[t].h2),a=g(a,n[t].v2);const c=i+h[0]-e.l,d=o+h[0]+e.r,_=a+h[1]+e.t,u=r+h[1]-e.b;t.box=[[c,_],[d,_],[d,u],[c,u]],t.bounds=s?{h1:c-s[0],h2:d-s[0],v1:u-s[1],v2:_-s[1]}:{h1:c,h2:d,v1:u,v2:_}}else if(a=t.border){let e,c;if(o(a)){let{h1:t,v1:i,h2:s,v2:r}=n?n[0]:l;if(n)for(let e=1;e<n.length;e++)t=p(t,n[e].h1),i=p(i,n[e].v1),s=g(s,n[e].h2),r=g(r,n[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else r(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=s?{h1:l.h1-s[0],h2:l.h2-s[0],v1:l.v1-s[1],v2:l.v2-s[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const hr=Math.min,lr=Math.max;class cr extends gt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.mainLandBounds=null,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],i=t.props["ctr-lat"];isNaN(e)||isNaN(i)||(this.center=[+e,+i])}}setSelected(t){this._selected=t}get path(){return this._path}get internal(){return this._internal}get external(){return this._external}get selected(){return this._selected}displayText(){return this.name||this.id}getInfo(){return this._info||(this._info={id:this.source.id,props:this.source.props,h1:this.h1,v1:this.v1}),this._info}reset(){this._path=this._internal=this._external=null}$_readBound(t,e){let i=this.h1,s=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{i=hr(i,t[0]+e[0]),s=lr(s,t[0]+e[0]),r=hr(r,t[1]+e[1]),n=lr(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,s=t.offset;let n=[0,0];return r(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),r(s)&&s.length>0&&(n[0]+=b(s[0],0),n[1]+=b(s[1],0)),t.off=n}$_toPath(t,e,i,s){const r=t.isGlobe,n=e[0].slice();if(i){for(let t=0;t<n.length;t++)n[t]=n[t].slice(0);n.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let o=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=n.map((e=>{const i=t?t.project(e):e;return i.outside||(o=hr(o,i[0]),a=lr(a,i[0]),h=hr(h,i[1]),l=lr(l,i[1])),i}));let d;if(this.x1=o,this.x2=a,this.y1=h,this.y2=l,r){let e,i,s=!1;!function(t){let e=t.length-1;for(;e--;)if(Math.max(Math.abs(t[e][0]-t[e+1][0]),Math.abs(t[e][1]-t[e+1][1]))>10){const i=or(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(n),d=[];for(let r=0;r<c.length;r++){const o=n[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=o,n.push(o),c.push(a)),s&&i){or(i,o).forEach((e=>d.push(t.project(e))))}d.push(a),i=o,s=!1}}}else d=c;if(d.length>0){const t=`M ${d[0][0]} ${d[0][1]} L`+d.slice(1).map((t=>t.join(" "))).join(" ");return s?t+" Z":t}return""}readBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=hr(e,t[0]),i=lr(i,t[0]),s=hr(s,t[1]),r=lr(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=hr(e,t[0]),i=lr(i,t[0]),s=hr(s,t[1]),r=lr(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)e=hr(e,t[0]),i=lr(i,t[0]),s=hr(s,t[1]),r=lr(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){let i;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,s=!e||!1!==e.visible;if(e){if(s)if(this._insetChilds){let t=1/0,s=1/0;this.source.polygons.forEach(((e,i)=>{this._insetChilds.indexOf(i)>=0&&e[0].forEach((e=>{t=hr(t,e[0]),s=hr(s,e[1])}))})),i=this.$_readInset(e,{h1:t,v1:s}),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,i):this.$_readBound(t,_i)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,_i))):this.$_readBound(this.source.polygon,_i),i=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,_i))):this.$_readBound(this.source.polygon,_i);i&&(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,i):this.$_readBound(t,_i)}))):(this.h1+=i[0],this.h2+=i[0],this.v1+=i[1],this.v2+=i[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;let r="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((e,n)=>{this._insetChilds.indexOf(n)>=0?s&&(r+=this.$_toPath(t,e,i,!0)):r+=this.$_toPath(t,e,null,!0)})):s&&this.source.polygons.forEach(((e,s)=>{r+=this.$_toPath(t,e,i,!0)})):s&&(r=this.$_toPath(t,this.source.polygon,i,!0)),this._path=r}return e.internals&&this.$_readInternal(t,this._insetChilds?_i:i),e.externals&&this.$_readExternal(t,this._insetChilds?_i:i),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new cr;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class dr extends gt{constructor(t){super(),this.source=t}get path(){return this._path}reset(){this._path=null}readPath(t){if(!this._path){let e="";this.source.polygon.forEach((i=>{const s=i.map((e=>t.project(e)));e+=`M ${s[0][0]} ${s[0][1]} L`+s.slice(1).join(" ")})),this._path=e}}}class _r extends gt{constructor(t,e,i){if(super(),this.owner=t,this.source=e,this._hiddens={},this._world=!1,!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=i,this._name=e.name,(this._second=e instanceof _r)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new Os({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 alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof nr&&this.source.internals}get hasExternals(){return this.source instanceof nr&&this.source.externals}get hasBorders(){return this.source instanceof nr&&this.source.borders}get isWorld(){return this._world}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const i in this._areaMap){const s=this._areaMap[i];t in s.source.props&&(e[s.source.props[t]]=s)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()}));for(const t in this._borders)this._borders[t].reset();this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}insetAt(t){for(const e of this._insets)if(e.bounds&&pi(t,e.bounds))return e}getBorder(t){return this._borders[t]}$_preflight(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let r=0;r<this._areas.length;r++){const n=this._areas[r],o=n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null==o?void 0:o.coord){const[t,e]=o.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<t&&(t=a),h>e&&(e=h),l<i&&(i=l),c>s&&(s=c),t<=-180&&e>=180&&i<=-90&&s>=90)return}return{minLat:i,maxLat:s,minLon:t,maxLon:e}}$_resetAreas(){const t=this.owner.getProjection(this._second),e={internals:this.hasInternals,externals:this.hasExternals};if(t instanceof rr)this._areas.forEach((i=>{i.visible=this.isVisible(i.id),i.readPath(t,e)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=ir,this.y2=ir;else{let i=1/0,s=-1/0,r=1/0,n=-1/0,o=1/0,a=-1/0,h=1/0,l=-1/0;if(!this._second&&this._useOffset){const e=this.$_preflight();t.offset=e?!0===this._useOffset?[-(e.minLon+(e.maxLon-e.minLon)/2),-(e.minLat+(e.maxLat-e.minLat)/2)]:this._useOffset:[0,0]}if(this._areas.forEach((c=>{c.visible=this.isVisible(c.id),c.readPath(t,e)&&(i=hr(i,c.h1),s=lr(s,c.h2),r=hr(r,c.v1),n=hr(90,lr(n,c.v2)),o=hr(o,c.x1),a=lr(a,c.x2),h=hr(h,c.y1),l=lr(l,c.y2),c.mainLandBounds={x1:c.x1,x2:c.x2,y1:c.y1,y2:c.y2},this.$_updateMainAreaBounds(c))})),this.source instanceof tr){const t=this.source.paddings;r-=t.b,n+=t.t,i-=t.l,s+=t.r,h-=t.b,l+=t.t,o-=t.l,a+=t.r}n>83.63&&this.source.alignArctic&&(n=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,n])[1]),(this._world=i<=-180&&s>=180)&&(o=Math.min(o,-a),a=Math.max(-o,a)),this.h1=lr(-180,i),this.v1=lr(-90,r),this.h2=hr(180,s),this.v2=hr(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l,this.cx=o+(a-o)/2,this.cy=h+(l-h)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_updateMainAreaBounds(t){var e,i;const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const n=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,n=r&&r[s];if(!n)continue;const o=t.readPolygonBounds(n);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=o),t.mainLandBounds.x1=hr(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=lr(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=hr(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=lr(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,s=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._borders={},_=this._insets=[];this._useOffset=t.useOffset,Object.values(i).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((e=>{if(e instanceof Ks){const r=w(e.props[s],e.id);if(r&&t.included(r)){const t=i[r],s=new cr(e,t);t&&(delete i[r],t._area=s,_.push(t)),h&&h.indexOf(r)>=0?(l.unshift(s),s.dummy=!0):l.push(s),c[s.id=r]=s,s.name=w(e.props[n],e[n])}}else if(e instanceof Qs){const t=new dr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const s=c[t[i]];if(s){const n=e.polygons[i];s.inset=e,s._insetChilds=r(n)?n:[n],e._parent=t[i],e._base=s._insetChilds,e._area=s,_.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,e._area=t,_.push(e))}else if(r(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],s=e._children=[];if(r(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=hr(t,r.h1),s=hr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const r of e.children){const e=c[r];if(e){const n=e.inset={area:r,offset:i};t.push(e),n._area=e,s.push(n)}}_.push(e)}}if(o&&!isNaN(+t.dokdo)){const e=c[o.group];e&&(e.source=new qs(e.source,+t.dokdo,+o.index,+o.parent))}this.reset(),_.forEach((t=>ar(t,t._area)))}$_copy(t){const e=this._areas=[],i=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const s=t._clone();e.push(s),i[s.id]=s})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new _r(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class ur extends Be{getText(t){return ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}ur.defaults=De(Ue.defaults,{offset:4});class pr extends Ue{_doInit(t){super._doInit(t),t.label=(this._label=new ur(this.chart))._init()}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}pr.defaults=De(Ue.defaults,{visible:!1});class gr extends $e{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:gr.ITEM_GAP}}gr.ITEM_GAP=4,gr.defaults=De($e.defaults,{offsetX:8,offsetY:8,itemGap:3});class mr extends gr{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:mr.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:mr.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)}}mr.BUTTON_SIZE=24,mr.defaults=De(gr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class fr extends gr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}fr.defaults=De(gr.defaults,{type:"text",align:"left",verticalAlign:"top"});class br extends gt{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 i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,1),t.unselect(e),this._owner.selectionItemRemoved(e),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,e)}_changed(){this._owner.selectionChanged(this)}}class yr extends $e{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}}yr.defaults=De($e.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class wr extends yr{}wr.defaults=De(yr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class xr extends $e{constructor(t){super(t.chart),this.owner=t}_doInit(){this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?te.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?fe.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}xr.defaults=De($e.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class vr extends ii{constructor(){super(...arguments),this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(/\$\{(.*?)\}/g,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(t):this._params[e[0]];return void 0===i&&(i=e[1]),i||""}_isVisible(){return this._op.visible&&!z(this._op.html)}_doSetSimple(t,e){return o(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=n(i)?i:null}}vr.DEF_SIZE=100,vr.type="html",vr.defaults=De(ii.defaults,{width:vr.DEF_SIZE});class Cr extends ii{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t,e){return o(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}Cr.type="image",Cr.defaults=De(ii.defaults,{});class Sr extends ii{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||Sr.defaults.shape}_doSetSimple(t,e){return o(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Sr.type="shape",Sr.defaults=De(ii.defaults,{width:64,height:64,shape:"square"});class Lr extends ii{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?te.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?fe.getFormatter(t):void 0)}(t.timeFormat)}}Lr.type="text",Lr.defaults=De(ii.defaults,{text:"Text"});class Ar extends er{project(t){return[t[0]+this.offset[0]-this.scroll,t[1]+this.offset[1]]}backward(t){return[t[0]-this.offset[0],t[1]-this.offset[1]]}}const Mr=1.340264,Pr=-.081106,kr=893e-6,Ir=.003796,Nr=Math.sqrt(3)/2,Tr=74.03120656864502;class Er extends er{get lonElliptic(){return!0}get latElliptic(){return!1}getYRange(t,e){return t<=0&&e>=0?[0,0]:e<0?[t,e]:[e,t]}project(t){const e=T,i=Math.asin(Nr*Math.sin((t[1]+this.offset[1])*e)),s=i*i,r=s*s*s;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(i)*Tr/(Nr*(Mr+3*Pr*s+r*(7*kr+9*Ir*s))),i*Tr*(Mr+Pr*s+r*(kr+Ir*s))]}backward(t){const e=t[0]/Tr,i=t[1]/Tr,s=180/Math.PI;let r,n,o,a,h,l=i;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Mr+Pr*r+n*(kr+Ir*r))-i,a=Mr+3*Pr*r+n*(7*kr+9*Ir*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*Nr*e*(Mr+3*Pr*r+n*(7*kr+9*Ir*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/Nr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const Vr=63.78137,Dr=Math.PI/180;class Rr extends er{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]+this.offset[1]));const i=Math.sin(e*Dr);return[Vr*(t[0]+this.offset[0]-this.scroll)*Dr,Vr*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(Vr*Dr),(2*Math.atan(Math.exp((t[1]-this.offset[1])/Vr))-Math.PI/2)/Dr]}}const $r=Math.PI/4,Or=Math.PI/180,Fr=63.78137;class Br extends er{project(t){return[(t[0]+this.offset[0]-this.scroll)*Or*Fr,79.7267125*Math.log(Math.tan($r+.4*(t[1]+this.offset[1])*Or))]}backward(t){return[(t[0]-this.offset[0])/Fr/Or,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/Fr*.8))-$r)/Or]}}class zr extends Yi{}class jr extends Zi{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this._op.barOrder}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new zr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return ni.create(t,di,0,0,e,e,2)}}jr.type="bar",jr.defaults=De(Zi.defaults,{barWidth:.7,overflow:!1,barOrder:"normal"});class Gr extends $e{constructor(t){super(t.chart),this.gauge=t}}class Hr extends Gr{}Hr.defaults=De($e.defaults,{visible:!1});class Wr extends Gr{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Wr.defaults=De($e.defaults,{});class Yr extends Gr{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Yr.defaults=De($e.defaults,{thickness:"100%",stroked:!1});class Zr extends Gr{getExtents(t){return{radius:Y(this._radiusDim,t,0),length:Y(this._lengthDim,t,0),offset:Y(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Zr.defaults=De($e.defaults,{visible:!1,radius:3,length:"100%",offset:0});class Ur extends Gr{getRadius(t){return Y(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}Ur.defaults=De($e.defaults,{visible:!1,radius:5});class Xr extends Fe{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:Y(this._offsetXDim,t,0),y:Y(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Xr.defaults=De(Fe.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class Kr{constructor(){this.setCenterX(Jr.DEF_CENTER),this.setCenterY(Jr.DEF_CENTER),this.setRadius(Jr.DEF_RADIUS),this.setInnerRadius(Jr.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=W(w(t,Jr.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(w(t,Jr.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(w(t,Jr.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(w(t,Jr.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),i=p(e,this._innerDim?Y(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?Y(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=b(t%360,0),s=g(0,p(360,b(e,360)));this._startRad=N+T*i,this._handRad=T*i,this._sweepRad=T*s}}class qr extends Ui{_readObject(t,e){super._readObject(t,e)}}class Jr extends Ki{_doInit(t){super._doInit(t),t.face=(this._face=new Hr(this))._init(),t.rim=(this._rim=new Wr(this))._init(),t.valueRim=(this._valueRim=new Yr(this))._init(),t.hand=(this._hand=new Zr(this))._init(),t.pin=(this._pin=new Ur(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Xr(this.chart))._init(),this._props=new Kr}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 qr(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)}}Jr.DEF_CENTER="50%",Jr.DEF_RADIUS="50%",Jr.DEF_INNER="80%",Jr.type="gauge",Jr.defaults=De(Ki.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Qr extends $e{constructor(t){super(t.chart),this.gauge=t}}class tn extends Qr{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}tn.defaults=De($e.defaults,{thickness:3});class en extends Qr{getLength(t){return Y(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}en.defaults=De($e.defaults,{thickness:1.5,length:"55%"});class sn extends en{}sn.defaults=De(en.defaults,{thickness:1,length:"80%"});class rn extends en{}rn.defaults=De(en.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class nn extends Qr{}nn.defaults=De($e.defaults,{length:5});class on extends Qr{}on.defaults=De($e.defaults,{step:1,offset:0});class an extends Qr{}an.defaults=De($e.defaults,{radius:4});class hn extends Fe{}hn.defaults=De(Fe.defaults,{text:"RealMap",position:"top"});class ln extends Ui{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 cn extends Xi{_doInit(t){super._doInit(t),t.face=(this._face=new $e(this.chart))._init(),t.rim=(this._rim=new tn(this))._init(),t.hourHand=(this._hourHand=new en(this))._init(),t.minuteHand=(this._minuteHand=new sn(this))._init(),t.secondHand=(this._secondHand=new rn(this))._init(),t.tick=(this._tick=new nn(this))._init(),t.tickLabel=(this._tickLabel=new on(this))._init(),t.pin=(this._pin=new an(this))._init(),t.gaugeLabel=(this._gaugeLabel=new hn(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,i){const s=p(t,e)*i;return{cx:Y(this._centerXDim,t,t/2),cy:Y(this._centerYDim,e,e/3),rd:Y(this._radiusDim,s,s/2)}}_createPoint(t){return new ln(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=W(w(e._centerX=t,cn.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=W(w(e._centerY=i,cn.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=W(w(e._radius=s,cn.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}cn.DEF_CENTER="50%",cn.DEF_RADIUS="50%",cn.type="clock",cn.defaults=De(Xi.defaults,{centerX:cn.DEF_CENTER,centerY:cn.DEF_CENTER,radius:cn.DEF_RADIUS,active:!0,size:70});class dn extends zi{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class _n extends Bi{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Li(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 dn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}_n.type="figure",_n.defaults=De(Bi.defaults,{position:"top"});class un extends Li{}un.defaults=De(Li.defaults,{visible:!1});class pn extends vi{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class gn extends $i{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new un(t)}_createPoint(t){return new pn(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+="/")}}gn.type="image",gn.defaults=De($i.defaults,{imageWidth:24,imageHeight:24,position:"top"});class mn extends Pt{constructor(t,e){super(t,di),this.add(this._area=new Nt(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Nt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class fn extends Yi{}class bn extends $e{}bn.defaults=De(Zi.defaults,{visible:!1});class yn extends Zi{_doInit(t){super._doInit(t),t.area=(this._area=new bn(this.chart))._init()}get area(){return this._area}_createPoint(t){return new fn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new mn(t,e)}}yn.type="line",yn.defaults=De(Zi.defaults,{});class wn extends Fi{_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)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class xn extends Li{}xn.defaults=De(Li.defaults,{visible:!1,hoverColor:"white"});class vn extends $e{}vn.defaults=De($e.defaults,{enabled:!0,autoMapChange:!0});class Cn extends $e{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return o(e)?(t.name=e,!0):super._doSetSimple(t,e)}}Cn.defaults=De($e.defaults,{});class Sn extends $e{constructor(t,e){super(e.chart),this.name=t,this.series=e}}Sn.defaults=De($e.defaults,{visible:!1});class Ln extends Bi{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new vn(this.chart))._init(),t.internalBorder=(this._internalBorder=new Sn(null,this))._init(),t.externalBorder=(this._externalBorder=new Sn(null,this))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var i;const s=this._points.getPoints();for(const r of s)if((null===(i=r.area)||void 0===i?void 0:i.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof wn||(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 xn(t)}$_createDetail(){return this._detail||(this._detail=new Ln(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){if(this.getDetailed()||(s(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),i.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(r(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new wn(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const n=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=o(e.hiddenAreas)?[e.hiddenAreas]:r(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=n.getBorder(t.name))})),this._minValue=h,this._maxValue=l,s(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new hs(t)}else this._colorRanger=null===(i=t.getColorScale(this._op.colorScale))||void 0===i?void 0:i.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(r(t)?t[0]:t)||"id",s=(r(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===s,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[s]]:o[t.source[s]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new we(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new Cn(t.name,this);i._init(),i._load(t),e.push(i)}))}}Ln.type="map",Ln.defaults=De(Bi.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class An extends Li{}An.defaults=De(Li.defaults,{visible:!1});class Mn extends Fi{}class Pn extends $e{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 Ee),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}Pn.defaults=De($e.defaults,{});class kn extends Pn{getMinSize(t){return Y(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}kn.defaults=De(Pn.defaults,{text:"${name}"});class In extends Pn{}In.defaults=De(Pn.defaults,{text:"${value}"});class Nn extends Bi{_doInit(t){super._doInit(t),t.header=(this._header=new kn(this))._init(),t.divider=(this._divider=new $e(this.chart))._init(),t.body=(this._body=new In(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,ht.clampEx(t,this._minWidth,this._maxWidth)),height:b(this._height,ht.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new An(t)}_createPoint(t){return new Mn(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}}Nn.DEF_MIN_WIDTH=80,Nn.DEF_MIN_HEIGHT=50,Nn.type="panel",Nn.defaults=De(Bi.defaults,{orientation:"vertical",minWidth:Nn.DEF_MIN_WIDTH,minHeight:Nn.DEF_MIN_HEIGHT,position:"top"});class Tn extends Gi{}class En{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class Vn extends Wi{getRadius(t){return b(Y(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}_createPoint(t){return new Tn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius"),this._thresholds=this.$_parseThresholds(t.threshold)}_doPrepareRender(t,e){super._doPrepareRender(t,e);let i=b(e.startAngle%360,0),s=g(0,p(360,b(e.totalAngle,360)));this._startRad=N+T*i,this._totalRad=T*s}$_parseThresholds(t){return r(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new En(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new En(t.value,t.radius,t.style)]:void 0}}Vn.type="pie",Vn.defaults=De(Wi.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class Dn extends Nt{constructor(t,e){super(t,di),this._rd=e,this.setPath(Qe.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 Rn extends zi{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class $n extends ji{getExt(t,e){const i=b(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t),this._rd=b(t.radius,$n.DEF_RADIUS),this._innerRd=b(t.innerRadius,0)}_createPoint(t){return new Rn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new Dn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new we(this._calcedColor)}getColorScale(){return this._op.colorScale}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);this._minValue=r,this._maxValue=n,this._colorRanger=null===(i=t.getColorScale(e.colorScale))||void 0===i?void 0:i.getRanger()}}$n.DEF_RADIUS=9,$n.type="pin",$n.defaults=De(ji.defaults,{radius:$n.DEF_RADIUS,innerRadius:0,position:"top"});class On extends Pt{constructor(t,e){super(t,di),this._size=e,this.add(this._marker=new Nt(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);Qe.setShape(this._marker,this._shape,e,e)}}class Fn extends zi{_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){const e=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],i=this.value!==t.value;return e||i||super._valuesChanged(t)}}class Bn extends ji{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(){return this._op.shape||this._shape}getRadius(){return b(this._op.radius,Bn.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new Fn(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 On(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),p(e,2*this._op.radius)),i}}Bn.type="point",Bn.defaults=De(ji.defaults,{radius:5,position:"center"});class zn extends Pt{constructor(t,e){super(t,di),this.add(this._line=new Nt(t)),this.add(this._arrow=new Nt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=$(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class jn extends vi{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 i,s;const n=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(n(t)):e.push(t)})):o(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(s=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==s?s:[],this.path=null!=e.path?n(e.path):void 0}}class Gn extends $i{needMapScale(){return!0}_createPoint(t){return new jn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;s(e)&&(t=t.map((t=>{const i=l({},t);if(r(i.coords)){const t=i.coords.slice();o(t[0])&&(t[0]=e[t[0]]),o(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new zn(t,e)}}Gn.type=ri,Gn.defaults=De($i.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class Hn extends Gi{}class Wn extends Wi{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),n={rowCount:this._rowCount,colCount:this._colCount,grid:s,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:s,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new Hn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Wn.ROW_COUNT,this._colCount=t.colCount||Wn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Wn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Wn.CELL_SIZE,this._gap=b(t.gap,Wn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=r(t.values)?t.values.reduce(((t,e)=>t+b(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*b(i,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(s);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,i=e.length;for(let s=0;s<i;s++)if(isNaN(e[s][t]))return s;return i}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._colCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),a==i-1?(h++,a=this.$_rows(h)):h===s-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=n,t.cols=o}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),h==s-1?(a++,h=this.$_cols(a)):a===i-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=n,t.cols=o}}Wn.ROW_COUNT=10,Wn.COL_COUNT=10,Wn.THRESHOLD=1,Wn.CELL_SIZE=5,Wn.GAP=2,Wn.type="waffle",Wn.defaults=De(Wi.defaults,{rowCount:Wn.ROW_COUNT,colCount:Wn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Wn.THRESHOLD,cellSize:Wn.CELL_SIZE,gap:Wn.GAP});class Yn extends tr{static loadMap(t,e){return s(t)&&s(t.source)&&r(t.source.features)||s(t)&&s(t.map)&&r(t.map.features)?new Yn(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Ks(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,i.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,i.push(e)}}})),i}}class Zn extends ut{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=b(i,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==s||s()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Un extends ut{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=b(s,300),this._old=t.zoom,this.view.$_moveTo(i),this.endHandler=()=>{this.view.zoom=e,this.view=null,null==r||r()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Xn extends $e{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}Xn.defaults=De($i.defaults,{visible:void 0,globeFill:"lightblue"});const Kn={zoom:1,panX:1,panY:1};class qn extends $e{constructor(t){super(t),this._prj=(new Ar).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new si(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new Xn(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){return this._map.isWorld&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof rr?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof rr?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 movable(){return!1!==this._op.movable}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this._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}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepare(t){this._map=t}prepareLayout(t,e){return this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this._map,r=i.getYRange(s.v1,s.v2),n=i.project([s.h1,r[0]]),o=i.project([s.h2,r[1]]),a=this._wMap=o[0]-n[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=Math.min(t/a,e/l),d=this._scale=this._zoom/100*c,_=b(this._op.panX*d,0),u=b(this._op.panY*d,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*d,_)/d;this._panX=e}this._panY=this.$_calcPan(e,l*d,u)/d;const p=(i.scroll%360+360)%360*a/360,g=t/2-(n[0]+a/2)*d-(this._panX+p)*d,m=e/2+(h[1]+l/2)*d-this._panY*d,f=c/d*a,y=c/d*l,w=s.x1+a/2-f/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=dt.create(w,x,f,y),{scale:d,wMap:a,hMap:l,tx:g,ty:m}}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=b(this._op.panX*d,0),u=b(this._op.panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,y=s+a/2-m/2+this._panX,w=n+h/2-f/2-this._panY;return this._vRect=dt.create(y,w,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}getPoint(t){return this._points[t]}toVisible(t,e){const i=e?this._prj.second:this._prj;let s,r;if(this.isFlatWorld){const r=i.scroll;s=e?t[0]>=-180&&t[0]<=180+r:t[0]>=-180+r&&t[0]<=180}else r=i.getVisible(t),r&&(e||(s=this._vRect.contains(r[0],r[1])));if(s)return r||(r=i.getVisible(t)),!r.outside&&r}isScrollable(){return this.options.scrollable&&this.map.isWorld}setZoom(t,e=300){let i,r;a(e)?r=e:n(e)?(i=e,r=300):s(e)&&(i=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new Zn(this,t,r,i).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new Un(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={...ti,...s},n=this.map.areaOf(t),o=n.getCenter(),{x1:a,x2:h,y1:l,y2:c}=n.mainLandBounds,d=(this.map.x2-this.map.x1)*e/(h-a)*100,_=(this.map.y2-this.map.y1)*e/(c-l)*100,u=Math.min(d,_),p=Math.min(r.maximumZoom,Math.max(r.minimumZoom,u));new Un(this,p,o,i,null).start()}zoomToBounds(t,e,i=300){const s=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)/s*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,o=Math.min(t,e);new Un(this,o,n,i,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,[i,s]=this._prj.project(t);this.isScrollable()?this.scroll=t[0]:this.panX=i-e.cx,this.panY=-s+e.cy}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Kn;s&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,i)}finally{s&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let i=!0;for(const e in t)if(!(e in Kn)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,n,a;const h=this;var l;super._doApply(t),i.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 rr;break;case"equalearth":h._prj=(new Er).prepareSecond();break;case"miller":h._prj=(new Br).prepareSecond();break;case"mercator":h._prj=(new Rr).prepareSecond();break;default:h._prj=(new Ar).prepareSecond()}return!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 rr&&(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]]:s(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,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}qn.defaults=De($e.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class Jn extends Ln{}class Qn extends $e{constructor(){super(...arguments),this._widgetGaps=new ft}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;o(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}Qn.defaults=De($e.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class to extends mt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Ke.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Ut,this._series=new Oi(this),this._annotations=new si(this),this._widgetGroups=new Ze(this),this._legends=new as(this),this._colorScales=new ys(this),this._bubbleScales=new rs(this),(this._chartOptions=new Qn(this))._init(),(this._axis=new Vs(this))._init(),(this._body=new qn(this))._init(),(this._exporter=new ws(this))._init(),(this._title=new yr(this))._init(),(this._subtitle=new wr(this))._init(),(this._zoomPanel=new mr(this))._init(),(this._drilldownPanel=new fr(this))._init(),(this._mapScale=new pr(this))._init(),(this._credits=new Xe(this))._init(),(this._tooltip=new xr(this))._init(),this.options=Object.assign({},to.defaults),s(t)?this._load(t):this._initOptions(),this._selection=new br(this)}_initOptions(){}get wrapper(){return this._wrapper}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return o(t)&&Si[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&ei[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 i,s;this._fireEvent("onModelChanged",t,"selection"),null===(s=(i=this._chartOptions.options).onSelectionChanged)||void 0===s||s.call(i,{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 Ar).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,i){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._legends.first}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof _r?t:this.getMap(t))||this._maps[0];i!==e&&(this._baseMap=i,this._loading||(this._baseMap.reset(),this.mapChanged(i)))}get axis(){return this._axis}get title(){return this._title}get body(){return this._body}get visibleSeries(){return this._series.visibles}get firstVisible(){return this._series.firstVisible}get firstMapSeries(){return this._series.visibles.find((t=>t instanceof Ln))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Ln&&!!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)}getSeries(t){return a(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}_collectWidgets(){const t={};for(const e of Object.values(tt))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(tt)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Re(n={},r.base),s(r[i])&&(n||(n={}),Re(n,r[i])),n?Re(n,t):t}_setProperties(t,e=!0){const i=this.options;for(const e in to.defaults)t.hasOwnProperty(e)&&(i[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 i=r(t.map)?t.map:s(t.map)?[t.map]:null;return r(i)&&(i.forEach(((t,e)=>{if(!1!==t.enabled){const i=nr.loadMap(t,e)||Yn.loadMap(t,e),s=i&&new _r(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),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.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,Jn),this._series.get(0)instanceof Ln||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._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 i=this._templates={};for(const e in t){const r=t[e];s(r)&&(i[e]=l({},r))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let i=this._templates[e];if(i)return Re(Re({},i),t)}else r(e)&&e.forEach((e=>{let i=this._templates[e];return i?Re(Re({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}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 i=this[e];(i instanceof $e||i instanceof Oe||i instanceof Ut)&&i.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(t){return this._series.getLegendSources(t).concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof Ln&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.options.enabled)return;s.options.dataUrl&&(s.updateOption("data",await fetch(s.options.dataUrl).then((t=>t.json()))),delete s.options.dataUrl);const r=t.map,n=this.getMap(s.options.map)||r;i.options.autoMapChange&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof Ln&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const i=t.parent,s=this.map;e.options.autoMapChange&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return n(this._chartOptions.options.onClick)}click(t){var e,i;null===(i=(e=this._chartOptions.options).onClick)||void 0===i||i.call(e,t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof He){const i=t.get(e.options.group,e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s,r;null===(r=(s=this._body.options).onHoverArea)||void 0===r||r.call(s,{chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i,s;null===(s=(i=this._body.options).onClickArea)||void 0===s||s.call(i,{chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}to.defaults={type:"map",startOfWeek:0},$i.register(Ln,Bn,$n,jr,Vn,_n,Qi,Gn,gn,yn,Nn,Wn,Jr,cn),ii.register(Cr,Sr,Lr,vr);const eo="$ctrl";class io{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new to(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 widgetGroup(){return this._obj.widgetGroup}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}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,i){var r;if(s(t)){const s="load chart ";ht.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new to(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",Ve),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,i){var r;if(!s(t))return this;const n=this[eo];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const s="load chart ";ht.LOGGING&&console.time(s),await S.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new to(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",Ve),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){console.error(t),null==n||n.showErrorView(null==t?void 0:t.message)}finally{null==n||n.hideLoadingView()}}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,i){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof Ln?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof Ln&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof Ln?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Ln&&this._obj.drillup(e)}}class so extends Pt{constructor(t,e,i){super(t,i,"image"),this._dirty=!0,this._bounds=lt,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,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class ro extends Pt{constructor(t,e){super(t,ro.STYLE),this._spinnerWrapper=new Pt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new so(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=ro.LOADING_SPINNER,this._spinner.width=ro.SPINNER_LENGTH,this._spinner.height=ro.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-ro.SPINNER_LENGTH/2,t.height/2-ro.SPINNER_LENGTH/2)}}ro.STYLE="rm-loading-indicator",ro.BACK_STYLE="rm-loading-background",ro.SPINNER_LENGTH=64,ro.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class no{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,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,i,s)&&(this._clearTouchEffects(),i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(s<0||s>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?i&&this.$_stopDragTracker(e,s,r,!0):i?this.$_doDrag(t,e,s,r):(!this._dragTracker&&Math.abs(this._prevX-s)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!i)&&this.$_startMove(t,e,s,r),this._prevX=s,this._prevY=r,this._touches.push({x:s,y:r,t:t.timeStamp})):i&&this.$_stopDragTracker(e,s,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:i,y:s}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,i,s)}pointerCancel(t){const e=t.target,{x:i,y:s}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,i,s,!0),clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerCancel(t)}pointerLeave(t){clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerLeave(t)}touchStart(t){if(this._pinching=!1,t.touches.length>=2){const e=t.target;this._isPinchTarget(e)&&(this._pinching=!0,this._distance=this.$_getDistance(t.touches[0],t.touches[1])),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,i){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,i){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,i,s,r){return!1}_getDragTracker(t,e,i){return null}$_startDrag(t,e,i,s,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i)),!!this._dragTracker&&this._dragTracker.start(t,e,i,s,r)}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s=!1){this.dragging&&(s?this._dragTracker.cancel():this._dragTracker.drop(null,e,i),this._dragTracker=null)}$_pointerToPoint(t){return this._control.pointerToPoint(t)}$_checkSwipe(t,e){const i=this._touches,s=i.length;if(s<2)return;const r=i[s-1];let n=i[s-2];if(r.t-n.t<=100)for(let t=s-3;t>=0&&(n=i[t],!(r.t-n.t>100));t--);const o=n.x,a=n.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-n.t),d=.998;if(c>.1){const e=this._dragTracker,i=Math.log(.1/c)/Math.log(d),s=c*(1-Math.pow(d,i+1))/(1-d);let r,n=Math.round(180*Math.atan2(l-a,h-o)/Math.PI);if(n<0&&(n=360+n),r=n>45&&n<=135?X.DOWN:n>135&&n<=225?X.LEFT:n>225&&n<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class oo extends gt{constructor(t){super(),this._dragging=!1,this._control=t}get control(){return this._control}get dragging(){return this._dragging}get startWhenCreated(){return!1}get cursor(){}canSwipe(){return!1}start(t,e,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this._dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this._dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,i){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}swipe(t,e,i){if(this._doSwipe(t,e,i))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,i){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_canAccept(t,e,i){return!0}_doCompleted(t,e,i){}_doEnded(t=-1,e=-1){}}class ao extends oo{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class ho extends oo{constructor(t){super(t);const e=t.model.body;this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,i,s,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=i,super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=this._oldX-(s-this._xStart)/n.scale,a=this._oldY-(r-this._yStart)/n.scale;if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else n.panX=o;return n.panY=a,!0}$_mapView(){return this.control.model.body}}class lo extends no{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof ho&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=at?t.ctrlKey:t.metaKey,s=this.$_chart(),r=this.$_chartView(),n=s.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 vi){const t=a.source;s.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;switch(n){case"select":h&&h.model.canSelect()&&(i?h.toggleSelect(e):h.select(e,!0));break;case"drilldown":this.$_drildown(s,t,r)}r.click(t,e,h)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.chartOptions.options.dblClickAction;"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.options.zoomable){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.zoom+=-i/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,i){const s=this.$_chart();return s.isGlobe?new ao(this.control):s.body.isScrollable()||s.body.movable?new ho(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,i){const s=t.firstMapSeries;if(s){const r=e.target,n=i.bodyView().getSeries(s).pointByDom(r);n&&n.point instanceof wn&&t.drilldown(t.firstMapSeries,n.point.area.id)}}}class co{static empty(){return new co}static create(t=0,e=0){return new co(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 co(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+"}"}}co.EMPTY=new co;class _o extends Pt{constructor(t,e=M){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return _o.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}_o.IGNORE_ATTRS={width:"",height:""};class uo extends _o{constructor(e,i){super(e,i),this.add(this._text=new Se(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.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 ni(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 Se(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()),i?this._icon||(this.add(this._icon=new so(t,!1)),this._icon.url=i,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=we.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._icon;let i=0;const s=this._text.bbox(),r=s.width,n=s.height;let o,a=r,h=n,l=0,c=0,d=0,_=0;if(this._box=void 0,e){const t=e.bbox();switch(i=b(this._model.options.iconGap,0),l=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":a+=i+l,h=Math.max(c,n);break;default:h+=i+c,a=Math.max(l,r)}}if(this._back&&this._back.parent&&(o=getComputedStyle(this._back.dom),d=parseFloat(o.paddingLeft)||0,_=parseFloat(o.paddingTop)||0,this._back.setBounds(0,0,a+d+(parseFloat(o.paddingRight)||0),h+_+(parseFloat(o.paddingBottom)||0),o.rx)),e)switch(this._model.getIconPos()){case"left":e.trans(d,(h-c)/2),d+=l+i,a-=l+i;break;case"right":e.trans(d+a-l,(h-c)/2),a-=l+i;break;case"top":e.transX((a-l)/2),_+=c+i;break;case"bottom":e.trans((a-l)/2,_+n+i)}switch(o||(o=getComputedStyle(this._text.dom)),o.textAlign){case"center":d+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":d+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(d,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(d,_)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class po extends Pt{constructor(t,e=M){super(t,e,"g"),Pt.DEBUGGING&&(this.add(this._debugRect=new ni(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._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Pt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ni(this.doc,"rm-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,i,s){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class go extends po{constructor(t,e,i){super(t,e),this._margins=new ft,this._paddings=new ft,this.add(this._background=new ni(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const n=this._paddings;n.applyPadding(r);const o=this._doMeasure(t,e,i,s);if(o.width+=n.left+n.right,o.height+=n.top+n.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class mo extends _o{measure(t,e,i,s){const r=this._doMeasure(t,e,i,s);return this.mw=r?r.width:0,this.mh=r?r.height:0,r}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}locateInner(t,e,i){return this._doLocateInner(t,e,i),this}}class fo extends uo{constructor(t){super(t,"rm-map-widget-title")}}class bo extends uo{constructor(t){super(t,"rm-map-widget-footer")}}class yo extends go{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new fo(t)),this.add(this._footerView=new bo(t))}_setBackgroundStyle(t){t.setVisible(this.model.options.background.visible)&&t.setStyleOrClass(this.model.options.background.style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.options.text),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class wo extends gt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,n=this._views;for(let t of n)t.parent;for(t=Math.max(0,t);n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(s);n.push(e),i&&i(e,n.length-1,t)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._reversed?this._owner.insertFirst(t):this._owner.add(t),t}free(t,e=0){if(t){t.remove(),this._pool.push(t);const e=this._views.indexOf(t);e>=0&&this._views.splice(e,1)}}freeAll(t,e=0){for(let i of t)this.free(i,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===e}find(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return e[i]}sort(t){const e=this._views.sort(t);return e.forEach((t=>t.remove())),e.forEach((t=>this._owner.add(t))),this}map(t){return this._views.map(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const i=this._views.indexOf(t);i>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(i,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._reversed?this._owner.insertFirst(e):this._owner.add(e),e}_getElementId(t){}}class xo extends po{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new ni(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Se(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.options.markerVisible)?this._marker.bbox():lt,n=ct(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,i=b(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.bbox().height)/2)}}class vo extends yo{constructor(t){super(t,vo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new wo(this,xo)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=b(r.itemsPerLine,Number.MAX_SAFE_INTEGER),o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),this.$_prepareItems(t,n);const a=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?a.height=Math.max(a.height,this._rTitle.height):a.width=Math.max(a.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?a.height=Math.max(a.height,this._rFooter.height):a.width=Math.max(a.width,this._rFooter.width)),a}_doLayout(){const t=this.model,e=t.options,i=this._rowViews,s=e.sameTextColor,r=this._sizes,n=e.itemsAlign,o=e.lineGap||0,a=e.itemGap||0,h=this._margins,l=this._paddings,c=this._vertical,d=this._titleView,_=this._footerView,u=this._rTitle,p=d.visible?u.height:0,g=d.visible?u.width:0,m=this._rFooter,f=_.visible?m.height:0,b=_.visible?m.width:0,y=_.visible?this._gapFooter:0;let w,x,v,C=h.left+l.left,S=h.top+l.top,L=this.width-C-h.right-l.right,A=this.height-S-h.bottom-l.bottom;if(d.visible)if(this._inTitle){switch(x=S,t.title.options.verticalAlign){case"top":break;case"bottom":x+=A-p;break;default:x+=(A-p)/2}d.trans(C,x),C+=g,L-=g}else{switch(t.title.options.align){case"center":w=Math.max(C,C+(L-u.width)/2);break;case"right":w=Math.max(C,C+L-u.width);break;default:w=C}d.trans(w,S),S+=p,A-=p}const M=C,P=S;if(_.visible){if(this._inFooter){switch(w=M+L-b,x=S,t.footer.options.verticalAlign){case"top":break;case"bottom":x+=A-f;break;default:x+=(A-f)/2}L-=b+y}else{switch(x=S+A-f,t.footer.options.align){case"center":w=Math.max(C,C+(L-m.width)/2);break;case"right":w=Math.max(C,C+L-m.width);break;default:w=C}A-=f+y}_.trans(w,x)}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("")})),i.forEach(((t,e)=>{if(c){const i=this._wMarkers;t.forEach((t=>{t.mw=r[e],t.resizeByMeasured().layout(i[e])})),S=P,"center"!==n&&"end"!==n||(v=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1),S+="center"===n?(A-v)/2:A-v),t.forEach((t=>{t.trans(C,S),S+=t.height+a})),C+=r[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),C=M,"center"!==n&&"end"!==n||(v=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1),C+="center"===n?(L-v)/2:L-v),t.forEach((t=>{t.trans(C,S),C+=t.width+a})),S+=r[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,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,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||ns.MARKER_SIZE)),e.measure(t,a[i],r,n)}));let y=0,w=0;if(i){for(;y<d;)b=h.get(y),w%s===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 i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=g(i,t.mw),r=g(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=g(m,s),p+=i,u.push(i),this._wMarkers.push(r)})),p+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%s===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,i=0;t.forEach((t=>{e+=t.mw,i=g(i,t.mh)})),e+=l*(t.length-1),p=g(p,e),m+=i,u.push(i)})),m+=c*(_.length-1)}return this._titleView.visible&&(this._inTitle?p+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?p+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),{width:p,height:m}}}vo.LEGEND_CLASS="rm-legend";const Co={};class So extends go{static register(...t){t.forEach((t=>{Co[t[0].type]=t[1]}))}constructor(t,e){super(t,So.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,i){this.measure(this.doc,this.model,e,i),this._layoutView(t,0,0,e,i)}_layoutView(t,e,i,s,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,i,s,r,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this._op.align){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.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)}}So.CLASS_NAME="rm-annotation";class Lo{static interpolate(t,e){if(e instanceof rr==!1)return t;const i=[];let s=null,r=null,n=!1;for(let o=0;o<t.length;o++){const a=t[o],h=e.project(a);if(h.outside)n=!0;else{if(s||(s=a,t.push(a)),n&&r){const t=or(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,n=!1}}return i}}class Ao{static box(t,e,i,s,r){const n=Math.floor(Math.abs(i-t)/20),o=this.boxPoints(t,e,i,s,n);return this.coordsToPath(Ao.toPixelCoord(r,o))}static ellipse(t,e,i,s,r,n=40){const o=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,n);return this.coordsToPath(Ao.toPixelCoord(r,o))}static geoCircle(t,e,i,s,r,n=!1,o=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,o);let h=this.toPixelCoord(r,a);return n&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof rr?Lo.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let i=!1;for(const s of t){if(!!s.outside){i=!1;continue}const[t,r]=s;i?e.push("L",t,r):(e.push("M",t,r),i=!0)}return e}static horizontalLineToRight(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([n,t]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][0]===i||r.push([i,t]),r}static horizontalLineToLeft(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([n,t]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([t,n]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][1]===i||r.push([t,i]),r}static verticalLineToDown(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([t,n]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const n=[],[o,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),n.push(...this.horizontalLineToRight(h,o,a,r)),n.push(...this.verticalLineToUp(a,h,l,r)),n.push(...this.horizontalLineToLeft(l,o,a,r)),n.push(...this.verticalLineToDown(o,h,l,r)),n}static arcCoords(t,e,i,s,r,n,o,a=64){const h=2*Math.PI,l=n-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?o?-h:h:l;c||(o&&d>0&&(d-=h),!o&&d<0&&(d+=h));const _=d/a,u=[];for(let n=0;n<=a;n++){const o=r+_*n;u.push([t+Math.cos(o)*Math.abs(i),e+Math.sin(o)*Math.abs(s)])}return u}}class Mo extends Nt{renderLat(t,e,i,s,r){let n=r.project([e,t]),o=ui(n)?`M${n[0]},${n[1]}`:"";if(r.latElliptic){let a=e+s;const h=t=>{n=r.project(t),ui(n)&&(o+=o?` L${n[0]},${n[1]}`:`M${n[0]},${n[1]}`)};for(;a<=i-s;)h([a,t]),a+=s;a<=i&&h([i,t])}else n=r.project([i,t]),o+=` L${n[0]},${n[1]}`;this.setPath(o)}renderLatGlobe(t,e,i,s,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=i;)o+=s,a=r.project([o,t]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([o,t]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}renderLon(t,e,i,s,r){let n=r.project([t,e]),o=ui(n)?`M${n[0]},${n[1]}`:"";if(r.lonElliptic){let a=e+s;const h=t=>{n=r.project(t),ui(n)&&(o+=o?` L${n[0]},${n[1]}`:`M${n[0]},${n[1]}`)};for(;a<=i-s;)h([t,a]),a+=s;a<=i&&h([t,i])}else n=r.project([t,i]),o+=` L${n[0]},${n[1]}`;this.setPath(o)}renderLonGlobe(t,e,i,s,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=i;)o+=s,a=r.project([t,o]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([t,o]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}}class Po extends po{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new wo(this,Mo),this._lonPool=new wo(this,Mo)}_doInitStyles(){this.ignorePointer()}prepare(t){this._latPool.prepare((t.y2-t.y1)/t.latStep+1,null,(t=>{Lt.setNoScale(t.dom)})),this._lonPool.prepare((t.x2-t.x1)/t.lonStep+1,null,(t=>{Lt.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,t.x1),y1:Math.max(-90,t.y1),x2:Math.min(180,t.x2),y2:Math.min(90,t.y2),latStep:t.latStep,lonStep:t.lonStep}}_doMeasure(t,e,i,s){return co.create(i,s)}_doLayout(t){const e=this.model,i=this.second,s=e.chart,r=e.line,n=e.lonLine,o=e.latLine,a=e.chart.getProjection(i),h=a.isGlobe,l=this._bounds;let c;Lt.setImportantStyle(this.dom.style,"pointer-events","none"),Lt.setImportantStyle(this.dom.style,"fill","none");const d=l.x1,_=l.x2;let u=l.latStep;if(c=s.axis.latInterval,h)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(r._style),t.internalSetStyleOrClass(o._style),t.renderLatGlobe(l.y1+e*u,d,_,c,a)}));else{const t=Math.ceil(l.y1/u)*u;this._latPool.forEach(((e,i)=>{const s=t+i*u;(e.visible=s<=l.y2&&s>=l.y1)&&(e.internalResetStyleOrClass(r._style),e.internalSetStyleOrClass(o._style),e.renderLat(s,d,_,c,a))}))}const p=l.y1,g=l.y2;if(u=l.lonStep,c=s.axis.lonInterval,h)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(r._style),t.internalSetStyleOrClass(n._style),t.renderLonGlobe(l.x1+e*u,p,g,c,a)}));else{const t=Math.ceil(l.x1/u)*u;this._lonPool.forEach(((e,s)=>{const o=t+s*u;(e.visible=!(i&&-180===o)&&o<=l.x2&&o>=l.x1)&&(e.internalResetStyleOrClass(r._style),e.internalSetStyleOrClass(n._style),e.renderLon(o,p,g,c,a))}))}}}class ko extends kt{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new kt(t,"rm-axis-tick-labels")),this._labelPool=new wo(this._labelLayer,Se)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),n=e.getLatInterval(),o=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*n,h=1+((i.x2-i.x1)/o|0),l=1+((i.y2-i.y1)/a|0);let c=0;this._model=e,this._bounds=Object.assign({},i),this._topCount=this._bottomCount=this._rightCount=this._leftCount=0,e.visibleAt("top")&&(c+=this._topCount=h),e.visibleAt("bottom")&&(c+=this._bottomCount=h),e.visibleAt("right")&&(c+=this._rightCount=l),e.visibleAt("left")&&(c+=this._leftCount=l),this._labelLayer.setVisible(e.label.visible)&&this._labelPool.prepare(c,null,(t=>{t.internalResetStyleOrClass(s)}))}layout(t){if(this._model,this._labelLayer.visible){const e=0!=t.scroll?t.second:null,i=this._scale,s=this._bounds;let r,n,o,a,h,l=0,c=s.x1,d=s.y1;(n=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,n.forEach(((s,n)=>{o=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(o[0]*i,o[1]*-i),c+=r})),l+=this._topCount),(n=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._bottomCount),(n=this._labelPool.getRange(l,l+this._rightCount)).length>0&&(r=this._latStep,a=this._bounds.x2,h=Math.ceil(d/r)*r,e&&(a=-180+t.scroll,t=e),n.forEach(((e,s)=>{o=t.project([a,h]),e.text=h+"°",e.trans(o[0]*i-e.bbox().width/2,o[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(n=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._leftCount)}}}class Io extends po{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Po(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,n=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(n),this._gridView.measure(t,r,i,s)),co.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.map,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:n,y1:o,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:o,x2:n,y2:a,latStep:s,lonStep:i}}$_calcBoundary(t,e,i){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class No extends uo{}class To extends po{constructor(t,e){super(t),this.add(this._pathView=new Nt(t)),e.add(this._labelView=new No(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Ns?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.options,s=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(i.label.text),"range"===i.type){const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(i,t,r),s.setStyle("strokeWidth",`${e}px`)}else if("band"===i.type){o||(this.add(o=this._fromView=new Nt(this.doc)),this.add(a=this._toView=new Nt(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(i,t,r),s.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(i,t,r),s.setStyle("fill","none"),s.setStyle("strokeWidth",`${e}px`)}s.setPath(n).setStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a;if("lat"===t.axis){const r=t.position,o=s.h1,h=s.h2;a=Ao.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=Ao.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return Ao.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a=[];if("lat"===t.axis){const h=Math.min(t.from,t.to),l=Math.max(t.from,t.to),c=s.h1,d=s.h2;a.push(...Ao.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath(Ao.coordsToPath(_.map((t=>r.project(t))))),a.push(...Ao.verticalLineToUp(d,h,l,o));const u=Ao.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath(Ao.coordsToPath(u.map((t=>r.project(t))))),a.push(...Ao.verticalLineToDown(c,h,l,o)),this.$_renderLatLabel(c,l,e,i)}else{const o=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=s.v1,c=s.v2;a.push(...Ao.verticalLineToUp(o,l,c,n));const d=[...a],_=Ao.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath(Ao.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(Ao.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return Ao.coordsToPath(Ao.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=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),i=Math.abs(h-o);r=Ao.ellipse(t[0],t[1],e,i,s)}else r=Ao.box(n,o,a,h,s);if(i.visible){const t=Math.min(n,a),r=Math.max(o,h),l=s.project([t,r]);l.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return r}$_renderLatLabel(t,e,i,s){if(!s.visible)return;const{prj:r,map:n,tf:o}=i;let a=0,h=0;const l=s.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*s.scale+s.tx,o=c*-s.scale+s.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);ui(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<i-r;)a([o,t]),o+=r;return o<=i&&a([i,t]),n}$_renderHorizontalLineToLeft(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);ui(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,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);ui(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=i-r;)a([t,o]),o+=r;return o<i&&a([t,i]),n}$_renderVerticalLineToBottom(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);ui(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class Eo extends _o{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new ni(t,"rm-crosshair-flag-back")),this.add(this._text=new Se(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,n,o){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(n-l.width,Math.max(0,o.tx+h[0]*o.scale-l.width/2)),Math.max(0,o.ty-a[1]*o.scale-l.height))}renderLatFlag(t,e,i,s,r,n){const o=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,n.tx+o[0]*n.scale-a.width),Math.max(0,Math.min(r-a.height,n.ty-o[1]*n.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(s.tx+o[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-o[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,n,o,a){const h=e.project([i,s]),l=e.project([o,s]),c=this.prepareLabel(t);this.trans(Math.min(r-c.width,Math.max(0,a.tx+h[0]*a.scale)),Math.max(0,Math.min(n-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class Vo extends po{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Mo(t,"rm-crosshair-line")),this.add(this._lonLine=new Mo(t,"rm-crosshair-line")),Lt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Lt.setImportantStyle(this._latLine.dom.style,"fill","none"),Lt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Lt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Eo(t)),this.add(this._lonFlag=new Eo(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${i}px`),this._lonLine.setStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.map,n=t[0],o=t[1],a=this._lonLine,h=this._latLine,l=this._lonFlag,c=this._latFlag,d="map"===i.axis.grid.fitTo,_=d?r.h1:-180,u=d?r.h2:180,p=d?r.v1:-90,g=d?r.v2:90;this._bounds={x1:_,x2:u,y1:p,y2:g};const m=[a,l,h,c],f=m.reduce(((t,e)=>t&&e.visible),!0);if(!(_<=n&&n<=u&&p<=o&&o<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(!1),y=b instanceof rr?b:new b.constructor;y.offset=b.offset,this.$_renderLon(t,s.axis.lonInterval,e,y),this.$_renderLat(t,s.axis.latInterval,e,y)}$_renderLon(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof rr;_?l.renderLonGlobe(h,o,a,e,s):l.renderLon(h,o,a,e,s);const u=this.calcTopY(i,n,s,o),p=r.chart.getProjection(!1).getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,n=r.chart.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=s instanceof rr;u?l.renderLatGlobe(h,o,a,e,s):l.renderLat(h,o,a,e,s);const p=u?90-s.rotationX:o,g=s.project(t),m=this.calcRightX(i,s,_,n,g[1]);u?c.renderGlobeLatFlag(d,s,p,h,_.width,_.height,m,i):c.renderLatFlag(d,s,p,h,_.height,i)}calcTopY(t,e,i,s){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let n=[NaN,NaN];const o=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?s:n[1]}calcRightX(t,e,i,s,r){const n=[(i.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?s.x2:o[0]}}const Do="rm_map_globe_fill";class Ro extends Nt{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,n){const o=e.map,a=this.parent,h=e.body.projection;o||this.setPath("");const l=e.body.mapBackground;let c;if(this.internalClearStyles(),a.isProjectionChanged&&this.transEx(0,0).scale(1),e.isGlobe)c=this.$_renderGlobeBg(t,l,c,r,n,i,s);else if(h.lonElliptic||h.latElliptic){const t=e.body.projection.getClipBounds(e.axis.lonInterval,e.axis.latInterval);c=`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`)),this.internalSetStyleOrClass(l._style)}else this.internalSetStyleOrClass(l._style),c=Qe.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof rr)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,n,o){const a=e.options.globeFill,h=Math.max(s,r)/2;if(i=Qe.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(Do),a){const e={id:Do,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Ht(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${Do})`),this.internalSetStyleOrClass(e._style),i}}class $o extends Nt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){ht.isNum(t)?this.setPath(Qe.line(t,e,i,s)):t&&this.setPath(Qe.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(Qe.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(Qe.line(t,e,t,i))}setHLine(t,e,i){this.setPath(Qe.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(Qe.line(e,t,i,t))}}class Oo extends Nt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){ht.isNum(t[0])?this.setPath(Qe.lines(...t)):r(t[0])?this.setPath(Qe.lines3(...t)):this.setPath(Qe.lines2(...t))}}var Fo;class Bo extends wo{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class zo extends uo{constructor(t){super(t,"rm-point-label")}}class jo extends kt{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new wo(this,zo),new wo(this,zo)],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,i,s,r,n){const o=r.getPointText(s,i,n.options.text);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):(e.setText(n.getText(n.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),n=this._labels,o=i.getLabeledPoints(),a=this._maps,h=s[0]._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}removePoint(t,e){for(let i=0;i<2;i++){const s=this.get(t,i);if(s)return void this._labels[i].removeLater(s,e)}}}class Go extends _o{constructor(t){super(t),this.add(this._line=new Oo(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Nt(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Nt(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(Qe.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=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(s(a,a)),o.trans(i[0],i[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(i,!1),s&&r.usePointColor&&(o.visible&&o.setFill(s),a.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Ho extends Et{constructor(t){super(t),this.add(this._back=new ni(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Nt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(Qe.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(Qe.rect(t).concat(Qe.rect(e))):this._mask.setPath(Qe.rect(t)),this}}class Wo extends kt{constructor(t,e){super(t,e),this._callouts=new wo(this,Go),this._map={},this.add(this._maskLayer=new kt(t)),this._masks=new wo(this._maskLayer,Ho),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,i=t.callout,s=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=i._style,a=this._map={};r.prepare(n.length,(t=>{})),s.prepare(n.length),n.forEach(((t,i)=>{const n=s.get(i);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(i).id}`),n.index=i,a[t.pid]=n)})),this.setStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const i={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},s=this._masks.get(t.index);return s.setBackground(i),s}}class Yo extends Tt{constructor(t,e=!1){super(t,Xo.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const n=.35,o={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].x-t[r].x,y:t[r+1].y-t[r].y};let c={x:0,y:0},d=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=d,l.y/=d;let _=t[r+1].x-t[r].x,u=t[r].x,p=t[r].y;for(++r;r!=i;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].x-t[r].x,l.y=t[r+1].y-t[r].y,d=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=d,l.y/=d,l.x<h.x?(c.x=h.x-l.x,c.y=h.y-l.y):(c.x=l.x-h.x,c.y=l.y-h.y);const e=Math.sqrt(c.x*c.x+c.y*c.y);c.x/=e,c.y/=e,h.y*l.y>=0&&(c={x:1,y:0}),o.x=-c.x*_*n,o.y=-c.y*_*n;const i=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*n,a.y=c.y*_*n,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.setStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.setStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Zo extends kt{}const Uo={};class Xo extends po{static register(...t){t.forEach((t=>{Uo[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof Fo)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Qe[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,i=!0){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,i,s)=>({x:t-i/2,y:e-s}),bottom:(t,e,i,s)=>({x:t-i/2,y:e}),center:(t,e,i,s)=>({x:t-i/2,y:e-s/2}),left:(t,e,i,s)=>({x:t-i,y:e-s/2}),right:(t,e,i,s)=>({x:t,y:e-s/2})},this._labelPositioner={bottom:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e+=r+n}),top:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=r+n+i.height}),right:(t,e,i,s,r,n)=>({x:t+=s+n,y:e-=i.height/2}),left:(t,e,i,s,r,n)=>({x:t-=s+n+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=i.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointLayer=new kt(t)),this._pointLayer.add(this._pointContainer=new Zo(t,"rm-series-points")),this.add(this._calloutContainer=new Wo(t,"rm-series-callouts")),i&&(this._labelContainer=new jo(t,e))}get owner(){return this.parent}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepare(t,e){const i=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,s=this._labelContainer,r=this._calloutContainer;this.setModel(e),this.setStyle("pointerEvents",e.options.disabled?"none":""),e instanceof Ln?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==s||s.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),i?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),null==s||s.prepare(t,this),r.prepare(t,this)):((null==s?void 0:s.isEmpty())&&s.prepare(t,this),r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e){const i=this.model;this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),i instanceof Ln||i.isEmpty(!0)||!this.chart().animatable()||this._runShowEffect(i&&(!this.control.loaded&&this.chart().loadAnimatable()||i._dataLoaded)&&!i.isEmpty(!0)),i._dataLoaded=!1}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}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 i=this.pointByDom(t);i&&this.chart().selection.add(this.model,i.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}get growRate(){return this._growRate}_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,i){if(t.setAttrEx("aria-label",i.ariaHint()),t.internalClearStyleAndClass(),i._runColor)this._setPointColor(t,i._runColor);else{const s=e.getRangedColor(i);s&&this._setPointColor(t,s)}const s=e.getPointStyle(i);s&&t.internalSetStyleOrClass(s)}_doPointerMoved(t,e,i){return!1}_getGrowRate(){return 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&&ht.log("CLICKED: ",t.point.name,t.point.getValue())}}Fo=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=>Qe.circle(0,0,t)},Fo._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Ko extends Yo{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class qo 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 Jo extends Yo{prepare(t,e){return this.point=t,this._ext=ht.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Qo extends Xo{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class ta extends Jo{constructor(t){super(t,!0),this.add(this._contentLayer=new kt(t)),this.add(this._baseLine=new $o(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class ea extends Qo{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,b(t._minValue,i.min)),i.max=Math.max(i.max,b(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.options.inverted;let r=s?e._height:e._width;const n=e.getPadding(r);this._ext.inverted=s,this._ext.pad=n,this._ext[s?"height":"width"]=r-2*n}}class ia extends Yo{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class sa extends Xo{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class ra extends So{constructor(t){super(t,ra.CLASS_NAME),this.add(this._imageView=new so(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}ra.CLASS_NAME="rm-image-annotation";class na extends So{constructor(t){super(t,na.CLASS_NAME),this.add(this._shapeView=new Nt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),Qe.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)}}na.CLASS_NAME="rm-shape-annotation";class oa extends So{constructor(e){super(e,oa.CLASS_NAME),this.add(this._textView=new Se(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new Ee}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),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,i,s,null,e._domain);const a=ct(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)}}oa.CLASS_NAME="rm-text-annotation";class aa{static reveal(t,e){new la(t,e)}static grow(t,e){new da(t,e)}static spread(t,e){new _a(t,e)}static fadeIn(t){new ha(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);window.Animation&&i instanceof Animation&&(i.addEventListener("finish",(()=>{t._animationFinished(i)})),t._animationStarted(i))}}class ha extends aa{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:ut.DURATION,fill:"none"})}}class la extends aa{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:ut.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,i){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class ca extends ut{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Pt}_stop(){super._stop(),this._series=null}}class da extends ca{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class _a extends ca{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ua extends Nt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(Qe.bar(t-i/2,e,i,-s,r,n))}}class pa extends ta{constructor(t){super(t),this._bars=new wo(this._contentLayer,ua)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,i,s,r,n,o){const a=t._categories||[],{min:h,max:l,base:c}=t.getPointExtents(i,e),d=i.length,_=r/d,u=_*s.barWidth,p=s.barWidth>1&&!s.overflow,g=s.pad;this._bars.forEach(((t,e)=>{const s=i[e];if(t.setVisible(!isNaN(s))){const i=(s-h)/(l-h)*n*o;let c=g+_*e+(_-u)/2;p&&(c+u>g+r&&(c=g+r-u),c=Math.max(c,g)),t.setPath(Qe.bar(c,n,u,-i,0,0)),t.internalClearStyleAndClass(),a[e]&&a[e].color&&t.setFill(a[e].color)}})),this._renderBaseLine(t.baseLine,!1,this.width,this.height)}}class ga extends Ko{tooltipColor(){return getComputedStyle(this.dom).fill}}class ma extends Nt{static create(t,e,i,s,r,n,o,a,h=!0){return new ma(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,n,o,a,h,l=!0){return new ma(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=M,i=M){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,i&&this._assignShape(i,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return Qe.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 Qe.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 fa=function(t){return isNaN(t)?0:t};class ba{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",fa(t),fa(e)):this._path.push("M",fa(t.x),fa(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",fa(t),fa(e)):this._path.push("m",fa(t.x),fa(t.y)),this}movep(t,e){return a(t)?this._path.push("M",F(t),F(e)):this._path.push("M",F(t.x),F(t.y)),this}line(t,e){return a(t)?this._path.push("L",fa(t),fa(e)):this._path.push("L",fa(t.x),fa(t.y)),this}linep(t,e){return a(t)?this._path.push("L",F(t),F(e)):this._path.push("L",F(t.x),F(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",fa(t[e]),fa(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",fa(t[e].x),fa(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,i){return this._path.push(`M ${t-i}, ${e} a ${i},${i} 0 1,0 ${2*i},0 a ${i},${i} 0 1,0 ${2*-i},0`),this}}class ya extends Nt{render(t,e){const i=t.getExtents(e);if(i.radius!==this._radius||i.length!==this._length||i.offset!==this._offset){const t=this._radius=i.radius,e=this._offset=i.offset;if(this._length=i.length,this._radius>0&&this._length>0){const i=new ba;i.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(i.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let wa=class extends Nt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new ba).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class xa extends ia{constructor(t){super(t),this.add(this._faceView=new ma(t,"rm-circle-gauge-face")),this.add(this._rimView=new ma(t,"rm-circle-gauge-rim")),this.add(this._valueView=new ma(t,"rm-circle-gauge-value")),this.add(this._textView=new Se(t,"rm-circle-gauge-text")),this.add(this._handContainer=new kt(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 ya(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 wa(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=p(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const n=t.options,o=t._props,a=s.getValue(),h=t.getValueRate(a)*r,l=t.valueRim.getThickness(i.radiusThick),c=this._textView;if(this._valueView.visible){const s=t.valueRim,r=s.options,a=i.value+(r.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(s._style),r.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",O(l))),c.setBoolData("stroked",r.stroked),c.setSectorEx({cx:e.x,cy:e.y,rx:a,ry:a,innerRadius:(a-l)/a,start:o._startRad,angle:o._sweepRad*h,clockwise:n.clockwise},r.stroked)}if(c.visible){const i=t.gaugeLabel;c.text=i.getNumberText(a,!1,!1,void 0),i.buildSvg(c,null,NaN,NaN,t,i._domain);const s=c.bbox(),r=i.getOffset(this.width,this.height);c.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class va extends Pt{constructor(t,e,i,s,r){super(t,e,"circle"),"number"==typeof i&&this.setCircle(i,s,r)}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class Ca extends ut{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 Sa extends ia{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new va(e,"rm-clock-gauge-face")),this.add(this._rimView=new ma(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Se(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new kt(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new kt(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Nt(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new Nt(e,"rm-clock-gauge-minute")),this.add(this._secondView=new Nt(e,"rm-clock-gauge-second")),this.add(this._pinView=new va(e,"rm-clock-gauge-pin")),this._tickViews=new wo(this._tickContainer,$o,"rm-clock-gauge-tick"),this._tickLabelViews=new wo(this._tickLabelContainer,Se,"rm-clock-gauge-tick-label")}prepare(e,i){const s=Math.round(12/g(1,Math.floor(i.tickLabel.options.step)||1));this._tickViews.prepare(i.tick.visible?12:0),this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=i.options.timezoneCallback}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+s.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 i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,d=t.tick.options.length||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-c/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-c;let g=p-d,m=N,f=I/12;if(this._tickViews.forEach(((e,i)=>{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,i=I/12*e;m=N,n.get(0).text="12",g=p-(d+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((s,r,n)=>{s.text=String(0===r?12:r*e),s.trans(a+_(m)*g,h+u(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=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=i.getMinutes()+i.getTimezoneOffset()+s;i.setMinutes(r)}return i}$_renderHands(t,e){const i=this.$_getNow(this.point),s=i.getHours(),r=i.getMinutes(),n=i.getSeconds(),o=s>=12,{cx:a,cy:h,rd:l}=e,c=new ba;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=I*(s/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*E)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=I*(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*E)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?I*(this._aniSec+this._secRate)/60:I*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*E),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new Ca(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class La extends Yo{constructor(t){super(t,!0),this.add(this._back=new kt(t)),this._back.add(this._figure=new Nt(t)),this._back.add(this._textView=new uo(t,"rm-figure-series-inner-label"))}prepare(t,e,i){const s=this._textView,r=i.options.text;this._clearScale(this._back),this._figure.setPath(e),s.internalResetStyleOrClass(i._style),s.setModel(t,i,null,null),i.prepareRich(r),i.buildSvg(s._text,s._outline,NaN,NaN,i,i.getTextDomain(this.point)),s.layout()}render(t){const e=this._rBox=this._figure.bbox(),i=this._textView,s=i.bbox(),r=Lt.getPadding(i._text.dom),n=e.width-r.left-r.right,o=e.height-r.top-r.bottom;this._aniScale(this._back,t),i.trans(r.left+(n-s.width)/2,(o-s.height)/2+r.top)}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Aa extends Yo{constructor(t){super(t,!0),this.add(this._imageView=new so(t,!1))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Ma{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:ut.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}let Pa=class extends ta{constructor(t){super(t),this._contentLayer.addAll(this._back=new ni(t),this._area=new Nt(t,"rm-line-series-area"),this._line=new Nt(t,"rm-line-series-line"),this._lowLine=new Nt(t))}render(t,e,i,s,r,n){const{min:o,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,o,a,s,r,n),c=i.length,d=c>2&&t.options.curved,_=new ba;if(this.resize(s,r),this._back.setVisible(!1)&&(this._back.resize(s,r),this._back.setStroke("none")),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}if(this._line.setPath(_.end()),this._area.setVisible(t.area.visible)){if(this._area.internalResetStyleOrClass(t.area._style),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}_.line(l[c-1].x,r),_.line(l[0].x,r),this._area.setPath(_.end(!0))}this._renderBaseLine(t.baseLine,!1,s,r)}$_getPts(t,e,i,s,r,n){const o=t.length,a=[];let h=.05*s,l=.1*r;const c=i-e;s-=.1*s,r-=.2*r;for(let i=0;i<o;i++){const d=t[i],_=h+i/(o-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*n-e)/c)*r);a.push({x:_,y:u})}return a}};const ka="rm-map-series-id-";class Ia extends Yo{static idClass(t){return ka+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(ka))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i){const s=this.point;if(i){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||s.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(Ia.idClass(this.model))}this.setBoolData("selected",s&&s._selected)}reset(){this.model=null}}class Na extends Nt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Ta extends Nt{constructor(t){super(t,"rm-map-series-border")}setModel(t){t!==this.model&&(this.model=t,this.setPath(t.getPath()))}reset(){this.model=null}}class Ea extends Nt{constructor(t){super(t,"rm-map-series-inset")}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`;"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i)}}}class Va extends Xo{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new Bo(this._pointContainer,Ia),this._insetPool=new wo(this._pointContainer,Ea)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,i,r;const n=this._hoverArea;if(t!==n){const r=this.model;if(n&&(n.setBoolData(Xo.DATA_HOVER,!1),n.point&&(null===(e=this._labelContainer.get(n.point,0))||void 0===e||e._text.setBoolData(Xo.DATA_HOVER,!1))),!t||t.point||r.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=r.options,n=document.querySelector(".rm-root");let o=e.hoverColor,a=r.pointLabel.options.hoverColor;!o&&s(e.hoverStyle)&&(o=e.hoverStyle.fill),n.style.setProperty("--map-series-hover-fill",o||""),n.style.setProperty("--map-series-hover-label-fill",a||""),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!=n&&r.chart._hoverAreaChanged(r,null==t?void 0:t.model,null==n?void 0:n.model)}const o=this.owner.getSiblingOf(this);o&&(o.hoverArea=o._areas[null===(r=this.hoverArea)||void 0===r?void 0:r.model.id])}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=Ia.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,i){const s=this._second,r=e.map,n=e.internalBorder._style,o=e.externalBorder._style,a=e.getMapBorders(),h=e.options.bringToFront?[]:null;this._insets=r._insets,r.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new kt(t,"rm-map-series-internals")),this._internalPool=new wo(this._internalContainer,Na)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),r.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new kt(t,"rm-map-series-externals")),this._externalPool=new wo(this._externalContainer,Na)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),r.hasBorders&&a.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new kt(t,"rm-map-series-borders")),this._borderPool=new wo(this._borderContainer,Ta))),this._areaPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i),n=t.point=e.pointOf(r);t.setModel(r),n?(r.dummy||this._setPointStyle(t,e,n),h&&h.push(t)):t.internalClearStyleAndClass(),Lt.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i);t.setModel(r,"internal"),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(n)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i);t.setModel(r,"external"),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(o)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(a.length,((t,e)=>{const i=a[e];t.setModel(i),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),h&&h.length!==e.areaCount&&h.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Lt.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){const s=this.areaOfDom(i);return this.hoverArea=s,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const i=this.chart(),s=this._second,r=i.isDirty,n=i.body,o=this.model,a=o.map,h=o.options,l=i.getProjection(s),c=this._areas={},d=this._insets,_=h.allAreas,u=this._labelViews(),p=h.nullStyle,g=h.dummyStyle,m=this._scale,f=this._areaPool;f.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,a=u&&e&&u.get(e,0);if(c[i.id]=t,t.setVisible(i.visible&&(_||!!e)&&!o.isHiddenArea(i.id))){if(t.render(p,g,r),a){const i=n.toVisible(o.getCenter(e),s);if(a.setVisible(!!i)){r&&this._layoutLabel(a,t.dom);const s=a.bbox();let[n,o]=i;e.xPos=n,e.yPos=o,n*=m,o*=-m,n-=s.width/2,o-=s.height/2,a.trans(n,o)}}}else a&&a.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(f.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(f.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=d[e];if(t.setVisible(!1!==i.visible)){const e=c[i.area];if(e)t.setVisible(e.visible)&&t.render(i,l);else{const e=i._base;if(e)if(e[0]instanceof cr){for(const t of e)if(!t.visible||o.isHiddenArea(t.id))return;t.render(i,l)}else if(e[0]>=0){const e=a.areaOf(i._parent);e&&e.visible&&!o.isHiddenArea(e.id)&&t.render(i,l)}}}}))}}class Da extends po{constructor(t,e,i){super(t,e),this._paddings=new ft,this.add(this._background=new Nt(t,i)),this.add(this._textView=new Se(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=e.options.text;r?(e.prepareRich(r),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;n(a)&&(a=a(e.series.getPointArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(e){const i=this._textView,s=this.width;let r=0;this._renderBackgrouond(this._background,s,this.height,e);switch(getComputedStyle(i.dom).textAlign){case"center":r+=s/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=s,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}i.trans(r,this._paddings.top)}}class Ra extends Da{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,i,s){t.setPath(Qe.bar(0,i,e,-i,s,0))}}class $a extends Da{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Qe.bar(0,i,e,-i,0,s))}}class Oa extends Yo{constructor(t){super(t,!0),this.add(this._back=new kt(t)),this._back.addAll(this._borderView=new ni(t),this._headerView=new Ra(t),this._bodyView=new $a(t),this._divider=new $o(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,n){const o=this.point,a=e.header,h=e.body,l=this._headerView,c=this._bodyView,d=this._divider;let _,u;l.setVisible(a.visible)&&(l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(o).measure(t,h,i,s);let p=u.width,g=u.height;l.visible&&(p=Math.max(p,_.width),g+=_.height);const m=e.getExtents(p,g);l.visible&&(l.resize(m.width,_.height),l.layout(r),d.setVisible(e.divider.visible)&&(d.trans(0,_.height),d.setHLine(0,0,m.width))),c.resize(m.width,m.height-_.height),c.transY(_.height),c.layout(r),this._borderView.setBounds(0,0,m.width,m.height,r),this._rBox={x:0,y:0,width:m.width,height:m.height},this._aniScale(this._back,n)}}class Fa extends ma{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Ba extends Jo{constructor(t){super(t,!0),this._sectors=new wo(this,Fa,null,.5),this._rdRate=1,this.add(this._circle=new va(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,n=0;if(e){this.$_calcAngles(t,[0],s);const o=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.options.clockwise;let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:n,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),o[0]&&o[0].color&&a.setFill(o[0].color),a.internalSetStyleOrClass(e.style)}else{const e=this.point.values;this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),this.$_layoutSectors(t,r,n,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=t.options,r=e.length,n=s.clockwise?1:-1,o=e.reduce(((t,e)=>t+e),0),a=t._totalRad*i;let h=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),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.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.options.clockwise;this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const a=t.value;if(isNaN(a))t.setVisible(!1);else{const a=t.start;let h=0,l=0;t.trans(h,l).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:a,angle:m(t.angle),clockwise:o}),t.internalClearStyleAndClass(),n[r]&&n[r].color&&t.setFill(n[r].color)}}))}}class za extends Ko{constructor(t){super(t,!0),this.add(this._pin=new Nt(t))}render(t){this._pin.setPath(Qe.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new va(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 ja extends Ko{}class Ga extends Yo{constructor(t){super(t,!0),this.add(this._line=new Nt(t)),this.add(this._arrow=new Nt(t))}prepare(){this._checkStatic()}render(t,e,i,s){if(i.length>1){const t=i[i.length-2],r=i[i.length-1],n=$(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+i.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(s)&&(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 Ha extends Jo{constructor(t){super(t,!0),this._cells=new wo(this,Nt)}render(t,e,i,s){const r=t.getPointGrid(this.point,e,s);this.$_prepareCells(Math.round(r.count),i.wCell,i.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,i)}$_prepareCells(t,e,i){this._cells.prepare(t,(t=>{t.setPath(Qe.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const n=i*r.hCell+(i-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[o][a])&&(o++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),n-o*r.hCell-(o>0?o*r.gap:0)),a++}))}}class Wa extends Qo{constructor(t){super(t,"rm-waffle-series"),this._waffles=new Bo(this._pointContainer,Ha)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._waffles.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.getWaffleInfo(),n=s.chart.getProjection(this._second),o=+s.options.rotation||0,a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),c=s.getLabelOff(),d=this._labelViews(),_={...this._getSeriesExt(s,s._visPoints),gap:s.options.gap},u=s.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,C,S,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=C=g[1],v*=a[0],C*=a[1],t.render(s,_,r,i*b.vrate()),m=t.bbox(),f=e(v,C,m.width,m.height),t.trans(f.x,f.y).rotate(o),d&&(S=d.get(b,0))&&S.setVisible(t._static)&&this._layoutLabel(S,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.setVisible(t._static)&&L.render(u,b,x.flat().map(((t,e)=>t*a[e%2])),null)}}))}}class Ya extends So{constructor(t){super(t,Ya.CLASS_NAME),this.add(this._foreignObj=new Pt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=Ya.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._htmlView;let a=r.html||"";const h=(a.startsWith("#")||a.startsWith("."))&&t.querySelector(a);return this._foreignObj.resize(b(n.width,vr.DEF_SIZE),n.height),a=e.applyParams(h?h.innerHTML:a),a!==o.innerHTML&&(o.innerHTML=a),h&&this._templateDom!==h&&(this._templateDom=h,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),isNaN(this._foreignObj.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),ct(this._foreignObj.bbox())}_doLayout(t){super._doLayout(t)}_doDestory(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}function Za(t,e){return new(Co[e._type()])(t)}Ya.CLASS_NAME="rm-html-annotation",Ya.HTML_VIEW_CLASS="rm-html-annotation-view",Xo.register([Ln,Va],[Bn,class extends qo{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new Bo(t,ja)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t){const e=this.model,i=e.chart.getProjection(this._second),s=Math.max(0,e.getRadius()),r=[this._scale,-this._scale],n=+e.options.rotation||0,o=e.options.position,a=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach(((p,g)=>{var m;const f=p.point,b=[f.lon,f.lat];if(p.setVisible(!f.isNull&&null!=(_=i.getVisible(b)))){const g=this._getPointPositioner(f.position||o,"center"),y=(null!==(m=p._radius)&&void 0!==m?m:s)*f.vrate(),w=y*t,x=Xo.getDrawer(e.getShape());let v,C,S,L,A,M;if(c&&(v=f.getCallout(b))&&(C=v.map((t=>i.project(t))),_=C[C.length-1]),f.xPos=S=_[0],f.xPos=L=_[1],S*=r[0],L*=r[1],u=g(S,L,2*y,2*y),u.x+=y,u.y+=y,p.setPath(x(w,w)),p.trans(u.x,u.y).rotate(n),h&&(A=h.get(f,0))&&A.setVisible(p._static)&&(this._layoutLabel(A,p.dom),A.transp(a(u.x,u.y,A.bbox(),y,y,l))),d&&C&&(M=d.get(f))&&M.setVisible(p._static)){const t=C.flat().map(((t,e)=>t*r[e%2]));d.setMask(M,t).setCircle(t[t.length-2],t[t.length-1],y),M.render(c,f,t,null)}}}))}}],[$n,class extends qo{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new Bo(t,za)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),i=this._getGrowRate(),s=this.model,r=[this._scale,-this._scale],n=+s.options.rotation||0,o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom");s.pointLabel.options.position;const h=this._labelViews(),l=s.getLabelOff(),c=s.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=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,A;c&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),_=v[v.length-1]),m.xPos=C=_[0],m.yPos=S=_[1],C*=r[0],S*=r[1],u=g(C,S,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(n),h&&(L=h.get(m,0))&&L.setVisible(p._static)&&(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&&(A=d.get(m))&&A.setVisible(p._static)&&A.render(c,m,v.flat().map(((t,e)=>t*r[e%2])),null)}}))}}],[jr,class extends ea{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new Bo(this._pointContainer,pa)}_getPointPool(){return this._bars}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){const i=t.reversed;this._bars.prepare(e.length,((s,r)=>{const n=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,n)}))}$_layoutBars(t,e,i){const s=this.model,r=s._width,n=s._height,o=!s._pointDomain,a=this._getSeriesExt(s,this._visPoints),h=s.chart.getProjection(this._second),l=[this._scale,-this._scale],c=s.options.position,d=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),_=s.getLabelOff(),u=this._labelViews(),p=s.getCallout(),g=this._calloutViews(),m={pad:this._ext.pad,barWidth:s.options.barWidth,overflow:s.options.overflow};let f,b;this._bars.forEach(((t,e)=>{const y=t.point,w=[y.lon,y.lat];if(t.setVisible(!y.isNull&&null!=(f=h.getVisible(w)))){const e=this._getPointPositioner(y.position||c,"center"),x=t.getSizeRate(t._ext.max,a),v=this._ext.width*x,C=this._ext.height*x;let S,L,A,M,P,k;p&&(S=y.getCallout(w))&&(L=S.map((t=>h.project(t))),f=L[L.length-1]),y.xPos=A=f[0],y.yPos=M=f[1],A*=l[0],M*=l[1],b=e(A,M,r,n),t.resize(r,n),t.render(s,o&&a,y.values,m,v,C,i*y.vrate()),t.trans(b.x,b.y).rotate(this.rotation),u&&(P=u.get(y,0))&&P.setVisible(t._static)&&P.layout().transp(d(b.x+r/2,b.y+n/2,P.bbox(),r/2,n/2,_)),g&&L&&(k=g.get(y))&&k.setVisible(t._static)&&k.render(p,y,L.flat().map(((t,e)=>t*l[e%2])),null)}}))}}],[yn,class extends ea{constructor(t){super(t,"rm-line-series"),this._lines=new Bo(this._pointContainer,Pa)}_getPointPool(){return this._lines}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,b(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Ma(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=!s._pointDomain,n=this._getSeriesExt(s,this._visPoints),o=s.chart.getProjection(this._second),a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),c=s.getLabelOff(),d=this._labelViews(),_=s.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,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(s,r&&n,m.values,y,w,i*m.vrate()),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.setVisible(t._static)&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.setVisible(t._static)&&A.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[Vn,class extends Qo{constructor(t){super(t,"rm-pie-series"),this._pies=new Bo(this._pointContainer,Ba)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._pies.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutPies(t,e,i){const s=this.model,r=s.chart.getProjection(this._second),n=[this._scale,-this._scale],o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),h=s.getLabelOff(),l=this._labelViews(),c=s.getCallout(),d=this._calloutViews(),_=s.getRadius(Math.min(t,e)),u=s.hasThreshold();let p,g;this._pies.forEach(((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=r.getVisible(f)))){const e=this._getPointPositioner(m.position||o,"top"),b=_*t._rdRate;let y,w,x,v,C,S;c&&(y=m.getCallout(f))&&(w=y.map((t=>r.project(t))),p=w[w.length-1]),m.xPos=x=p[0],m.yPos=v=p[1],x*=n[0],v*=n[1],g=e(x,v,2*b,2*b),g.x+=b,g.y+=b,t.render(s,u&&s.getThreshold(m.getSum()),b,i*m.vrate()),t.trans(g.x,g.y),l&&(C=l.get(m,0))&&C.layout().transp(a(g.x,g.y,C.bbox(),b,b,h)),d&&w&&(S=d.get(m))&&S.render(c,m,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[_n,class extends Xo{constructor(t){super(t,"rm-figure-series"),this._figures=new wo(this._pointContainer,La)}_doPrepeare(t,e,i){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutFigures(t)}$_prepareFigures(t,e){const i=t.chart.isDirty,s=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),i&&r.prepare(this.doc,t.getFigure(o),s)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(this._second),i=this.model,s=[this._scale,-this._scale],r=+i.options.rotation||0,n=i.options.position,o=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews();let d,_;this._figures.forEach(((i,u)=>{const p=i.point,g=[p.lon,p.lat];if(i.setVisible(!p.isNull&&null!=(d=e.getVisible(g)))){const u=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>e.project(t))),d=f[f.length-1]),p.xPos=b=d[0],p.yPos=y=d[1],b*=s[0],y*=s[1],i.render(t),v=i._rBox,_=u(b,y,v.width,v.height),i.trans(_.x,_.y).rotate(r),a&&(w=a.get(p,0))&&w.setVisible(i._static)&&this._layoutLabel(w,i.dom).transp(o(_.x+v.width/2,_.y+v.height/2,w.bbox(),v.width/2,v.height/2,h)),c&&f&&(x=c.get(p))&&x.setVisible(i._static)){const t=f.flat().map(((t,e)=>t*s[e%2]));v.x=i.tx,v.y=i.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,i.getFill())}}}))}}],[Wn,Wa],[Gn,class extends Xo{constructor(t){super(t,"rm-route-series",!1),this._lines=new Bo(this._pointContainer,Ga,"rm-route-series-line")}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(b(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setStroke(t._runColor),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(),i._line.setFill("none"),Lt.setNoScale(i._line.dom),i._arrow.setStroke("none"),Lt.setNoScale(i._arrow.dom)}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(this._second),r=e.options.lineWidth,n=e.options.arrowDisplay;if(at){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(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,s,n){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)o(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const r=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));n<1&&(r.length=r.length*n|0),t.render(e,1/this._scale,r,"none"!==s&&(n<1||"moving"!==s))}}$_genPath3(t,e,i){const s=[],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((o-h)**2+(a-l)**2)))*r;var o,a,h,l;const c=this._calculateControlPoint(t,e,n);for(let r=0;r<=i;r++){const n=r/i,o=this.interpolate3(t,c,n),a=this.interpolate3(c,e,n),h=this.interpolate3(o,a,n);s.push(h)}return s}interpolate3(t,e,i){const s=R(t[1]),r=R(t[0]),n=R(e[1]),o=R(e[0]),a=Math.acos(Math.sin(s)*Math.sin(n)+Math.cos(s)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-i)*a)/Math.sin(a),l=Math.sin(i*a)/Math.sin(a),c=h*Math.cos(s)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(s)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(s)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[$(Math.atan2(d,c)),$(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=R(r[1]),o=R(r[0]),a=n+s*Math.sin(Math.PI/2);return[$(o+s*Math.cos(Math.PI/2)),$(a)]}}],[Qi,class extends qo{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new Bo(t,ga)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=this.model,r=s.chart,n=r.getProjection(this._second),o=+s.options.rotation||0,a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"center"),c=this._getLabelPositioner(s.subLabel.options.position,"right"),d=this._labelViews(),_=s.getLabelOff(),u=s.getSubLabelOff(),g=s.getCallout(),m=this._calloutViews(),{min:f,max:b}=s.getPixelMinMax(p(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,p=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(p)))){const e=this._getPointPositioner(r.position||h,"center"),x=Xo.getDrawer(s.getShape());let v,C,S,L,A,M,P=(t._radius=s.getRadius(r.getValue(),f,b))*r.vrate()*i;g&&(v=r.getCallout(p))&&(C=v.map((t=>n.project(t))),y=C[C.length-1]),r.xPos=S=y[0],r.xPos=L=y[1],S*=a[0],L*=a[1],w=e(S,L,2*P,2*P),w.x+=P,w.y+=P;const k=()=>{t.setPath(x(P,P)),t.trans(w.x,w.y).rotate(o)},I=()=>{if(n instanceof rr){const e=n.r,i=this.chart().width,s=p[1]*Math.PI/180,r=P/2*(360/i),o=r/Math.cos(s),a=r;n.r=ir*this._scale;const h=Ao.geoCircle(p[0],p[1],o,a,n,!0);n.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else k()};if(this.model.alignToSurface?I():k(),d&&((A=d.get(r,0))&&this._layoutLabel(A,t.dom).transp(l(w.x,w.y,A.bbox(),P,P,_)),(A=d.get(r,1))&&this._layoutLabel(A,t.dom).transp(c(w.x,w.y,A.bbox(),P,P,u))),m&&C&&(M=m.get(r))&&M.setVisible(t._static)){const e=C.flat().map(((t,e)=>t*a[e%2]));m.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],P),M.render(g,r,e,t.getFill())}}}))}}],[gn,class extends Xo{constructor(t){super(t,"rm-image-series"),this._images=new Bo(this._pointContainer,Aa)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.options.imageWidth,s=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),i,s),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(this._second),s=+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(((e,u)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(d=i.getVisible(g)))){const u=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>i.project(t))),d=f[f.length-1]),p.xPos=b=d[0],p.yPos=y=d[1],b*=r[0],y*=r[1],e.render(t),v=e._rBox,_=u(b,y,v.width,v.height),e.trans(_.x,_.y).rotate(s),h&&(w=h.get(p,0))&&w.setVisible(e._static)&&w.layout().transp(o(_.x+v.width/2,_.y+v.height/2,w.bbox(),v.width/2,v.height/2,a)),c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*r[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}],[Nn,class extends Xo{constructor(t){super(t,"rm-panel-series"),this._panels=new Bo(this._pointContainer,Oa)}_doPrepeare(t,e,i){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,this._getGrowRate())}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){this.$_layoutPanels(this.doc,this.width,this.height,t)}_getPointPool(){return this._panels}$_preparePanels(t,e){const i=e.length;this._panels.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPanels(t,e,i,s){const r=this.model,n=r.chart.getProjection(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(((u,b)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const b=this._getPointPositioner(y.position||a,"top");let x,v,C,S,L,A;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),g=v[v.length-1]),y.xPos=C=g[0],y.yPos=S=g[1],C*=o[0],S*=o[1],u.render(t,r,e,i,p,s),m=u._rBox,f=b(C,S,m.width,m.height),u.trans(f.x,f.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(f.x+m.width/2,f.y+m.height/2,L.bbox(),m.width/2,m.height/2,c)),_&&v&&(A=_.get(y))&&A.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));m.x=u.tx,m.y=u.ty,_.setMask(A,t).setRects(m),A.render(d,y,t,u.getFill())}}}))}}],[Wn,Wa],[Jr,class extends sa{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new Bo(t,xa)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height,1)}_doReset(){}_runShowEffect(t){t&&aa.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.chart.getProjection(this._second),n=[this._scale,-this._scale],o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),h=this._labelViews(),l=s.getLabelOff(),c=s.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,C,S;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(s,t,e,i*f.vrate()),u=g._size,p=m(x,v,u,u),g.trans(p.x,p.y),h&&(C=h.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(a(p.x+u/2,p.y+u/2,C.bbox(),u/2,u/2,l)),d&&w&&(S=d.get(f))&&S.setVisible(f._isStatic())&&S.render(c,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[cn,class extends sa{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new Bo(t,Sa)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],n=i.options.position,o=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(d=s.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;l&&(y=f.getCallout(b))&&(w=y.map((t=>s.project(t))),d=w[w.length-1]),f.xPos=x=d[0],f.yPos=v=d[1],x*=r[0],v*=r[1],g.render(i,t,e),_=p(t,e),u=m(x,v,_,_),g.trans(u.x,u.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(o(u.x+_/2,u.y+_/2,C.bbox(),_/2,_/2,h)),c&&w&&(S=c.get(f))&&S.setVisible(f._isStatic())&&S.render(l,f,w.flat().map(((t,e)=>t*r[e%2])),null)}}))}}]),So.register([Lr,oa],[Cr,ra],[Sr,na],[vr,Ya]);class Ua extends ut{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 ut{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class Ka extends kt{constructor(t,e,i){super(t,""),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new Io(t,i)),this.add(this.tickLayer=new ko(t))}getSiblingOf(t){if(this.sibling)for(const e of this.sibling.seriesViews)if(e.model===t.model)return e}prepare(t,e){const i=e.visibleSeries,s=this.seriesMap,r=this.seriesViews,n=this._h1,o=this._h2;r.forEach((t=>{var e;i.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),this.control.loaded?t.removeLater(200):t.remove())})),r.length=0,i.forEach((e=>{const i=!s[e.hash],a=s[e.hash]||function(t,e){return new(Uo[e._type()])(t)}(t,e);a.parent||(this.add(a),this.labelsContainer.add(a._labelContainer)),s[e.hash]=a,r.push(a),a._second=this.second,a._h1=n,a._h2=o,i&&(e._optionsDirty=!0),a.prepare(t,e)})),this.prevViews&&ht.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 qa extends kt{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new kt(t)),this.add(this._labelLayer=new kt(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,i,s,r)}$_prepareGuides(t,e){const i=this._guideViews,s=e.length;for(;i.length>s;)i.pop().remove();for(;i.length<s;){const e=new To(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],s,r),n.layout(i)}))}}class Ja extends po{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new ni(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Ro(t)),this.add(this._contentLayer=new kt(t,"rm-body-content")),this.add(this._crosshairView=new Vo(t)),this._contentLayer.add(this._annotationContainer=new kt(t)),this._contentLayer.add(this._axisGuideContainer=new qa(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new qa(t,!1)),this._contentLayer.add(this._seriesContainer=new Ka(t,new kt(t),!1)),this._contentLayer.add(this._secondContainer=new Ka(t,new kt(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._seriesContainer.sibling=this._secondContainer,this._contentLayer.add(this._frontAxisGuideContainer=new qa(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new qa(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new kt(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]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),(this._seconded=0!=r)?(this._seriesContainer._h1=t+r,this._seriesContainer._h2=s,this._secondContainer._h1=t,this._secondContainer._h2=t+r):(this._seriesContainer._h1=t,this._seriesContainer._h2=s,this._secondContainer._h1=this._secondContainer._h2=NaN),this._h1=t+r,this._h2=s+r}this.$_prepareSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),co.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=s.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(s._style),o){const{wMap:t,hMap:e,scale:a,tx:c,ty:d}=s.prepareLayout(l,h);this.$_prepareLayoutSeries(i,r),this._transformInfo={tx:c,ty:d,scale:a,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const _=`translate(${c}px, ${d}px) scale(${a}, ${-a})`,u=t*a,p=e*a,g=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-u)/2-s.panX*a,e=(h-p)/2-s.panY*a;this._mapBack.render(this.doc,r,t,e,u,p)}this._secondContainer.visible&&g.push(this._secondContainer),g.forEach((t=>{const e=t.axisView,r=t.tickLayer;e.setScale(a),e.measure(i,n,l,h),e.resize(l,h),e.trans(c,d),r.setVisible(n.tick.visible)&&(r.prepare(i,n.tick,e.steps),r.resize(l,h),r.setScale(a),r.layout(s.projection),r.trans(c,d)),t.seriesViews.forEach((t=>{var e;t._scale=a,t.model.needMapScale()?(t._pointLayer.setStyle("transform",_),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:_})):t.trans(c,d),t.move(c,d),t.resize(u,p),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(c,d)})),e.layout()}));const m=s._prj,f={map:o,prj:m,tf:this._transformInfo,trans:_,latInterval:n.latInterval,lonInterval:n.lonInterval};this.$_doClipPathLayout(s,m,l,h,a),this._crosshairView.visible&&this._crosshairView.prepare(a,_),this.$_layoutAxisGuides(i,n,f,l,h)}if(this.$_layoutAnnotations(l,h),a&&a.parent&&a.width===l&&a.height===h||(a&&a.dom.remove(),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 Ua(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(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,i){function s(s){for(const o of s)o.pointerMoved(t,e,i)&&(r=o,n=o.getPointView(i));if(!n)for(const t of s)if(n=t.getPointView(i),n){r=t;break}return r&&n}if(!this.model)return;let r,n;!s(this._seriesContainer.seriesViews)&&this._secondContainer.visible&&s(this._secondContainer.seriesViews);const o=this.model.chart,a=null==r?void 0:r.model,h=a&&this._owner.getScaleView(o.getColorScale(a.getColorScale()));return(null==n?void 0:n.point)?(this._owner.showTooltip(a,n,this,{x:t,y:e}),null==h||h.setValue(n.point.getValue())):(this._owner.hideTooltip(),null==h||h.setValue(NaN)),this._crosshairView.visible&&o&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!r}seriesByDom(t){return this._seriesContainer.seriesViews.find((e=>e.dom.contains(t)))}showSeries(t){t.visible=!0,this._requestShow=t}hideSeries(t){var e;const i=this.getSeries(t);i&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new Xa(i)).start())}mouseToMap(t){const{tx:e,ty:i,scale:s,vx:r,vy:n}=this._transformInfo,o=(t.x-r-e)/s,a=(t.y-n-i)/-s;return this.pointToMap(o,a)}pointToMap(t,e){return this.model.chart.getProjection(!1).backward([t,e])}$_prepareSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(this._seconded)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.visible&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Za(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r);const n=this.model.chart,o={...i,prj:i.prj.second};this._secondFrontAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,o,s,r)),this._secondAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,o,s,r))}$_doClipPathLayout(t,e,i,s,r){const n=()=>{const i=e.getClipBounds(t.chart.axis.lonInterval,t.chart.axis.latInterval);return`M${i[0][0]},${i[0][1]} L`+i.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.parent&&t.width===i&&t.height===s){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 e=n();t&&t.dom.remove(),this._clipMap=this._contentLayer.clipPath(e),o(this._clipMap),this._clipMap.resize(i,s)}}else this._contentLayer.detachClipPath()}}class Qa extends go{constructor(t,e){super(t,e?Qa.SUBTITLE_CLASS:Qa.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Se(t)),this._richText=new Ee}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var th;Qa.TITLE_CLASS="rm-title",Qa.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(th||(th={}));class eh extends Pt{constructor(e){super(e,eh.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 Nt(e,"rm-tooltip-back")),this.add(this._top=new Nt(e,"rm-tooltip-top")),this.add(this._textView=new Se(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Mt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new Ee,this.close(!0,!1)}show(t,e,i,s,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.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,C=e.getBounds(),S=_.getBounds();let L;L=i-y/2-g(0,p(i-y/2,u-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=th.TOP;this.drawTooltip(0,0,y,w,A,L),s-=w+v,i=g(0,p(i-=y/2,u-y)),s=g(0,p(s,m-w)),this.transEx(i,s,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:xr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?H(e,i):{},a=H(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,i,s,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+i-a,e,"Q",t+i,e,t+i,e+a,"L",t+i,e+s-a,"Q",t+i,e+s,t+i-a,e+s,"L",t+a,e+s,"Q",t,e+s,t,e+s-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case th.TOP:l=l.concat(["M",t+i/2-o/2+n,e+s,"L",t+i/2+n,e+s+o,"L",t+i/2+o/2+n,e+s]);break;case th.BOTTOM:l=l.concat(["M",t+i/2-o/2+n,e,"L",t+i/2+n,e-o,"L",t+i/2+o/2+n,e]);break;case th.LEFT:l=l.concat(["M",t+i,e+s/2-o/2+n,"L",t+i+o,e+s/2+n,"L",t+i,e+s/2+o/2+n]);break;case th.RIGHT:l=l.concat(["M",t,e+s/2-o/2+n,"L",t-o,e+s/2+n,"L",t,e+s/2+o/2+n])}const c=r===th.BOTTOM,d=c?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(i-u.width)/2,e+=(s-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}eh.CLASS_NAME="rm-tooltip";class ih extends yo{constructor(t){super(t,ih.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new kt(t);this.add(e),e.add(this._boxLayer=new kt(t)),this._boxes=new wo(this._boxLayer,ni,"rm-color-scale-box"),e.add(this._splitLayer=new kt(t)),this._splits=new wo(this._splitLayer,$o,"rm-color-scale-split"),e.add(this._markerLabel=new uo(t,void 0)),e.add(this._marker=new Nt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new kt(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new kt(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new kt(t,"rm-color-scale-null")),this._tickLines=new wo(this._tickLineLayer,$o),this._tickLabels=new wo(this._tickLabelLayer,uo),this._fills=[]}setValue(t){var e,i;e=t,i=this._value,(isNaN(e)?isNaN(i):e===i)||(this._value=t,this.$_resetMarker(this._wBar,this._hBar,this._vertical,this._reversed,this._inverted))}_doMeasure(t,e,i,s){let r=this.chart().isDirty;const n=e.marker,o=e.tick,a=this._tickLen=+o.line.options.length||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.options.reversed,_=this._inverted=e.options.inverted,u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(n,c,d,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==o.options.minVisible),e>1){t.last.setVisible(!1!==o.options.maxVisible);for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==o.options.minVisible),i>1){e.last.setVisible(!1!==o.options.maxVisible);for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-n.x,g-n.y)}$_getFillId(t){return`${ih.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,i){const s=t.createElementNS(e,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(t.createElementNS(e,"stop")),s.appendChild(t.createElementNS(e,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Lt.setAttrs(t,i?ih.VERT_FILL_I:ih.VERT_FILL):Lt.setAttrs(t,i?ih.HORZ_FILL_I:ih.HORZ_FILL)}$_fillStops(t,e,i){const s=t.childNodes[0],r=t.childNodes[1];s.setAttribute("offset","0"),s.setAttribute("stop-color",e.toString()),s.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",i.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,i,s){this._fills.forEach((t=>this.control.removeDef(t)));const r=this._fills=[],n=e.getSteps();if(n){let e=0;n.forEach(((i,s)=>{i._color1&&(r.push(this.$_createGradient(t,e)),r[r.length-1][hi]=i,e++)})),r.forEach((t=>{const e=t[hi];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(e,((t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))}))}else if(this._boxes.prepare(1),e.minColor){const n=this.$_createGradient(t,0);r.push(n),this.$_setDir(n,i,s),this.$_fillStops(n,e.minColor,e.maxColor),this._boxes.first.setStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new ni(t,"rm-color-scale-box")),e.add(this._nullLabel=new uo(t,"rm-color-scale-tick-label")))}$_layoutSplits(t,e){this._splits.forEach((i=>{this._vertical?i.setHLine(i._userData,0,t):i.setVLine(i._userData,0,e)}))}$_layoutTickLines(t){this._tickLines.forEach((e=>{this._vertical?e.setHLine(e._userData,0,t):e.setVLine(e._userData,0,t)}))}$_resetMarker(t,e,i,s,r){const n=this._markerSize,o=isNaN(this._value),a=this.model.getPosition(this._value);let h,l;a>1&&console.log(this.model.getPosition(this._value)),this._marker.setBoolData("null",o),i?(h=s?t-n+1:n-1,l=(o?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(o?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-n+1:n),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,n=this._inverted,o=this._tickLabelLayer,a=this._tickLabelSize,h=this._markerSize,l=this._tickLen,c=this._stepCount,d=t?t.getGap():0,_=((s?i:e)-d)/(c+(t?1:0)),u=this._nullSize=t?_+d:0;let p=e,g=i,m=0,f=0,b=0,y=0;if(s?(m+=r?a:h,p-=h,y=n?f+u:f,a>0&&(r?o.trans(0,y):o.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(n?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=n?m:m+u,a>0&&(r?o.trans(b,0):o.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((n?i-1-e:e)*_-t.bbox().width/2,0)})),g-=a),g-=l,r&&(f+=l),y=f),this._boxLayer.setBounds(b,y,p,g),1===this._boxes.count?s?this._boxes.get(0).setBounds(0,0,p,g-u):this._boxes.get(0).setBounds(0,0,p-u,g):this._boxes.forEach(((t,e,i)=>{s?t.setBounds(0,(n?e:i-1-e)*_,p,_):t.setBounds((n?i-1-e:e)*_,0,_,g)})),this._splitLayer.visible&&(this._splitLayer.trans(b,y),this.$_layoutSplits(p,g)),this._tickLineLayer.visible&&(s?(r?m-=l:m+=p,this._tickLineLayer.trans(m,y)):(r?f-=l:f+=g,this._tickLineLayer.trans(b,f)),this.$_layoutTickLines(l)),t){let e=_,i=_,r=m,a=f;s?(m=this._boxLayer.tx,r=o.tx,e=p,f=n?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=o.ty,i=g,n&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.options.color&&this._nullBar.setFill(t.options.color),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,n)}}ih.SCALE_CLASS="rm-color-scale",ih.SCALE_FILL="rm-color-scale-fill",ih.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},ih.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},ih.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},ih.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class sh extends Pt{constructor(t,e,i){super(t,sh.STYLE),this.add(this._back=new ni(t,sh.BACK_STYLE)),this.add(this._textView=new Se(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,i){this.internalSetStyleOrClass(i),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),r=getComputedStyle(this._back.dom),n=(new ft).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(n.left+s.width/2,n.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+n.left+n.right,height:s.height+n.top+n.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}sh.STYLE="rm-button",sh.BACK_STYLE="rm-button-background";class rh extends sh{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class nh extends po{}class oh extends nh{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new rh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new rh(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new rh(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,i,s){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(ci,r<=100),this._btnDec.setBoolData(ci,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 ah extends nh{constructor(t){super(t,"rm-drilldown-panel")}getButton(t){return this._btnBack&&this._btnBack.containsDom(t)&&this._btnBack}click(t){const e=this._textViews;if(e)for(let i=0;i<e.count-1;i++)if(e.get(i).containsDom(t))return this.model.chart.drillup(e.get(i+1)[li]),!0}_doMeasure(e,i,s,r){let n=this._btnBack,o=0,a=0;if("text"===i.options.type){null==n||n.remove(),this._textViews||(this._textViews=new wo(this,Se,"rm-drilldown-text"),this._seperators=new wo(this,Se,"rm-drilldown-separator"));const e=i.chart.firstVisible,s=this._history=e.getHistory();this._textViews.prepare(s.length,((e,i)=>{e.text=s[i].displayName(),e.anchor=t.TextAnchor.START,e[li]=s[i]})),this._seperators.prepare(s.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),n||this.add(n=this._btnBack=new rh(e,"<",(()=>{i.chart.drillup()}))),n.layout();const t=n.bbox();o=t.width,a=t.height}return{width:o,height:a}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class hh extends yo{constructor(t){super(t,hh.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new kt(t);this.add(e),e.add(this._bubbleLayer=new kt(t)),e.add(this._lineLayer=new kt(t)),e.add(this._labelLayer=new kt(t))}_doMeasure(t,e,i,s){const r=e.chart,n=this._steps=e.getSteps(r.width,r.height),o=n.map((t=>t.rd)).reduce(((t,e)=>Math.max(t,e)));let a=0,h=0;return this._checkTitle(t)&&(this._inTitle?a+=this._rTitle.width:h+=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?a+=this._rFooter.width+this._gapFooter:h+=this._rFooter.height+this._gapFooter),this.$_prepareBubbles(t,e,n),this.$_layoutBubbles(2*o,n),this._rScale=this._scaleLayer.bbox(),a+=this._rScale.width,h+=this._rScale.height,{width:a,height:h}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-n.x,g-n.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;Pt.fit(t,this._bubbleLayer,this._bubbles,r,va,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Pt.fit(t,this._lineLayer,this._lines,r,$o,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Pt.fit(t,this._labelLayer,this._labels,r,uo,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const n=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-n.rd,n.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.options.length||0);this._lines.forEach(((i,n)=>{const o=e[n];i.setHLine(t-2*o.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.options.length+(i.tick.label.options.offset||0);this._labels.forEach(((s,n)=>{const o=e[n];s.setText(i.tick.label.getText(o.label)),s.trans(r,t-2*o.rd-s.bbox().height/2)}))}}}hh.SCALE_CLASS="rm-bubble-scale";class lh extends yo{constructor(t){super(t,lh.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}lh.SCALE_CLASS="rm-map-scale";class ch extends mo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Qa(t,!1)),this.add(this.subtitleView=new Qa(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=i,u=0,p=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,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,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.options,o=r&&r.options,a=s&&s.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||s&&"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,i)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},d=()=>{const e=g(this._hTitle,this._hSub);m=g(m,m+t(s,e,this._hTitle)),y=g(y,y+t(r,e,this._hSub))},_=(t,e,i)=>{switch(t.options.align){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},u=()=>{if(f=g(f,f+_(s,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),i.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?s:r,n=a?e:i,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,i){}}class dh extends yo{constructor(t){super(t,dh.GROUP_CLASS,"rm-map-widget-group-background"),this.add(this._widgetLayer=new kt(t,"rm-map-widget-group-widget-layer"))}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),n=this._gap=8,o=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new co;return this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),o.forEach(((r,n)=>r.measure(t,e.getWidget(n),i,s))),r?(o.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),o.length>1&&(a.height+=(o.length-1)*n)):(o.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),o.length>1&&(a.width+=(o.length-1)*n)),this._titleView.visible&&(this._inTitle?a.width+=this._rTitle.width:a.height+=this._rTitle.height),this._footerView.visible&&(this._inFooter?a.width+=this._rFooter.width+this._gapFooter:a.height+=this._rFooter.height+this._gapFooter),a}_doLayout(t){const e=this.model,i=this._titleView,s=this._footerView,r=this._margins,n=this._paddings,o=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+n.left,d=r.top+n.top;let _,u,p=this.width-c-r.right-n.right,g=this.height-d-r.bottom-n.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.options.align){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.options.align){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.options.align){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+o})):a.forEach((t=>{switch(t.model.options.verticalAlign){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+o}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return e.forEach((e=>{let n=null==s?void 0:s.find((t=>t.model===e));n?(r.push(n),s.splice(s.indexOf(n),1)):(n=new(_h[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}dh.GROUP_CLASS="rm-map-widget-group";const _h={legend:vo,colorScale:ih,bubbleScale:hh,group:dh};class uh extends mo{constructor(t,e){super(t),this._loc=e,this._horz=e==tt.TOP||e==tt.BOTTOM,this._vert=e==tt.LEFT||e==tt.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){return this._views.get(t)}_setWidgets(t,e,i){return r(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof vo&&e.legendByDom(t);if(i)return i}}_doMeasure(t,e,i,s){const r=this._prepareViews(t,i,s);if(!this.setVisible(r.size>0))return;const n=this._gap=b(+e.chartOptions.options.widgetGap,0),o=new co;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=g(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=g(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=s.options,n=i.mw,o=i.mh;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).resize(n,o),i.layout()}))}_prepareViews(t,e,i){const s=this._views,r=new Map;this._starts=[],this._ends=[],this._centers=[],this._models.forEach((e=>{let i=s.get(e);i?(r.set(e,i),s.delete(e)):(i=new(_h[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.options.align){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.options.verticalAlign){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class ph extends po{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Se(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.offsetX||0,n=+t.offsetY||0;let o=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+n;break;default:a=e.y+n}switch(t.align){case"right":o=e.right-i-r;break;case"center":o=e.x+(e.width-i)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,i){const s=t.location,r=this.width,n=this.height,o=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(s){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=i-n-a}if("left"===s||"right"===s)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-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,i,s){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class gh extends kt{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new kt(t,"rm-annotations")),this.add(this._bodyView=new Ja(t,this)),this.add(this._titleSectionView=new ch(t)),this.add(this._widgetLayer=new kt(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new kt(t,"rm-front-annotations")),this.add(this._zoomPanelView=new oh(t)),this.add(this._drilldownPanelView=new ah(t)),this.add(this._mapScaleView=new lh(t)),this.add(this._creditView=new ph(t)),this.add(this._tooltipView=new eh(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}getWidgetViews(t,e){return this._widgetMap[t],[]}measure(t,e,i,s){const r=(this._model=e)._credits,n=this._bodyView;let o,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(o=this._creditView.measure(t,r,a,h),e.location){case"body":break;case"right":case"left":a-=o.width+(+e.offsetX||0)+(+e.gap||0);break;default:h-=o.height+(+e.offsetY||0)+(+e.gap||0)}}o=this._titleSectionView.measure(t,e,a,h),h-=o.height,n.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(tt)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new uh(t,r),this._widgetLayer.add(o),this._widgetMap[r]=o);const l=o._setWidgets(n,i,s).measure(t,e,a,h);if(l){const t=e.chartOptions.getWidgetSectionGap(r);r===tt.BOTTOM||r===tt.TOP?h-=l.height+t:r!==tt.RIGHT&&r!==tt.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const n=this._bodyView;let o=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){const t=a.options;h.resizeByMeasured();const e=h.width+(+t.offsetX||0)+(+t.gap||0),i=h.height+(+t.offsetY||0)+(+t.gap||0);switch(a.options.location){case"body":break;case"right":s-=e;break;case"left":s-=e,c+=e;break;case"top":r-=i,d+=i;break;default:r-=l=i}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=o=_.height);const u=this._widgetMap;for(const n in u){const o=u[n];if(o.visible){n===tt.RIGHT||n===tt.LEFT?(o.resize(o.mw,i),o.layout()):n===tt.TOP||n===tt.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.chartOptions.getWidgetSectionGap(n);switch(n){case tt.BOTTOM:r-=o.height+a;break;case tt.TOP:r-=o.height+a,d+=o.height+a;break;case tt.RIGHT:s-=o.width+a;break;case tt.LEFT:s-=o.width+a,c+=o.width+a}}}const p=dt.create(c,d,s,r);if(h.visible){const t=a.options,s="body"===t.location?h.locateInner(t,p):h.locateOuter(t,e,i);h.transp(s)}n.trans(p.x,p.y),n.resize(p.width,p.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case tt.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case tt.TOP:d=o+0,c=(e-s.width)/2;break;case tt.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case tt.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?s.x:r)-this.tx,h=(o?s.y:n)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r);let o;i instanceof Va&&(o=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),o||(o=this._model.map.findByCoord(n)),r.coord=n,r.area=null==o?void 0:o.id,r.chart=this._model.wrapper,this._model.click(r)}}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}isAnimating(){}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>{r.get(t.model)||t.remove()})),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Za(t,e);(!1===e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,n,o,a;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)r=-s.left,n=-s.top,o=t+s.left+s.right,a=e+s.top+s.bottom;else r=n=0,o=t,a=e;i._layoutView(this,r,n,o,a)}))}$_layoutPanel(t,e){const i=t.model.options,s=i.offsetX||0,r=i.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.align){case"right":a+=e.width-s-n;break;case"center":a+=(e.width-n)/2+s;break;default:a+=s}t.trans(a,h)}}var mh;!function(t){t.EXPORT="$$realmap_export"}(mh||(mh={}));class fh extends Mt{constructor(t,e){super(t,e),this.addElement(this._chartView=new gh(t)),this.addElement(this._loadingView=new ro(t)),this.addElement(this._errorView=new Se(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new io(null,((t,e)=>{this.changeModel(t,e)}))}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this._export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i})}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===mh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}showLoadingView(){this._loadingView.visible=!0}hideLoadingView(){this._loadingView.visible=!1}showErrorView(e="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=t.TextLayout.MIDDLE,this._errorView.text=e,this._errorView.stain();const{width:i,height:s}=this._errorView.bbox(),r=16+i/2,n=16+s/2;this._errorView.trans(r,n)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new lo(this)}_doBeforeRender(t){var e,i;(null===(i=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===i?void 0:i.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const i=this.model,s=this._chartView,r=t.width,n=t.height;if(this.$_renderLoadingView(r,n),i.options.chart&&(this._setBackgroundStyle(i.options.chart.backgroundStyle),i&&(this.setDomResize(i.chartOptions.options.domResize),i.prepareRender(),this._loadModules()),this.loaded||s.clean(),s.measure(this.doc(),i,r,n),s.setRect(t),s.layout(),i&&i.afterRender(),null===(e=this._chart)||void 0===e?void 0:e._loadCallback)){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_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 i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e.options.exporting)}}$_renderLoadingView(t,e){const i=fh.LOADING_VIEW_LENGTH;this._loadingView.layout({width:i,height:i});const s=t/2+20-i/2,r=e/2+20-i/2;this._loadingView.trans(s,r)}}fh.LOADING_VIEW_LENGTH=128;const bh={chartControl:fh};class yh{static getVersion(){return"1.0.11"}static setLicenseKey(t){wt.code=t}static setDebugging(t){Pt.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static getDistance(t,e){return ht.getDistance(t,e)}static setGlobals(t){Object.assign(bh,t)}static createChart(t,e,i,r=!0,n){S.loadConfigAsync(i,!0);const o=new bh.chartControl(t,e);return s(i)&&o.chart.load(i,r,n),o.chart[eo]=o,o.chart}static async createChartAsync(t,e,i,r=!0,n){const o=new bh.chartControl(t,e);o.chart[eo]=o;try{o.showLoadingView(),await S.loadConfigAsync(i),s(i)&&o.chart.load(i,r,n)}catch(t){console.error(t),o.showErrorView(null==t?void 0:t.message)}finally{o.hideLoadingView()}return o.chart}static preset(t,e){return tr.createStockInset(t,e)}}class wh{constructor(){this._moduleMap=new Map}static getInstance(){return wh.instance||(wh.instance=new wh),wh.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}wh.instance=null,wh.ModuleNames={realchart:"realchart"};const xh=yh.getVersion,vh=yh.setDebugging,Ch=yh.setLogging,Sh=yh.setGlobals,Lh=yh.getDistance,Ah=yh.createChart,Mh=yh.createChartAsync,Ph=yh.preset,kh=yh.setLicenseKey;t.Annotation=ii,t.AnnotationView=So,t.BandSeriesType="band",t.BarSeries=jr,t.Body=qn,t.BodyView=Ja,t.BubbleSeries=Qi,t.ChartAnnotationType="chart",t.ChartControl=fh,t.ChartElement=po,t.ChartItem=$e,t.ChartObject=to,t.ChartView=gh,t.CircleElement=va,t.CircleGauge=Jr,t.ClockGauge=cn,t.Color=we,t.ColorRanger=hs,t.Credits=Xe,t.DataPoint=vi,t.DataPointLabel=Li,t.Dom=Lt,t.DragTracker=oo,t.ElementPool=wo,t.Exporter=ws,t.ExternalModuleManager=wh,t.FeatureSeriesType="feature",t.FigureSeries=_n,t.HeatmapSeriesType="heatmap",t.HtmlAnnotation=vr,t.ImageAnnotation=Cr,t.ImageSeries=gn,t.LayerElement=kt,t.Legend=os,t.LineElement=$o,t.LineSeries=yn,t.MapArea=cr,t.MapAxis=Vs,t.MapAxisBandGuide=Is,t.MapAxisGuide=Ps,t.MapAxisLineGuide=ks,t.MapAxisRangeGuide=Ns,t.MapChart=io,t.MapCrosshair=Es,t.MapSeries=Ln,t.MapSeriesType="map",t.MapTool=lo,t.MarkerSeries=ji,t.MarkerSeriesPoint=zi,t.MarkerSeriesPointView=Ko,t.MarkerSeriesView=qo,t.ORG_ANGLE=N,t.OrthogonalSparkSeries=Zi,t.PI_2=I,t.PanelSeries=Nn,t.PathElement=Nt,t.PieSeries=Vn,t.PinSeries=$n,t.PointElement=Yo,t.PointLabelView=zo,t.PointSeries=Bn,t.PointViewPool=Bo,t.PolyLineElement=Oo,t.RAD_DEG=E,t.RectElement=ni,t.RmElement=Pt,t.RouteSeries=Gn,t.RouteSeriesType=ri,t.SankeySeriesType="sankey",t.SectionView=mo,t.SectorElement=ma,t.Series=$i,t.SeriesAnimation=aa,t.SeriesView=Xo,t.ShapeAnnotation=Sr,t.Size=co,t.SparkSeries=Wi,t.Subtitle=wr,t.TableSeriesType="table",t.TextAnnotation=Lr,t.TextElement=Se,t.TiledWebSeriesType="tiledweb",t.Title=yr,t.TrackSeriesType="track",t.Utils=ht,t.ValuePoint=Fi,t.ValueSeries=Bi,t.VectorSeriesType="vector",t.WaffleSeries=Wn,t._isIE=at,t.absv=m,t.assignObj=l,t.calcPercent=Y,t.copyObj=f,t.cos=_,t.createChart=Ah,t.createChartAsync=Mh,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=De,t.fixnum=D,t.getDistance=Lh,t.getVersion=xh,t.incv=v,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=s,t.isString=o,t.maxv=g,t.minv=p,t.parsePercentSize=W,t.pickNum=b,t.pickProp=w,t.pickProp3=x,t.pixel=O,t.preset=Ph,t.rectToSize=ct,t.setDebugging=vh,t.setGlobals=Sh,t.setLicenseKey=kh,t.setLogging=Ch,t.sin=u}));
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",i=Object.prototype.hasOwnProperty,s=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,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},w=function(t,e){return void 0!==t?t:e},x=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},v=(t,e,i)=>t+(e-t)*i;class C{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}C._debugging=!1;class S{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(o(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)o(t.map[e])&&(t.map[e]={url:t.map[e]});const i=r(t.map)?t.map:[t.map];for(const t of i)!s(t.source)&&o(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const i=r(t.series)?t.series:[t.series];for(const t of i)!s(t.data)&&!r(t.data)&&o(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=await this.fetchJson(t.dataUrl),delete t.dataUrl))}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const 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 A=L.ko;const M=void 0,P="%".charCodeAt(0),k=Math.PI,I=2*k,N=-k/2,T=k/180,E=180/k;function V(t){return t>I?t%I:t}function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function B(t){return t+"%"}function F(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const i={};return i[t]=e,i}function W(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===P&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;K(A.invalidSizeValue,t)}}return{size:s,fixed:i}}function Y(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}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 K=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},q="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),i=b(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const it="undefined"!=typeof navigator?navigator.userAgent:"",st=it?navigator.appVersion:"",rt=!!it.match(/Trident.*rv\:11\./),nt=-1!==st.indexOf("MSIE 10"),ot=-1!==st.indexOf("MSIE 9"),at=rt||nt||ot;class ht{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&ht.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(i,ht.month_days[ht.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!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 i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}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 i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-et}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=g(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=g(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let i of Object.keys(t))e[i]=ht.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const i=+new Date;e(),ht.log(t,+new Date-i+"ms")}static clamp(t,e,i){return g(e,p(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=g(e,t)),isNaN(i)||(t=p(i,t)),t}static makeIntArray(t,e){const i=new Array(g(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,i){const s=m(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*T,s=(e[1]-t[1])*T,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*T)*Math.cos(e[0]*T)*Math.sin(s/2)*Math.sin(s/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],i=t[0];for(let s=1;s<t.length;s++)e=p(e,t[s]),i=g(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||r(t))){const i=e.split(".");let s=t;for(let t of i)s=s[t];return s}return t}static normalizeToSteps(t,e){if(t.length<2)return t;const i=Math.min(...t),s=Math.max(...t);if(i===s)return[i];const r=(s-i)/(e-1),n=10**Math.floor(Math.log10(r)),o=r/n;let a;a=o<=1?1:o<=2?2:o<=5?5:10,a*=n;const h=Math.floor(i/a)*a,l=[];a=(Math.ceil(s/a)*a-h)/(e-1);for(let t=0;t<e;t++)l.push(h+t*a);return l}}ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];const lt=Object.freeze({x:0,y:0,width:0,height:0});function ct(t){return{width:t.width,height:t.height}}class dt{static create(t,e,i,s){const r=arguments.length;return ht.isObject(t)?new dt(t.x,t.y,t.width,t.height):r<2?new dt(t,t,t,t):r<3?new dt(t,e,t,e):new dt(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}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 dt(this.x,this.y,this.width,this.height)}getInner(){return new dt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}dt.Empty=new dt,dt.Temp=new dt;const _t={inOutSine:t=>-(_(k*t)-1)/2};class ut{constructor(){this.delay=0,this.duration=ut.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=p(1,g(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return isNaN(t)||(this.duration=t),this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,i=null){this._started&&this._stop(),this.duration=b(t,ut.DURATION),this.delay=e||0,this._easing=_t[i],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}ut.DURATION=700,ut.SHORT_DURATION=300;let pt=0;class gt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(pt++))}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 mt extends gt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}class ft{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new ft(t,t,t,t):new ft(t,t,e,e):new ft(t,e,i,s)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new ft(this.top,this.bottom,this.left,this.right)}set(...t){for(const e of t)if(isNaN(e))return;const e=t.length;1===e?this.top=this.bottom=this.left=this.right=t[0]:2===e?(this.top=this.bottom=t[0],this.left=this.right=t[1]):3===e?(this.top=t[0],this.bottom=t[1],this.left=this.right=t[2]):e>3&&(this.top=t[0],this.right=t[1],this.bottom=t[2],this.left=t[3])}applyPadding(t){return this.left=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+"}"}}var bt;ft.Empty=Object.freeze(new ft),ft.Temp=new ft,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(bt||(bt={}));const yt={name:"RealMap",version:"1.0.12",license:"enterprise",code:""},wt={name:"RealMap",version:"1.0.12",license:"enterprise",code:null};class xt{static decode(t){const e=xt.CHARS,i=xt.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}xt.PAD="=",xt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class vt{static union(t,e){const i=e.s3[255&t];t>>=8;const s=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=vt.xor,s=vt.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=vt.xor,s=vt.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=vt.kb,s=vt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map((function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*vt.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=vt._decryptBlock;let s=vt._init(e),r=[],n=xt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*vt.POW24|n[a+1]*vt.POW16|n[a+2]*vt.POW8|n[a+3],h.right=n[a+4]*vt.POW24|n[a+5]*vt.POW16|n[a+6]*vt.POW8|n[a+7],i(h,s);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),a+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}vt.POW2=Math.pow(2,2),vt.POW3=Math.pow(2,3),vt.POW4=Math.pow(2,4),vt.POW8=Math.pow(2,8),vt.POW16=Math.pow(2,16),vt.POW24=Math.pow(2,24),vt.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 Ct{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==t)}static _getLDKey(t){let e="";for(let i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}const n=r.split(".").length,o=r.indexOf("*");if(n>=2&&n<=4&&o>=2){const t=r.substring(0,o);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=vt.decrypt(t,"dkdl"+this._getLDKey(vt.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}let St=651212;class Lt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=i.pageYOffset||n.scrollTop||r.scrollTop,a=i.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+o-h;return{x:Math.round(c),y:Math.round(d)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,i){t.style.left=e+"px",t.style.top=i+"px"}static moveI(t,e,i){t.style.left=(e>>>0)+"px",t.style.top=(i>>>0)+"px"}static resize(t,e,i){t.style.width=e+"px",t.style.height=i+"px"}static resizeSVG(t,e,i){t.setAttribute("viewBox",`0 0 ${e} ${i}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,i=e.defaultView;return{width:i.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:i.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const i=t.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}static setBounds(t,e,i,s,r){const n=t.style;n.left=e+"px",n.top=i+"px",n.width=s+"px",n.height=r+"px"}static setBoundsEx(t,e,i,s,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(i)&&(n.top=i+"px"),!isNaN(e)&&(n.width=s+"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 i=e.children;for(let e=i.length;e--;)if(i[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;)Lt.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 i in e)t[i]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,i){if(e!=i){if(i)for(const e in i)t[e]="";return e&&Object.assign(t,e),e}return i}static createElement(t,e,i){const s=t.createElement(e);return i&&Object.assign(s.style,i),s}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,i){null==i||""===i?delete t.dataset[e]:t.dataset[e]=i}static toggleData(t,e,i){i?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,i){t.style.setProperty(e,i)}static animate(t,e,i,s,r=150,n="none"){const o={},a={};return o[e]=i,a[e]=s,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+St++}static createBR(t,e){const i=t.createElement("br");return i.className=e,i}static createSpan(t,e){const i=t.createElement("span");return e&&Object.assign(i.style,e),i}static createCheckBox(t,e){const i=t.createElement("input");return i.type="checkbox",e&&Object.assign(i.style,e),i}static createRadio(t,e){const i=t.createElement("input");return i.type="radio",e&&Object.assign(i.style,e),i}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){C.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!at&&t.setAttribute("vector-effect","non-scaling-stroke")}}const At={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Mt extends gt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this._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=wt.code||realMapLic,!e)return!1}catch(t){return!1}const i=Ct.decrypt(e);if("RealMap"!=i.name||"RealMap"!==yt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(yt.license!=bt.Developer&&!Ct.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(bt).includes(n))return!1;if(yt.code=i.code,yt.license=i.lic,n==bt.Evaluation||n==bt.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||Mt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(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),Lt.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(){Lt.clearChildren(this._defs)}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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new Rt(this.doc(),t,e,i,s,r,r))}clip(t){return this._defs.appendChild(t.dom),t}pointerToPoint(t){const e=this._dom.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_setTesting(){this._testing=!0,Pt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_registerEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),this.$_addListener(t,"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){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("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,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=t.getElementById(i),this._container instanceof HTMLDivElement||K(A.invalidOuterDiv,i);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=s,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 It(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,i){let s=t.createElementNS(e,"filter");const r=t.createElementNS(e,"feDropShadow");s.setAttribute("id",Mt.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"),s.appendChild(r),i.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._padding=Lt.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:s,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(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()}ht.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){}_domResized(){this.invalidateLayout()}}Mt.CLASS_NAME="rm-control",Mt.SHADOW_FILTER="rm-shadow-filter",Mt._animatable=!0;class Pt extends gt{static createElement(t,i){return t.createElementNS(e,i)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,n){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,n);e.add(s),i.push(s)}}constructor(t,i,s=M){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,s||"g"),(this._styleName=i)&&this.setAttr("class",i),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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}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,i){const s=t.createElementNS(e,i);return this._dom.appendChild(s),s}insertElement(t,i,s){const r=t.createElementNS(e,i);return this._dom.insertBefore(r,s),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}setAttrEx(t,e){return z(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return dt.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=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==M&&(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 i in this._styles)t.removeProperty(U(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const i=this.dom.style;for(let s of t)s in this._styles&&(i.removeProperty(U(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(o(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let i in t)e.setProperty(U(i),this._styles[i]=t[i],"important")}}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this._dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}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 i=!1;if(t){for(let s in t)if(s in At&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(b(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in At){const i=At[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}setStyle(t,e){let i=!1;return t in At||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let i=!1;return t in At&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}putStyles(t,e){if(e=e||{},t)for(let i in t)e[i]=t[i];return e}putStyle(t,e,i){return(i=i||{})[t]=e,i}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=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 i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,r);return this.$_setClip(n),n}clipPath(t){const e=this.control.clip(new $t(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 Pt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(ht.isValidNum(e)||ht.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),ht.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")");const r=ht.getNum(this._scaleX,1),n=ht.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}Pt.TESTING=!1,Pt.DEBUGGING=!1,Pt.ASSET_KEY="_asset_",Pt.TEMP_KEY="_temp_";class kt extends Pt{constructor(t,e=void 0){super(t,e,"g")}}class It extends Pt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Nt extends Pt{constructor(t,e=void 0){super(t,e,"use")}get id(){return this._id}setId(t){return t!==this._id&&this.dom.setAttribute("href",this._id=t),this}}class Tt extends Pt{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}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 Et extends Pt{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}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 Vt extends Pt{constructor(t){super(t,M,"mask");const e=this._id=ht.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Dt extends Pt{constructor(t){super(t,M,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Rt extends Dt{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Pt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.move(t,e),this._rect.resize(i,s),this}resize(t,e,i){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class $t extends Dt{constructor(t,e){super(t),this._path=new Tt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var Ot;!function(t){t.SIDO="sido"}(Ot||(Ot={}));const Bt="shuffle",Ft="random";var zt;class jt{constructor(t){this.source=t}hasDef(){return!0}}class Gt extends jt{getElement(t,e){throw new Error("Method not implemented.")}}Gt.TYPE="shape";class Ht extends jt{getElement(t,e){throw new Error("Method not implemented.")}}Ht.TYPE="image";class Wt extends jt{_setStops(t,i){const s=t.createElementNS(e,"stop"),n=t.createElementNS(e,"stop"),o=this.source.color,a=F(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;i.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",h),s.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(s),i.appendChild(n)}}class Yt extends Wt{getElement(t,i){const s=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,s),i.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",o),s.setAttribute("x2",n),s.setAttribute("y2",a),s}}Yt.TYPE="lineargradient";class Zt extends Wt{getElement(t,i){const s=t.createElementNS(e,"radialGradient");return F(i.cx)||s.setAttribute("cx",i.cx),F(i.cy)||s.setAttribute("cy",i.cy),F(i.r)||s.setAttribute("r",i.r),this._setStops(t,s),s}}Zt.TYPE="radialgradient";class Ut extends jt{getElement(t,i){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rm-pattern"),+i.pattern>=0){const t=zt.STOCK[+i.pattern%zt.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else o(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)),n.setAttribute("d",a),h&&l(n.style,h),i.style&&l(n.style,i.style),_&&(n.style.fill="none");let u=i.backgroundStyle;if(o(u)||s(u)){const i=t.createElementNS(e,"rect");r.append(i),i.style.fill=o(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return i.transform&&r.setAttribute("patternTransform",i.transform),r.append(n),r}}zt=Ut,Ut.TYPE="pattern",Ut.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}],Ut.SELECT=Object.assign(zt.STOCK[4],{id:"rm-selected-area-fill",pattern:zt.STOCK[4].path,transform:"scale(0.5)"});class Xt extends jt{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===Ft?this._index=-1:(t.mode===Bt&&ht.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:[]}}Xt.TYPE="colors";class Kt extends jt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Kt.SIZE,height:e.height||e.width||Kt.SIZE})}}Kt.TYPE="images",Kt.SIZE=20;class qt{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(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 Ut(Ut.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(Pt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(Pt.ASSET_KEY,"1"),e.addDef(s)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ut.TYPE:r(t.colors)?e=Xt.TYPE:r(t.images)?e=Kt.TYPE:null!=t.url?e=Ht.TYPE:null!=t.path&&(e=Gt.TYPE)),e)switch(e.toLowerCase()){case Gt.TYPE:return new Gt(t);case Ht.TYPE:return new Ht(t);case Yt.TYPE:return new Yt(t);case Zt.TYPE:return new Zt(t);case Ut.TYPE:return new Ut(t);case Xt.TYPE:return new Xt(t);case Kt.TYPE:return new Kt(t)}}}}const Jt="0".charCodeAt(0),Qt="#".charCodeAt(0),te=",".charCodeAt(0),ee="s".charCodeAt(0),ie="a".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(se.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===Jt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Qt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Jt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===te){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===ee){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===ie){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}se.DEFAULT_FORMAT="",se.Formatters={};const re=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ne=[".","/","-",":"],oe="Z".charCodeAt(0),ae="z".charCodeAt(0),he="A".charCodeAt(0),le="a".charCodeAt(0),ce="y".charCodeAt(0),de="M".charCodeAt(0),_e="m".charCodeAt(0),ue="W".charCodeAt(0),pe="w".charCodeAt(0),ge="d".charCodeAt(0),me="H".charCodeAt(0),fe="h".charCodeAt(0),be="S".charCodeAt(0),ye="s".charCodeAt(0);class we{static getFormatter(t){let e=we.Formatters[t];return e||(we.Formatters[t]=e=new we(t)),e}static get Default(){return we.getFormatter(A.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||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case ce:s+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case de:s+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case ge:s+=a>1?j(t.getDate()):t.getDate();break;case ue:s+=a>1?j(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case pe:s+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case me:s+=a>1?j(t.getHours()):t.getHours();break;case fe:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?j(e):e}else s+=a>1?j(t.getHours()):t.getHours();break;case _e:s+=a>1?j(t.getMinutes()):t.getMinutes();break;case ye:s+=a>1?j(t.getSeconds()):t.getSeconds();break;case le:case he:t.getHours()<12?s+=A.am:s+=A.pm;break;case be:let i=t.getMilliseconds();s+=3==a?G(i):2==a?j(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(ne.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),re.indexOf(n)<0){let e=n.charCodeAt(0);(e>=he&&e<=oe||e>=le&&e<=ae)&&K(A.invalidDateFormat,t)}e.push(n)}if(r<s&&ht.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&ht.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}we.Formatters={};const xe=["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"],ve=["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 Ce{static create(t){return o(t)?new Ce(t):void 0}static isBright(t){return new Ce(t).isBright()}static getContrast(t,e,i){return new Ce(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Ce(null);return s.r=Math.ceil(t.r+(e.r-t.r)*i),s.g=Math.ceil(t.g+(e.g-t.g)*i),s.b=Math.ceil(t.b+(e.b-t.b)*i),s.a=t.a+(e.a-t.a)*i,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(ht.startsWith(t,"rgba(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(ht.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Ce.COLORS[t]&&this.$_parseNumber(Ce.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 Ce(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}var Se,Le,Ae;Ce.COLORS=function(){const t={};for(let e=0;e<xe.length;e++)t[xe[e]]=ve[e];return t}(),t.TextAnchor=void 0,(Se=t.TextAnchor||(t.TextAnchor={})).START="start",Se.MIDDLE="middle",Se.END="end",t.TextLayout=void 0,(Le=t.TextLayout||(t.TextLayout={})).TOP="top",Le.MIDDLE="middle",Le.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ae||(Ae={}));class Me extends Pt{constructor(e,i=M){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.bbox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=s-i.height;break;default:r=Math.ceil(s)}this.setAttr("y",r)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.setStyleOrClass(Ce.isBright(getComputedStyle(t).fill)?e:i),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let i=super.setStyle(t,e);return i&&this.layoutText(),i}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 Pe="$_TH",ke="$_TW";class Ie{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?se.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?we.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=i[r+2]||"");s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),M),0===this._literals[2].length&&(this._literals[2]=M)}else this._literals.push(r,n,M,M);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ne extends Ie{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class Te extends Ne{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-link")}}const Ee={t:class extends Ne{tag(){return"</t>"}},b:class extends Ne{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ne{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Te};class Ve{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new Ie).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in Ee){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new Ee[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const De=/<br.*?>|\r\n|\n/;class Re{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,i,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===q||u===J;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(t.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=d&&t.prefix||"",i=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+i}const y=b.getBBox();if(b[ke]=y.width,b[Pe]=y.height,p?(u=g(u,b[ke]),m+=b[Pe]):(u+=b[ke],m=g(m,b[Pe])),f||(f=b),l instanceof Te){const i=a.createElementNS(e,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),t.appendDom(i)}}_.push(f),r[Pe]=m*h,r[ke]=u*h,d.push(0==i?r[ke]/2:r[ke])}if(c>0){let e=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(p?null!=_[i-1]&&(s=Math.floor(e[ke]-t.getAscent(e[ke]))+t.getAscent(l[i][ke])):r=e[Pe]-t.getAscent(e[Pe])+t.getAscent(l[i][Pe]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[ke]=n.width,r[Pe]=e[Pe]=n.height,_[0]=r}switch(u){case q:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case J:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}e=l[i]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=_,r=s[ke];if(e)s.setAttribute("dx",String(u===J?i-r/2:r/2));else switch(u){case q:s.setAttribute("x",String((i-r)/-2));break;case J:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(l[0][Pe])}}layout(e,i,s,r,n){const o=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===q||l===J)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(De);for(let t of i)e.push((new Ve).parse(t))}}}let $e=0;const Oe=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},Be=function(t,e){const i=s(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];r(n)?i[t]=n.slice(0):n instanceof Date?i[t]=new Date(n):s(n)?i[t]=Be(i[t],n):i[t]=n}return i};class Fe extends gt{constructor(t){super(),this.chart=t,$e++}_init(){const t=this._op=Be({},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(e,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(r,t)||Be(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 Fe&&(i._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0){if(this[t]instanceof Fe)this[t]._doSetSimple(e);else{const s=this._op;e!==s[t]&&(s[t]=e,this.$_applyOptions(s),i&&this._optionChanged())}return this}toggleOption(t,e=!0){const i=this._op,s=i[t];return i[t]=!h(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,e=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;i.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),e&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=Be({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((i=>e._op[i]=t(e[i])));else{e._children=[];for(const i in e){const s=e[i];s instanceof Fe&&(e._op[i]=t(s))}}return e._op}(this),t&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,i=!0){let s=this._op.style;return t&&(s||(s=this._op.style={}),null!=e&&""!==e||(e=void 0),s[t]!==e&&(void 0===e?delete s[t]:s[t]=e),this.$_applyOptions(this._op),i&&this._optionChanged()),this}setStyles(t,e=!0){let i=this._op.style;if(s(t)){let s=!1;i||(i=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),i[e]!==r&&(void 0===r?delete i[e]:i[e]=r,s=!0)}s&&(this.$_applyOptions(this._op),e&&this._optionChanged())}return this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const i in e)if(e.hasOwnProperty(i)){let n=e[i];this._doLoadProp(i,n)||(this[i]instanceof Fe?t[i]=this[i]._load(n):r(n)?t[i]=n.slice(0):n instanceof Date?t[i]=new Date(n):s(n)?t[i]=Object.assign({},n):t[i]=n)}}_doSetSimple(t,e){if(h(e))return t.visible=e,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`;t[e]!==this[i]&&(this[`${i}Dim`]=W(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){i.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 i=t[e];this._doLoadProp(e,i)||(this[e]instanceof Fe?this[e].updateOptions(i):r(i)?this[e]=i.slice(0):i instanceof Date?this[e]=new Date(i):s(i)?this[e]=l({},i):this[e]=i)}}_doPrepareRender(t,e){}_doAfterRender(){}}Fe.REFRESHED="refreshed",Fe.defaults={visible:!0};class ze{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 je extends Fe{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?se.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,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Re),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(ht.isValidNum(t)){const s=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=o(t)?t:this.$_getNumberText(e,i,s)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,i,s){let r="";if(ht.isValidNum(t)){const n=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,s)+n.symbol:this._numberFormatter.toStrEx(t,s):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}je.defaults=Oe(Fe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ge extends je{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof Kt&&(this._images=i)}this._root=this._images?"":e.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2);return i instanceof Kt?i.getImage(s):s}return this._root+t}}}Ge.defaults=Oe(je.defaults,{iconPosition:"default",iconGap:2});class He extends Fe{}He.defaults=Oe(je.defaults,{});class We extends Ge{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return b(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}We.defaults=Oe(Ge.defaults,{display:"auto"});class Ye extends Fe{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){return isNaN(this.options.order)?1/0:this.options.order}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){t.background=(this._background=new He(this.chart))._init(),t.title=(this._title=new We(this.chart))._init(),t.footer=(this._footer=new We(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=w(e.location,"bottom")}}Ye.defaults=Oe(Fe.defaults,{offsetX:0,offsetY:0});class Ze extends Ye{}class Ue extends Ye{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this._op.direction}}Ue.defaults=Oe(Ye.defaults,{direction:"vertical"});class Xe extends ze{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=o(t)?this._map[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=o(t)?this._map[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,i=this._items=[],n=this._map={};if(r(t))t.forEach(((t,s)=>{i.push(this.$_loadItem(e,t,s))}));else if(s(t))i.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const s={};h(t)&&(s.visible=t),i.push(this.$_loadItem(e,s,0))}i.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options[this._collectionProp()]=this._items.map((t=>t.options))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s._init(),s._setIndex(i),s._load(e),s}}class Ke extends Xe{_collectionProp(){return"widgetGroup"}_createWidget(t){return new Ue(t)}}class qe extends Ze{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}qe.defaults=Oe(Ye.defaults,{});class Je extends Fe{_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Je.defaults=Oe(Fe.defaults,{text:"RealMap v1.0.12",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const Qe=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),ti=.001,ei=Math.PI;class ii{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=p(-s/2,i/2,r),["M",t,e-(n=p(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=p(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=p(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=p(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=V(m(n-r)),l=2*ei-h<.01,c=h-ei<.01?0:1,d=o?1:0,p=_(r),g=u(r),f=_(n-=l?d?ti:-.001:0),b=u(n),y=[];return y.push("M",t+i*p,e+s*g,"A",i,s,0,c,d,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=V(m(o-n)),l=2*ei-h<ti;let c=h-ei<ti?0:1;const d=a?1:0,p=_(n),g=u(n),f=_(o-=l?d?ti:-.001:0),b=u(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*p,e+s*g,"A",i,s,0,c,d,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-d,t+y*p,e+w*g),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*u(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/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,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=ii[e](0,0,2*i,2*s);break;default:r=ii.circle(i,s,p(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const si={minimumZoom:200,maximumZoom:1600},ri={};class ni extends Fe{static register(...t){t.forEach((t=>{ri[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 i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const i=this._op;let s,r;return this.inBody&&(i.x1,i.x2,i.y1,i.y2,this._x=this._y=this._w=this._h=NaN),isNaN(s)?s=Y(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=Y(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:s,height:r}}getPosition(t,e,i,s,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+=(i-r)/2+o.x;break;case"right":a+=i-o.x-r;break;default:this._anchorObj?a+=(i-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+=(s-n)/2-o.y;break;case"bottom":h+=s-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,i=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t,e){}}ni.defaults=Oe(Fe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class oi extends ze{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 ni)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const i=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(i,t,s,e))})):s(t)&&n.push(this.$_loadItem(i,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,i,s){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,s);return a._init(),a.index=i,a._load(e),a}}const ai="route";class hi extends Pt{static create(t,e,i,s,r,n,o=0){return new hi(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}const li={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 ci{constructor(t,e){}}const di="_model_",_i="_tag_",ui="disabled",pi="rm-legend-item-marker",gi=Object.freeze([0,0]);function mi(t){return isFinite(t[0]+t[1])}function fi(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function bi(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=p(e,...t),i=p(i,...o),s=g(s,...t),r=g(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const yi="@_rm_state_",wi="@_rm_add_",xi="@_rm_update_",vi="@_rm_delete_";let Ci=0;const Si=[0,0];class Li{constructor(t){this.source=t,this.inset=Si,this.pid=Ci++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.coordOfArea(this.id)||gi),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(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,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[yi]=t:delete this[yi]}_isAdding(){return this[yi]===wi}_isUpdating(){return this[yi]===xi}_isDeleting(){return this[yi]===vi}_isStatic(){const t=this[yi];return t!==wi&&t!==vi}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){}_readObject(t,e){var i;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 s=t._lonFielder(e);if(isNaN(s))return;const r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);if(isNaN(r))return;this.coord=[s,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=t.coordOfArea(this.id)||gi),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 i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){o(t)&&(this.id=t)}}class Ai{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){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Mi={};class Pi extends Ge{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 ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return n(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}}Pi.defaults=Oe(Ge.defaults,{visible:!0,position:"auto",distance:25});class ki extends Fe{}ki.defaults=Oe(Fe.defaults,{shape:"circle",radius:2.5});class Ii extends Fe{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new ki(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}Ii.defaults=Oe(Fe.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class Ni{constructor(t,e){this._args=t,this._chart=e}get chart(){return this._chart}get count(){return this._points.length}get(t){if(t>=0&&t<this._points.length)return this._points[t].assignTo(this._args),this._args}}class Ti extends ut{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class Ei extends ut{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class Vi extends Ti{_init(t){super._init(t),t._setState(wi)}}class Di extends Ti{_init(t){super._init(t),t._setState(vi),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Ri extends Ti{_init(t){super._init(t),t._setState(xi)}}class $i extends Ei{_init(t){t.forEach((t=>{t._setState(wi),t._setVrate(0)}))}}class Oi extends Ei{_init(t){t.forEach((t=>{t._setState(vi),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class Bi extends Ei{_init(t){t.forEach((t=>{t._setState(xi),t._setVrate(0)}))}}class Fi extends Fe{static register(...t){t.forEach((t=>{Mi[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._dataDirty=!1,this._maxZindex=0,this._points=new Ai(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new Ni(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new Ii(this))._init()}_createLabel(t){return new Pi(t)}getTooltipText(t,e){if(this._op.tooltipCallback)return this._getPointArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs);{const t=this._op.tooltipText;return"boolean"==typeof t?t?Fi.defaultTooltipText:null:t}}getTooltipParam(t,e,i){return Fi.getPointTooltipParam(t,e,i)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this._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,e){if(t!==this._data||e!==this._dataPath)return this._data=ht.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}isDataSeries(){return!0}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?s:i}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointArgs(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&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!0===e.visible)}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.options.layoutOnly}getLegendSources(t,e){this._legend===t&&e.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,i;return li[t]||(null===(i=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===i?void 0:i.getCenter())}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){this.$_setData(t,this._op.dataPath)&&(this._dataLoaded=e,this.$_dataPointsChanged())}addPoint(t,e=-1,i=500){var s,r;const n=this.$_addPoint(t,-1);return this._points.insert(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(n._prev={},n._prev.ani=new Vi(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointAdded)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(r=(s=this._op).onPointAdded)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,n)),n}addPointList(t,e=-1,i=500){var s,n;if(!r(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new $i(this,o,(t=>{var e,i;null===(i=(e=this._op).onPointListAdded)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(n=(s=this._op).onPointListAdded)||void 0===n||n.call(s,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,n;a(t)?t=this._points.get(t):o(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new Di(this,t,(t=>{var e,i;this._points.remove(t),null===(i=(e=this._op).onPointRemoved)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(n=(r=this._op).onPointRemoved)||void 0===n||n.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];a(i)?t[e]=this._points.get(+i):o(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Oi(this,t,(t=>{var e,i;this._points.removeAll(t),null===(i=(e=this._op).onPointListRemoved)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(s=(i=this._op).onPointListRemoved)||void 0===s||s.call(i,this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s,r;if(o(t)?t=this._points.pointById(t):a(t)&&(t=this._points.get(t)),t instanceof Li&&this._points.contains(t)){let n=t._prev;return n&&n.ani&&n.ani.stop(),n=t.updateValues(this,e),n&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?n.ani=new Ri(this,t,(t=>{var e,i;null===(i=(e=this._op).onPointUpdated)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(r=(s=this._op).onPointUpdated)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,t))),!!n}return!1}updatePointList(t,e,i=300){var s,r;const n=this.$_points(t).filter((t=>this._points.contains(t)));n.length>0&&(n.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new Bi(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointListUpdated)||void 0===i||i.call(e,this._getPointListArgs(t))})).setDuration(i).start():null===(r=(s=this._op).onPointListUpdated)||void 0===r||r.call(s,this._getPointListArgs(n)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointArgs(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 Li&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_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._dataDirty?(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._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let s,h,l,c=this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;n(i)?s=i:r(i)?h=i:o(i)&&(l=this.chart._assets.get(i)),s?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||s(this._getPointArgs(this._pointArgs,t))||c})):l instanceof Xt?(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 i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return 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 hi.create(t,pi,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 ci);else if(r(t))return t}$_loadPoints(t){var e,i;this._doLoadPoints(t),null===(i=(e=this._op).onPointsLoaded)||void 0===i||i.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._pointLabelVisCallback=this._pointLabel.options.visibleCallback,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:p(s,e),i=isNaN(i)?s:g(s,i))})),{min:e,max:i}}}Fi.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",Fi.defaults=Oe(Fe.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:Fi.defaultTooltipText,loadAnimation:"default",hoverEffect:"default",legend:0});class zi extends ze{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const i=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(i,t,e)})):s(t)&&this.$_loadItem(i,t,0),i.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(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.options.legend,null)))),this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof Fi?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,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t);return n._init(),n.isDataSeries()&&(n.index=i,n.seriesIndex=n.chart._seriesIndex++),n._load(e),this.$_addSeries(n,i)}$_addSeries(t,e){return e>=0?this._items.splice(Math.min(e,this._items.length),0,t):this._items.push(t),t.name&&(this._map[t.name]=t),t}}class ji extends Li{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:v(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class Gi extends Fi{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}Gi.defaults=Oe(Fi.defaults,{valueField:"value"});class Hi extends ji{}class Wi extends Gi{}Wi.defaults=Oe(Gi.defaults,{});class Yi extends ji{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=r(this.values)?this.values.reduce(((t,e)=>t+b(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=r(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class Zi{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return hi.create(t,pi,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class Ui extends Gi{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}_createValueFielder(t){const e=t.valueFields;return r(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this._op.legendByCategory&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new Zi(t.name,t.color)))}}Ui.defaults=Oe(Gi.defaults,{position:"top"});class Xi extends Yi{}class Ki extends Ui{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Fe(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=ht.getMinMax(t),s=i.base=this._op.baseValue;if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=b(this._minValue,i.min),e=b(this._maxValue,i.max);i.min=isNaN(s)?Math.min(t,i.min):Math.min(t,i.min,s),i.max=isNaN(s)?Math.max(e,i.max):Math.max(e,i.max,s)}return i}getPadding(t){return b(Y(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=b(+t.width,Ki.DEF_WIDTH),this._height=b(+t.height,Ki.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}Ki.DEF_WIDTH=80,Ki.DEF_HEIGHT=50,Ki.defaults=Oe(Ui.defaults,{width:Ki.DEF_WIDTH,height:Ki.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class qi extends ji{}class Ji extends Gi{_doApply(t){super._doApply(t),this._width=b(+t.width||+t.size||+t.height,Ji.DEF_SIZE),this._height=b(+t.height||+t.size||+t.width,Ji.DEF_SIZE)}}Ji.DEF_SIZE=60,Ji.defaults=Oe(Gi.defaults,{size:Ji.DEF_SIZE});class Qi extends Ji{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),i=b(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=p(e,s),i=g(i,s))})),this._min=e,this._max=i}}Qi.defaults=Oe(Ji.defaults,{minValue:10});class ts extends Hi{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class es extends Pi{}es.defaults=Oe(Pi.defaults,{visible:!1});class is extends Wi{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new es(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:Y(this._minSizeDim,t),max:Y(this._maxSizeDim,t)}}getRadius(t,e,i){let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return b(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._extMin=+t.minValue,this._extMax=+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,e){super._doPrepareRender(t,e);const i=this._extMin,s=this._extMax;if(!isNaN(i)&&!isNaN(s)&&this._runPoints.length>0)this._noSize=i>s||(this._vMin=i)===(this._vMax=s);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((r=>{const n=r.getValue();r.isNull||isNaN(n)||(isNaN(i)&&(t=p(t,n)),isNaN(s)&&(e=g(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}is.type="bubble",is.defaults=Oe(Wi.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class ss extends Fe{}ss.defaults=Oe(qe.defaults,{length:10});class rs extends Ge{getText(t){return ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}rs.defaults=Oe(qe.defaults,{offset:4});class ns extends Fe{_doInit(t){t.line=(this._line=new ss(this.chart))._init(),t.label=(this._label=new rs(this.chart))._init()}get line(){return this._line}get label(){return this._label}}ns.defaults=Oe(qe.defaults,{});class os extends qe{_doInit(t){super._doInit(t),t.tick=(this._tick=new ns(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof is){let{min:n,max:o}=s.getPixelMinMax(p(t,e));isNaN(i.minRadius)||(n=i.minRadius),isNaN(i.maxRadius)||(o=i.maxRadius),r.forEach((t=>{t.rd=s.getRadius(t.value,n,o)}))}else if(r.length>0){const t=b(i.minRadius,10),e=b(i.maxRadius,50)-t,s=r[0].value,n=r[r.length-1].value-s;r.forEach((i=>{i.rd=t+e*(i.value-s)/n}))}return r}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(r(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=Oe(qe.defaults,{});class as extends Xe{_collectionProp(){return"bubbleScale"}_createWidget(t){return new os(t)}beforeRender(){this._collectVisibles()}}class hs extends Fe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}hs.MARKER_SIZE=10;class ls extends Ze{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this._op.layout||"body"===t)return this._op.layout;switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.maxWidth)!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=W(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=W(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new hs(this,t))),e.reversed&&(this._items=this._items.reverse())}}ls.defaults=Oe(Ye.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:hs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class cs extends Xe{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new ls(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class ds{constructor(t){this._color1=Ce.create(t.minColor),this._color2=Ce.create(t.maxColor),this._logger=ht.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return Ce.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return x(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class _s extends Fe{_doInit(t){t.label=(this._label=new je(this.chart))._init()}get label(){return this._label}getMarkerSize(){return b(this._op.size,7)}}_s.defaults=Oe(Fe.defaults,{size:7});class us extends Fe{}us.defaults=Oe(Fe.defaults,{length:6});class ps extends Ge{getDefaultIconPos(){}}ps.defaults=Oe(Ge.defaults,{});class gs extends Fe{_doInit(t){t.line=(this._line=new us(this.chart))._init(),t.label=(this._label=new ps(this.chart))._init()}get line(){return this._line}get label(){return this._label}}gs.defaults=Oe(Fe.defaults,{});class ms{constructor(t,e,i,s,r){this.from=t,this.to=e,this._color1=i,this._color2=s,this.label=r,this.visible=!0}get color(){return this._color2.toString()}canHide(){return!0}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this.$_createLegendMarker(t,e))}$_createLegendMarker(t,e){const i=+e||hs.MARKER_SIZE;return hi.create(t,pi,0,0,i,i,0)}legendColor(){return this._color2.toString()}legendLabel(){return this.label}constains(t,e){return t>=this.from&&(e?t<=this.to:t<this.to)}getPosition(t,e){if(this.constains(t,e))return(t-this.from)/(this.to-this.from)}getColor(t,e){const i=this._color1,s=this._color2;if(!i)return(s||e).toString();const r=this.from,n=this.to;if(i&&s)return Ce.interpolate(i,s,(t-r)/(n-r)).toString();return x(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class fs extends Fe{}fs.defaults=Oe(Fe.defaults,{});class bs extends Fe{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return b(+this._op.gap,0)}}bs.defaults=Oe(Fe.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const ys="#fff",ws=Ce.create("#000");class xs extends qe{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new _s(e))._init(),t.stepLine=(this._stepLine=new fs(e))._init(),t.tick=(this._tick=new gs(e))._init(),t.nullStep=(this._nullStep=new bs(e))._init()}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=t?r[0]._color1.toString():s.toString()}return this._minColor?(this._logger&&(i=this._logger(i)),Ce.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()):s.toString()}if(this._op.nullStep.visible)return this._op.nullStep.color}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get maxColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?Y(this._barLengthDim,e):e,s=b(this._op.barWidth,12)):(s=this._barLengthDim?Y(this._barLengthDim,t):t,r=b(this._op.barWidth,12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,n=s?s.length:r?r.length-1:0,o=e?n+1:n,a=[];if(e&&(t-=i),n>0)for(let e=0;e<n;e++)a.push((e+1)/o*t);return a}getPosition(t){const e=this._steps;if(!e){const e=this._logger;return e&&(t=e(t)),(t-this._min)/(this._max-this._min)}for(let i=0,s=e.length;i<s;i++){const r=e[i].getPosition(t,i===s-1);if(!isNaN(r))return(i+r)/s}}getTicks(){const t=this._tick.label,e=this._steps,i=this._valueSteps,s=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=b(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=b(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=b(e[n-1].to,r)})}else if(i){n=i.length,o.push({pos:i[0]});for(let t=1;t<n-1;t++)o.push({pos:i[t]});o.push({pos:i[n-1]})}else o=[{pos:s},{pos:r}];return n=o.length-1,o.forEach(((e,i)=>{var s;e.label=null!==(s=e.label)&&void 0!==s?s:t.getNumberText(e.pos,!1,!1,0===i?"trunc":i===n?"ceil":void 0)})),o}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){"legend"!==this._op.display&&"both"!==this._op.display||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Ce.create(t.minColor||ys),this._maxColor=t.maxColor&&Ce.create(t.maxColor),this._colors=this.$_parseColorStops(t.colors)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this._op.name}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(r(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:Ce.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:Ce.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+e.minValue,this._max=+e.maxValue,this._logger=ht.getLogger(e.logBase),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||ws,this._steps=this.$_buildSteps()}$_parseValue(t,e,i){return o(t)?t.endsWith("%")?e+(i-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),D(t)}$_parseColor(t){return t&&t.endsWith("%")?Ce.interpolate(this._minColor,this._endColor,parseFloat(t)/100):Ce.create(t)}$_buildSteps(){const t=this._op,e=t.steps,i=[],s=this._min,n=this._max;let o=s,a=n;if(this._valueSteps=null,r(e)&&e.length>0){let t="0%";e.forEach(((s,r)=>{var n;let h=this.$_parseValue(s.from,o,a),l=this.$_parseValue(s.to,o,a);0===r&&isNaN(h)&&(h=o),r===e.length-1&&isNaN(l)&&(l=a);let c=this.$_parseColor(s.fromColor||t),d=this.$_parseColor(t=(null!==(n=s.toColor)&&void 0!==n?n:s.color)||"100%");i.push(new ms(h,l,c,d,s.label))})),this._logger=null}else if(o>=a)i.push(new ms(o,a,this._minColor,this._endColor,void 0));else if(!isNaN(o)&&!isNaN(a)){const e=t.logBase,i=this._logger&&o>=0&&a-o>=e?this._logger:null,r=i?Math.max(0,1-o):0,h=this._valueSteps=[],l=Math.max(1,b(t.stepCount,1));if(t.integralSteps)i&&(o=i(o),a=i(a)),h.push(...ht.normalizeToSteps([o,a],l+1));else{const t=(i?i(a)-i(o):a-o)/l;h.push(o);for(let e=1;e<l;e++)h.push(D(h[e-1]+t));h.push(D(i?i(a):a))}if(this._min=h[0],this._max=h[l],i){for(let t=0;t<=l;t++)h[t]=Math.pow(e,h[t]);h[0]-=r,t.integralSteps||(h[0]=s,h[l]=n)}}return i.length>1?i:void 0}}xs.defaults=Oe(Fe.defaults,{display:"scale",minColor:ys,layout:"auto",barWidth:12,barLength:"40%"});class vs 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}_collectionProp(){return"colorScale"}_createWidget(t){return new xs(t)}beforeRender(){this._collectVisibles()}}class Cs extends Fe{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e,i){this._module&&this._module.exportToImage(t,e,i)}}Cs.defaults=Oe(Fe.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ss extends Fe{_doSetSimple(t,e){return ht.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Ss.defaults=Oe(Fe.defaults,{});class Ls extends Fe{_doInit(t){t.line=(this._line=new Ss(this.chart))._init(),t.lonLine=(this._lonLine=new Ss(this.chart))._init(),t.latLine=(this._latLine=new Ss(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getLonStep(){return Math.max(0,y(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,y(this._latLine.options.step,this._line.options.step,this.$_defaultStep()))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t,e){super._doPrepareRender(t,e)}$_defaultStep(){return 10}}Ls.defaults=Oe(Fe.defaults,{visible:!1,fitTo:"map"});class As extends Fe{}As.defaults=Oe(Fe.defaults,{visible:!1});class Ms extends Fe{}Ms.defaults=Oe(Fe.defaults,{visible:!1});class Ps extends je{getText(t,e){let i=this._op.suffix;if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this._op.prefix&&(i=this._op.prefix+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=t.dirSymbols||Ps.defaults.dirSymbols}}Ps.defaults=Oe(je.defaults,{dirSymbols:"NSEW",suffix:"°°"});class ks extends Fe{_doInit(t){t.line=(this._line=new Ms(this.chart))._init(),t.label=(this._label=new Ps(this.chart))._init()}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,y(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,y(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=r(t.positions)?t.positions:[]}}ks.defaults=Oe(Fe.defaults,{visible:!1,positions:["top","right"],interval:1});class Is extends Ge{getDefaultIconPos(){return"left"}}Is.defaults=Oe(Ge.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Ns extends Fe{_doInit(t){t.label=(this._label=new Is(this.chart))._init()}get label(){return this._label}}Ns.defaults=Oe(Fe.defaults,{front:!0,zindex:0});class Ts extends Ns{}Ts.defaults=Oe(Ns.defaults,{});class Es extends Ns{}Es.defaults=Oe(Ns.defaults,{});class Vs extends Ns{}Vs.defaults=Oe(Ns.defaults,{});class Ds extends Fe{}Ds.defaults=Oe(Fe.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Rs extends Fe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new Ds(this.chart))._init(),this._args={chart:this.chart.wrapper,axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let i=se.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}moved(t,e,i){}_doSetSimple(t,e){return n(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Rs.defaults=Oe(Fe.defaults,{visible:!1});class $s extends Fe{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new As(this.chart))._init(),this.options.leftLine=(this._leftLine=new As(this.chart))._init(),this.options.rightLine=(this._rightLine=new As(this.chart))._init(),this.options.topLine=(this._topLine=new As(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new As(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new As(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new As(this.chart))._init(),this.options.grid=(this._grid=new Ls(this.chart))._init(),this.options.tick=(this._tick=new ks(this.chart))._init(),this.options.crosshair=(this._crosshair=new Rs(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()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),i.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}this._lonInterval=Math.max(1,y(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,y(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Vs(this.chart):"line"===t.type?new Ts(this.chart):"band"===t.type?new Es(this.chart):new Ts(this.chart),i._init(),i._load(t),e.push(i)}))}}function Os(t,e){const[i,s]=t;let r=!1;for(let t=0,n=e.length-1;t<e.length;n=t++){const[o,a]=e[t],[h,l]=e[n];a>s!=l>s&&i<(h-o)*(s-a)/(l-a)+o&&(r=!r)}return r}function Bs(t,e){let i=!1;Os(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Os(t,e[s])&&(i=!i);return i}$s.defaults=Oe(Fe.defaults,{interval:5});class Fs{constructor(t,e=4){this.bbox=t,this.capacity=e,this.entries=[],this.children=null,this.divided=!1}subdivide(){const{minLon:t,minLat:e,maxLon:i,maxLat:s}=this.bbox,r=(t+i)/2,n=(e+s)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:s},a={minLon:r,minLat:n,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:i,maxLat:n};this.children=[new Fs(o,this.capacity),new Fs(a,this.capacity),new Fs(h,this.capacity),new Fs(l,this.capacity)],this.divided=!0}intersects(t,e){return!(t.minLon>e.maxLon||t.maxLon<e.minLon||t.minLat>e.maxLat||t.maxLat<e.minLat)}isContained(t,e){return t.minLon>=e.minLon&&t.maxLon<=e.maxLon&&t.minLat>=e.minLat&&t.maxLat<=e.maxLat}insert(t){if(!this.intersects(t.bbox,this.bbox))return!1;if(this.divided&&this.children){let e=!1;for(const i of this.children)if(this.isContained(t.bbox,i.bbox)&&(e=i.insert(t),e))break;return e||(this.entries.push(t),e=!0),e}return this.entries.length<this.capacity?(this.entries.push(t),!0):(this.subdivide(),this.insert(t))}containsPoint(t,e,i){return t>=i.minLon&&t<=i.maxLon&&e>=i.minLat&&e<=i.maxLat}queryPoint(t,e,i=[]){if(!this.containsPoint(t,e,this.bbox))return i;for(const s of this.entries)this.containsPoint(t,e,s.bbox)&&i.push(s);if(this.divided&&this.children)for(const s of this.children)s.queryPoint(t,e,i);return i}}class zs{constructor(t,e){var i;this.worldBBox=t,this.root=new Fs(t);for(const t of e)this.root.insert({featureId:t.id,originalFeature:{id:t.id,geometry:{type:t.source.polygon?"Polygon":"MultiPolygon",coordinates:null!==(i=t.source.polygon)&&void 0!==i?i:t.source.polygons}},bbox:{minLon:t.h1,minLat:t.v1,maxLon:t.h2,maxLat:t.v2}})}find(t){const e=this.root.queryPoint(t[0],t[1]).find((e=>function(t,e){if("Polygon"===e.type)return Bs(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(Bs(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const js="37630",Gs={area:"39",name:"제주특별자치도",children:["39010","39020"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},Hs={area:js,name:"울릉도",parent:"37",polygons:[1,2],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},Ws={area:"",name:"백령도",parent:"23,23520",polygons:[[8,9],[14,15,16]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},Ys={area:"39",name:"제주특별자치도",children:["39010110","39010120","39010130","39010140","39010310","39010620","39010630","39010640","39010330","39010510","39010520","39010530","39010540","39010550","39010560","39010570","39010580","39010590","39010600","39010610","39010650","39010660","39010670","39010680","39010690","39020110","39020120","39020130","39020310","39020320","39020510","39020520","39020530","39020540","39020550","39020560","39020570","39020580","39020590","39020600","39020610","39020620"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},Zs={area:js,name:"울릉도",children:["37630110","37630310","37630320"],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},Us={area:"23520",name:"백령도",children:["23520330","23520340"],coord:[125.4,37.7],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},Xs={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},Ks={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},qs={area:"JPN-3502",name:"Okinawa",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};class Js{constructor(t){this.id=t}}class Qs extends Js{constructor(t,e){super(t),this.props=e}}class tr extends Qs{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(i,1);else if(1!==e){const t=r[i],n=[];for(let e=0;e<t.length;e++){const i=[];for(let s=0;s<t[e].length;s++)i.push(t[e][s].slice());n.push(i)}r[i]=n,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=bi(this.polygons[t]),r=bi(this.polygons[e]);let n,o,a=0,h=0;if((n=s.h1-r.h2)>0&&(o=r.v1-s.v2,n>o&&(a=-n*i,h=o*i)),0!==a)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][0]+=a;if(0!==h)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][1]+=h}}class er{constructor(t,e,i){this.name=t,this.closed=i,r(e)&&e.length>=2&&(this.border=[ht.makeArray(e[0]),ht.makeArray(e[1])])}}class ir extends Js{constructor(t,e){super(t),this.polygon=e}}class sr extends gt{static createStockInset(t,e){let i,r=!1;switch(t){case"제주":case"제주도":i=Gs;break;case"제주_B":case"제주도_B":i=Gs,r=!0;break;case"울릉":case"울릉도":i=Hs;break;case"울릉_B":case"울릉도_B":i=Hs,r=!0;break;case"백령":case"백령도":i=Ws;break;case"백령_B":case"백령도_B":i=Ws,r=!0;break;case"읍면동_제주":case"읍면동_제주도":i=Ys;break;case"읍면동_제주_B":case"읍면동_제주도_B":i=Ys,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":i=Zs;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":i=Zs,r=!0;break;case"읍면동_백령":case"읍면동_백령도":i=Us;break;case"읍면동_백령_B":case"읍면동_백령도_B":i=Us,r=!0;break;default:switch(t.toLowerCase()){case"alaska":i=Xs;break;case"hawaii":i=Ks;break;case"okinawa":i=qs;break;case"okinawa_b":i=qs,r=!0}}return i&&(h(e)?i=Object.assign({visible:e},i):s(e)&&(i=Object.assign({},i,e)),r&&i.border&&delete i.frame),i}constructor(t,e){var i,n,a;super(),this._excludes={};const h=null!==(i=t.source)&&void 0!==i?i:t.map,l=t.insets,c=r(l)?l:s(l)||o(l)?[l]: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=s(null==h?void 0:h.meta)?ht.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(n=this.meta.dummies)||void 0===n?void 0:n.slice(),this.paddings=Q(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,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={},c&&c.length>0&&c.forEach((t=>{var e,i;if(o(t)){const e=t.startsWith("-")?sr.createStockInset(t.substring(1),!1):sr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&ht.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new er(t.name,t.border,!0===t.closed))})),h&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(h,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class rr{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}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))}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this.second&&(this.second._offset=this._offset)}prepareSecond(){return this.second=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}getScrolledLon(t){return(t=((t+=this._scroll)%360+360)%360)>180&&(t-=360),t}}const nr=90,or=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class ar extends rr{constructor(){super(),this._rotation=[0,0],this._r=nr,this.bounds={x1:-90,x2:nr,y1:-90,y2:nr},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=or(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=or(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;or(-90-t),or(90-t),or(90+e),or(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*T,r=[Math.cos(s)*Math.sin(e*T)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/nr,i=t[1]/nr,s=Math.sqrt(e*e+i*i),r=Math.asin(s),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,s*o)/T,Math.asin(s&&i*n/s)/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,i=(this._rotation[1]||0)*T,s=Math.cos(i),r=Math.sin(i),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*T+e,h=t[1]*T,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*s+c*r;return[Math.atan2(d*n-u*o,c*s-_*r)/T,Math.asin(u*n+d*o)/T]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(s)*n,a=Math.sin(s)*n,h=Math.sin(r);const l=this._rotation[0]*e,c=this._rotation[1]*e,d=Math.cos(l),_=Math.sin(l),u=Math.cos(c),p=Math.sin(c),g={x:u*d*o+_*a-p*d*h,y:-u*_*o+d*a+p*_*h,z:p*o+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class hr extends sr{static loadMap(t,e){if(s(t)){const i=t.source;if(s(i)&&"Topology"===i.type&&s(i.objects)&&r(i.arcs))return new hr(t,e);const n=t.map;if(s(n)&&"Topology"===n.type&&s(n.objects)&&r(n.arcs))return new hr(t,e)}}_doLoad(t,e){const i=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),n=t=>t.map((t=>i(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(s(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const s=d[t].geometries;if(r(s)&&s.forEach((t=>{const e=new Qs(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=i(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=n(t.arcs),g.push(e)}})),m){const t={},i={};r(e.excludeInternal)?e.excludeInternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":o(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),ht.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};r(e.excludeExternal)?e.excludeExternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":o(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),ht.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,n=[],o=[];e.forEach((t=>{t instanceof Qs&&(i[0].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)))}));const a=n.flat(1/0),h=o.flat(1/0),l=[];if(a.forEach((t=>{h.forEach((e=>{(t===e||t<0&&~t===e||e<0&&t===~e)&&l.push(t)}))})),l.length>0){const e=l.map((e=>e<0?t[~e].slice().reverse():t[e]));s.push(new ir(r.name,e))}}e.push(...s)}}function lr(t,e){const{atan2:i,cos:s,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)+s(o)*s(h)*r(d/2)*r(d/2),u=2*i(n(_),n(1-_)),p=6371e3*u,g=Math.round(p/5e5),m=[];if(g>1){const t=1/g;for(let e=t;e<.999;e+=t){const t=r((1-e)*u)/r(u),c=r(e*u)/r(u),d=t*s(o)*s(a)+c*s(h)*s(l),_=t*s(o)*r(a)+c*s(h)*r(l),p=i(t*r(o)+c*r(h),n(d*d+_*_)),g=i(_,d);m.push([g/T,p/T])}}return m}function cr(t,e){const i=t._base,s=t.off;let n,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof ur?n=i:i[0]>=0&&(l=e.readBounds(i),h=s||h)}if(o(t.frame)&&t.frame.length>0){const e=Q(t.frame);let{h1:i,v1:r,h2:o,v2:a}=n?n[0]:l;if(n)for(let t=1;t<n.length;t++)i=p(i,n[t].h1),r=p(r,n[t].v1),o=g(o,n[t].h2),a=g(a,n[t].v2);const c=i+h[0]-e.l,d=o+h[0]+e.r,_=a+h[1]+e.t,u=r+h[1]-e.b;t.box=[[c,_],[d,_],[d,u],[c,u]],t.bounds=s?{h1:c-s[0],h2:d-s[0],v1:u-s[1],v2:_-s[1]}:{h1:c,h2:d,v1:u,v2:_}}else if(a=t.border){let e,c;if(o(a)){let{h1:t,v1:i,h2:s,v2:r}=n?n[0]:l;if(n)for(let e=1;e<n.length;e++)t=p(t,n[e].h1),i=p(i,n[e].v1),s=g(s,n[e].h2),r=g(r,n[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else r(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=s?{h1:l.h1-s[0],h2:l.h2-s[0],v1:l.v1-s[1],v2:l.v2-s[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const dr=Math.min,_r=Math.max;class ur extends gt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.mainLandBounds=null,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],i=t.props["ctr-lat"];isNaN(e)||isNaN(i)||(this.center=[+e,+i])}}setSelected(t){this._selected=t}get path(){return this._path}get internal(){return this._internal}get external(){return this._external}get selected(){return this._selected}displayText(){return this.name||this.id}getInfo(){return this._info||(this._info={id:this.source.id,props:this.source.props,h1:this.h1,v1:this.v1}),this._info}reset(){this._path=this._internal=this._external=null}$_readBound(t,e){let i=this.h1,s=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{i=dr(i,t[0]+e[0]),s=_r(s,t[0]+e[0]),r=dr(r,t[1]+e[1]),n=_r(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,s=t.offset;let n=[0,0];return r(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),r(s)&&s.length>0&&(n[0]+=b(s[0],0),n[1]+=b(s[1],0)),t.off=n}$_toPath(t,e,i,s){const r=t.isGlobe,n=e[0].slice();if(i){for(let t=0;t<n.length;t++)n[t]=n[t].slice(0);n.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let o=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=n.map((e=>{const i=t?t.project(e):e;return i.outside||(o=dr(o,i[0]),a=_r(a,i[0]),h=dr(h,i[1]),l=_r(l,i[1])),i}));let d;if(this.x1=o,this.x2=a,this.y1=h,this.y2=l,r){let e,i,s=!1;!function(t){let e=t.length-1;for(;e--;)if(Math.max(Math.abs(t[e][0]-t[e+1][0]),Math.abs(t[e][1]-t[e+1][1]))>10){const i=lr(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(n),d=[];for(let r=0;r<c.length;r++){const o=n[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=o,n.push(o),c.push(a)),s&&i){lr(i,o).forEach((e=>d.push(t.project(e))))}d.push(a),i=o,s=!1}}}else d=c;if(d.length>0){const t=`M ${d[0][0]} ${d[0][1]} L`+d.slice(1).map((t=>t.join(" "))).join(" ");return s?t+" Z":t}return""}readBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=dr(e,t[0]),i=_r(i,t[0]),s=dr(s,t[1]),r=_r(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=dr(e,t[0]),i=_r(i,t[0]),s=dr(s,t[1]),r=_r(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)e=dr(e,t[0]),i=_r(i,t[0]),s=dr(s,t[1]),r=_r(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){let i;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,s=e&&!1===e.visible;if(e){if(!s)if(this._insetChilds){let t=1/0,s=1/0;this.source.polygons.forEach(((e,i)=>{this._insetChilds.indexOf(i)>=0&&e[0].forEach((e=>{t=dr(t,e[0]),s=dr(s,e[1])}))})),i=this.$_readInset(e,{h1:t,v1:s}),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,i):this.$_readBound(t,gi)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,gi))):this.$_readBound(this.source.polygon,gi),i=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,gi))):this.$_readBound(this.source.polygon,gi);i&&(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,i):this.$_readBound(t,gi)}))):(this.h1+=i[0],this.h2+=i[0],this.v1+=i[1],this.v2+=i[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;let r="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((e,n)=>{this._insetChilds.indexOf(n)>=0?s||(r+=this.$_toPath(t,e,i,!0)):r+=this.$_toPath(t,e,null,!0)})):s||this.source.polygons.forEach(((e,s)=>{r+=this.$_toPath(t,e,i,!0)})):s||(r=this.$_toPath(t,this.source.polygon,i,!0)),this._path=r}return e.internals&&this.$_readInternal(t,this._insetChilds?gi:i),e.externals&&this.$_readExternal(t,this._insetChilds?gi:i),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new ur;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class pr extends gt{constructor(t){super(),this.source=t}get path(){return this._path}reset(){this._path=null}readPath(t){if(!this._path){let e="";this.source.polygon.forEach((i=>{const s=i.map((e=>t.project(e)));e+=`M ${s[0][0]} ${s[0][1]} L`+s.slice(1).join(" ")})),this._path=e}}}class gr extends gt{constructor(t,e,i){if(super(),this.owner=t,this.source=e,this._hiddens={},this._world=!1,!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=i,this._name=e.name,(this._second=e instanceof gr)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new zs({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 alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof hr&&this.source.internals}get hasExternals(){return this.source instanceof hr&&this.source.externals}get hasBorders(){return this.source instanceof hr&&this.source.borders}get isWorld(){return this._world}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const i in this._areaMap){const s=this._areaMap[i];t in s.source.props&&(e[s.source.props[t]]=s)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()}));for(const t in this._borders)this._borders[t].reset();this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}insetAt(t){for(const e of this._insets)if(e.bounds&&fi(t,e.bounds))return e}getBorder(t){return this._borders[t]}$_preflight(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let r=0;r<this._areas.length;r++){const n=this._areas[r],o=n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null==o?void 0:o.coord){const[t,e]=o.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<t&&(t=a),h>e&&(e=h),l<i&&(i=l),c>s&&(s=c),t<=-180&&e>=180&&i<=-90&&s>=90)return}return{minLat:i,maxLat:s,minLon:t,maxLon:e}}$_resetAreas(){const t=this.owner.getProjection(this._second),e={internals:this.hasInternals,externals:this.hasExternals};if(t instanceof ar)this._areas.forEach((i=>{i.visible=this.isVisible(i.id),i.readPath(t,e),this.$_updateMainAreaBounds(i)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=nr,this.y2=nr;else{let i=1/0,s=-1/0,r=1/0,n=-1/0,o=1/0,a=-1/0,h=1/0,l=-1/0;if(!this._second&&this._useOffset){const e=this.$_preflight();t.offset=e?!0===this._useOffset?[-(e.minLon+(e.maxLon-e.minLon)/2),-(e.minLat+(e.maxLat-e.minLat)/2)]:this._useOffset:[0,0]}if(this._areas.forEach((c=>{c.visible=this.isVisible(c.id),c.readPath(t,e)&&(i=dr(i,c.h1),s=_r(s,c.h2),r=dr(r,c.v1),n=dr(90,_r(n,c.v2)),o=dr(o,c.x1),a=_r(a,c.x2),h=dr(h,c.y1),l=_r(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof sr){const t=this.source.paddings;r-=t.b,n+=t.t,i-=t.l,s+=t.r,h-=t.b,l+=t.t,o-=t.l,a+=t.r}n>83.63&&this.source.alignArctic&&(n=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,n])[1]),(this._world=i<=-180&&s>=180)&&(o=Math.min(o,-a),a=Math.max(-o,a)),this.h1=_r(-180,i),this.v1=_r(-90,r),this.h2=dr(180,s),this.v2=dr(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l,this.cx=o+(a-o)/2,this.cy=h+(l-h)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const n=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,n=r&&r[s];if(!n)continue;const o=t.readPolygonBounds(n);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=o),t.mainLandBounds.x1=dr(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=_r(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=dr(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=_r(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,s=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._borders={},_=this._insets=[];this._useOffset=t.useOffset,Object.values(i).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((e=>{if(e instanceof Qs){const r=w(e.props[s],e.id);if(r&&t.included(r)){const t=i[r],s=new ur(e,t);t&&(delete i[r],t._area=s,_.push(t)),h&&h.indexOf(r)>=0?(l.unshift(s),s.dummy=!0):l.push(s),c[s.id=r]=s,s.name=w(e.props[n],e[n])}}else if(e instanceof ir){const t=new pr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const s=c[t[i]];if(s){const n=e.polygons[i];s.inset=e,s._insetChilds=r(n)?n:[n],e._parent=t[i],e._base=s._insetChilds,e._area=s,_.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,e._area=t,_.push(e))}else if(r(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],s=e._children=[];if(r(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=dr(t,r.h1),s=dr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const r of e.children){const e=c[r];if(e){const n=e.inset={area:r,offset:i};t.push(e),n._area=e,s.push(n)}}_.push(e)}}if(o&&!isNaN(+t.dokdo)){const e=c[o.group];e&&(e.source=new tr(e.source,+t.dokdo,+o.index,+o.parent))}this.reset(),_.forEach((t=>cr(t,t._area)))}$_copy(t){const e=this._areas=[],i=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const s=t._clone();e.push(s),i[s.id]=s})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new gr(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class mr extends Ge{getText(t){return ht.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}mr.defaults=Oe(qe.defaults,{offset:4});class fr extends qe{_doInit(t){super._doInit(t),t.label=(this._label=new mr(this.chart))._init()}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}fr.defaults=Oe(qe.defaults,{visible:!1});class br extends Fe{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:br.ITEM_GAP}}br.ITEM_GAP=4,br.defaults=Oe(Fe.defaults,{offsetX:8,offsetY:8,itemGap:3});class yr extends br{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:yr.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:yr.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)}}yr.BUTTON_SIZE=24,yr.defaults=Oe(br.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class wr extends br{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}wr.defaults=Oe(br.defaults,{type:"text",align:"left",verticalAlign:"top"});class xr extends gt{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 i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,1),t.unselect(e),this._owner.selectionItemRemoved(e),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,e)}_changed(){this._owner.selectionChanged(this)}}class vr extends Fe{isVisible(){return this.visible&&!F(this._op.text)}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}}vr.defaults=Oe(Fe.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Cr extends vr{}Cr.defaults=Oe(vr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Sr extends Fe{constructor(t){super(t.chart),this.owner=t}_doInit(){this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e){let i=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?se.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?we.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Sr.defaults=Oe(Fe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Lr extends ni{constructor(){super(...arguments),this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(/\$\{(.*?)\}/g,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(t):this._params[e[0]];return void 0===i&&(i=e[1]),i||""}_isVisible(){return this._op.visible&&!z(this._op.html)}_doSetSimple(t,e){return o(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=n(i)?i:null}}Lr.DEF_SIZE=100,Lr.type="html",Lr.defaults=Oe(ni.defaults,{width:Lr.DEF_SIZE});class Ar extends ni{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t,e){return o(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}Ar.type="image",Ar.defaults=Oe(ni.defaults,{});class Mr extends ni{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||Mr.defaults.shape}_doSetSimple(t,e){return o(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Mr.type="shape",Mr.defaults=Oe(ni.defaults,{width:64,height:64,shape:"square"});class Pr extends ni{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t,e){return o(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?se.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?we.getFormatter(t):void 0)}(t.timeFormat)}}Pr.type="text",Pr.defaults=Oe(ni.defaults,{text:"Text"});class kr extends rr{project(t){return[t[0]+this.offset[0]-this.scroll,t[1]+this.offset[1]]}backward(t){return[t[0]-this.offset[0],t[1]-this.offset[1]]}}const Ir=1.340264,Nr=-.081106,Tr=893e-6,Er=.003796,Vr=Math.sqrt(3)/2,Dr=74.03120656864502;class Rr extends rr{get lonElliptic(){return!0}get latElliptic(){return!1}getYRange(t,e){return t<=0&&e>=0?[0,0]:e<0?[t,e]:[e,t]}project(t){const e=T,i=Math.asin(Vr*Math.sin((t[1]+this.offset[1])*e)),s=i*i,r=s*s*s;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(i)*Dr/(Vr*(Ir+3*Nr*s+r*(7*Tr+9*Er*s))),i*Dr*(Ir+Nr*s+r*(Tr+Er*s))]}backward(t){const e=t[0]/Dr,i=t[1]/Dr,s=180/Math.PI;let r,n,o,a,h,l=i;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Ir+Nr*r+n*(Tr+Er*r))-i,a=Ir+3*Nr*r+n*(7*Tr+9*Er*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*Vr*e*(Ir+3*Nr*r+n*(7*Tr+9*Er*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/Vr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const $r=63.78137,Or=Math.PI/180;class Br extends rr{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]+this.offset[1]));const i=Math.sin(e*Or);return[$r*(t[0]+this.offset[0]-this.scroll)*Or,$r*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/($r*Or),(2*Math.atan(Math.exp((t[1]-this.offset[1])/$r))-Math.PI/2)/Or]}}const Fr=Math.PI/4,zr=Math.PI/180,jr=63.78137;class Gr extends rr{project(t){return[(t[0]+this.offset[0]-this.scroll)*zr*jr,79.7267125*Math.log(Math.tan(Fr+.4*(t[1]+this.offset[1])*zr))]}backward(t){return[(t[0]-this.offset[0])/jr/zr,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/jr*.8))-Fr)/zr]}}class Hr extends Xi{}class Wr extends Ki{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this._op.barOrder}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new Hr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return hi.create(t,pi,0,0,e,e,2)}}Wr.type="bar",Wr.defaults=Oe(Ki.defaults,{barWidth:.7,overflow:!1,barOrder:"normal"});class Yr extends Fe{constructor(t){super(t.chart),this.gauge=t}}class Zr extends Yr{}Zr.defaults=Oe(Fe.defaults,{visible:!1});class Ur extends Yr{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Ur.defaults=Oe(Fe.defaults,{});class Xr extends Yr{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Xr.defaults=Oe(Fe.defaults,{thickness:"100%",stroked:!1});class Kr extends Yr{getExtents(t){return{radius:Y(this._radiusDim,t,0),length:Y(this._lengthDim,t,0),offset:Y(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Kr.defaults=Oe(Fe.defaults,{visible:!1,radius:3,length:"100%",offset:0});class qr extends Yr{getRadius(t){return Y(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}qr.defaults=Oe(Fe.defaults,{visible:!1,radius:5});class Jr extends je{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:Y(this._offsetXDim,t,0),y:Y(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Jr.defaults=Oe(je.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class Qr{constructor(){this.setCenterX(en.DEF_CENTER),this.setCenterY(en.DEF_CENTER),this.setRadius(en.DEF_RADIUS),this.setInnerRadius(en.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=W(w(t,en.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(w(t,en.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(w(t,en.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(w(t,en.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),i=p(e,this._innerDim?Y(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?Y(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=b(t%360,0),s=g(0,p(360,b(e,360)));this._startRad=N+T*i,this._handRad=T*i,this._sweepRad=T*s}}class tn extends qi{_readObject(t,e){super._readObject(t,e)}}class en extends Qi{_doInit(t){super._doInit(t),t.face=(this._face=new Zr(this))._init(),t.rim=(this._rim=new Ur(this))._init(),t.valueRim=(this._valueRim=new Xr(this))._init(),t.hand=(this._hand=new Kr(this))._init(),t.pin=(this._pin=new qr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Jr(this.chart))._init(),this._props=new Qr}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 tn(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)}}en.DEF_CENTER="50%",en.DEF_RADIUS="50%",en.DEF_INNER="80%",en.type="gauge",en.defaults=Oe(Qi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class sn extends Fe{constructor(t){super(t.chart),this.gauge=t}}class rn extends sn{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}rn.defaults=Oe(Fe.defaults,{thickness:3});class nn extends sn{getLength(t){return Y(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}nn.defaults=Oe(Fe.defaults,{thickness:1.5,length:"55%"});class on extends nn{}on.defaults=Oe(nn.defaults,{thickness:1,length:"80%"});class an extends nn{}an.defaults=Oe(nn.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class hn extends sn{}hn.defaults=Oe(Fe.defaults,{length:5});class ln extends sn{}ln.defaults=Oe(Fe.defaults,{step:1,offset:0});class cn extends sn{}cn.defaults=Oe(Fe.defaults,{radius:4});class dn extends je{}dn.defaults=Oe(je.defaults,{text:"RealMap",position:"top"});class _n extends qi{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 un extends Ji{_doInit(t){super._doInit(t),t.face=(this._face=new Fe(this.chart))._init(),t.rim=(this._rim=new rn(this))._init(),t.hourHand=(this._hourHand=new nn(this))._init(),t.minuteHand=(this._minuteHand=new on(this))._init(),t.secondHand=(this._secondHand=new an(this))._init(),t.tick=(this._tick=new hn(this))._init(),t.tickLabel=(this._tickLabel=new ln(this))._init(),t.pin=(this._pin=new cn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new dn(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,i){const s=p(t,e)*i;return{cx:Y(this._centerXDim,t,t/2),cy:Y(this._centerYDim,e,e/3),rd:Y(this._radiusDim,s,s/2)}}_createPoint(t){return new _n(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=W(w(e._centerX=t,un.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=W(w(e._centerY=i,un.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=W(w(e._radius=s,un.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}un.DEF_CENTER="50%",un.DEF_RADIUS="50%",un.type="clock",un.defaults=Oe(Ji.defaults,{centerX:un.DEF_CENTER,centerY:un.DEF_CENTER,radius:un.DEF_RADIUS,active:!0,size:70});class pn extends Hi{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class gn extends Fe{getSize(){return{width:this._op.width,height:this._op.height}}}gn.defaults=Oe(Fe.defaults,{});class mn extends Gi{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Pi(this.chart))._init(),t.innerImage=(this._innerImage=new gn(this.chart))._init()}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this._op.figure}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this._op.width,i=this._op.height;return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(t.figureBox)}_createPoint(t){return new pn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}$_calcBox(t){if(r(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}mn.type="figure",mn.defaults=Oe(Gi.defaults,{position:"top"});class fn extends Pi{}fn.defaults=Oe(Pi.defaults,{visible:!1});class bn extends Li{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class yn extends Fi{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new fn(t)}_createPoint(t){return new bn(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+="/")}}yn.type="image",yn.defaults=Oe(Fi.defaults,{imageWidth:24,imageHeight:24,position:"top"});class wn extends Pt{constructor(t,e){super(t,pi),this.add(this._area=new Tt(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Tt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class xn extends Xi{}class vn extends Fe{}vn.defaults=Oe(Ki.defaults,{visible:!1});class Cn extends Ki{_doInit(t){super._doInit(t),t.area=(this._area=new vn(this.chart))._init()}get area(){return this._area}_createPoint(t){return new xn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new wn(t,e)}}Cn.type="line",Cn.defaults=Oe(Ki.defaults,{});class Sn extends ji{_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)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class Ln extends Fe{}Ln.defaults=Oe(Fe.defaults,{enabled:!0,autoMapChange:!0});class An extends Fe{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return o(e)?(t.name=e,!0):super._doSetSimple(t,e)}}An.defaults=Oe(Fe.defaults,{});class Mn extends Fe{constructor(t,e){super(e.chart),this.name=t,this.series=e}}Mn.defaults=Oe(Fe.defaults,{visible:!1});class Pn extends Ge{constructor(t){super(t),this._args={chart:t,inset:null}}getInsetText(t){var e;const i=this._op;let s=null!==(e=this._op.text)&&void 0!==e?e:t.name;if(i.textCallback){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if(this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}isInsetLabelVisible(t){return this._op.visibleCallback?(this._args.inset=t,this._op.visibleCallback(this._args)):this._op.visible}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}Pn.defaults=Oe(Ge.defaults,{visible:void 0});class kn extends Pi{}kn.defaults=Oe(Pi.defaults,{visible:!1,hoverColor:"white"});class In extends Gi{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Ln(this.chart))._init(),t.insetLabel=(this._insetLabel=new Pn(this.chart))._init(),t.internalBorder=(this._internalBorder=new Mn(null,this))._init(),t.externalBorder=(this._externalBorder=new Mn(null,this))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var i;const s=this._points.getPoints();for(const r of s)if((null===(i=r.area)||void 0===i?void 0:i.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof Sn||(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 kn(t)}$_createDetail(){return this._detail||(this._detail=new In(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){if(this.getDetailed()||(s(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),i.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(r(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new Sn(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const n=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=o(e.hiddenAreas)?[e.hiddenAreas]:r(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=n.getBorder(t.name))})),this._minValue=h,this._maxValue=l,s(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new ds(t)}else this._colorRanger=null===(i=t.getColorScale(this._op.colorScale))||void 0===i?void 0:i.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(r(t)?t[0]:t)||"id",s=(r(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===s,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[s]]:o[t.source[s]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ce(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new An(t.name,this);i._init(),i._load(t),e.push(i)}))}}In.type="map",In.defaults=Oe(Gi.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class Nn extends Pi{}Nn.defaults=Oe(Pi.defaults,{visible:!1});class Tn extends ji{}class En extends Fe{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 Re),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}En.defaults=Oe(Fe.defaults,{});class Vn extends En{getMinSize(t){return Y(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Vn.defaults=Oe(En.defaults,{text:"${name}"});class Dn extends En{}Dn.defaults=Oe(En.defaults,{text:"${value}"});class Rn extends Gi{_doInit(t){super._doInit(t),t.header=(this._header=new Vn(this))._init(),t.divider=(this._divider=new Fe(this.chart))._init(),t.body=(this._body=new Dn(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,ht.clampEx(t,this._minWidth,this._maxWidth)),height:b(this._height,ht.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new Nn(t)}_createPoint(t){return new Tn(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}}Rn.DEF_MIN_WIDTH=80,Rn.DEF_MIN_HEIGHT=50,Rn.type="panel",Rn.defaults=Oe(Gi.defaults,{orientation:"vertical",minWidth:Rn.DEF_MIN_WIDTH,minHeight:Rn.DEF_MIN_HEIGHT,position:"top"});class $n extends Yi{}class On{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class Bn extends Ui{getRadius(t){return b(Y(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}_createPoint(t){return new $n(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius"),this._thresholds=this.$_parseThresholds(t.threshold)}_doPrepareRender(t,e){super._doPrepareRender(t,e);let i=b(e.startAngle%360,0),s=g(0,p(360,b(e.totalAngle,360)));this._startRad=N+T*i,this._totalRad=T*s}$_parseThresholds(t){return r(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new On(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new On(t.value,t.radius,t.style)]:void 0}}Bn.type="pie",Bn.defaults=Oe(Ui.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class Fn extends Tt{constructor(t,e){super(t,pi),this._rd=e,this.setPath(ii.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 zn extends Hi{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class jn extends Wi{getExt(t,e){const i=b(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t),this._rd=b(t.radius,jn.DEF_RADIUS),this._innerRd=b(t.innerRadius,0)}_createPoint(t){return new zn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new Fn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ce(this._calcedColor)}getColorScale(){return this._op.colorScale}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);this._minValue=r,this._maxValue=n,this._colorRanger=null===(i=t.getColorScale(e.colorScale))||void 0===i?void 0:i.getRanger()}}jn.DEF_RADIUS=9,jn.type="pin",jn.defaults=Oe(Wi.defaults,{radius:jn.DEF_RADIUS,innerRadius:0,position:"top"});class Gn extends Pt{constructor(t,e){super(t,pi),this._size=e,this.add(this._marker=new Tt(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);ii.setShape(this._marker,this._shape,e,e)}}class Hn extends Hi{_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){const e=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],i=this.value!==t.value;return e||i||super._valuesChanged(t)}}class Wn extends Wi{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(){return this._op.shape||this._shape}getRadius(){return b(this._op.radius,Wn.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new Hn(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 Gn(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),p(e,2*this._op.radius)),i}}Wn.type="point",Wn.defaults=Oe(Wi.defaults,{radius:5,position:"center"});class Yn extends Pt{constructor(t,e){super(t,pi),this.add(this._line=new Tt(t)),this.add(this._arrow=new Tt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=$(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class Zn extends Li{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 i,s;const n=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(n(t)):e.push(t)})):o(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(s=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==s?s:[],this.path=null!=e.path?n(e.path):void 0}}class Un extends Fi{needMapScale(){return!0}_createPoint(t){return new Zn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;s(e)&&(t=t.map((t=>{const i=l({},t);if(r(i.coords)){const t=i.coords.slice();o(t[0])&&(t[0]=e[t[0]]),o(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new Yn(t,e)}}Un.type=ai,Un.defaults=Oe(Fi.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class Xn extends Yi{}class Kn extends Ui{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),n={rowCount:this._rowCount,colCount:this._colCount,grid:s,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:s,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new Xn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Kn.ROW_COUNT,this._colCount=t.colCount||Kn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Kn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Kn.CELL_SIZE,this._gap=b(t.gap,Kn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=r(t.values)?t.values.reduce(((t,e)=>t+b(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*b(i,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(s);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,i=e.length;for(let s=0;s<i;s++)if(isNaN(e[s][t]))return s;return i}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._colCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),a==i-1?(h++,a=this.$_rows(h)):h===s-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=n,t.cols=o}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),h==s-1?(a++,h=this.$_cols(a)):a===i-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=n,t.cols=o}}Kn.ROW_COUNT=10,Kn.COL_COUNT=10,Kn.THRESHOLD=1,Kn.CELL_SIZE=5,Kn.GAP=2,Kn.type="waffle",Kn.defaults=Oe(Ui.defaults,{rowCount:Kn.ROW_COUNT,colCount:Kn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Kn.THRESHOLD,cellSize:Kn.CELL_SIZE,gap:Kn.GAP});class qn extends sr{static loadMap(t,e){return s(t)&&s(t.source)&&r(t.source.features)||s(t)&&s(t.map)&&r(t.map.features)?new qn(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Qs(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,i.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,i.push(e)}}})),i}}class Jn extends ut{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=b(i,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==s||s()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Qn extends ut{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=b(s,300),this._old=t.zoom,this.view.$_moveTo(i),this.endHandler=()=>{this.view.zoom=e,this.view=null,null==r||r()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class to extends Fe{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}to.defaults=Oe(Fi.defaults,{visible:void 0,globeFill:"lightblue"});const eo={zoom:1,panX:1,panY:1};class io extends Fe{constructor(t){super(t),this._prj=(new kr).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new oi(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new to(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){return this._map.isWorld&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof ar?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof ar?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 movable(){return!1!==this._op.movable}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this._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}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepare(t){this._map=t}prepareLayout(t,e){return this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this._map,r=i.getYRange(s.v1,s.v2),n=i.project([s.h1,r[0]]),o=i.project([s.h2,r[1]]),a=this._wMap=o[0]-n[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=Math.min(t/a,e/l),d=this._scale=this._zoom/100*c,_=b(this._op.panX*d,0),u=b(this._op.panY*d,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*d,_)/d;this._panX=e}this._panY=this.$_calcPan(e,l*d,u)/d;const p=(i.scroll%360+360)%360*a/360,g=t/2-(n[0]+a/2)*d-(this._panX+p)*d,m=e/2+(h[1]+l/2)*d-this._panY*d,f=c/d*a,y=c/d*l,w=s.x1+a/2-f/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=dt.create(w,x,f,y),{scale:d,wMap:a,hMap:l,tx:g,ty:m}}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=b(this._op.panX*d,0),u=b(this._op.panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,y=s+a/2-m/2+this._panX,w=n+h/2-f/2-this._panY;return this._vRect=dt.create(y,w,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}getPoint(t){return this._points[t]}toVisible(t,e){const i=e?this._prj.second:this._prj;let s,r;if(this.isFlatWorld){const r=i.scroll;s=e?t[0]>=-180&&t[0]<=180+r:t[0]>=-180+r&&t[0]<=180}else r=i.getVisible(t),r&&(e||(s=this._vRect.contains(r[0],r[1])));if(s)return r||(r=i.getVisible(t)),!r.outside&&r}isScrollable(){return this.options.scrollable&&this.map.isWorld}setZoom(t,e=300){let i,r;a(e)?r=e:n(e)?(i=e,r=300):s(e)&&(i=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new Jn(this,t,r,i).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new Qn(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={...si,...s},n=this.map.areaOf(t),o=n.getCenter(),{x1:a,x2:h,y1:l,y2:c}=n.mainLandBounds,d=(this.map.x2-this.map.x1)*e/(h-a)*100,_=(this.map.y2-this.map.y1)*e/(c-l)*100,u=Math.min(d,_),p=Math.min(r.maximumZoom,Math.max(r.minimumZoom,u));new Qn(this,p,o,i,null).start()}zoomToBounds(t,e,i=300){const s=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)/s*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,o=Math.min(t,e);new Qn(this,o,n,i,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,[i,s]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(this.isScrollable()?this.scroll=t[0]:this.panX=i-e.cx,this.panY=-s+e.cy)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in eo;s&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,i)}finally{s&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let i=!0;for(const e in t)if(!(e in eo)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,n,a;const h=this;var l;super._doApply(t),i.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 ar;break;case"equalearth":h._prj=(new Rr).prepareSecond();break;case"miller":h._prj=(new Gr).prepareSecond();break;case"mercator":h._prj=(new Br).prepareSecond();break;default:h._prj=(new kr).prepareSecond()}return!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 ar&&(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]]:s(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,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}io.defaults=Oe(Fe.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class so extends In{}class ro extends Fe{constructor(){super(...arguments),this._widgetGaps=new ft}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;o(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}ro.defaults=Oe(Fe.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class no extends mt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Qe.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new qt,this._series=new zi(this),this._annotations=new oi(this),this._widgetGroups=new Ke(this),this._legends=new cs(this),this._colorScales=new vs(this),this._bubbleScales=new as(this),(this._chartOptions=new ro(this))._init(),(this._axis=new $s(this))._init(),(this._body=new io(this))._init(),(this._exporter=new Cs(this))._init(),(this._title=new vr(this))._init(),(this._subtitle=new Cr(this))._init(),(this._zoomPanel=new yr(this))._init(),(this._drilldownPanel=new wr(this))._init(),(this._mapScale=new fr(this))._init(),(this._credits=new Je(this))._init(),(this._tooltip=new Sr(this))._init(),this.options=Object.assign({},no.defaults),s(t)?this._load(t):this._initOptions(),this._selection=new xr(this)}_initOptions(){}get wrapper(){return this._wrapper}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return o(t)&&Mi[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&ri[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 i,s;this._fireEvent("onModelChanged",t,"selection"),null===(s=(i=this._chartOptions.options).onSelectionChanged)||void 0===s||s.call(i,{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 kr).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,i){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._legends.first}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof gr?t:this.getMap(t))||this._maps[0];i!==e&&(this._baseMap=i,this._loading||(this._baseMap.reset(),this.mapChanged(i)))}get axis(){return this._axis}get title(){return this._title}get body(){return this._body}get visibleSeries(){return this._series.visibles}get firstVisible(){return this._series.firstVisible}get firstMapSeries(){return this._series.visibles.find((t=>t instanceof In))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof In&&!!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)}getSeries(t){return a(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}_collectWidgets(){const t={};for(const e of Object.values(tt))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(tt)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Be(n={},r.base),s(r[i])&&(n||(n={}),Be(n,r[i])),n?Be(n,t):t}_setProperties(t,e=!0){const i=this.options;for(const e in no.defaults)t.hasOwnProperty(e)&&(i[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 i=r(t.map)?t.map:s(t.map)?[t.map]:null;return r(i)&&(i.forEach(((t,e)=>{if(!1!==t.enabled){const i=hr.loadMap(t,e)||qn.loadMap(t,e),s=i&&new gr(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),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.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,so),this._series.get(0)instanceof In||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._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 i=this._templates={};for(const e in t){const r=t[e];s(r)&&(i[e]=l({},r))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let i=this._templates[e];if(i)return Be(Be({},i),t)}else r(e)&&e.forEach((e=>{let i=this._templates[e];return i?Be(Be({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}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 i=this[e];(i instanceof Fe||i instanceof ze||i instanceof qt)&&i.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(t){return this._series.getLegendSources(t).concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof In&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.options.enabled)return;s.options.dataUrl&&(s.updateOption("data",await fetch(s.options.dataUrl).then((t=>t.json()))),delete s.options.dataUrl);const r=t.map,n=this.getMap(s.options.map)||r;i.options.autoMapChange&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof In&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const i=t.parent,s=this.map;e.options.autoMapChange&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return n(this._chartOptions.options.onClick)}click(t){var e,i;null===(i=(e=this._chartOptions.options).onClick)||void 0===i||i.call(e,t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof Ze){const i=t.get(e.options.group,e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s,r;null===(r=(s=this._body.options).onHoverArea)||void 0===r||r.call(s,{chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i,s;null===(s=(i=this._body.options).onClickArea)||void 0===s||s.call(i,{chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}no.defaults={type:"map",startOfWeek:0},Fi.register(In,Wn,jn,Wr,Bn,mn,is,Un,yn,Cn,Rn,Kn,en,un),ni.register(Ar,Mr,Pr,Lr);const oo="$ctrl";class ao{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new no(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 widgetGroup(){return this._obj.widgetGroup}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}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,i){var r;if(s(t)){const s="load chart ";ht.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new no(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",$e),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,i){var r;if(!s(t))return this;const n=this[oo];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const s="load chart ";ht.LOGGING&&console.time(s),await S.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new no(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",$e),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){console.error(t),null==n||n.showErrorView(null==t?void 0:t.message)}finally{null==n||n.hideLoadingView()}}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,i){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof In?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof In&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof In?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof In&&this._obj.drillup(e)}}class ho extends Pt{constructor(t,e,i){super(t,i,"image"),this._dirty=!0,this._bounds=lt,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,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class lo extends Pt{constructor(t,e){super(t,lo.STYLE),this._spinnerWrapper=new Pt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new ho(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=lo.LOADING_SPINNER,this._spinner.width=lo.SPINNER_LENGTH,this._spinner.height=lo.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-lo.SPINNER_LENGTH/2,t.height/2-lo.SPINNER_LENGTH/2)}}lo.STYLE="rm-loading-indicator",lo.BACK_STYLE="rm-loading-background",lo.SPINNER_LENGTH=64,lo.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class co{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,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,i,s)&&(this._clearTouchEffects(),i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(s<0||s>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?i&&this.$_stopDragTracker(e,s,r,!0):i?this.$_doDrag(t,e,s,r):(!this._dragTracker&&Math.abs(this._prevX-s)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!i)&&this.$_startMove(t,e,s,r),this._prevX=s,this._prevY=r,this._touches.push({x:s,y:r,t:t.timeStamp})):i&&this.$_stopDragTracker(e,s,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:i,y:s}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,i,s)}pointerCancel(t){const e=t.target,{x:i,y:s}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,i,s,!0),clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerCancel(t)}pointerLeave(t){clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerLeave(t)}touchStart(t){if(this._pinching=!1,t.touches.length>=2){const e=t.target;this._isPinchTarget(e)&&(this._pinching=!0,this._distance=this.$_getDistance(t.touches[0],t.touches[1])),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,i){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,i){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,i,s,r){return!1}_getDragTracker(t,e,i){return null}$_startDrag(t,e,i,s,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i)),!!this._dragTracker&&this._dragTracker.start(t,e,i,s,r)}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s=!1){this.dragging&&(s?this._dragTracker.cancel():this._dragTracker.drop(null,e,i),this._dragTracker=null)}$_pointerToPoint(t){return this._control.pointerToPoint(t)}$_checkSwipe(t,e){const i=this._touches,s=i.length;if(s<2)return;const r=i[s-1];let n=i[s-2];if(r.t-n.t<=100)for(let t=s-3;t>=0&&(n=i[t],!(r.t-n.t>100));t--);const o=n.x,a=n.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-n.t),d=.998;if(c>.1){const e=this._dragTracker,i=Math.log(.1/c)/Math.log(d),s=c*(1-Math.pow(d,i+1))/(1-d);let r,n=Math.round(180*Math.atan2(l-a,h-o)/Math.PI);if(n<0&&(n=360+n),r=n>45&&n<=135?X.DOWN:n>135&&n<=225?X.LEFT:n>225&&n<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class _o extends gt{constructor(t){super(),this._dragging=!1,this._control=t}get control(){return this._control}get dragging(){return this._dragging}get startWhenCreated(){return!1}get cursor(){}canSwipe(){return!1}start(t,e,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this._dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this._dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,i){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}swipe(t,e,i){if(this._doSwipe(t,e,i))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,i){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_canAccept(t,e,i){return!0}_doCompleted(t,e,i){}_doEnded(t=-1,e=-1){}}class uo extends _o{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class po extends _o{constructor(t){super(t);const e=t.model.body;this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,i,s,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=i,super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=this._oldX-(s-this._xStart)/n.scale,a=this._oldY-(r-this._yStart)/n.scale;if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else n.panX=o;return n.panY=a,!0}$_mapView(){return this.control.model.body}}class go extends co{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof po&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=at?t.ctrlKey:t.metaKey,s=this.$_chart(),r=this.$_chartView(),n=s.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 Li){const t=a.source;s.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;switch(n){case"select":h&&h.model.canSelect()&&(i?h.toggleSelect(e):h.select(e,!0));break;case"drilldown":this.$_drildown(s,t,r)}r.click(t,e,h)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.chartOptions.options.dblClickAction;"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.options.zoomable){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.zoom+=-i/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,i){const s=this.$_chart();return s.isGlobe?new uo(this.control):s.body.isScrollable()||s.body.movable?new po(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,i){const s=t.firstMapSeries;if(s){const r=e.target,n=i.bodyView().getSeries(s).pointByDom(r);n&&n.point instanceof Sn&&t.drilldown(t.firstMapSeries,n.point.area.id)}}}class mo{static empty(){return new mo}static create(t=0,e=0){return new mo(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 mo(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+"}"}}mo.EMPTY=new mo;class fo extends Pt{constructor(t,e=M){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return fo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}fo.IGNORE_ATTRS={width:"",height:""};class bo extends fo{constructor(e,i){super(e,i),this.add(this._text=new Me(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.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 hi(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 Me(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()),i?this._icon||(this.add(this._icon=new ho(t,!1)),this._icon.url=i,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=Ce.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._icon;let i=0;const s=this._text.bbox(),r=s.width,n=s.height;let o,a=r,h=n,l=0,c=0,d=0,_=0;if(this._box=void 0,e){const t=e.bbox();switch(i=b(this._model.options.iconGap,0),l=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":a+=i+l,h=Math.max(c,n);break;default:h+=i+c,a=Math.max(l,r)}}if(this._back&&this._back.parent&&(o=getComputedStyle(this._back.dom),d=parseFloat(o.paddingLeft)||0,_=parseFloat(o.paddingTop)||0,this._back.setBounds(0,0,a+d+(parseFloat(o.paddingRight)||0),h+_+(parseFloat(o.paddingBottom)||0),o.rx)),e)switch(this._model.getIconPos()){case"left":e.trans(d,(h-c)/2),d+=l+i,a-=l+i;break;case"right":e.trans(d+a-l,(h-c)/2),a-=l+i;break;case"top":e.transX((a-l)/2),_+=c+i;break;case"bottom":e.trans((a-l)/2,_+n+i)}switch(o||(o=getComputedStyle(this._text.dom)),o.textAlign){case"center":d+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":d+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(d,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(d,_)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class yo extends Pt{constructor(t,e=M){super(t,e,"g"),Pt.DEBUGGING&&(this.add(this._debugRect=new hi(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._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Pt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new hi(this.doc,"rm-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,i,s){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class wo extends yo{constructor(t,e,i){super(t,e),this._margins=new ft,this._paddings=new ft,this.add(this._background=new hi(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const n=this._paddings;n.applyPadding(r);const o=this._doMeasure(t,e,i,s);if(o.width+=n.left+n.right,o.height+=n.top+n.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class xo extends fo{measure(t,e,i,s){const r=this._doMeasure(t,e,i,s);return this.mw=r?r.width:0,this.mh=r?r.height:0,r}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}locateInner(t,e,i){return this._doLocateInner(t,e,i),this}}class vo extends bo{constructor(t){super(t,"rm-map-widget-title")}}class Co extends bo{constructor(t){super(t,"rm-map-widget-footer")}}class So extends wo{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new vo(t)),this.add(this._footerView=new Co(t))}_setBackgroundStyle(t){t.setVisible(this.model.options.background.visible)&&t.setStyleOrClass(this.model.options.background.style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.options.text),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class Lo extends gt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,n=this._views;for(let t of n)t.parent;for(t=Math.max(0,t);n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(s);n.push(e),i&&i(e,n.length-1,t)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._reversed?this._owner.insertFirst(t):this._owner.add(t),t}free(t,e=0){if(t){t.remove(),this._pool.push(t);const e=this._views.indexOf(t);e>=0&&this._views.splice(e,1)}}freeAll(t,e=0){for(let i of t)this.free(i,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===e}find(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return e[i]}sort(t){const e=this._views.sort(t);return e.forEach((t=>t.remove())),e.forEach((t=>this._owner.add(t))),this}map(t){return this._views.map(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const i=this._views.indexOf(t);i>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(i,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._reversed?this._owner.insertFirst(e):this._owner.add(e),e}_getElementId(t){}}class Ao extends yo{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new hi(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Me(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.options.markerVisible)?this._marker.bbox():lt,n=ct(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,i=b(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.bbox().height)/2)}}class Mo extends So{constructor(t){super(t,Mo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Lo(this,Ao)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=b(r.itemsPerLine,Number.MAX_SAFE_INTEGER),o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),this.$_prepareItems(t,n);const a=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?a.height=Math.max(a.height,this._rTitle.height):a.width=Math.max(a.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?a.height=Math.max(a.height,this._rFooter.height):a.width=Math.max(a.width,this._rFooter.width)),a}_doLayout(){const t=this.model,e=t.options,i=this._rowViews,s=e.sameTextColor,r=this._sizes,n=e.itemsAlign,o=e.lineGap||0,a=e.itemGap||0,h=this._margins,l=this._paddings,c=this._vertical,d=this._titleView,_=this._footerView,u=this._rTitle,p=d.visible?u.height:0,g=d.visible?u.width:0,m=this._rFooter,f=_.visible?m.height:0,b=_.visible?m.width:0,y=_.visible?this._gapFooter:0;let w,x,v,C=h.left+l.left,S=h.top+l.top,L=this.width-C-h.right-l.right,A=this.height-S-h.bottom-l.bottom;if(d.visible)if(this._inTitle){switch(x=S,t.title.options.verticalAlign){case"top":break;case"bottom":x+=A-p;break;default:x+=(A-p)/2}d.trans(C,x),C+=g,L-=g}else{switch(t.title.options.align){case"center":w=Math.max(C,C+(L-u.width)/2);break;case"right":w=Math.max(C,C+L-u.width);break;default:w=C}d.trans(w,S),S+=p,A-=p}const M=C,P=S;if(_.visible){if(this._inFooter){switch(w=M+L-b,x=S,t.footer.options.verticalAlign){case"top":break;case"bottom":x+=A-f;break;default:x+=(A-f)/2}L-=b+y}else{switch(x=S+A-f,t.footer.options.align){case"center":w=Math.max(C,C+(L-m.width)/2);break;case"right":w=Math.max(C,C+L-m.width);break;default:w=C}A-=f+y}_.trans(w,x)}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("")})),i.forEach(((t,e)=>{if(c){const i=this._wMarkers;t.forEach((t=>{t.mw=r[e],t.resizeByMeasured().layout(i[e])})),S=P,"center"!==n&&"end"!==n||(v=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1),S+="center"===n?(A-v)/2:A-v),t.forEach((t=>{t.trans(C,S),S+=t.height+a})),C+=r[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),C=M,"center"!==n&&"end"!==n||(v=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1),C+="center"===n?(L-v)/2:L-v),t.forEach((t=>{t.trans(C,S),C+=t.width+a})),S+=r[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,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,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||hs.MARKER_SIZE)),e.measure(t,a[i],r,n)}));let y=0,w=0;if(i){for(;y<d;)b=h.get(y),w%s===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 i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=g(i,t.mw),r=g(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=g(m,s),p+=i,u.push(i),this._wMarkers.push(r)})),p+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%s===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,i=0;t.forEach((t=>{e+=t.mw,i=g(i,t.mh)})),e+=l*(t.length-1),p=g(p,e),m+=i,u.push(i)})),m+=c*(_.length-1)}return this._titleView.visible&&(this._inTitle?p+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?p+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),{width:p,height:m}}}Mo.LEGEND_CLASS="rm-legend";const Po={};class ko extends wo{static register(...t){t.forEach((t=>{Po[t[0].type]=t[1]}))}constructor(t,e){super(t,ko.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,i){this.measure(this.doc,this.model,e,i),this._layoutView(t,0,0,e,i)}_layoutView(t,e,i,s,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,i,s,r,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this._op.align){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.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)}}ko.CLASS_NAME="rm-annotation";class Io{static interpolate(t,e){if(e instanceof ar==!1)return t;const i=[];let s=null,r=null,n=!1;for(let o=0;o<t.length;o++){const a=t[o],h=e.project(a);if(h.outside)n=!0;else{if(s||(s=a,t.push(a)),n&&r){const t=lr(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,n=!1}}return i}}class No{static box(t,e,i,s,r){const n=Math.floor(Math.abs(i-t)/20),o=this.boxPoints(t,e,i,s,n);return this.coordsToPath(No.toPixelCoord(r,o))}static ellipse(t,e,i,s,r,n=40){const o=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,n);return this.coordsToPath(No.toPixelCoord(r,o))}static geoCircle(t,e,i,s,r,n=!1,o=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,o);let h=this.toPixelCoord(r,a);return n&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof ar?Io.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let i=!1;for(const s of t){if(!!s.outside){i=!1;continue}const[t,r]=s;i?e.push("L",t,r):(e.push("M",t,r),i=!0)}return e}static horizontalLineToRight(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([n,t]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][0]===i||r.push([i,t]),r}static horizontalLineToLeft(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([n,t]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([t,n]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][1]===i||r.push([t,i]),r}static verticalLineToDown(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([t,n]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const n=[],[o,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),n.push(...this.horizontalLineToRight(h,o,a,r)),n.push(...this.verticalLineToUp(a,h,l,r)),n.push(...this.horizontalLineToLeft(l,o,a,r)),n.push(...this.verticalLineToDown(o,h,l,r)),n}static arcCoords(t,e,i,s,r,n,o,a=64){const h=2*Math.PI,l=n-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?o?-h:h:l;c||(o&&d>0&&(d-=h),!o&&d<0&&(d+=h));const _=d/a,u=[];for(let n=0;n<=a;n++){const o=r+_*n;u.push([t+Math.cos(o)*Math.abs(i),e+Math.sin(o)*Math.abs(s)])}return u}}class To extends Tt{renderLat(t,e,i,s,r){let n=r.project([e,t]),o=mi(n)?`M${n[0]},${n[1]}`:"";if(r.latElliptic){let a=e+s;const h=t=>{n=r.project(t),mi(n)&&(o+=o?` L${n[0]},${n[1]}`:`M${n[0]},${n[1]}`)};for(;a<=i-s;)h([a,t]),a+=s;a<=i&&h([i,t])}else n=r.project([i,t]),o+=` L${n[0]},${n[1]}`;this.setPath(o)}renderLatGlobe(t,e,i,s,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=i;)o+=s,a=r.project([o,t]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([o,t]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}renderLon(t,e,i,s,r){let n=r.project([t,e]),o=mi(n)?`M${n[0]},${n[1]}`:"";if(r.lonElliptic){let a=e+s;const h=t=>{n=r.project(t),mi(n)&&(o+=o?` L${n[0]},${n[1]}`:`M${n[0]},${n[1]}`)};for(;a<=i-s;)h([t,a]),a+=s;a<=i&&h([t,i])}else n=r.project([t,i]),o+=` L${n[0]},${n[1]}`;this.setPath(o)}renderLonGlobe(t,e,i,s,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=i;)o+=s,a=r.project([t,o]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([t,o]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}}class Eo extends yo{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new Lo(this,To),this._lonPool=new Lo(this,To)}_doInitStyles(){this.ignorePointer()}prepare(t){this._latPool.prepare((t.y2-t.y1)/t.latStep+1,null,(t=>{Lt.setNoScale(t.dom)})),this._lonPool.prepare((t.x2-t.x1)/t.lonStep+1,null,(t=>{Lt.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,t.x1),y1:Math.max(-90,t.y1),x2:Math.min(180,t.x2),y2:Math.min(90,t.y2),latStep:t.latStep,lonStep:t.lonStep}}_doMeasure(t,e,i,s){return mo.create(i,s)}_doLayout(t){const e=this.model,i=this.second,s=e.chart,r=e.line,n=e.lonLine,o=e.latLine,a=e.chart.getProjection(i),h=a.isGlobe,l=this._bounds;let c;Lt.setImportantStyle(this.dom.style,"pointer-events","none"),Lt.setImportantStyle(this.dom.style,"fill","none");const d=l.x1,_=l.x2;let u=l.latStep;if(c=s.axis.latInterval,h)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(r._style),t.internalSetStyleOrClass(o._style),t.renderLatGlobe(l.y1+e*u,d,_,c,a)}));else{const t=Math.ceil(l.y1/u)*u;this._latPool.forEach(((e,i)=>{const s=t+i*u;(e.visible=s<=l.y2&&s>=l.y1)&&(e.internalResetStyleOrClass(r._style),e.internalSetStyleOrClass(o._style),e.renderLat(s,d,_,c,a))}))}const p=l.y1,g=l.y2;if(u=l.lonStep,c=s.axis.lonInterval,h)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(r._style),t.internalSetStyleOrClass(n._style),t.renderLonGlobe(l.x1+e*u,p,g,c,a)}));else{const t=Math.ceil(l.x1/u)*u;this._lonPool.forEach(((e,s)=>{const o=t+s*u;(e.visible=!(i&&-180===o)&&o<=l.x2&&o>=l.x1)&&(e.internalResetStyleOrClass(r._style),e.internalSetStyleOrClass(n._style),e.renderLon(o,p,g,c,a))}))}}}class Vo extends kt{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new kt(t,"rm-axis-tick-labels")),this._labelPool=new Lo(this._labelLayer,Me)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),n=e.getLatInterval(),o=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*n,h=1+((i.x2-i.x1)/o|0),l=1+((i.y2-i.y1)/a|0);let c=0;this._model=e,this._bounds=Object.assign({},i),this._topCount=this._bottomCount=this._rightCount=this._leftCount=0,e.visibleAt("top")&&(c+=this._topCount=h),e.visibleAt("bottom")&&(c+=this._bottomCount=h),e.visibleAt("right")&&(c+=this._rightCount=l),e.visibleAt("left")&&(c+=this._leftCount=l),this._labelLayer.setVisible(e.label.visible)&&this._labelPool.prepare(c,null,(t=>{t.internalResetStyleOrClass(s)}))}layout(t){if(this._model,this._labelLayer.visible){const e=0!=t.scroll?t.second:null,i=this._scale,s=this._bounds;let r,n,o,a,h,l=0,c=s.x1,d=s.y1;(n=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,n.forEach(((s,n)=>{o=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(o[0]*i,o[1]*-i),c+=r})),l+=this._topCount),(n=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._bottomCount),(n=this._labelPool.getRange(l,l+this._rightCount)).length>0&&(r=this._latStep,a=this._bounds.x2,h=Math.ceil(d/r)*r,e&&(a=-180+t.scroll,t=e),n.forEach(((e,s)=>{o=t.project([a,h]),e.text=h+"°",e.trans(o[0]*i-e.bbox().width/2,o[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(n=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._leftCount)}}}class Do extends yo{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Eo(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,n=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(n),this._gridView.measure(t,r,i,s)),mo.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.map,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:n,y1:o,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:o,x2:n,y2:a,latStep:s,lonStep:i}}$_calcBoundary(t,e,i){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class Ro extends bo{}class $o extends yo{constructor(t,e){super(t),this.add(this._pathView=new Tt(t)),e.add(this._labelView=new Ro(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Vs?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.options,s=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(i.label.text),"range"===i.type){const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(i,t,r),s.setStyle("strokeWidth",`${e}px`)}else if("band"===i.type){o||(this.add(o=this._fromView=new Tt(this.doc)),this.add(a=this._toView=new Tt(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(i,t,r),s.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(i,t,r),s.setStyle("fill","none"),s.setStyle("strokeWidth",`${e}px`)}s.setPath(n).setStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a;if("lat"===t.axis){const r=t.position,o=s.h1,h=s.h2;a=No.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=No.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return No.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a=[];if("lat"===t.axis){const h=Math.min(t.from,t.to),l=Math.max(t.from,t.to),c=s.h1,d=s.h2;a.push(...No.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath(No.coordsToPath(_.map((t=>r.project(t))))),a.push(...No.verticalLineToUp(d,h,l,o));const u=No.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath(No.coordsToPath(u.map((t=>r.project(t))))),a.push(...No.verticalLineToDown(c,h,l,o)),this.$_renderLatLabel(c,l,e,i)}else{const o=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=s.v1,c=s.v2;a.push(...No.verticalLineToUp(o,l,c,n));const d=[...a],_=No.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath(No.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(No.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return No.coordsToPath(No.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=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),i=Math.abs(h-o);r=No.ellipse(t[0],t[1],e,i,s)}else r=No.box(n,o,a,h,s);if(i.visible){const t=Math.min(n,a),r=Math.max(o,h),l=s.project([t,r]);l.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return r}$_renderLatLabel(t,e,i,s){if(!s.visible)return;const{prj:r,map:n,tf:o}=i;let a=0,h=0;const l=s.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*s.scale+s.tx,o=c*-s.scale+s.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);mi(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<i-r;)a([o,t]),o+=r;return o<=i&&a([i,t]),n}$_renderHorizontalLineToLeft(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);mi(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,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);mi(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=i-r;)a([t,o]),o+=r;return o<i&&a([t,i]),n}$_renderVerticalLineToBottom(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);mi(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class Oo extends fo{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new hi(t,"rm-crosshair-flag-back")),this.add(this._text=new Me(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,n,o){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(n-l.width,Math.max(0,o.tx+h[0]*o.scale-l.width/2)),Math.max(0,o.ty-a[1]*o.scale-l.height))}renderLatFlag(t,e,i,s,r,n){const o=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,n.tx+o[0]*n.scale-a.width),Math.max(0,Math.min(r-a.height,n.ty-o[1]*n.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(s.tx+o[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-o[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,n,o,a){const h=e.project([i,s]),l=e.project([o,s]),c=this.prepareLabel(t);this.trans(Math.min(r-c.width,Math.max(0,a.tx+h[0]*a.scale)),Math.max(0,Math.min(n-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class Bo extends yo{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new To(t,"rm-crosshair-line")),this.add(this._lonLine=new To(t,"rm-crosshair-line")),Lt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Lt.setImportantStyle(this._latLine.dom.style,"fill","none"),Lt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Lt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Oo(t)),this.add(this._lonFlag=new Oo(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${i}px`),this._lonLine.setStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.map,n=t[0],o=t[1],a=this._lonLine,h=this._latLine,l=this._lonFlag,c=this._latFlag,d="map"===i.axis.grid.fitTo,_=d?r.h1:-180,u=d?r.h2:180,p=d?r.v1:-90,g=d?r.v2:90;this._bounds={x1:_,x2:u,y1:p,y2:g};const m=[a,l,h,c],f=m.reduce(((t,e)=>t&&e.visible),!0);if(!(_<=n&&n<=u&&p<=o&&o<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(!1),y=b instanceof ar?b:new b.constructor;y.offset=b.offset,this.$_renderLon(t,s.axis.lonInterval,e,y),this.$_renderLat(t,s.axis.latInterval,e,y)}$_renderLon(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof ar;_?l.renderLonGlobe(h,o,a,e,s):l.renderLon(h,o,a,e,s);const u=this.calcTopY(i,n,s,o),p=r.chart.getProjection(!1).getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,n=r.chart.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=s instanceof ar;u?l.renderLatGlobe(h,o,a,e,s):l.renderLat(h,o,a,e,s);const p=u?90-s.rotationX:o,g=s.project(t),m=this.calcRightX(i,s,_,n,g[1]);u?c.renderGlobeLatFlag(d,s,p,h,_.width,_.height,m,i):c.renderLatFlag(d,s,p,h,_.height,i)}calcTopY(t,e,i,s){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let n=[NaN,NaN];const o=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?s:n[1]}calcRightX(t,e,i,s,r){const n=[(i.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?s.x2:o[0]}}const Fo="rm_map_globe_fill";class zo extends Tt{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,n){const o=e.map,a=this.parent,h=e.body.projection;o||this.setPath("");const l=e.body.mapBackground;let c;if(this.internalClearStyles(),a.isProjectionChanged&&this.transEx(0,0).scale(1),e.isGlobe)c=this.$_renderGlobeBg(t,l,c,r,n,i,s);else if(h.lonElliptic||h.latElliptic){const t=e.body.projection.getClipBounds(e.axis.lonInterval,e.axis.latInterval);c=`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`)),this.internalSetStyleOrClass(l._style)}else this.internalSetStyleOrClass(l._style),c=ii.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof ar)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,n,o){const a=e.options.globeFill,h=Math.max(s,r)/2;if(i=ii.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(Fo),a){const e={id:Fo,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Zt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${Fo})`),this.internalSetStyleOrClass(e._style),i}}class jo extends Tt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){ht.isNum(t)?this.setPath(ii.line(t,e,i,s)):t&&this.setPath(ii.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(ii.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(ii.line(t,e,t,i))}setHLine(t,e,i){this.setPath(ii.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(ii.line(e,t,i,t))}}class Go extends Tt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){ht.isNum(t[0])?this.setPath(ii.lines(...t)):r(t[0])?this.setPath(ii.lines3(...t)):this.setPath(ii.lines2(...t))}}var Ho;class Wo extends Lo{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Yo extends bo{constructor(t){super(t,"rm-point-label")}}class Zo extends kt{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Lo(this,Yo),new Lo(this,Yo)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.options.text);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):(e.setText(n.getText(n.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),n=this._labels,o=i.getLabeledPoints(),a=this._maps,h=s[0]._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}removePoint(t,e){for(let i=0;i<2;i++){const s=this.get(t,i);if(s)return void this._labels[i].removeLater(s,e)}}}class Uo extends fo{constructor(t){super(t),this.add(this._line=new Go(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Tt(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Tt(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(ii.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=ta.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(s(a,a)),o.trans(i[0],i[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(i,!1),s&&r.usePointColor&&(o.visible&&o.setFill(s),a.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Xo extends Vt{constructor(t){super(t),this.add(this._back=new hi(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Tt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(ii.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(ii.rect(t).concat(ii.rect(e))):this._mask.setPath(ii.rect(t)),this}}class Ko extends kt{constructor(t,e){super(t,e),this._callouts=new Lo(this,Uo),this._map={},this.add(this._maskLayer=new kt(t)),this._masks=new Lo(this._maskLayer,Xo),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,i=t.callout,s=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=i._style,a=this._map={};r.prepare(n.length,(t=>{})),s.prepare(n.length),n.forEach(((t,i)=>{const n=s.get(i);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(i).id}`),n.index=i,a[t.pid]=n)})),this.setStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const i={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},s=this._masks.get(t.index);return s.setBackground(i),s}}class qo extends Et{constructor(t,e=!1){super(t,ta.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const n=.35,o={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].x-t[r].x,y:t[r+1].y-t[r].y};let c={x:0,y:0},d=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=d,l.y/=d;let _=t[r+1].x-t[r].x,u=t[r].x,p=t[r].y;for(++r;r!=i;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].x-t[r].x,l.y=t[r+1].y-t[r].y,d=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=d,l.y/=d,l.x<h.x?(c.x=h.x-l.x,c.y=h.y-l.y):(c.x=l.x-h.x,c.y=l.y-h.y);const e=Math.sqrt(c.x*c.x+c.y*c.y);c.x/=e,c.y/=e,h.y*l.y>=0&&(c={x:1,y:0}),o.x=-c.x*_*n,o.y=-c.y*_*n;const i=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*n,a.y=c.y*_*n,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.setStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.setStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Jo extends kt{}const Qo={};class ta extends yo{static register(...t){t.forEach((t=>{Qo[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof Ho)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>ii[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,i,s){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,i,s)=>({x:t-i/2,y:e-s}),bottom:(t,e,i,s)=>({x:t-i/2,y:e}),center:(t,e,i,s)=>({x:t-i/2,y:e-s/2}),left:(t,e,i,s)=>({x:t-i,y:e-s/2}),right:(t,e,i,s)=>({x:t,y:e-s/2})},this._labelPositioner={bottom:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e+=r+n}),top:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=r+n+i.height}),right:(t,e,i,s,r,n)=>({x:t+=s+n,y:e-=i.height/2}),left:(t,e,i,s,r,n)=>({x:t-=s+n+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=i.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],s&&this.addDom(this._defs=Pt.createElement(t,"defs")),this.add(this._pointLayer=new kt(t)),this._pointLayer.add(this._pointContainer=new Jo(t,"rm-series-points")),this.add(this._calloutContainer=new Ko(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}get owner(){return this.parent}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e){const i=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,s=this._labelContainer,r=this._calloutContainer;this.setModel(e),this.setStyle("pointerEvents",e.options.disabled?"none":""),e instanceof In?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==s||s.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),i?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),s&&s.visible&&s.prepare(t,this),r.visible&&r.prepare(t,this)):(s&&s.visible&&(null==s?void 0:s.isEmpty())&&s.prepare(t,this),r.visible&&r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e){const i=this.model;this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),i instanceof In||i.isEmpty(!0)||!this.chart().animatable()||this._runShowEffect(i&&(!this.control.loaded&&this.chart().loadAnimatable()||i._dataLoaded)&&!i.isEmpty(!0)),i._dataLoaded=!1}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}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 i=this.pointByDom(t);i&&this.chart().selection.add(this.model,i.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}get growRate(){return this._growRate}_createLabelContainer(t,e){return new Zo(t,e)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_addDef(t,e){const i=this.hash+e;return t.id=i,this._defs.append(t),t}_getPointPositioner(t,e){return this._pointPositioner[t]||this._pointPositioner[e]}_getLabelPositioner(t,e){return this._labelPositioner[t]||this._labelPositioner[e]}_labelViews(){return this._labelContainer.setVisible(this.model.isPointLabelsVisible()),this._labelContainer.visible?this._labelContainer:void 0}_calloutViews(){return this._calloutContainer.setVisible(this.model.isPointCalloutVisible()),this._calloutContainer.visible?this._calloutContainer:void 0}_getPointPool(){}_collectVisPoints(t){return t._visPoints}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,i){if(t.setAttrEx("aria-label",i.ariaHint()),t.internalClearStyleAndClass(),i._runColor)this._setPointColor(t,i._runColor);else{const s=e.getRangedColor(i);s&&this._setPointColor(t,s)}const s=e.getPointStyle(i);s&&t.internalSetStyleOrClass(s)}_doPointerMoved(t,e,i){return!1}_getGrowRate(){return 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&&ht.log("CLICKED: ",t.point.name,t.point.getValue())}}Ho=ta,ta.POINT_CLASS="rm-point",ta.DATA_HOVER="hover",ta.DATA_UNHOVER="unhover",ta.LEGEND_MARKER="rm-legend-item-marker",ta._drawers=Object.assign({circle:t=>ii.circle(0,0,t)},Ho._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ea extends qo{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class ia extends ta{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class sa extends qo{prepare(t,e){return this.point=t,this._ext=ht.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class ra extends ta{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class na extends sa{constructor(t){super(t,!0),this.add(this._contentLayer=new kt(t)),this.add(this._baseLine=new jo(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class oa extends ra{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,b(t._minValue,i.min)),i.max=Math.max(i.max,b(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.options.inverted;let r=s?e._height:e._width;const n=e.getPadding(r);this._ext.inverted=s,this._ext.pad=n,this._ext[s?"height":"width"]=r-2*n}}class aa extends qo{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class ha extends ta{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class la extends ko{constructor(t){super(t,la.CLASS_NAME),this.add(this._imageView=new ho(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}la.CLASS_NAME="rm-image-annotation";class ca extends ko{constructor(t){super(t,ca.CLASS_NAME),this.add(this._shapeView=new Tt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),ii.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)}}ca.CLASS_NAME="rm-shape-annotation";class da extends ko{constructor(e){super(e,da.CLASS_NAME),this.add(this._textView=new Me(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new Re}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),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,i,s,null,e._domain);const a=ct(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)}}da.CLASS_NAME="rm-text-annotation";class _a{static reveal(t,e){new pa(t,e)}static grow(t,e){new ma(t,e)}static spread(t,e){new fa(t,e)}static fadeIn(t){new ua(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);window.Animation&&i instanceof Animation&&(i.addEventListener("finish",(()=>{t._animationFinished(i)})),t._animationStarted(i))}}class ua extends _a{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:ut.DURATION,fill:"none"})}}class pa extends _a{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:ut.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,i){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class ga extends ut{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Pt}_stop(){super._stop(),this._series=null}}class ma extends ga{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class fa extends ga{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ba extends Tt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(ii.bar(t-i/2,e,i,-s,r,n))}}class ya extends na{constructor(t){super(t),this._bars=new Lo(this._contentLayer,ba)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,i,s,r,n,o){const a=t._categories||[],{min:h,max:l,base:c}=t.getPointExtents(i,e),d=i.length,_=r/d,u=_*s.barWidth,p=s.barWidth>1&&!s.overflow,g=s.pad;this._bars.forEach(((t,e)=>{const s=i[e];if(t.setVisible(!isNaN(s))){const i=(s-h)/(l-h)*n*o;let c=g+_*e+(_-u)/2;p&&(c+u>g+r&&(c=g+r-u),c=Math.max(c,g)),t.setPath(ii.bar(c,n,u,-i,0,0)),t.internalClearStyleAndClass(),a[e]&&a[e].color&&t.setFill(a[e].color)}})),this._renderBaseLine(t.baseLine,!1,this.width,this.height)}}class wa extends ea{tooltipColor(){return getComputedStyle(this.dom).fill}}class xa extends Tt{static create(t,e,i,s,r,n,o,a,h=!0){return new xa(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,n,o,a,h,l=!0){return new xa(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=M,i=M){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,i&&this._assignShape(i,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return ii.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 ii.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 va=function(t){return isNaN(t)?0:t};class Ca{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",va(t),va(e)):this._path.push("M",va(t.x),va(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",va(t),va(e)):this._path.push("m",va(t.x),va(t.y)),this}movep(t,e){return a(t)?this._path.push("M",B(t),B(e)):this._path.push("M",B(t.x),B(t.y)),this}line(t,e){return a(t)?this._path.push("L",va(t),va(e)):this._path.push("L",va(t.x),va(t.y)),this}linep(t,e){return a(t)?this._path.push("L",B(t),B(e)):this._path.push("L",B(t.x),B(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",va(t[e]),va(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",va(t[e].x),va(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,i){return this._path.push(`M ${t-i}, ${e} a ${i},${i} 0 1,0 ${2*i},0 a ${i},${i} 0 1,0 ${2*-i},0`),this}}class Sa extends Tt{render(t,e){const i=t.getExtents(e);if(i.radius!==this._radius||i.length!==this._length||i.offset!==this._offset){const t=this._radius=i.radius,e=this._offset=i.offset;if(this._length=i.length,this._radius>0&&this._length>0){const i=new Ca;i.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(i.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let La=class extends Tt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new Ca).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class Aa extends aa{constructor(t){super(t),this.add(this._faceView=new xa(t,"rm-circle-gauge-face")),this.add(this._rimView=new xa(t,"rm-circle-gauge-rim")),this.add(this._valueView=new xa(t,"rm-circle-gauge-value")),this.add(this._textView=new Me(t,"rm-circle-gauge-text")),this.add(this._handContainer=new kt(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 Sa(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 La(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=p(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const n=t.options,o=t._props,a=s.getValue(),h=t.getValueRate(a)*r,l=t.valueRim.getThickness(i.radiusThick),c=this._textView;if(this._valueView.visible){const s=t.valueRim,r=s.options,a=i.value+(r.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(s._style),r.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",O(l))),c.setBoolData("stroked",r.stroked),c.setSectorEx({cx:e.x,cy:e.y,rx:a,ry:a,innerRadius:(a-l)/a,start:o._startRad,angle:o._sweepRad*h,clockwise:n.clockwise},r.stroked)}if(c.visible){const i=t.gaugeLabel;c.text=i.getNumberText(a,!1,!1,void 0),i.buildSvg(c,null,NaN,NaN,t,i._domain);const s=c.bbox(),r=i.getOffset(this.width,this.height);c.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class Ma extends Pt{constructor(t,e,i,s,r){super(t,e,"circle"),"number"==typeof i&&this.setCircle(i,s,r)}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class Pa extends ut{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 ka extends aa{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Ma(e,"rm-clock-gauge-face")),this.add(this._rimView=new xa(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Me(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new kt(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new kt(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Tt(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new Tt(e,"rm-clock-gauge-minute")),this.add(this._secondView=new Tt(e,"rm-clock-gauge-second")),this.add(this._pinView=new Ma(e,"rm-clock-gauge-pin")),this._tickViews=new Lo(this._tickContainer,jo,"rm-clock-gauge-tick"),this._tickLabelViews=new Lo(this._tickLabelContainer,Me,"rm-clock-gauge-tick-label")}prepare(e,i){const s=Math.round(12/g(1,Math.floor(i.tickLabel.options.step)||1));this._tickViews.prepare(i.tick.visible?12:0),this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=i.options.timezoneCallback}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+s.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 i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,d=t.tick.options.length||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-c/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-c;let g=p-d,m=N,f=I/12;if(this._tickViews.forEach(((e,i)=>{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,i=I/12*e;m=N,n.get(0).text="12",g=p-(d+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((s,r,n)=>{s.text=String(0===r?12:r*e),s.trans(a+_(m)*g,h+u(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=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=i.getMinutes()+i.getTimezoneOffset()+s;i.setMinutes(r)}return i}$_renderHands(t,e){const i=this.$_getNow(this.point),s=i.getHours(),r=i.getMinutes(),n=i.getSeconds(),o=s>=12,{cx:a,cy:h,rd:l}=e,c=new Ca;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=I*(s/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*E)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=I*(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*E)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?I*(this._aniSec+this._secRate)/60:I*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*E),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new Pa(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class Ia extends qo{constructor(t){super(t,!0),this.add(this._back=new kt(t)),this._back.add(this._figure=new Nt(t)),this._back.add(this._textView=new bo(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,n=s.options.text;this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=Pt.createElement(t,"use"),this._textView.dom),Lt.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!n)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(n),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t){const e=this._image,i=this._textView,s=this._rBox=this._figure.bbox();if(this._aniScale(this._back,t),e){const t=e.getBBox();let i,r,n,o;t.width>s.width?(i=(t.width-s.width)/2,s.width=t.width):n=(s.width-t.width)/2,t.height>s.height?(r=(t.height-s.height)/2,s.height=t.height):o=(s.height-t.height)/2,Lt.setAttrs(this._figure.dom,{x:i,y:r}),Lt.setAttrs(e,{x:n,y:o})}if(i.visible){const t=i.bbox(),e=Lt.getPadding(i._text.dom),r=s.width-e.left-e.right,n=s.height-e.top-e.bottom;i.trans(e.left+(r-t.width)/2,(n-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Na extends qo{constructor(t){super(t,!0),this.add(this._imageView=new ho(t,!1))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Ta{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:ut.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}let Ea=class extends na{constructor(t){super(t),this._contentLayer.addAll(this._back=new hi(t),this._area=new Tt(t,"rm-line-series-area"),this._line=new Tt(t,"rm-line-series-line"),this._lowLine=new Tt(t))}render(t,e,i,s,r,n){const{min:o,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,o,a,s,r,n),c=i.length,d=c>2&&t.options.curved,_=new Ca;if(this.resize(s,r),this._back.setVisible(!1)&&(this._back.resize(s,r),this._back.setStroke("none")),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}if(this._line.setPath(_.end()),this._area.setVisible(t.area.visible)){if(this._area.internalResetStyleOrClass(t.area._style),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}_.line(l[c-1].x,r),_.line(l[0].x,r),this._area.setPath(_.end(!0))}this._renderBaseLine(t.baseLine,!1,s,r)}$_getPts(t,e,i,s,r,n){const o=t.length,a=[];let h=.05*s,l=.1*r;const c=i-e;s-=.1*s,r-=.2*r;for(let i=0;i<o;i++){const d=t[i],_=h+i/(o-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*n-e)/c)*r);a.push({x:_,y:u})}return a}};const Va="rm-map-series-id-";class Da extends qo{static idClass(t){return Va+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Va))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i){const s=this.point;if(i){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||s.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(Da.idClass(this.model))}this.setBoolData("selected",s&&s._selected)}reset(){this.model=null}}class Ra extends Tt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class $a extends Tt{constructor(t){super(t,"rm-map-series-border")}setModel(t){t!==this.model&&(this.model=t,this.setPath(t.getPath()))}reset(){this.model=null}}class Oa extends Tt{constructor(t){super(t,"rm-map-series-inset")}get center(){if(!this._center){const t=this._pts;let e=t[0][0],i=t[0][1],s=e,r=i;for(let n=1;n<t.length;n++)e=p(e,t[n][0]),s=g(s,t[n][0]),i=p(i,t[n][1]),r=g(r,t[n][1]);this._center=[e+(s-e)/2,i+(r-i)/2]}return this._center}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=this._pts=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);this._pts=[n],i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`,this._pts.push(n);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class Ba extends bo{constructor(t){super(t,"rm-point-label rm-point-inset")}}class Fa extends kt{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new Lo(this,Ba),new Lo(this,Ba)],this._maps=[new Map,new Map],this.ignorePointer()}get(t,e){const i=this._maps[e];return i&&i.get(t)}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}prepare(t,e){const i=e.model,s=i.insetLabel,r=i.map._insets;if(this.visible&&r&&r.length>0){const e=i.getPointLabels(),n=i.pointLabelCount(),o=this._labels,a=this._maps;o[0].prepare(r.length),a[0].clear(),o[1].prepare(n>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{console.log(i);for(let h=0;h<n;h++){const n=o[h].get(r);n.setVisible(!0)&&(this.$_prepareInsetLabel(t,n,e[h],s,i),a[h].set(i,n))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const n=s.getInsetText(r);e.setModel(t,s,null,null),e._text.internalResetStyleOrClass(i._style),e._text.internalResetStyleOrClass(s._style),e._text.internalSetStyleOrClass(s.getInsetLabelStyle(r)),n?(i.prepareRich(n),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class za extends ta{constructor(t){super(t,"rm-map-series",!0,!1),this._areas={},this._insetLabelContainer=new Fa(t),this._areaPool=new Wo(this._pointContainer,Da),this._insetPool=new Lo(this._pointContainer,Oa)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,i,r;const n=this._hoverArea;if(t!==n){const r=this.model;if(n&&(n.setBoolData(ta.DATA_HOVER,!1),n.point&&(null===(e=this._labelContainer.get(n.point,0))||void 0===e||e._text.setBoolData(ta.DATA_HOVER,!1))),!t||t.point||r.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=r.options,n=document.querySelector(".rm-root");let o=e.hoverColor,a=r.pointLabel.options.hoverColor;!o&&s(e.hoverStyle)&&(o=e.hoverStyle.fill),n.style.setProperty("--map-series-hover-fill",o||""),n.style.setProperty("--map-series-hover-label-fill",a||""),t.setBoolData(ta.DATA_HOVER,!0),t.point&&(null===(i=this._labelContainer.get(t.point,0))||void 0===i||i._text.setBoolData(ta.DATA_HOVER,!0))}t!=n&&r.chart._hoverAreaChanged(r,null==t?void 0:t.model,null==n?void 0:n.model)}const o=this.owner.getSiblingOf(this);o&&(o.hoverArea=o._areas[null===(r=this.hoverArea)||void 0===r?void 0:r.model.id])}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=Da.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e){super.prepareModel(t,e);const i=this._insetLabelContainer;i.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?i.visible&&i.prepare(t,this):i.visible&&!i.isEmpty&&i.prepare(t,this)}_doPrepeare(t,e,i){const s=this._second,r=e.map,n=e.internalBorder._style,o=e.externalBorder._style,a=e.getMapBorders(),h=e.options.bringToFront?[]:null;this._insets=r._insets,r.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new kt(t,"rm-map-series-internals")),this._internalPool=new Lo(this._internalContainer,Ra)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),r.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new kt(t,"rm-map-series-externals")),this._externalPool=new Lo(this._externalContainer,Ra)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),r.hasBorders&&a.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new kt(t,"rm-map-series-borders")),this._borderPool=new Lo(this._borderContainer,$a))),this._areaPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i),n=t.point=e.pointOf(r);t.setModel(r),n?(r.dummy||this._setPointStyle(t,e,n),h&&h.push(t)):t.internalClearStyleAndClass(),Lt.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i);t.setModel(r,"internal"),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(n)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const r=e.get(s,i);t.setModel(r,"external"),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(o)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(a.length,((t,e)=>{const i=a[e];t.setModel(i),Lt.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),h&&h.length!==e.areaCount&&h.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Lt.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){const s=this.areaOfDom(i);return this.hoverArea=s,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const i=this.chart(),s=this._second,r=i.isDirty,n=i.body,o=this.model,a=o.map,h=o.options,l=i.getProjection(s),c=this._areas={},d=this._insets,_=h.allAreas,u=this._labelViews(),p=this._insetLabelContainer.visible?this._insetLabelContainer:null,g=o.insetLabel,m=h.nullStyle,f=h.dummyStyle,b=this._scale,y=this._areaPool;y.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,a=u&&e&&u.get(e,0);if(c[i.id]=t,t.setVisible(i.visible&&(_||!!e)&&!o.isHiddenArea(i.id))){if(t.render(m,f,r),a){const i=n.toVisible(o.getCenter(e),s);if(a.setVisible(!!i)){r&&this._layoutLabel(a,t.dom);const s=a.bbox();let[n,o]=i;e.xPos=n,e.yPos=o,n*=b,o*=-b,n-=s.width/2,o-=s.height/2,a.trans(n,o)}}}else a&&a.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=d[e];if(t.setVisible(!1!==i.visible)){const e=c[i.area],h=p&&g.isInsetLabelVisible(i)&&p.get(i,0);let d;if(e){if(t.setVisible(e.visible)){if(u&&(d=u.get(e.point,0),d&&o.isPointLabelVisible(e.point))){const t=o.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const r=n.toVisible(t,s),a=d.bbox();if(d.setVisible(!!r)){let[t,e]=r;t*=b,e*=-b,t-=a.width/2,e-=a.height/2,d.trans(t,e)}}t.render(i,l)}}else{const e=i._base;if(e)if(e[0]instanceof ur){for(const t of e){if(!t.visible||o.isHiddenArea(t.id))return;if(u){const e=c[t.id];if(d=e&&u.get(e.point,0),d&&d.visible){const t=o.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const r=n.toVisible(t,s),a=d.bbox();if(d.setVisible(!!r)){let[t,e]=r;t*=b,e*=-b,t-=a.width/2,e-=a.height/2,d.trans(t,e)}}}}t.render(i,l)}else if(e[0]>=0){const e=a.areaOf(i._parent);e&&e.visible&&!o.isHiddenArea(e.id)&&t.render(i,l)}}if(h&&h.setVisible(!d)){r&&h.layout();const e=t.center,i=h.bbox();let[s,n]=e;s*=b,n*=-b,s-=i.width/2,n-=i.height/2,h.trans(s,n)}}}))}}class ja extends yo{constructor(t,e,i){super(t,e),this._paddings=new ft,this.add(this._background=new Tt(t,i)),this.add(this._textView=new Me(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=e.options.text;r?(e.prepareRich(r),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;n(a)&&(a=a(e.series.getPointArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(e){const i=this._textView,s=this.width;let r=0;this._renderBackgrouond(this._background,s,this.height,e);switch(getComputedStyle(i.dom).textAlign){case"center":r+=s/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=s,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}i.trans(r,this._paddings.top)}}class Ga extends ja{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,i,s){t.setPath(ii.bar(0,i,e,-i,s,0))}}class Ha extends ja{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(ii.bar(0,i,e,-i,0,s))}}class Wa extends qo{constructor(t){super(t,!0),this.add(this._back=new kt(t)),this._back.addAll(this._borderView=new hi(t),this._headerView=new Ga(t),this._bodyView=new Ha(t),this._divider=new jo(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,n){const o=this.point,a=e.header,h=e.body,l=this._headerView,c=this._bodyView,d=this._divider;let _,u;l.setVisible(a.visible)&&(l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(o).measure(t,h,i,s);let p=u.width,g=u.height;l.visible&&(p=Math.max(p,_.width),g+=_.height);const m=e.getExtents(p,g);l.visible&&(l.resize(m.width,_.height),l.layout(r),d.setVisible(e.divider.visible)&&(d.trans(0,_.height),d.setHLine(0,0,m.width))),c.resize(m.width,m.height-_.height),c.transY(_.height),c.layout(r),this._borderView.setBounds(0,0,m.width,m.height,r),this._rBox={x:0,y:0,width:m.width,height:m.height},this._aniScale(this._back,n)}}class Ya extends xa{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Za extends sa{constructor(t){super(t,!0),this._sectors=new Lo(this,Ya,null,.5),this._rdRate=1,this.add(this._circle=new Ma(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,n=0;if(e){this.$_calcAngles(t,[0],s);const o=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.options.clockwise;let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:n,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),o[0]&&o[0].color&&a.setFill(o[0].color),a.internalSetStyleOrClass(e.style)}else{const e=this.point.values;this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),this.$_layoutSectors(t,r,n,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=t.options,r=e.length,n=s.clockwise?1:-1,o=e.reduce(((t,e)=>t+e),0),a=t._totalRad*i;let h=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),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.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.options.clockwise;this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const a=t.value;if(isNaN(a))t.setVisible(!1);else{const a=t.start;let h=0,l=0;t.trans(h,l).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:a,angle:m(t.angle),clockwise:o}),t.internalClearStyleAndClass(),n[r]&&n[r].color&&t.setFill(n[r].color)}}))}}class Ua extends ea{constructor(t){super(t,!0),this.add(this._pin=new Tt(t))}render(t){this._pin.setPath(ii.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Ma(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 Xa extends ea{}class Ka extends qo{constructor(t){super(t,!0),this.add(this._line=new Tt(t)),this.add(this._arrow=new Tt(t))}prepare(){this._checkStatic()}render(t,e,i,s){if(i.length>1){const t=i[i.length-2],r=i[i.length-1],n=$(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+i.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(s)&&(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 qa extends sa{constructor(t){super(t,!0),this._cells=new Lo(this,Tt)}render(t,e,i,s){const r=t.getPointGrid(this.point,e,s);this.$_prepareCells(Math.round(r.count),i.wCell,i.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,i)}$_prepareCells(t,e,i){this._cells.prepare(t,(t=>{t.setPath(ii.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const n=i*r.hCell+(i-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[o][a])&&(o++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),n-o*r.hCell-(o>0?o*r.gap:0)),a++}))}}class Ja extends ra{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new Wo(this._pointContainer,qa)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._waffles.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.getWaffleInfo(),n=s.chart.getProjection(this._second),o=+s.options.rotation||0,a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),c=s.getLabelOff(),d=this._labelViews(),_={...this._getSeriesExt(s,s._visPoints),gap:s.options.gap},u=s.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,C,S,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=C=g[1],v*=a[0],C*=a[1],t.render(s,_,r,i*b.vrate()),m=t.bbox(),f=e(v,C,m.width,m.height),t.trans(f.x,f.y).rotate(o),d&&(S=d.get(b,0))&&S.setVisible(t._static)&&this._layoutLabel(S,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.setVisible(t._static)&&L.render(u,b,x.flat().map(((t,e)=>t*a[e%2])),null)}}))}}class Qa extends ko{constructor(t){super(t,Qa.CLASS_NAME),this.add(this._foreignObj=new Pt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=Qa.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._htmlView;let a=r.html||"";const h=(a.startsWith("#")||a.startsWith("."))&&t.querySelector(a);return this._foreignObj.resize(b(n.width,Lr.DEF_SIZE),n.height),a=e.applyParams(h?h.innerHTML:a),a!==o.innerHTML&&(o.innerHTML=a),h&&this._templateDom!==h&&(this._templateDom=h,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),isNaN(this._foreignObj.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),ct(this._foreignObj.bbox())}_doLayout(t){super._doLayout(t)}_doDestory(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}function th(t,e){return new(Po[e._type()])(t)}Qa.CLASS_NAME="rm-html-annotation",Qa.HTML_VIEW_CLASS="rm-html-annotation-view",ta.register([In,za],[Wn,class extends ia{constructor(t){super(t,"rm-point-series",!0,!0)}_createMarkers(t){return new Wo(t,Xa)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t){const e=this.model,i=e.chart.getProjection(this._second),s=Math.max(0,e.getRadius()),r=[this._scale,-this._scale],n=+e.options.rotation||0,o=e.options.position,a=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach(((p,g)=>{var m;const f=p.point,b=[f.lon,f.lat];if(p.setVisible(!f.isNull&&null!=(_=i.getVisible(b)))){const g=this._getPointPositioner(f.position||o,"center"),y=(null!==(m=p._radius)&&void 0!==m?m:s)*f.vrate(),w=y*t,x=ta.getDrawer(e.getShape());let v,C,S,L,A,M;if(c&&(v=f.getCallout(b))&&(C=v.map((t=>i.project(t))),_=C[C.length-1]),f.xPos=S=_[0],f.xPos=L=_[1],S*=r[0],L*=r[1],u=g(S,L,2*y,2*y),u.x+=y,u.y+=y,p.setPath(x(w,w)),p.trans(u.x,u.y).rotate(n),h&&(A=h.get(f,0))&&A.setVisible(p._static)&&(this._layoutLabel(A,p.dom),A.transp(a(u.x,u.y,A.bbox(),y,y,l))),d&&C&&(M=d.get(f))&&M.setVisible(p._static)){const t=C.flat().map(((t,e)=>t*r[e%2]));d.setMask(M,t).setCircle(t[t.length-2],t[t.length-1],y),M.render(c,f,t,null)}}}))}}],[jn,class extends ia{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new Wo(t,Ua)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),i=this._getGrowRate(),s=this.model,r=[this._scale,-this._scale],n=+s.options.rotation||0,o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom");s.pointLabel.options.position;const h=this._labelViews(),l=s.getLabelOff(),c=s.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=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,A;c&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),_=v[v.length-1]),m.xPos=C=_[0],m.yPos=S=_[1],C*=r[0],S*=r[1],u=g(C,S,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(n),h&&(L=h.get(m,0))&&L.setVisible(p._static)&&(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&&(A=d.get(m))&&A.setVisible(p._static)&&A.render(c,m,v.flat().map(((t,e)=>t*r[e%2])),null)}}))}}],[Wr,class extends oa{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._bars=new Wo(this._pointContainer,ya)}_getPointPool(){return this._bars}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){const i=t.reversed;this._bars.prepare(e.length,((s,r)=>{const n=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,n)}))}$_layoutBars(t,e,i){const s=this.model,r=s._width,n=s._height,o=!s._pointDomain,a=this._getSeriesExt(s,this._visPoints),h=s.chart.getProjection(this._second),l=[this._scale,-this._scale],c=s.options.position,d=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),_=s.getLabelOff(),u=this._labelViews(),p=s.getCallout(),g=this._calloutViews(),m={pad:this._ext.pad,barWidth:s.options.barWidth,overflow:s.options.overflow};let f,b;this._bars.forEach(((t,e)=>{const y=t.point,w=[y.lon,y.lat];if(t.setVisible(!y.isNull&&null!=(f=h.getVisible(w)))){const e=this._getPointPositioner(y.position||c,"center"),x=t.getSizeRate(t._ext.max,a),v=this._ext.width*x,C=this._ext.height*x;let S,L,A,M,P,k;p&&(S=y.getCallout(w))&&(L=S.map((t=>h.project(t))),f=L[L.length-1]),y.xPos=A=f[0],y.yPos=M=f[1],A*=l[0],M*=l[1],b=e(A,M,r,n),t.resize(r,n),t.render(s,o&&a,y.values,m,v,C,i*y.vrate()),t.trans(b.x,b.y).rotate(this.rotation),u&&(P=u.get(y,0))&&P.setVisible(t._static)&&P.layout().transp(d(b.x+r/2,b.y+n/2,P.bbox(),r/2,n/2,_)),g&&L&&(k=g.get(y))&&k.setVisible(t._static)&&k.render(p,y,L.flat().map(((t,e)=>t*l[e%2])),null)}}))}}],[Cn,class extends oa{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new Wo(this._pointContainer,Ea)}_getPointPool(){return this._lines}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,b(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Ta(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=!s._pointDomain,n=this._getSeriesExt(s,this._visPoints),o=s.chart.getProjection(this._second),a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),c=s.getLabelOff(),d=this._labelViews(),_=s.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,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map((t=>o.project(t))),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(s,r&&n,m.values,y,w,i*m.vrate()),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.setVisible(t._static)&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.setVisible(t._static)&&A.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[Bn,class extends ra{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new Wo(this._pointContainer,Za)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._pies.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutPies(t,e,i){const s=this.model,r=s.chart.getProjection(this._second),n=[this._scale,-this._scale],o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),h=s.getLabelOff(),l=this._labelViews(),c=s.getCallout(),d=this._calloutViews(),_=s.getRadius(Math.min(t,e)),u=s.hasThreshold();let p,g;this._pies.forEach(((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=r.getVisible(f)))){const e=this._getPointPositioner(m.position||o,"top"),b=_*t._rdRate;let y,w,x,v,C,S;c&&(y=m.getCallout(f))&&(w=y.map((t=>r.project(t))),p=w[w.length-1]),m.xPos=x=p[0],m.yPos=v=p[1],x*=n[0],v*=n[1],g=e(x,v,2*b,2*b),g.x+=b,g.y+=b,t.render(s,u&&s.getThreshold(m.getSum()),b,i*m.vrate()),t.trans(g.x,g.y),l&&(C=l.get(m,0))&&C.layout().transp(a(g.x,g.y,C.bbox(),b,b,h)),d&&w&&(S=d.get(m))&&S.render(c,m,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[mn,class extends ta{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new Wo(this._pointContainer,Ia)}$_createFigure(t){const e=Pt.createElement(t,"symbol");return e.append(Pt.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=Pt.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const s=e.figureBox,r=e.innerImage.options;Lt.setAttr(this._figure,"viewBox",s?`0 0 ${s[0]} ${s[1]}`:null),Lt.setAttr(this._figure.firstElementChild,"d",e.path),Lt.setAttrs(this._image,{href:r.url,width:r.width,height:r.height}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutFigures(t)}$_prepareFigures(t,e){const i=t.chart.isDirty,s=e.length,r={id:`#${this._figure.id}`,...t.getFigureSize()},n=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,o=t.innerLabel;this._pointContainer.setFill(t._runColor),this._figures.prepare(s,((s,a)=>{const h=s.point=e[a];this._setPointStyle(s,t,h),i&&s.prepare(this.doc,r,n,o)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(this._second),i=this.model,s=[this._scale,-this._scale],r=+i.options.rotation||0,n=i.options.position,o=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews();let d,_;this._figures.forEach(((i,u)=>{const p=i.point,g=[p.lon,p.lat];if(i.setVisible(!p.isNull&&null!=(d=e.getVisible(g)))){const u=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>e.project(t))),d=f[f.length-1]),p.xPos=b=d[0],p.yPos=y=d[1],b*=s[0],y*=s[1],i.render(t),v=i._rBox,_=u(b,y,v.width,v.height),i.trans(_.x,_.y).rotate(r),a&&(w=a.get(p,0))&&w.setVisible(i._static)&&this._layoutLabel(w,i.dom).transp(o(_.x+v.width/2,_.y+v.height/2,w.bbox(),v.width/2,v.height/2,h)),c&&f&&(x=c.get(p))&&x.setVisible(i._static)){const t=f.flat().map(((t,e)=>t*s[e%2]));v.x=i.tx,v.y=i.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,i.getFill())}}}))}}],[Kn,Ja],[Un,class extends ta{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new Wo(this._pointContainer,Ka,"rm-route-series-line")}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(b(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setStroke(t._runColor),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(),i._line.setFill("none"),Lt.setNoScale(i._line.dom),i._arrow.setStroke("none"),Lt.setNoScale(i._arrow.dom)}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(this._second),r=e.options.lineWidth,n=e.options.arrowDisplay;if(at){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(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,s,n){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)o(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const r=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));n<1&&(r.length=r.length*n|0),t.render(e,1/this._scale,r,"none"!==s&&(n<1||"moving"!==s))}}$_genPath3(t,e,i){const s=[],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((o-h)**2+(a-l)**2)))*r;var o,a,h,l;const c=this._calculateControlPoint(t,e,n);for(let r=0;r<=i;r++){const n=r/i,o=this.interpolate3(t,c,n),a=this.interpolate3(c,e,n),h=this.interpolate3(o,a,n);s.push(h)}return s}interpolate3(t,e,i){const s=R(t[1]),r=R(t[0]),n=R(e[1]),o=R(e[0]),a=Math.acos(Math.sin(s)*Math.sin(n)+Math.cos(s)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-i)*a)/Math.sin(a),l=Math.sin(i*a)/Math.sin(a),c=h*Math.cos(s)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(s)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(s)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[$(Math.atan2(d,c)),$(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=R(r[1]),o=R(r[0]),a=n+s*Math.sin(Math.PI/2);return[$(o+s*Math.cos(Math.PI/2)),$(a)]}}],[is,class extends ia{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new Wo(t,wa)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=this.model,r=s.chart,n=r.getProjection(this._second),o=+s.options.rotation||0,a=[this._scale,-this._scale],h=s.options.position,l=this._getLabelPositioner(s.pointLabel.options.position,"center"),c=this._getLabelPositioner(s.subLabel.options.position,"right"),d=this._labelViews(),_=s.getLabelOff(),u=s.getSubLabelOff(),g=s.getCallout(),m=this._calloutViews(),{min:f,max:b}=s.getPixelMinMax(p(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,p=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(p)))){const e=this._getPointPositioner(r.position||h,"center"),x=ta.getDrawer(s.getShape());let v,C,S,L,A,M,P=(t._radius=s.getRadius(r.getValue(),f,b))*r.vrate()*i;g&&(v=r.getCallout(p))&&(C=v.map((t=>n.project(t))),y=C[C.length-1]),r.xPos=S=y[0],r.xPos=L=y[1],S*=a[0],L*=a[1],w=e(S,L,2*P,2*P),w.x+=P,w.y+=P;const k=()=>{t.setPath(x(P,P)),t.trans(w.x,w.y).rotate(o)},I=()=>{if(n instanceof ar){const e=n.r,i=this.chart().width,s=p[1]*Math.PI/180,r=P/2*(360/i),o=r/Math.cos(s),a=r;n.r=nr*this._scale;const h=No.geoCircle(p[0],p[1],o,a,n,!0);n.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else k()};if(this.model.alignToSurface?I():k(),d&&((A=d.get(r,0))&&this._layoutLabel(A,t.dom).transp(l(w.x,w.y,A.bbox(),P,P,_)),(A=d.get(r,1))&&this._layoutLabel(A,t.dom).transp(c(w.x,w.y,A.bbox(),P,P,u))),m&&C&&(M=m.get(r))&&M.setVisible(t._static)){const e=C.flat().map(((t,e)=>t*a[e%2]));m.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],P),M.render(g,r,e,t.getFill())}}}))}}],[yn,class extends ta{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new Wo(this._pointContainer,Na)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.options.imageWidth,s=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),i,s),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(this._second),s=+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(((e,u)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(d=i.getVisible(g)))){const u=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>i.project(t))),d=f[f.length-1]),p.xPos=b=d[0],p.yPos=y=d[1],b*=r[0],y*=r[1],e.render(t),v=e._rBox,_=u(b,y,v.width,v.height),e.trans(_.x,_.y).rotate(s),h&&(w=h.get(p,0))&&w.setVisible(e._static)&&w.layout().transp(o(_.x+v.width/2,_.y+v.height/2,w.bbox(),v.width/2,v.height/2,a)),c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*r[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}],[Rn,class extends ta{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new Wo(this._pointContainer,Wa)}_doPrepeare(t,e,i){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,this._getGrowRate())}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){this.$_layoutPanels(this.doc,this.width,this.height,t)}_getPointPool(){return this._panels}$_preparePanels(t,e){const i=e.length;this._panels.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPanels(t,e,i,s){const r=this.model,n=r.chart.getProjection(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(((u,b)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const b=this._getPointPositioner(y.position||a,"top");let x,v,C,S,L,A;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),g=v[v.length-1]),y.xPos=C=g[0],y.yPos=S=g[1],C*=o[0],S*=o[1],u.render(t,r,e,i,p,s),m=u._rBox,f=b(C,S,m.width,m.height),u.trans(f.x,f.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(f.x+m.width/2,f.y+m.height/2,L.bbox(),m.width/2,m.height/2,c)),_&&v&&(A=_.get(y))&&A.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));m.x=u.tx,m.y=u.ty,_.setMask(A,t).setRects(m),A.render(d,y,t,u.getFill())}}}))}}],[Kn,Ja],[en,class extends ha{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new Wo(t,Aa)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height,1)}_doReset(){}_runShowEffect(t){t&&_a.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.chart.getProjection(this._second),n=[this._scale,-this._scale],o=s.options.position,a=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),h=this._labelViews(),l=s.getLabelOff(),c=s.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,C,S;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(s,t,e,i*f.vrate()),u=g._size,p=m(x,v,u,u),g.trans(p.x,p.y),h&&(C=h.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(a(p.x+u/2,p.y+u/2,C.bbox(),u/2,u/2,l)),d&&w&&(S=d.get(f))&&S.setVisible(f._isStatic())&&S.render(c,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[un,class extends ha{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new Wo(t,ka)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],n=i.options.position,o=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(d=s.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;l&&(y=f.getCallout(b))&&(w=y.map((t=>s.project(t))),d=w[w.length-1]),f.xPos=x=d[0],f.yPos=v=d[1],x*=r[0],v*=r[1],g.render(i,t,e),_=p(t,e),u=m(x,v,_,_),g.trans(u.x,u.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(o(u.x+_/2,u.y+_/2,C.bbox(),_/2,_/2,h)),c&&w&&(S=c.get(f))&&S.setVisible(f._isStatic())&&S.render(l,f,w.flat().map(((t,e)=>t*r[e%2])),null)}}))}}]),ko.register([Pr,da],[Ar,la],[Mr,ca],[Lr,Qa]);class eh extends ut{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 ih extends ut{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class sh extends kt{constructor(t,e,i){super(t,""),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new Do(t,i)),this.add(this.tickLayer=new Vo(t))}getSiblingOf(t){if(this.sibling)for(const e of this.sibling.seriesViews)if(e.model===t.model)return e}prepare(t,e){const i=e.visibleSeries,s=this.seriesMap,r=this.seriesViews,n=this._h1,o=this._h2;r.forEach((t=>{var e,s;i.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(s=t.secondLabelContainer())||void 0===s||s.remove(),this.control.loaded?t.removeLater(200):t.remove())})),r.length=0,i.forEach((e=>{const i=!s[e.hash],a=s[e.hash]||function(t,e){return new(Qo[e._type()])(t)}(t,e);a.parent||(this.add(a),this.labelsContainer.add(a._labelContainer),this.labelsContainer.add(a.secondLabelContainer())),s[e.hash]=a,r.push(a),a._second=this.second,a._h1=n,a._h2=o,i&&(e._optionsDirty=!0),a.prepareModel(t,e)})),this.prevViews&&ht.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 rh extends kt{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new kt(t)),this.add(this._labelLayer=new kt(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,i,s,r)}$_prepareGuides(t,e){const i=this._guideViews,s=e.length;for(;i.length>s;)i.pop().remove();for(;i.length<s;){const e=new $o(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],s,r),n.layout(i)}))}}class nh extends yo{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new hi(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new zo(t)),this.add(this._contentLayer=new kt(t,"rm-body-content")),this.add(this._crosshairView=new Bo(t)),this._contentLayer.add(this._annotationContainer=new kt(t)),this._contentLayer.add(this._axisGuideContainer=new rh(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new rh(t,!1)),this._contentLayer.add(this._seriesContainer=new sh(t,new kt(t),!1)),this._contentLayer.add(this._secondContainer=new sh(t,new kt(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._seriesContainer.sibling=this._secondContainer,this._contentLayer.add(this._frontAxisGuideContainer=new rh(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new rh(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new kt(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]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),(this._seconded=0!=r)?(this._seriesContainer._h1=t+r,this._seriesContainer._h2=s,this._secondContainer._h1=t,this._secondContainer._h2=t+r):(this._seriesContainer._h1=t,this._seriesContainer._h2=s,this._secondContainer._h1=this._secondContainer._h2=NaN),this._h1=t+r,this._h2=s+r}this.$_prepareSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),mo.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=s.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(s._style),o){const{wMap:t,hMap:e,scale:a,tx:c,ty:d}=s.prepareLayout(l,h);this.$_prepareLayoutSeries(i,r),this._transformInfo={tx:c,ty:d,scale:a,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const _=`translate(${c}px, ${d}px) scale(${a}, ${-a})`,u=t*a,p=e*a,g=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-u)/2-s.panX*a,e=(h-p)/2-s.panY*a;this._mapBack.render(this.doc,r,t,e,u,p)}this._secondContainer.visible&&g.push(this._secondContainer),g.forEach((t=>{const e=t.axisView,r=t.tickLayer;e.setScale(a),e.measure(i,n,l,h),e.resize(l,h),e.trans(c,d),r.setVisible(n.tick.visible)&&(r.prepare(i,n.tick,e.steps),r.resize(l,h),r.setScale(a),r.layout(s.projection),r.trans(c,d)),t.seriesViews.forEach((t=>{var e,i;t._scale=a,t.model.needMapScale()?(t._pointLayer.setStyle("transform",_),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:_})):t.trans(c,d),t.move(c,d),t.resize(u,p),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(c,d),null===(i=t.secondLabelContainer())||void 0===i||i.trans(c,d)})),e.layout()}));const m=s._prj,f={map:o,prj:m,tf:this._transformInfo,trans:_,latInterval:n.latInterval,lonInterval:n.lonInterval};this.$_doClipPathLayout(s,m,l,h,a),this._crosshairView.visible&&this._crosshairView.prepare(a,_),this.$_layoutAxisGuides(i,n,f,l,h)}if(this.$_layoutAnnotations(l,h),a&&a.parent&&a.width===l&&a.height===h||(a&&a.dom.remove(),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 eh(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(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,i){function s(s){for(const o of s)o.pointerMoved(t,e,i)&&(r=o,n=o.getPointView(i));if(!n)for(const t of s)if(n=t.getPointView(i),n){r=t;break}return r&&n}if(!this.model)return;let r,n;!s(this._seriesContainer.seriesViews)&&this._secondContainer.visible&&s(this._secondContainer.seriesViews);const o=this.model.chart,a=null==r?void 0:r.model,h=a&&this._owner.getScaleView(o.getColorScale(a.getColorScale()));return(null==n?void 0:n.point)?(this._owner.showTooltip(a,n,this,{x:t,y:e}),null==h||h.setValue(n.point.getValue())):(this._owner.hideTooltip(),null==h||h.setValue(NaN)),this._crosshairView.visible&&o&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!r}seriesByDom(t){return this._seriesContainer.seriesViews.find((e=>e.dom.contains(t)))}showSeries(t){t.visible=!0,this._requestShow=t}hideSeries(t){var e;const i=this.getSeries(t);i&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new ih(i)).start())}mouseToMap(t){const{tx:e,ty:i,scale:s,vx:r,vy:n}=this._transformInfo,o=(t.x-r-e)/s,a=(t.y-n-i)/-s;return this.pointToMap(o,a)}pointToMap(t,e){return this.model.chart.getProjection(!1).backward([t,e])}$_prepareSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(this._seconded)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.visible&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||th(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r);const n=this.model.chart,o={...i,prj:i.prj.second};this._secondFrontAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,o,s,r)),this._secondAxisGuideContainer.setVisible(n.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,o,s,r))}$_doClipPathLayout(t,e,i,s,r){const n=()=>{const i=e.getClipBounds(t.chart.axis.lonInterval,t.chart.axis.latInterval);return`M${i[0][0]},${i[0][1]} L`+i.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.parent&&t.width===i&&t.height===s){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 e=n();t&&t.dom.remove(),this._clipMap=this._contentLayer.clipPath(e),o(this._clipMap),this._clipMap.resize(i,s)}}else this._contentLayer.detachClipPath()}}class oh extends wo{constructor(t,e){super(t,e?oh.SUBTITLE_CLASS:oh.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Me(t)),this._richText=new Re}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var ah;oh.TITLE_CLASS="rm-title",oh.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(ah||(ah={}));class hh extends Pt{constructor(e){super(e,hh.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 Tt(e,"rm-tooltip-back")),this.add(this._top=new Tt(e,"rm-tooltip-top")),this.add(this._textView=new Me(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Mt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new Re,this.close(!0,!1)}show(t,e,i,s,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.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,C=e.getBounds(),S=_.getBounds();let L;L=i-y/2-g(0,p(i-y/2,u-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=ah.TOP;this.drawTooltip(0,0,y,w,A,L),s-=w+v,i=g(0,p(i-=y/2,u-y)),s=g(0,p(s,m-w)),this.transEx(i,s,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:Sr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?H(e,i):{},a=H(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,i,s,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+i-a,e,"Q",t+i,e,t+i,e+a,"L",t+i,e+s-a,"Q",t+i,e+s,t+i-a,e+s,"L",t+a,e+s,"Q",t,e+s,t,e+s-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case ah.TOP:l=l.concat(["M",t+i/2-o/2+n,e+s,"L",t+i/2+n,e+s+o,"L",t+i/2+o/2+n,e+s]);break;case ah.BOTTOM:l=l.concat(["M",t+i/2-o/2+n,e,"L",t+i/2+n,e-o,"L",t+i/2+o/2+n,e]);break;case ah.LEFT:l=l.concat(["M",t+i,e+s/2-o/2+n,"L",t+i+o,e+s/2+n,"L",t+i,e+s/2+o/2+n]);break;case ah.RIGHT:l=l.concat(["M",t,e+s/2-o/2+n,"L",t-o,e+s/2+n,"L",t,e+s/2+o/2+n])}const c=r===ah.BOTTOM,d=c?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(i-u.width)/2,e+=(s-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}hh.CLASS_NAME="rm-tooltip";class lh extends So{constructor(t){super(t,lh.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new kt(t);this.add(e),e.add(this._boxLayer=new kt(t)),this._boxes=new Lo(this._boxLayer,hi,"rm-color-scale-box"),e.add(this._splitLayer=new kt(t)),this._splits=new Lo(this._splitLayer,jo,"rm-color-scale-split"),e.add(this._markerLabel=new bo(t,void 0)),e.add(this._marker=new Tt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new kt(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new kt(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new kt(t,"rm-color-scale-null")),this._tickLines=new Lo(this._tickLineLayer,jo),this._tickLabels=new Lo(this._tickLabelLayer,bo),this._fills=[]}setValue(t){var e,i;e=t,i=this._value,(isNaN(e)?isNaN(i):e===i)||(this._value=t,this.$_resetMarker(this._wBar,this._hBar,this._vertical,this._reversed,this._inverted))}_doMeasure(t,e,i,s){let r=this.chart().isDirty;const n=e.marker,o=e.tick,a=this._tickLen=+o.line.options.length||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.options.reversed,_=this._inverted=e.options.inverted,u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(n,c,d,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==o.options.minVisible),e>1){t.last.setVisible(!1!==o.options.maxVisible);for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==o.options.minVisible),i>1){e.last.setVisible(!1!==o.options.maxVisible);for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-n.x,g-n.y)}$_getFillId(t){return`${lh.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,i){const s=t.createElementNS(e,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(t.createElementNS(e,"stop")),s.appendChild(t.createElementNS(e,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Lt.setAttrs(t,i?lh.VERT_FILL_I:lh.VERT_FILL):Lt.setAttrs(t,i?lh.HORZ_FILL_I:lh.HORZ_FILL)}$_fillStops(t,e,i){const s=t.childNodes[0],r=t.childNodes[1];s.setAttribute("offset","0"),s.setAttribute("stop-color",e.toString()),s.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",i.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,i,s){this._fills.forEach((t=>this.control.removeDef(t)));const r=this._fills=[],n=e.getSteps();if(n){let e=0;n.forEach(((i,s)=>{i._color1&&(r.push(this.$_createGradient(t,e)),r[r.length-1][di]=i,e++)})),r.forEach((t=>{const e=t[di];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(e,((t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))}))}else if(this._boxes.prepare(1),e.minColor){const n=this.$_createGradient(t,0);r.push(n),this.$_setDir(n,i,s),this.$_fillStops(n,e.minColor,e.maxColor),this._boxes.first.setStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new hi(t,"rm-color-scale-box")),e.add(this._nullLabel=new bo(t,"rm-color-scale-tick-label")))}$_layoutSplits(t,e){this._splits.forEach((i=>{this._vertical?i.setHLine(i._userData,0,t):i.setVLine(i._userData,0,e)}))}$_layoutTickLines(t){this._tickLines.forEach((e=>{this._vertical?e.setHLine(e._userData,0,t):e.setVLine(e._userData,0,t)}))}$_resetMarker(t,e,i,s,r){const n=this._markerSize,o=isNaN(this._value),a=this.model.getPosition(this._value);let h,l;a>1&&console.log(this.model.getPosition(this._value)),this._marker.setBoolData("null",o),i?(h=s?t-n+1:n-1,l=(o?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(o?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-n+1:n),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,n=this._inverted,o=this._tickLabelLayer,a=this._tickLabelSize,h=this._markerSize,l=this._tickLen,c=this._stepCount,d=t?t.getGap():0,_=((s?i:e)-d)/(c+(t?1:0)),u=this._nullSize=t?_+d:0;let p=e,g=i,m=0,f=0,b=0,y=0;if(s?(m+=r?a:h,p-=h,y=n?f+u:f,a>0&&(r?o.trans(0,y):o.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(n?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=n?m:m+u,a>0&&(r?o.trans(b,0):o.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((n?i-1-e:e)*_-t.bbox().width/2,0)})),g-=a),g-=l,r&&(f+=l),y=f),this._boxLayer.setBounds(b,y,p,g),1===this._boxes.count?s?this._boxes.get(0).setBounds(0,0,p,g-u):this._boxes.get(0).setBounds(0,0,p-u,g):this._boxes.forEach(((t,e,i)=>{s?t.setBounds(0,(n?e:i-1-e)*_,p,_):t.setBounds((n?i-1-e:e)*_,0,_,g)})),this._splitLayer.visible&&(this._splitLayer.trans(b,y),this.$_layoutSplits(p,g)),this._tickLineLayer.visible&&(s?(r?m-=l:m+=p,this._tickLineLayer.trans(m,y)):(r?f-=l:f+=g,this._tickLineLayer.trans(b,f)),this.$_layoutTickLines(l)),t){let e=_,i=_,r=m,a=f;s?(m=this._boxLayer.tx,r=o.tx,e=p,f=n?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=o.ty,i=g,n&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.options.color&&this._nullBar.setFill(t.options.color),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,n)}}lh.SCALE_CLASS="rm-color-scale",lh.SCALE_FILL="rm-color-scale-fill",lh.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},lh.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},lh.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},lh.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class ch extends Pt{constructor(t,e,i){super(t,ch.STYLE),this.add(this._back=new hi(t,ch.BACK_STYLE)),this.add(this._textView=new Me(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,i){this.internalSetStyleOrClass(i),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),r=getComputedStyle(this._back.dom),n=(new ft).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(n.left+s.width/2,n.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+n.left+n.right,height:s.height+n.top+n.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}ch.STYLE="rm-button",ch.BACK_STYLE="rm-button-background";class dh extends ch{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class _h extends yo{}class uh extends _h{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new dh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new dh(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new dh(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,i,s){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(ui,r<=100),this._btnDec.setBoolData(ui,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 ph extends _h{constructor(t){super(t,"rm-drilldown-panel")}getButton(t){return this._btnBack&&this._btnBack.containsDom(t)&&this._btnBack}click(t){const e=this._textViews;if(e)for(let i=0;i<e.count-1;i++)if(e.get(i).containsDom(t))return this.model.chart.drillup(e.get(i+1)[_i]),!0}_doMeasure(e,i,s,r){let n=this._btnBack,o=0,a=0;if("text"===i.options.type){null==n||n.remove(),this._textViews||(this._textViews=new Lo(this,Me,"rm-drilldown-text"),this._seperators=new Lo(this,Me,"rm-drilldown-separator"));const e=i.chart.firstVisible,s=this._history=e.getHistory();this._textViews.prepare(s.length,((e,i)=>{e.text=s[i].displayName(),e.anchor=t.TextAnchor.START,e[_i]=s[i]})),this._seperators.prepare(s.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),n||this.add(n=this._btnBack=new dh(e,"<",(()=>{i.chart.drillup()}))),n.layout();const t=n.bbox();o=t.width,a=t.height}return{width:o,height:a}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class gh extends So{constructor(t){super(t,gh.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new kt(t);this.add(e),e.add(this._bubbleLayer=new kt(t)),e.add(this._lineLayer=new kt(t)),e.add(this._labelLayer=new kt(t))}_doMeasure(t,e,i,s){const r=e.chart,n=this._steps=e.getSteps(r.width,r.height),o=n.map((t=>t.rd)).reduce(((t,e)=>Math.max(t,e)));let a=0,h=0;return this._checkTitle(t)&&(this._inTitle?a+=this._rTitle.width:h+=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?a+=this._rFooter.width+this._gapFooter:h+=this._rFooter.height+this._gapFooter),this.$_prepareBubbles(t,e,n),this.$_layoutBubbles(2*o,n),this._rScale=this._scaleLayer.bbox(),a+=this._rScale.width,h+=this._rScale.height,{width:a,height:h}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-n.x,g-n.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;Pt.fit(t,this._bubbleLayer,this._bubbles,r,Ma,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Pt.fit(t,this._lineLayer,this._lines,r,jo,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Pt.fit(t,this._labelLayer,this._labels,r,bo,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const n=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-n.rd,n.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.options.length||0);this._lines.forEach(((i,n)=>{const o=e[n];i.setHLine(t-2*o.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.options.length+(i.tick.label.options.offset||0);this._labels.forEach(((s,n)=>{const o=e[n];s.setText(i.tick.label.getText(o.label)),s.trans(r,t-2*o.rd-s.bbox().height/2)}))}}}gh.SCALE_CLASS="rm-bubble-scale";class mh extends So{constructor(t){super(t,mh.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}mh.SCALE_CLASS="rm-map-scale";class fh extends xo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new oh(t,!1)),this.add(this.subtitleView=new oh(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=i,u=0,p=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,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,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.options,o=r&&r.options,a=s&&s.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||s&&"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,i)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},d=()=>{const e=g(this._hTitle,this._hSub);m=g(m,m+t(s,e,this._hTitle)),y=g(y,y+t(r,e,this._hSub))},_=(t,e,i)=>{switch(t.options.align){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},u=()=>{if(f=g(f,f+_(s,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),i.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?s:r,n=a?e:i,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,i){}}class bh extends So{constructor(t){super(t,bh.GROUP_CLASS,"rm-map-widget-group-background"),this.add(this._widgetLayer=new kt(t,"rm-map-widget-group-widget-layer"))}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),n=this._gap=8,o=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new mo;return this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),o.forEach(((r,n)=>r.measure(t,e.getWidget(n),i,s))),r?(o.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),o.length>1&&(a.height+=(o.length-1)*n)):(o.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),o.length>1&&(a.width+=(o.length-1)*n)),this._titleView.visible&&(this._inTitle?a.width+=this._rTitle.width:a.height+=this._rTitle.height),this._footerView.visible&&(this._inFooter?a.width+=this._rFooter.width+this._gapFooter:a.height+=this._rFooter.height+this._gapFooter),a}_doLayout(t){const e=this.model,i=this._titleView,s=this._footerView,r=this._margins,n=this._paddings,o=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+n.left,d=r.top+n.top;let _,u,p=this.width-c-r.right-n.right,g=this.height-d-r.bottom-n.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.options.align){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.options.align){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.options.align){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+o})):a.forEach((t=>{switch(t.model.options.verticalAlign){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+o}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return e.forEach((e=>{let n=null==s?void 0:s.find((t=>t.model===e));n?(r.push(n),s.splice(s.indexOf(n),1)):(n=new(yh[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}bh.GROUP_CLASS="rm-map-widget-group";const yh={legend:Mo,colorScale:lh,bubbleScale:gh,group:bh};class wh extends xo{constructor(t,e){super(t),this._loc=e,this._horz=e==tt.TOP||e==tt.BOTTOM,this._vert=e==tt.LEFT||e==tt.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){return this._views.get(t)}_setWidgets(t,e,i){return r(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof Mo&&e.legendByDom(t);if(i)return i}}_doMeasure(t,e,i,s){const r=this._prepareViews(t,i,s);if(!this.setVisible(r.size>0))return;const n=this._gap=b(+e.chartOptions.options.widgetGap,0),o=new mo;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=g(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=g(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=s.options,n=i.mw,o=i.mh;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).resize(n,o),i.layout()}))}_prepareViews(t,e,i){const s=this._views,r=new Map;this._starts=[],this._ends=[],this._centers=[],this._models.forEach((e=>{let i=s.get(e);i?(r.set(e,i),s.delete(e)):(i=new(yh[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.options.align){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.options.verticalAlign){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class xh extends yo{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Me(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.offsetX||0,n=+t.offsetY||0;let o=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+n;break;default:a=e.y+n}switch(t.align){case"right":o=e.right-i-r;break;case"center":o=e.x+(e.width-i)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,i){const s=t.location,r=this.width,n=this.height,o=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(s){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=i-n-a}if("left"===s||"right"===s)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-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,i,s){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class vh extends kt{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new kt(t,"rm-annotations")),this.add(this._bodyView=new nh(t,this)),this.add(this._titleSectionView=new fh(t)),this.add(this._widgetLayer=new kt(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new kt(t,"rm-front-annotations")),this.add(this._zoomPanelView=new uh(t)),this.add(this._drilldownPanelView=new ph(t)),this.add(this._mapScaleView=new mh(t)),this.add(this._creditView=new xh(t)),this.add(this._tooltipView=new hh(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}getWidgetViews(t,e){return this._widgetMap[t],[]}measure(t,e,i,s){const r=(this._model=e)._credits,n=this._bodyView;let o,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(o=this._creditView.measure(t,r,a,h),e.location){case"body":break;case"right":case"left":a-=o.width+(+e.offsetX||0)+(+e.gap||0);break;default:h-=o.height+(+e.offsetY||0)+(+e.gap||0)}}o=this._titleSectionView.measure(t,e,a,h),h-=o.height,n.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(tt)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new wh(t,r),this._widgetLayer.add(o),this._widgetMap[r]=o);const l=o._setWidgets(n,i,s).measure(t,e,a,h);if(l){const t=e.chartOptions.getWidgetSectionGap(r);r===tt.BOTTOM||r===tt.TOP?h-=l.height+t:r!==tt.RIGHT&&r!==tt.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const n=this._bodyView;let o=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){const t=a.options;h.resizeByMeasured();const e=h.width+(+t.offsetX||0)+(+t.gap||0),i=h.height+(+t.offsetY||0)+(+t.gap||0);switch(a.options.location){case"body":break;case"right":s-=e;break;case"left":s-=e,c+=e;break;case"top":r-=i,d+=i;break;default:r-=l=i}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=o=_.height);const u=this._widgetMap;for(const n in u){const o=u[n];if(o.visible){n===tt.RIGHT||n===tt.LEFT?(o.resize(o.mw,i),o.layout()):n===tt.TOP||n===tt.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.chartOptions.getWidgetSectionGap(n);switch(n){case tt.BOTTOM:r-=o.height+a;break;case tt.TOP:r-=o.height+a,d+=o.height+a;break;case tt.RIGHT:s-=o.width+a;break;case tt.LEFT:s-=o.width+a,c+=o.width+a}}}const p=dt.create(c,d,s,r);if(h.visible){const t=a.options,s="body"===t.location?h.locateInner(t,p):h.locateOuter(t,e,i);h.transp(s)}n.trans(p.x,p.y),n.resize(p.width,p.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case tt.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case tt.TOP:d=o+0,c=(e-s.width)/2;break;case tt.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case tt.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?s.x:r)-this.tx,h=(o?s.y:n)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r);let o;i instanceof za&&(o=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),o||(o=this._model.map.findByCoord(n)),r.coord=n,r.area=null==o?void 0:o.id,r.chart=this._model.wrapper,this._model.click(r)}}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}isAnimating(){}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>{r.get(t.model)||t.remove()})),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||th(t,e);(!1===e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,n,o,a;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)r=-s.left,n=-s.top,o=t+s.left+s.right,a=e+s.top+s.bottom;else r=n=0,o=t,a=e;i._layoutView(this,r,n,o,a)}))}$_layoutPanel(t,e){const i=t.model.options,s=i.offsetX||0,r=i.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.align){case"right":a+=e.width-s-n;break;case"center":a+=(e.width-n)/2+s;break;default:a+=s}t.trans(a,h)}}var Ch;!function(t){t.EXPORT="$$realmap_export"}(Ch||(Ch={}));class Sh extends Mt{constructor(t,e){super(t,e),this.addElement(this._chartView=new vh(t)),this.addElement(this._loadingView=new lo(t)),this.addElement(this._errorView=new Me(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new ao(null,((t,e)=>{this.changeModel(t,e)}))}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this._export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i})}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Ch.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}showLoadingView(){this._loadingView.visible=!0}hideLoadingView(){this._loadingView.visible=!1}showErrorView(e="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=t.TextLayout.MIDDLE,this._errorView.text=e,this._errorView.stain();const{width:i,height:s}=this._errorView.bbox(),r=16+i/2,n=16+s/2;this._errorView.trans(r,n)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new go(this)}_doBeforeRender(t){var e,i;(null===(i=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===i?void 0:i.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const i=this.model,s=this._chartView,r=t.width,n=t.height;if(this.$_renderLoadingView(r,n),i.options.chart&&(this._setBackgroundStyle(i.options.chart.backgroundStyle),i&&(this.setDomResize(i.chartOptions.options.domResize),i.prepareRender(),this._loadModules()),this.loaded||s.clean(),s.measure(this.doc(),i,r,n),s.setRect(t),s.layout(),i&&i.afterRender(),null===(e=this._chart)||void 0===e?void 0:e._loadCallback)){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_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 i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e.options.exporting)}}$_renderLoadingView(t,e){const i=Sh.LOADING_VIEW_LENGTH;this._loadingView.layout({width:i,height:i});const s=t/2+20-i/2,r=e/2+20-i/2;this._loadingView.trans(s,r)}}Sh.LOADING_VIEW_LENGTH=128;const Lh={chartControl:Sh};class Ah{static getVersion(){return"1.0.12"}static setLicenseKey(t){wt.code=t}static setDebugging(t){Pt.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static getDistance(t,e){return ht.getDistance(t,e)}static setGlobals(t){Object.assign(Lh,t)}static createChart(t,e,i,r=!0,n){S.loadConfigAsync(i,!0);const o=new Lh.chartControl(t,e);return s(i)&&o.chart.load(i,r,n),o.chart[oo]=o,o.chart}static async createChartAsync(t,e,i,r=!0,n){const o=new Lh.chartControl(t,e);o.chart[oo]=o;try{o.showLoadingView(),await S.loadConfigAsync(i),s(i)&&o.chart.load(i,r,n)}catch(t){console.error(t),o.showErrorView(null==t?void 0:t.message)}finally{o.hideLoadingView()}return o.chart}static preset(t,e){return sr.createStockInset(t,e)}}class Mh{constructor(){this._moduleMap=new Map}static getInstance(){return Mh.instance||(Mh.instance=new Mh),Mh.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Mh.instance=null,Mh.ModuleNames={realchart:"realchart"};const Ph=Ah.getVersion,kh=Ah.setDebugging,Ih=Ah.setLogging,Nh=Ah.setGlobals,Th=Ah.getDistance,Eh=Ah.createChart,Vh=Ah.createChartAsync,Dh=Ah.preset,Rh=Ah.setLicenseKey;t.Annotation=ni,t.AnnotationView=ko,t.BandSeriesType="band",t.BarSeries=Wr,t.Body=io,t.BodyView=nh,t.BubbleSeries=is,t.ChartAnnotationType="chart",t.ChartControl=Sh,t.ChartElement=yo,t.ChartItem=Fe,t.ChartObject=no,t.ChartView=vh,t.CircleElement=Ma,t.CircleGauge=en,t.ClockGauge=un,t.Color=Ce,t.ColorRanger=ds,t.Credits=Je,t.DataPoint=Li,t.DataPointLabel=Pi,t.Dom=Lt,t.DragTracker=_o,t.ElementPool=Lo,t.Exporter=Cs,t.ExternalModuleManager=Mh,t.FeatureSeriesType="feature",t.FigureSeries=mn,t.HeatmapSeriesType="heatmap",t.HtmlAnnotation=Lr,t.ImageAnnotation=Ar,t.ImageSeries=yn,t.LayerElement=kt,t.Legend=ls,t.LineElement=jo,t.LineSeries=Cn,t.MapArea=ur,t.MapAxis=$s,t.MapAxisBandGuide=Es,t.MapAxisGuide=Ns,t.MapAxisLineGuide=Ts,t.MapAxisRangeGuide=Vs,t.MapChart=ao,t.MapCrosshair=Rs,t.MapSeries=In,t.MapSeriesType="map",t.MapTool=go,t.MarkerSeries=Wi,t.MarkerSeriesPoint=Hi,t.MarkerSeriesPointView=ea,t.MarkerSeriesView=ia,t.ORG_ANGLE=N,t.OrthogonalSparkSeries=Ki,t.PI_2=I,t.PanelSeries=Rn,t.PathElement=Tt,t.PieSeries=Bn,t.PinSeries=jn,t.PointElement=qo,t.PointLabelView=Yo,t.PointSeries=Wn,t.PointViewPool=Wo,t.PolyLineElement=Go,t.RAD_DEG=E,t.RectElement=hi,t.RmElement=Pt,t.RouteSeries=Un,t.RouteSeriesType=ai,t.SankeySeriesType="sankey",t.SectionView=xo,t.SectorElement=xa,t.Series=Fi,t.SeriesAnimation=_a,t.SeriesView=ta,t.ShapeAnnotation=Mr,t.Size=mo,t.SparkSeries=Ui,t.Subtitle=Cr,t.TableSeriesType="table",t.TextAnnotation=Pr,t.TextElement=Me,t.TiledWebSeriesType="tiledweb",t.Title=vr,t.TrackSeriesType="track",t.Utils=ht,t.ValuePoint=ji,t.ValueSeries=Gi,t.VectorSeriesType="vector",t.WaffleSeries=Kn,t._isIE=at,t.absv=m,t.assignObj=l,t.calcPercent=Y,t.copyObj=f,t.cos=_,t.createChart=Eh,t.createChartAsync=Vh,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=Oe,t.fixnum=D,t.getDistance=Th,t.getVersion=Ph,t.incv=v,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=s,t.isString=o,t.maxv=g,t.minv=p,t.parsePercentSize=W,t.pickNum=b,t.pickProp=w,t.pickProp3=x,t.pixel=O,t.preset=Dh,t.rectToSize=ct,t.setDebugging=kh,t.setGlobals=Nh,t.setLicenseKey=Rh,t.setLogging=Ih,t.sin=u}));
|