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.mjs
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
|
-
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=Object.assign,l=Math.floor,c=Math.ceil,d=Math.cos,_=Math.sin,u=Math.min,p=Math.max,g=Math.abs,m=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},f=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},y=function(t,e){return void 0!==t?t:e},w=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},x=(t,e,i)=>t+(e-t)*i;class v{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}v._debugging=!1;class C{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(s(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=s(t.map)?t.map:[t.map];for(const t of r)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const r=s(t.series)?t.series:[t.series];for(const t of r)!i(t.data)&&!s(t.data)&&n(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 S={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 L=S.ko;const A=void 0,M="%".charCodeAt(0),k=Math.PI,P=2*k,I=-k/2,N=k/180,E=180/k;function T(t){return t>P?t%P:t}function V(t){return parseFloat(t.toPrecision(12))}function D(t){return t*Math.PI/180}function R(t){return 180*t/Math.PI}function $(t){return t+"px"}function O(t){return t+"%"}function F(t){return null==t||Number.isNaN(t)||""===t}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const i={};return i[t]=e,i}function H(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)===M&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;X(L.invalidSizeValue,t)}}return{size:s,fixed:i}}function W(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const Y={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"},Z=function(t){const e=Y[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Y[t]=e,e}return e};var U;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(U||(U={}));const X=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),i=f(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const Q={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},tt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const et="undefined"!=typeof navigator?navigator.userAgent:"",it=et?navigator.appVersion:"",st=!!et.match(/Trident.*rv\:11\./),rt=-1!==it.indexOf("MSIE 10"),nt=-1!==it.indexOf("MSIE 9"),ot=st||rt||nt;class at{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&&at.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(u(i,at.month_days[at.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-tt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=s(t)?[]:{};for(let i of Object.keys(t))e[i]=at.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(),at.log(t,+new Date-i+"ms")}static clamp(t,e,i){return p(e,u(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=p(e,t)),isNaN(i)||(t=u(i,t)),t}static makeIntArray(t,e){const i=new Array(p(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,i){const s=g(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*N,s=(e[1]-t[1])*N,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*N)*Math.cos(e[0]*N)*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=u(e,t[s]),i=p(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||s(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}}at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.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 ht=Object.freeze({x:0,y:0,width:0,height:0}),lt=function(t,e,i,s){return{x:t,y:e,width:i,height:s}};function ct(t){return{width:t.width,height:t.height}}function dt(t){return t.width<=0||t.height<=0}class _t{static create(t,e,i,s){const r=arguments.length;return at.isObject(t)?new _t(t.x,t.y,t.width,t.height):r<2?new _t(t,t,t,t):r<3?new _t(t,e,t,e):new _t(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 _t(this.x,this.y,this.width,this.height)}getInner(){return new _t(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}_t.Empty=new _t,_t.Temp=new _t;const ut={inOutSine:t=>-(d(k*t)-1)/2};class pt{constructor(){this.delay=0,this.duration=pt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=u(1,p(0,V(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=f(t,pt.DURATION),this.delay=e||0,this._easing=ut[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}}pt.DURATION=700,pt.SHORT_DURATION=300;let gt=0;class mt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(gt++))}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 ft extends mt{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 bt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new bt(t,t,t,t):new bt(t,t,e,e):new bt(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 bt(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=f(t.paddingLeft,0),this.right=f(t.paddingRight,0),this.top=f(t.paddingTop,0),this.bottom=f(t.paddingBottom,0),this}applyMargin(t){return this.left=f(t.marginLeft,0),this.right=f(t.marginRight,0),this.top=f(t.marginTop,0),this.bottom=f(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}var yt;bt.Empty=Object.freeze(new bt),bt.Temp=new bt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(yt||(yt={}));const wt={name:"RealMap",version:"1.0.11",license:"enterprise",code:""},xt={name:"RealMap",version:"1.0.11",license:"enterprise",code:null};class vt{static decode(t){const e=vt.CHARS,i=vt.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}}vt.PAD="=",vt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ct{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=Ct.xor,s=Ct.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=Ct.xor,s=Ct.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=Ct.kb,s=Ct._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*Ct.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=Ct._decryptBlock;let s=Ct._init(e),r=[],n=vt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ct.POW24|n[a+1]*Ct.POW16|n[a+2]*Ct.POW8|n[a+3],h.right=n[a+4]*Ct.POW24|n[a+5]*Ct.POW16|n[a+6]*Ct.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)}}Ct.POW2=Math.pow(2,2),Ct.POW3=Math.pow(2,3),Ct.POW4=Math.pow(2,4),Ct.POW8=Math.pow(2,8),Ct.POW16=Math.pow(2,16),Ct.POW24=Math.pow(2,24),Ct.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 St{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=Ct.decrypt(t,"dkdl"+this._getLDKey(Ct.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 Lt=651212;class At{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;)At.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-"+Lt++}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){v.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){!ot&&t.setAttribute("vector-effect","non-scaling-stroke")}}const Mt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class kt extends mt{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=xt.code||realMapLic,!e)return!1}catch(t){return!1}const i=St.decrypt(e);if("RealMap"!=i.name||"RealMap"!==wt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(wt.license!=yt.Developer&&!St.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(yt).includes(n))return!1;if(wt.code=i.code,wt.license=i.lic,n==yt.Evaluation||n==yt.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||kt.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),At.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(){At.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(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}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(e,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=e.getElementById(i),this._container instanceof HTMLDivElement||X(L.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(t,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Nt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(e,i){let s=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");s.setAttribute("id",kt.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=At.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()}at.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()}}kt.CLASS_NAME="rm-control",kt.SHADOW_FILTER="rm-shadow-filter",kt._animatable=!0;class Pt extends mt{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(e,i,s=A){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,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(e,i){const s=e.createElementNS(t,i);return this._dom.appendChild(s),s}insertElement(e,i,s){const r=e.createElementNS(t,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 B(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return _t.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=at.isValidNum(t)?t:this._tx,e=at.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=at.isValidNum(t)?t:this._tx,e=at.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&&at.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.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!==A&&(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(Z(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(Z(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(Z(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(Z(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){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let i=!1;if(t){for(let s in t)if(s in Mt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(f(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Mt){const i=Mt[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 Mt||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 Mt&&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]=y(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const 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=[];(at.isValidNum(e)||at.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),at.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")");const r=at.getNum(this._scaleX,1),n=at.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 It extends Pt{constructor(t,e=void 0){super(t,e,"g")}}class Nt extends Pt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Et 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=n(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=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Vt extends Pt{constructor(t){super(t,A,"mask");const e=this._id=at.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Dt extends Pt{constructor(t){super(t,A,"clipPath");const e=this._id=at.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 Et(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 Ft="shuffle",Bt="random";var zt;class jt{constructor(t){this.source=t}hasDef(){return!0}}class Gt extends jt{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),o=this.source.color,a=F(this.source.opacity)?1:this.source.opacity,h=s(o)?o[0]:o,l=s(o)&&o.length>1?o[1]:"white",c=s(a)?a[0]:a,d=s(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(r),i.appendChild(n)}}class Ht extends Gt{getElement(e,i){const s=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,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}}Ht.TYPE="lineargradient";class Wt extends Gt{getElement(e,i){const s=e.createElementNS(t,"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(e,s),s}}Wt.TYPE="radialgradient";class Yt extends jt{getElement(e,s){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,l,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=zt.STOCK[+s.pattern%zt.STOCK.length];a=t.path,l=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(s.pattern)&&(a=s.pattern,c=s.width||s.height||20,d=s.height||s.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),l&&h(o.style,l),s.style&&h(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const i=e.createElementNS(t,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}zt=Yt,Yt.TYPE="pattern",Yt.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}],Yt.SELECT=Object.assign(zt.STOCK[4],{id:"rm-selected-area-fill",pattern:zt.STOCK[4].path,transform:"scale(0.5)"});class Zt extends jt{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===Bt?this._index=-1:(t.mode===Ft&&at.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=s(e.colors)?e.colors:[]}}Zt.TYPE="colors";class Ut extends jt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Ut.SIZE,height:e.height||e.width||Ut.SIZE})}}Ut.TYPE="images",Ut.SIZE=20;class Xt{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new Yt(Yt.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(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Yt.TYPE:s(t.colors)?e=Zt.TYPE:s(t.images)&&(e=Ut.TYPE)),e)switch(e.toLowerCase()){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);case Ut.TYPE:return new Ut(t)}}}}const Kt="0".charCodeAt(0),qt="#".charCodeAt(0),Jt=",".charCodeAt(0),Qt="s".charCodeAt(0),te="a".charCodeAt(0);class ee{static getFormatter(t){let e=ee.Formatters[t];return e||(ee.Formatters[t]=e=new ee(t)),e}static get Default(){return ee.getFormatter(ee.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){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)===Kt;)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)===Kt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Jt){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===Qt){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===te){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}ee.DEFAULT_FORMAT="",ee.Formatters={};const ie=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],se=[".","/","-",":"],re="Z".charCodeAt(0),ne="z".charCodeAt(0),oe="A".charCodeAt(0),ae="a".charCodeAt(0),he="y".charCodeAt(0),le="M".charCodeAt(0),ce="m".charCodeAt(0),de="W".charCodeAt(0),_e="w".charCodeAt(0),ue="d".charCodeAt(0),pe="H".charCodeAt(0),ge="h".charCodeAt(0),me="S".charCodeAt(0),fe="s".charCodeAt(0);class be{static getFormatter(t){let e=be.Formatters[t];return e||(be.Formatters[t]=e=new be(t)),e}static get Default(){return be.getFormatter(L.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||L.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 he:s+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case le:s+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case ue:s+=a>1?z(t.getDate()):t.getDate();break;case de:s+=a>1?z(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case _e:s+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case pe:s+=a>1?z(t.getHours()):t.getHours();break;case ge:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?z(e):e}else s+=a>1?z(t.getHours()):t.getHours();break;case ce:s+=a>1?z(t.getMinutes()):t.getMinutes();break;case fe:s+=a>1?z(t.getSeconds()):t.getSeconds();break;case ae:case oe:t.getHours()<12?s+=L.am:s+=L.pm;break;case me:let i=t.getMilliseconds();s+=3==a?j(i):2==a?z(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(se.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),ie.indexOf(n)<0){let e=n.charCodeAt(0);(e>=oe&&e<=re||e>=ae&&e<=ne)&&X(L.invalidDateFormat,t)}e.push(n)}if(r<s&&at.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&at.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||L.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}be.Formatters={};const ye=["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"],we=["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 xe{static create(t){return n(t)?new xe(t):void 0}static isBright(t){return new xe(t).isBright()}static getContrast(t,e,i){return new xe(t).getContrast(e,i)}static interpolate(t,e,i){const s=new xe(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(at.startsWith(t,"rgb(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(at.startsWith(t,"rgba(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(at.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{xe.COLORS[t]&&this.$_parseNumber(xe.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 xe(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 ve,Ce,Se;xe.COLORS=function(){const t={};for(let e=0;e<ye.length;e++)t[ye[e]]=we[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ve||(ve={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Ce||(Ce={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Se||(Se={}));class Le extends Pt{constructor(t,e=A){super(t,e,"text"),this._layout=Ce.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.bbox(),i=this.getAscent(isNaN(t)?e.height:t);let s;switch(this._layout){case Ce.MIDDLE:s=Math.floor(i/2);break;case Ce.BOTTOM:s=i-e.height;break;default:s=Math.ceil(i)}this.setAttr("y",s)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=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(xe.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 Ae="$_TH",Me="$_TW";class ke{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]?ee.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?be.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),A),0===this._literals[2].length&&(this._literals[2]=A)}else this._literals.push(r,n,A,A);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Pe extends ke{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 Ie 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 Ne={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:Ie};class Ee{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 ke).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 Ne){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 Ne[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 Ve{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,r,n,o){const a=e.doc,h=f(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];e.clearDom(),n=n||e;const u=e.getStyle("writing-mode"),g=u===K||u===q;for(let s=0;s<c;s++){const r=l[s];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,_=s===c-1&&h===r.words.length-1,b=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(i(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[Me]=y.width,b[Ae]=y.height,g?(u=p(u,b[Me]),m+=b[Ae]):(u+=b[Me],m=p(m,b[Ae])),f||(f=b),l instanceof Ie){const i=a.createElementNS(t,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),e.appendDom(i)}}_.push(f),r[Ae]=m*h,r[Me]=u*h,d.push(0==s?r[Me]/2:r[Me])}if(c>0){let t=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(g?null!=_[i-1]&&(s=Math.floor(t[Me]-e.getAscent(t[Me]))+e.getAscent(l[i][Me])):r=t[Ae]-e.getAscent(t[Ae])+e.getAscent(l[i][Ae]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=e.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[Me]=n.width,r[Ae]=t[Ae]=n.height,_[0]=r}switch(u){case K:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case q:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}t=l[i]}if(g){const t=e.parent.dom.classList.contains("rm-annotation"),i=e.bbox().width,[s]=_,r=s[Me];if(t)s.setAttribute("dx",String(u===q?i-r/2:r/2));else switch(u){case K:s.setAttribute("x",String((i-r)/-2));break;case q:s.setAttribute("x",String((i-r)/2))}}else e.layoutText(l[0][Ae])}}layout(t,e,i,s,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===K||h===q)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=ve.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=ve.END,a=n.height-r.bottom;break;default:t.anchor=ve.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=ve.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=ve.END,o=i-r.right;break;default:t.anchor=ve.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(Te);for(let t of i)e.push((new Ee).parse(t))}}}let De=0;const Re=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},$e=function(t,e){const r=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];s(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):i(n)?r[t]=$e(r[t],n):r[t]=n}return r};class Oe extends mt{constructor(t){super(),this.chart=t,De++}_init(){const t=this._op=$e({},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 s=this,r=this._op;return void 0===t||this._doSetSimple(r,t)||$e(r,t),this.$_applyOptions(r),i(t)&&function(t){if(s._children)s._children.forEach((e=>t.hasOwnProperty(e)&&s[e].updateOptions(t[e])));else{s._children=[];for(const e in s){const i=s[e];i instanceof Oe&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0){if(this[t]instanceof Oe)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]=!a(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,i=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;e.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),i&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=$e({},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 Oe&&(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 s=this._op.style;if(i(t)){let i=!1;s||(s=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),s[e]!==r&&(void 0===r?delete s[e]:s[e]=r,i=!0)}i&&(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 r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Oe?t[r]=this[r]._load(n):s(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):i(n)?t[r]=Object.assign({},n):t[r]=n)}}_doSetSimple(t,e){if(a(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`]=H(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){e.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let r=t[e];this._doLoadProp(e,r)||(this[e]instanceof Oe?this[e].updateOptions(r):s(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):i(r)?this[e]=h({},r):this[e]=r)}}_doPrepareRender(t,e){}_doAfterRender(){}}Oe.REFRESHED="refreshed",Oe.defaults={visible:!0};class Fe{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 Be extends Oe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=f(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?ee.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 Ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(at.isValidNum(t)){const s=this._numSymbols&&e&&at.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;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(at.isValidNum(t)){const n=this._numSymbols&&e&&at.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}}Be.defaults=Re(Oe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ze extends Be{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 Ut&&(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 Ut?i.getImage(s):s}return this._root+t}}}ze.defaults=Re(Be.defaults,{iconPosition:"default",iconGap:2});class je extends Oe{}je.defaults=Re(Be.defaults,{});class Ge extends ze{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return f(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}Ge.defaults=Re(ze.defaults,{display:"auto"});class He extends Oe{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 je(this.chart))._init(),t.title=(this._title=new Ge(this.chart))._init(),t.footer=(this._footer=new Ge(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=y(e.location,"bottom")}}He.defaults=Re(Oe.defaults,{offsetX:0,offsetY:0});class We extends He{}class Ye extends He{_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}}Ye.defaults=Re(He.defaults,{direction:"vertical"});class Ze extends Fe{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._map[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(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,r=this._items=[],n=this._map={};if(s(t))t.forEach(((t,i)=>{r.push(this.$_loadItem(e,t,i))}));else if(i(t))r.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const i={};a(t)&&(i.visible=t),r.push(this.$_loadItem(e,i,0))}r.forEach((t=>{t.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 Ue extends Ze{_collectionProp(){return"widgetGroup"}_createWidget(t){return new Ye(t)}}class Xe extends We{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Xe.defaults=Re(He.defaults,{});class Ke extends Oe{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Ke.defaults=Re(Oe.defaults,{text:"RealMap v1.0.11",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"}),Je=.001,Qe=Math.PI;class ti{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=u(-s/2,i/2,r),["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=u(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=u(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=T(g(n-r)),l=2*Qe-h<.01,c=h-Qe<.01?0:1,u=o?1:0,p=d(r),m=_(r),f=d(n-=l?u?Je:-.001:0),b=_(n),y=[];return y.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=T(g(o-n)),l=2*Qe-h<Je;let c=h-Qe<Je?0:1;const u=a?1:0,p=d(n),m=_(n),f=d(o-=l?u?Je:-.001:0),b=_(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-u,t+y*p,e+w*m),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*_(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*d(r),o+h*_(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*_(r),"L",n+l*d(r+p),o+c*_(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=ti[e](0,0,2*i,2*s);break;default:r=ti.circle(i,s,u(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const ei={minimumZoom:200,maximumZoom:1600},ii={};class si extends Oe{static register(...t){t.forEach((t=>{ii[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=W(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=W(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(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`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){}}si.defaults=Re(Oe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class ri extends Fe{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 si)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};s(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(r,t,i,e))})):i(t)&&n.push(this.$_loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}$_loadItem(t,e,i,s){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a._init(),a.index=i,a._load(e),a}}const ni="route",oi="map",ai="feature",hi="vector",li="heatmap",ci="tiledweb",di="track",_i="band",ui="table",pi="sankey";class gi extends Pt{static create(t,e,i,s,r,n,o=0){return new gi(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 mi={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 fi{constructor(t,e){}}const bi="_model_",yi="_tag_",wi="disabled",xi="rm-legend-item-marker",vi=Object.freeze([0,0]);function Ci(t){return isFinite(t[0]+t[1])}function Si(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function Li(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=u(e,...t),i=u(i,...o),s=p(s,...t),r=p(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const Ai="@_rm_state_",Mi="@_rm_add_",ki="@_rm_update_",Pi="@_rm_delete_";let Ii=0;const Ni=[0,0];class Ei{constructor(t){this.source=t,this.inset=Ni,this.pid=Ii++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.coordOfArea(this.id)||vi),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[Ai]=t:delete this[Ai]}_isAdding(){return this[Ai]===Mi}_isUpdating(){return this[Ai]===ki}_isDeleting(){return this[Ai]===Pi}_isStatic(){const t=this[Ai];return t!==Mi&&t!==Pi}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){}_readObject(t,e){var i;if(this.id=y(t._idFielder(e),e.id),this.name=y(t._nameFielder(e),e.name),this.color=y(t._colorFielder(e),e.color),this.className=e.className,s(e.coord))this.coord=e.coord.slice(0,2);else if(n(e.coord)){const t=e.coord.split(/s\+/);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const 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)||vi),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=s(e.callout)&&this.$_parseCallout(e.callout),s(this.callout)||(this.offset=s(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),s(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(s(t))e.push(t.slice(0,2));else if(n(t)){const i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class Ti{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Vi={};class Di extends ze{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return r(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}}Di.defaults=Re(ze.defaults,{visible:!0,position:"auto",distance:25});class Ri extends Oe{}Ri.defaults=Re(Oe.defaults,{shape:"circle",radius:2.5});class $i extends Oe{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new Ri(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}$i.defaults=Re(Oe.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class Oi{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 Fi extends pt{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 Bi extends pt{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 zi extends Fi{_init(t){super._init(t),t._setState(Mi)}}class ji extends Fi{_init(t){super._init(t),t._setState(Pi),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Gi extends Fi{_init(t){super._init(t),t._setState(ki)}}class Hi extends Bi{_init(t){t.forEach((t=>{t._setState(Mi),t._setVrate(0)}))}}class Wi extends Bi{_init(t){t.forEach((t=>{t._setState(Pi),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class Yi extends Bi{_init(t){t.forEach((t=>{t._setState(ki),t._setVrate(0)}))}}class Zi extends Oe{static register(...t){t.forEach((t=>{Vi[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 Ti(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new Oi(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new $i(this))._init()}_createLabel(t){return new Di(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?Zi.defaultTooltipText:null:t}}getTooltipParam(t,e,i){return Zi.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=at.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 f(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}coordOfArea(t){var e,i;return mi[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 zi(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 r,n;if(!s(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 Hi(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=(r=this._op).onPointListAdded)||void 0===n||n.call(r,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,a;o(t)?t=this._points.get(t):n(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new ji(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===(a=(r=this._op).onPointRemoved)||void 0===a||a.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];o(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Wi(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(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points.get(t)),t instanceof Ei&&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 Gi(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 Yi(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 Ei&&(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 a,h,l,c=this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;r(i)?a=i:s(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))||c})):l instanceof Zt?(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 r(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(t){this._idFielder=this._createFielder(t.idField),this._nameFielder=this._createFielder(t.nameField),this._colorFielder=this._createFielder(t.colorField)}_createLegendMarker(t,e){return gi.create(t,xi,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 fi);else if(s(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:u(s,e),i=isNaN(i)?s:p(s,i))})),{min:e,max:i}}}Zi.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",Zi.defaults=Re(Oe.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:Zi.defaultTooltipText,loadAnimation:"default",hoverEffect:"default",legend:0});class Ui extends Fe{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},s(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):i(t)&&this.$_loadItem(r,t,0),r.options.series=this._items.map((t=>t.options))}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(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 Zi?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,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 Xi extends Ei{_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:x(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class Ki extends Zi{_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")}}Ki.defaults=Re(Zi.defaults,{valueField:"value"});class qi extends Xi{}class Ji extends Ki{}Ji.defaults=Re(Ki.defaults,{});class Qi extends Xi{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=s(this.values)?this.values.reduce(((t,e)=>t+f(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=s(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ts{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return gi.create(t,xi,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class es extends Ki{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 s(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(s(t))return t.map((t=>new ts(t.name,t.color)))}}es.defaults=Re(Ki.defaults,{position:"top"});class is extends Qi{}class ss extends es{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Oe(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=at.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=f(this._minValue,i.min),e=f(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 f(W(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=f(+t.width,ss.DEF_WIDTH),this._height=f(+t.height,ss.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}ss.DEF_WIDTH=80,ss.DEF_HEIGHT=50,ss.defaults=Re(es.defaults,{width:ss.DEF_WIDTH,height:ss.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class rs extends Xi{}class ns extends Ki{_doApply(t){super._doApply(t),this._width=f(+t.width||+t.size||+t.height,ns.DEF_SIZE),this._height=f(+t.height||+t.size||+t.width,ns.DEF_SIZE)}}ns.DEF_SIZE=60,ns.defaults=Re(Ki.defaults,{size:ns.DEF_SIZE});class os extends ns{getValueRate(t){return(f(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=f(this._minValue,1/0),i=f(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=u(e,s),i=p(i,s))})),this._min=e,this._max=i}}os.defaults=Re(ns.defaults,{minValue:10});class as extends qi{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class hs extends Di{}hs.defaults=Re(Di.defaults,{visible:!1});class ls extends Ji{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new hs(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,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 f(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 as(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=u(t,n)),isNaN(s)&&(e=p(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}ls.type="bubble",ls.defaults=Re(Ji.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class cs extends Oe{}cs.defaults=Re(Xe.defaults,{length:10});class ds extends ze{getText(t){return at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}ds.defaults=Re(Xe.defaults,{offset:4});class _s extends Oe{_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=Re(Xe.defaults,{});class us extends Xe{_doInit(t){super._doInit(t),t.tick=(this._tick=new _s(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof ls){let{min:n,max:o}=s.getPixelMinMax(u(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=f(i.minRadius,10),e=f(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(s(t)&&t.length>0){const s=this.tick.label;t.forEach((t=>{i(t)?e.push({value:+t.value,label:t.label||s.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:s.getText(+t),rd:0})}))}return e}}us.defaults=Re(Xe.defaults,{});class ps extends Ze{_collectionProp(){return"bubbleScale"}_createWidget(t){return new us(t)}beforeRender(){this._collectVisibles()}}class gs extends Oe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}gs.MARKER_SIZE=10;class ms extends We{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 W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(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=H(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=H(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new gs(this,t))),e.reversed&&(this._items=this._items.reverse())}}ms.defaults=Re(He.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:gs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class fs extends Ze{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new ms(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class bs{constructor(t){this._color1=xe.create(t.minColor),this._color2=xe.create(t.maxColor),this._logger=at.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 xe.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return w(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class ys extends Oe{_doInit(t){t.label=(this._label=new Be(this.chart))._init()}get label(){return this._label}getMarkerSize(){return f(this._op.size,7)}}ys.defaults=Re(Oe.defaults,{size:7});class ws extends Oe{}ws.defaults=Re(Oe.defaults,{length:6});class xs extends ze{getDefaultIconPos(){}}xs.defaults=Re(ze.defaults,{});class vs extends Oe{_doInit(t){t.line=(this._line=new ws(this.chart))._init(),t.label=(this._label=new xs(this.chart))._init()}get line(){return this._line}get label(){return this._label}}vs.defaults=Re(Oe.defaults,{});class Cs{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||gs.MARKER_SIZE;return gi.create(t,xi,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 xe.interpolate(i,s,(t-r)/(n-r)).toString();return w(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class Ss extends Oe{}Ss.defaults=Re(Oe.defaults,{});class Ls extends Oe{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return f(+this._op.gap,0)}}Ls.defaults=Re(Oe.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const As="#fff",Ms=xe.create("#000");class ks extends Xe{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new ys(e))._init(),t.stepLine=(this._stepLine=new Ss(e))._init(),t.tick=(this._tick=new vs(e))._init(),t.nullStep=(this._nullStep=new Ls(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)),xe.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?W(this._barLengthDim,e):e,s=f(this._op.barWidth,12)):(s=this._barLengthDim?W(this._barLengthDim,t):t,r=f(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=f(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=f(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=f(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=xe.create(t.minColor||As),this._maxColor=t.maxColor&&xe.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(s(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:xe.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:xe.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=at.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)||Ms,this._steps=this.$_buildSteps()}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>l(t/e)*e?t=l(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),V(t)}$_parseColor(t){return t&&t.endsWith("%")?xe.interpolate(this._minColor,this._endColor,parseFloat(t)/100):xe.create(t)}$_buildSteps(){const t=this._op,e=t.steps,i=[],r=this._min,n=this._max;let o=r,a=n;if(this._valueSteps=null,s(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 Cs(h,l,c,d,s.label))})),this._logger=null}else if(o>=a)i.push(new Cs(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,s=i?Math.max(0,1-o):0,h=this._valueSteps=[],l=Math.max(1,f(t.stepCount,1));if(t.integralSteps)i&&(o=i(o),a=i(a)),h.push(...at.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(V(h[e-1]+t));h.push(V(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]-=s,t.integralSteps||(h[0]=r,h[l]=n)}}return i.length>1?i:void 0}}ks.defaults=Re(Oe.defaults,{display:"scale",minColor:As,layout:"auto",barWidth:12,barLength:"40%"});class Ps extends Ze{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 ks(t)}beforeRender(){this._collectVisibles()}}class Is extends Oe{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)}}Is.defaults=Re(Oe.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ns extends Oe{_doSetSimple(t,e){return at.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Ns.defaults=Re(Oe.defaults,{});class Es extends Oe{_doInit(t){t.line=(this._line=new Ns(this.chart))._init(),t.lonLine=(this._lonLine=new Ns(this.chart))._init(),t.latLine=(this._latLine=new Ns(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,b(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,b(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}}Es.defaults=Re(Oe.defaults,{visible:!1,fitTo:"map"});class Ts extends Oe{}Ts.defaults=Re(Oe.defaults,{visible:!1});class Vs extends Oe{}Vs.defaults=Re(Oe.defaults,{visible:!1});class Ds extends Be{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||Ds.defaults.dirSymbols}}Ds.defaults=Re(Be.defaults,{dirSymbols:"NSEW",suffix:"°°"});class Rs extends Oe{_doInit(t){t.line=(this._line=new Vs(this.chart))._init(),t.label=(this._label=new Ds(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,b(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,b(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=s(t.positions)?t.positions:[]}}Rs.defaults=Re(Oe.defaults,{visible:!1,positions:["top","right"],interval:1});class $s extends ze{getDefaultIconPos(){return"left"}}$s.defaults=Re(ze.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Os extends Oe{_doInit(t){t.label=(this._label=new $s(this.chart))._init()}get label(){return this._label}}Os.defaults=Re(Oe.defaults,{front:!0,zindex:0});class Fs extends Os{}Fs.defaults=Re(Os.defaults,{});class Bs extends Os{}Bs.defaults=Re(Os.defaults,{});class zs extends Os{}zs.defaults=Re(Os.defaults,{});class js extends Oe{}js.defaults=Re(Oe.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Gs extends Oe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new js(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=ee.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 r(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Gs.defaults=Re(Oe.defaults,{visible:!1});class Hs extends Oe{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new Ts(this.chart))._init(),this.options.leftLine=(this._leftLine=new Ts(this.chart))._init(),this.options.rightLine=(this._rightLine=new Ts(this.chart))._init(),this.options.topLine=(this._topLine=new Ts(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new Ts(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new Ts(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new Ts(this.chart))._init(),this.options.grid=(this._grid=new Es(this.chart))._init(),this.options.tick=(this._tick=new Rs(this.chart))._init(),this.options.crosshair=(this._crosshair=new Gs(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),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(s(e)?e:[e]))}this._lonInterval=Math.max(1,b(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,b(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new zs(this.chart):"line"===t.type?new Fs(this.chart):"band"===t.type?new Bs(this.chart):new Fs(this.chart),i._init(),i._load(t),e.push(i)}))}}function Ws(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 Ys(t,e){let i=!1;Ws(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Ws(t,e[s])&&(i=!i);return i}Hs.defaults=Re(Oe.defaults,{interval:5});class Zs{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 Zs(o,this.capacity),new Zs(a,this.capacity),new Zs(h,this.capacity),new Zs(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 Us{constructor(t,e){var i;this.worldBBox=t,this.root=new Zs(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 Ys(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(Ys(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const Xs="37630",Ks={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"},qs={area:Xs,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"},Qs={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"},tr={area:Xs,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"},er={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"},ir={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},sr={area:"HI",coord:[-126,21],frame:"0.5 0.5"},rr={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 nr{constructor(t){this.id=t}}class or extends nr{constructor(t,e){super(t),this.props=e}}class ar extends or{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=Li(this.polygons[t]),r=Li(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 hr{constructor(t,e,i){this.name=t,this.closed=i,s(e)&&e.length>=2&&(this.border=[at.makeArray(e[0]),at.makeArray(e[1])])}}class lr extends nr{constructor(t,e){super(t),this.polygon=e}}class cr extends mt{static createStockInset(t,e){let s,r=!1;switch(t){case"제주":case"제주도":s=Ks;break;case"제주_B":case"제주도_B":s=Ks,r=!0;break;case"울릉":case"울릉도":s=qs;break;case"울릉_B":case"울릉도_B":s=qs,r=!0;break;case"백령":case"백령도":s=Js;break;case"백령_B":case"백령도_B":s=Js,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=Qs;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=Qs,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=tr;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=tr,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=er;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=er,r=!0;break;default:switch(t.toLowerCase()){case"alaska":s=ir;break;case"hawaii":s=sr;break;case"okinawa":s=rr;break;case"okinawa_b":s=rr,r=!0}}return s&&(a(e)?s=Object.assign({visible:e},s):i(e)&&(s=Object.assign({},s,e)),r&&s.border&&delete s.frame),s}constructor(t,e){var r,o,a;super(),this._excludes={};const h=null!==(r=t.source)&&void 0!==r?r:t.map,l=t.insets,c=s(l)?l:i(l)||n(l)?[l]:void 0;this.name=t.name,this.enabled=y(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==h?void 0:h.meta)?at.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=J(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this._excludes={},s(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},c&&c.length>0&&c.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?cr.createStockInset(t.substring(1),!1):cr.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:s(t.polygons)?t.polygons.slice():s(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:s(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&at.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new hr(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 dr{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 _r=90,ur=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class pr extends dr{constructor(){super(),this._rotation=[0,0],this._r=_r,this.bounds={x1:-90,x2:_r,y1:-90,y2:_r},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=ur(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=ur(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;ur(-90-t),ur(90-t),ur(90+e),ur(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*N,r=[Math.cos(s)*Math.sin(e*N)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/_r,i=t[1]/_r,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)/N,Math.asin(s&&i*n/s)/N];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}_rotate(t){const e=this._rotation[0]*N,i=(this._rotation[1]||0)*N,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]*N+e,h=t[1]*N,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)/N,Math.asin(u*n+d*o)/N]}_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 gr extends cr{static loadMap(t,e){if(i(t)){const r=t.source;if(i(r)&&"Topology"===r.type&&i(r.objects)&&s(r.arcs))return new gr(t,e);const n=t.map;if(i(n)&&"Topology"===n.type&&i(n.objects)&&s(n.arcs))return new gr(t,e)}}_doLoad(t,e){const r=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>r(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(i(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const i=d[t].geometries;if(s(i)&&i.forEach((t=>{const e=new or(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=r(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};s(e.excludeInternal)?e.excludeInternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),at.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};s(e.excludeExternal)?e.excludeExternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),at.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 or&&(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 lr(r.name,e))}}e.push(...s)}}function mr(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*N,a=t[0]*N,h=e[1]*N,l=e[0]*N,c=h-o,d=l-a,_=r(c/2)*r(c/2)+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/N,p/N])}}return m}function fr(t,e){const i=t._base,r=t.off;let o,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof wr?o=i:i[0]>=0&&(l=e.readBounds(i),h=r||h)}if(n(t.frame)&&t.frame.length>0){const e=J(t.frame);let{h1:i,v1:s,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=u(i,o[t].h1),s=u(s,o[t].v1),n=p(n,o[t].h2),a=p(a,o[t].v2);const c=i+h[0]-e.l,d=n+h[0]+e.r,_=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,_],[d,_],[d,g],[c,g]],t.bounds=r?{h1:c-r[0],h2:d-r[0],v1:g-r[1],v2:_-r[1]}:{h1:c,h2:d,v1:g,v2:_}}else if(a=t.border){let e,c;if(n(a)){let{h1:t,v1:i,h2:s,v2:r}=o?o[0]:l;if(o)for(let e=1;e<o.length;e++)t=u(t,o[e].h1),i=u(i,o[e].v1),s=p(s,o[e].h2),r=p(r,o[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else s(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=r?{h1:l.h1-r[0],h2:l.h2-r[0],v1:l.v1-r[1],v2:l.v2-r[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const br=Math.min,yr=Math.max;class wr extends mt{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=br(i,t[0]+e[0]),s=yr(s,t[0]+e[0]),r=br(r,t[1]+e[1]),n=yr(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,r=t.offset;let n=[0,0];return s(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),s(r)&&r.length>0&&(n[0]+=f(r[0],0),n[1]+=f(r[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=br(o,i[0]),a=yr(a,i[0]),h=br(h,i[1]),l=yr(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=mr(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){mr(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=br(e,t[0]),i=yr(i,t[0]),s=br(s,t[1]),r=yr(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=br(e,t[0]),i=yr(i,t[0]),s=br(s,t[1]),r=yr(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=br(e,t[0]),i=yr(i,t[0]),s=br(s,t[1]),r=yr(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=br(t,e[0]),s=br(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,vi)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,vi))):this.$_readBound(this.source.polygon,vi),i=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,vi))):this.$_readBound(this.source.polygon,vi);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,vi)}))):(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?vi:i),e.externals&&this.$_readExternal(t,this._insetChilds?vi: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 wr;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class xr extends mt{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 vr extends mt{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 vr)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new Us({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,s(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof gr&&this.source.internals}get hasExternals(){return this.source instanceof gr&&this.source.externals}get hasBorders(){return this.source instanceof gr&&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&&Si(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 pr)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=_r,this.y2=_r;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=br(i,c.h1),s=yr(s,c.h2),r=br(r,c.v1),n=br(90,yr(n,c.v2)),o=br(o,c.x1),a=yr(a,c.x2),h=br(h,c.y1),l=yr(l,c.y2),c.mainLandBounds={x1:c.x1,x2:c.x2,y1:c.y1,y2:c.y2},this.$_updateMainAreaBounds(c))})),this.source instanceof cr){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=yr(-180,i),this.v1=yr(-90,r),this.h2=br(180,s),this.v2=br(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=br(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=yr(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=br(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=yr(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,r=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",a=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._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 or){const s=y(e.props[r],e.id);if(s&&t.included(s)){const t=i[s],r=new wr(e,t);t&&(delete i[s],t._area=r,_.push(t)),h&&h.indexOf(s)>=0?(l.unshift(r),r.dummy=!0):l.push(r),c[r.id=s]=r,r.name=y(e.props[n],e[n])}}else if(e instanceof lr){const t=new xr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(o(e.polygons)||s(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const r=c[t[i]];if(r){const n=e.polygons[i];r.inset=e,r._insetChilds=s(n)?n:[n],e._parent=t[i],e._base=r._insetChilds,e._area=r,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=s(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(s(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],r=e._children=[];if(s(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=br(t,r.h1),s=br(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 s of e.children){const e=c[s];if(e){const n=e.inset={area:s,offset:i};t.push(e),n._area=e,r.push(n)}}_.push(e)}}if(a&&!isNaN(+t.dokdo)){const e=c[a.group];e&&(e.source=new ar(e.source,+t.dokdo,+a.index,+a.parent))}this.reset(),_.forEach((t=>fr(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 vr(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Cr extends ze{getText(t){return at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Cr.defaults=Re(Xe.defaults,{offset:4});class Sr extends Xe{_doInit(t){super._doInit(t),t.label=(this._label=new Cr(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}}Sr.defaults=Re(Xe.defaults,{visible:!1});class Lr extends Oe{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Lr.ITEM_GAP}}Lr.ITEM_GAP=4,Lr.defaults=Re(Oe.defaults,{offsetX:8,offsetY:8,itemGap:3});class Ar extends Lr{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:Ar.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:Ar.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)}}Ar.BUTTON_SIZE=24,Ar.defaults=Re(Lr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Mr extends Lr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Mr.defaults=Re(Lr.defaults,{type:"text",align:"left",verticalAlign:"top"});class kr extends mt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,s=!1){let r;return s&&(r=this.clear()),t&&i(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const 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 Pr extends Oe{isVisible(){return this.visible&&!F(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Pr.defaults=Re(Oe.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Ir extends Pr{}Ir.defaults=Re(Pr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Nr extends Oe{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=y(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?ee.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?be.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Nr.defaults=Re(Oe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});const Er="chart";class Tr extends si{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&&!B(this._op.html)}_doSetSimple(t,e){return n(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},at.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}}Tr.DEF_SIZE=100,Tr.type="html",Tr.defaults=Re(si.defaults,{width:Tr.DEF_SIZE});class Vr extends si{_isVisible(){return this._op.visible&&!B(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}Vr.type="image",Vr.defaults=Re(si.defaults,{});class Dr extends si{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||Dr.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Dr.type="shape",Dr.defaults=Re(si.defaults,{width:64,height:64,shape:"square"});class Rr extends si{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!B(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?ee.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?be.getFormatter(t):void 0)}(t.timeFormat)}}Rr.type="text",Rr.defaults=Re(si.defaults,{text:"Text"});class $r extends dr{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 Or=1.340264,Fr=-.081106,Br=893e-6,zr=.003796,jr=Math.sqrt(3)/2,Gr=74.03120656864502;class Hr extends dr{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=N,i=Math.asin(jr*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)*Gr/(jr*(Or+3*Fr*s+r*(7*Br+9*zr*s))),i*Gr*(Or+Fr*s+r*(Br+zr*s))]}backward(t){const e=t[0]/Gr,i=t[1]/Gr,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*(Or+Fr*r+n*(Br+zr*r))-i,a=Or+3*Fr*r+n*(7*Br+9*zr*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*jr*e*(Or+3*Fr*r+n*(7*Br+9*zr*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/jr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const Wr=63.78137,Yr=Math.PI/180;class Zr extends dr{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*Yr);return[Wr*(t[0]+this.offset[0]-this.scroll)*Yr,Wr*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(Wr*Yr),(2*Math.atan(Math.exp((t[1]-this.offset[1])/Wr))-Math.PI/2)/Yr]}}const Ur=Math.PI/4,Xr=Math.PI/180,Kr=63.78137;class qr extends dr{project(t){return[(t[0]+this.offset[0]-this.scroll)*Xr*Kr,79.7267125*Math.log(Math.tan(Ur+.4*(t[1]+this.offset[1])*Xr))]}backward(t){return[(t[0]-this.offset[0])/Kr/Xr,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/Kr*.8))-Ur)/Xr]}}class Jr extends is{}class Qr extends ss{_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 Jr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return gi.create(t,xi,0,0,e,e,2)}}Qr.type="bar",Qr.defaults=Re(ss.defaults,{barWidth:.7,overflow:!1,barOrder:"normal"});class tn extends Oe{constructor(t){super(t.chart),this.gauge=t}}class en extends tn{}en.defaults=Re(Oe.defaults,{visible:!1});class sn extends tn{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}sn.defaults=Re(Oe.defaults,{});class rn extends tn{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}rn.defaults=Re(Oe.defaults,{thickness:"100%",stroked:!1});class nn extends tn{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}nn.defaults=Re(Oe.defaults,{visible:!1,radius:3,length:"100%",offset:0});class on extends tn{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}on.defaults=Re(Oe.defaults,{visible:!1,radius:5});class an extends Be{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}an.defaults=Re(Be.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class hn{constructor(){this.setCenterX(cn.DEF_CENTER),this.setCenterY(cn.DEF_CENTER),this.setRadius(cn.DEF_RADIUS),this.setInnerRadius(cn.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=H(y(t,cn.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=H(y(t,cn.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(y(t,cn.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=H(y(t,cn.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=H(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),i=u(e,this._innerDim?W(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?W(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=f(t%360,0),s=p(0,u(360,f(e,360)));this._startRad=I+N*i,this._handRad=N*i,this._sweepRad=N*s}}class ln extends rs{_readObject(t,e){super._readObject(t,e)}}class cn extends os{_doInit(t){super._doInit(t),t.face=(this._face=new en(this))._init(),t.rim=(this._rim=new sn(this))._init(),t.valueRim=(this._valueRim=new rn(this))._init(),t.hand=(this._hand=new nn(this))._init(),t.pin=(this._pin=new on(this))._init(),t.gaugeLabel=(this._gaugeLabel=new an(this.chart))._init(),this._props=new hn}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 ln(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)}}cn.DEF_CENTER="50%",cn.DEF_RADIUS="50%",cn.DEF_INNER="80%",cn.type="gauge",cn.defaults=Re(os.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class dn extends Oe{constructor(t){super(t.chart),this.gauge=t}}class _n extends dn{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}_n.defaults=Re(Oe.defaults,{thickness:3});class un extends dn{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}un.defaults=Re(Oe.defaults,{thickness:1.5,length:"55%"});class pn extends un{}pn.defaults=Re(un.defaults,{thickness:1,length:"80%"});class gn extends un{}gn.defaults=Re(un.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class mn extends dn{}mn.defaults=Re(Oe.defaults,{length:5});class fn extends dn{}fn.defaults=Re(Oe.defaults,{step:1,offset:0});class bn extends dn{}bn.defaults=Re(Oe.defaults,{radius:4});class yn extends Be{}yn.defaults=Re(Be.defaults,{text:"RealMap",position:"top"});class wn extends rs{getTime(){const t=this.time;return t instanceof Date?t:n(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=f(e.time,NaN),this.timezone=f(e.timezone,NaN)}}class xn extends ns{_doInit(t){super._doInit(t),t.face=(this._face=new Oe(this.chart))._init(),t.rim=(this._rim=new _n(this))._init(),t.hourHand=(this._hourHand=new un(this))._init(),t.minuteHand=(this._minuteHand=new pn(this))._init(),t.secondHand=(this._secondHand=new gn(this))._init(),t.tick=(this._tick=new mn(this))._init(),t.tickLabel=(this._tickLabel=new fn(this))._init(),t.pin=(this._pin=new bn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new yn(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=u(t,e)*i;return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new wn(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=H(y(e._centerX=t,xn.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=H(y(e._centerY=i,xn.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=H(y(e._radius=s,xn.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}xn.DEF_CENTER="50%",xn.DEF_RADIUS="50%",xn.type="clock",xn.defaults=Re(ns.defaults,{centerX:xn.DEF_CENTER,centerY:xn.DEF_CENTER,radius:xn.DEF_RADIUS,active:!0,size:70});class vn extends qi{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Cn extends Ki{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Di(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 vn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}Cn.type="figure",Cn.defaults=Re(Ki.defaults,{position:"top"});class Sn extends Di{}Sn.defaults=Re(Di.defaults,{visible:!1});class Ln extends Ei{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class An extends Zi{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Sn(t)}_createPoint(t){return new Ln(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+="/")}}An.type="image",An.defaults=Re(Zi.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Mn extends Pt{constructor(t,e){super(t,xi),this.add(this._area=new Et(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Et(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 kn extends is{}class Pn extends Oe{}Pn.defaults=Re(ss.defaults,{visible:!1});class In extends ss{_doInit(t){super._doInit(t),t.area=(this._area=new Pn(this.chart))._init()}get area(){return this._area}_createPoint(t){return new kn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Mn(t,e)}}In.type="line",In.defaults=Re(ss.defaults,{});class Nn extends Xi{_readObject(t,e){super._readObject(t,e),this.center=e.center}getLabel(t){var e;return this.name||(null===(e=this.area)||void 0===e?void 0:e.name)}getParam(t){return this.area?y(super.getParam(t),this.area.source.props[t]):super.getParam(t)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class En extends Di{}En.defaults=Re(Di.defaults,{visible:!1,hoverColor:"white"});class Tn extends Oe{}Tn.defaults=Re(Oe.defaults,{enabled:!0,autoMapChange:!0});class Vn extends Oe{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return n(e)?(t.name=e,!0):super._doSetSimple(t,e)}}Vn.defaults=Re(Oe.defaults,{});class Dn extends Oe{constructor(t,e){super(e.chart),this.name=t,this.series=e}}Dn.defaults=Re(Oe.defaults,{visible:!1});class Rn extends Ki{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Tn(this.chart))._init(),t.internalBorder=(this._internalBorder=new Dn(null,this))._init(),t.externalBorder=(this._externalBorder=new Dn(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 Nn||(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 En(t)}$_createDetail(){return this._detail||(this._detail=new Rn(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){if(this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),e.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(s(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new Nn(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var r;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:s(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,i(e.colorRange)){const t=m(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new bs(t)}else this._colorRanger=null===(r=t.getColorScale(this._op.colorScale))||void 0===r?void 0:r.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(s(t)?t[0]:t)||"id",r=(s(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[r]]:o[t.source[r]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new xe(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new Vn(t.name,this);i._init(),i._load(t),e.push(i)}))}}Rn.type="map",Rn.defaults=Re(Ki.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class $n extends Di{}$n.defaults=Re(Di.defaults,{visible:!1});class On extends Xi{}class Fn extends Oe{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 Ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}Fn.defaults=Re(Oe.defaults,{});class Bn extends Fn{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Bn.defaults=Re(Fn.defaults,{text:"${name}"});class zn extends Fn{}zn.defaults=Re(Fn.defaults,{text:"${value}"});class jn extends Ki{_doInit(t){super._doInit(t),t.header=(this._header=new Bn(this))._init(),t.divider=(this._divider=new Oe(this.chart))._init(),t.body=(this._body=new zn(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:f(this._width,at.clampEx(t,this._minWidth,this._maxWidth)),height:f(this._height,at.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new $n(t)}_createPoint(t){return new On(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}}jn.DEF_MIN_WIDTH=80,jn.DEF_MIN_HEIGHT=50,jn.type="panel",jn.defaults=Re(Ki.defaults,{orientation:"vertical",minWidth:jn.DEF_MIN_WIDTH,minHeight:jn.DEF_MIN_HEIGHT,position:"top"});class Gn extends Qi{}class Hn{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class Wn extends es{getRadius(t){return f(W(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 Gn(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=f(e.startAngle%360,0),s=p(0,u(360,f(e.totalAngle,360)));this._startRad=I+N*i,this._totalRad=N*s}$_parseThresholds(t){return s(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new Hn(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new Hn(t.value,t.radius,t.style)]:void 0}}Wn.type="pie",Wn.defaults=Re(es.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class Yn extends Et{constructor(t,e){super(t,xi),this._rd=e,this.setPath(ti.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 qi{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class Un extends Ji{getExt(t,e){const i=f(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=f(t.radius,Un.DEF_RADIUS),this._innerRd=f(t.innerRadius,0)}_createPoint(t){return new Zn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new Yn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new xe(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()}}Un.DEF_RADIUS=9,Un.type="pin",Un.defaults=Re(Ji.defaults,{radius:Un.DEF_RADIUS,innerRadius:0,position:"top"});class Xn extends Pt{constructor(t,e){super(t,xi),this._size=e,this.add(this._marker=new Et(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);ti.setShape(this._marker,this._shape,e,e)}}class Kn extends qi{_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 qn extends Ji{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(){return this._op.shape||this._shape}getRadius(){return f(this._op.radius,qn.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new Kn(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 Xn(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),u(e,2*this._op.radius)),i}}qn.type="point",qn.defaults=Re(Ji.defaults,{radius:5,position:"center"});class Jn extends Pt{constructor(t,e){super(t,xi),this.add(this._line=new Et(t)),this.add(this._arrow=new Et(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=R(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class Qn extends Ei{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return h(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,r;const o=function(t){let e=[];return s(t)?t.forEach((t=>{s(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(r=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==r?r:[],this.path=null!=e.path?o(e.path):void 0}}class to extends Zi{needMapScale(){return!0}_createPoint(t){return new Qn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(s(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const i=h({},t);if(s(i.coords)){const t=i.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new Jn(t,e)}}to.type=ni,to.defaults=Re(Zi.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class eo extends Qi{}class io extends es{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 eo(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||io.ROW_COUNT,this._colCount=t.colCount||io.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||io.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||io.CELL_SIZE,this._gap=f(t.gap,io.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=s(t.values)?t.values.reduce(((t,e)=>t+f(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*f(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}}io.ROW_COUNT=10,io.COL_COUNT=10,io.THRESHOLD=1,io.CELL_SIZE=5,io.GAP=2,io.type="waffle",io.defaults=Re(es.defaults,{rowCount:io.ROW_COUNT,colCount:io.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:io.THRESHOLD,cellSize:io.CELL_SIZE,gap:io.GAP});class so extends cr{static loadMap(t,e){return i(t)&&i(t.source)&&s(t.source.features)||i(t)&&i(t.map)&&s(t.map.features)?new so(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new or(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 ro extends pt{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=f(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 no extends pt{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=f(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 oo extends Oe{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}oo.defaults=Re(Zi.defaults,{visible:void 0,globeFill:"lightblue"});const ao={zoom:1,panX:1,panY:1};class ho extends Oe{constructor(t){super(t),this._prj=(new $r).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new ri(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new oo(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 pr?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof pr?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,_=f(this._op.panX*d,0),u=f(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,b=c/d*a,y=c/d*l,w=s.x1+a/2-b/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=_t.create(w,x,b,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,_=f(this._op.panX*d,0),u=f(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,b=l/d*h,y=s+a/2-m/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=_t.create(y,w,m,b),{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 s,n;o(e)?n=e:r(e)?(s=e,n=300):i(e)&&(s=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new ro(this,t,n,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new no(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={...ei,...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 no(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 no(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 ao;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 ao)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o,a;const h=this;var l;super._doApply(t),e.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new pr;break;case"equalearth":h._prj=(new Hr).prepareSecond();break;case"miller":h._prj=(new qr).prepareSecond();break;case"mercator":h._prj=(new Zr).prepareSecond();break;default:h._prj=(new $r).prepareSecond()}return!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof pr&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,f(t,100)))}(t.zoom);const u=this._points={};s(t.points)&&t.points.forEach((t=>{s(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=s(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}ho.defaults=Re(Oe.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class lo extends Rn{}class co extends Oe{constructor(){super(...arguments),this._widgetGaps=new bt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}co.defaults=Re(Oe.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class _o extends ft{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 Xt,this._series=new Ui(this),this._annotations=new ri(this),this._widgetGroups=new Ue(this),this._legends=new fs(this),this._colorScales=new Ps(this),this._bubbleScales=new ps(this),(this._chartOptions=new co(this))._init(),(this._axis=new Hs(this))._init(),(this._body=new ho(this))._init(),(this._exporter=new Is(this))._init(),(this._title=new Pr(this))._init(),(this._subtitle=new Ir(this))._init(),(this._zoomPanel=new Ar(this))._init(),(this._drilldownPanel=new Mr(this))._init(),(this._mapScale=new Sr(this))._init(),(this._credits=new Ke(this))._init(),(this._tooltip=new Nr(this))._init(),this.options=Object.assign({},_o.defaults),i(t)?this._load(t):this._initOptions(),this._selection=new kr(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 n(t)&&Vi[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ii[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 $r).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 vr?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 Rn))}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 Rn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}requestRender(t){this._fireEvent("onRequestRender",t)}mapByName(t){return this._maps.find((e=>e&&e.name===t))}mapAt(t){return this._maps[t]}getMap(t){return n(t)?this.mapByName(t):this.mapAt(+t)}getSeries(t){return o(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}_collectWidgets(){const t={};for(const e of Object.values(Q))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(Q)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&$e(n={},r.base),i(r[s])&&(n||(n={}),$e(n,r[s])),n?$e(n,t):t}_setProperties(t,e=!0){const i=this.options;for(const e in _o.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(y(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const r=s(t.map)?t.map:i(t.map)?[t.map]:null;return s(r)&&(r.forEach(((t,e)=>{if(!1!==t.enabled){const i=gr.loadMap(t,e)||so.loadMap(t,e),s=i&&new vr(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,lo),this._series.get(0)instanceof Rn||!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(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=h({},s))}["@series","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return $e($e({},i),t)}else s(e)&&e.forEach((e=>{let i=this._templates[e];return i?$e($e({},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(i(t)){this._setProperties(t,!1);for(const e in t){const i=this[e];(i instanceof Oe||i instanceof Fe||i instanceof Xt)&&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 Rn&&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 Rn&&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 r(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 We){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()})}}_o.defaults={type:"map",startOfWeek:0},Zi.register(Rn,qn,Un,Qr,Wn,Cn,ls,to,An,In,jn,io,cn,xn),si.register(Vr,Dr,Rr,Tr);const uo="$ctrl";class po{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new _o(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 n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart ";at.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new _o(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",De),at.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,s){var r;if(!i(t))return this;const n=this[uo];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const i="load chart ";at.LOGGING&&console.time(i),await C.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new _o(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",De),at.LOGGING&&console.timeEnd(i),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 Rn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof Rn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof Rn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Rn&&this._obj.drillup(e)}}class go extends Pt{constructor(t,e,i){super(t,i,"image"),this._dirty=!0,this._bounds=ht,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 mo extends Pt{constructor(t,e){super(t,mo.STYLE),this._spinnerWrapper=new Pt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new go(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=mo.LOADING_SPINNER,this._spinner.width=mo.SPINNER_LENGTH,this._spinner.height=mo.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-mo.SPINNER_LENGTH/2,t.height/2-mo.SPINNER_LENGTH/2)}}mo.STYLE="rm-loading-indicator",mo.BACK_STYLE="rm-loading-background",mo.SPINNER_LENGTH=64,mo.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class fo{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?U.DOWN:n>135&&n<=225?U.LEFT:n>225&&n<=315?U.UP:U.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 bo extends mt{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 yo extends bo{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class wo extends bo{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 xo extends fo{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof wo&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=ot?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 Ei){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/f(Math.max(1,e.options.wheelZoomFactor),4),t.preventDefault(),!0}}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,i){const s=this.$_chart();return s.isGlobe?new yo(this.control):s.body.isScrollable()||s.body.movable?new wo(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 Nn&&t.drilldown(t.firstMapSeries,n.point.area.id)}}}class vo{static empty(){return new vo}static create(t=0,e=0){return new vo(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 vo(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+"}"}}vo.EMPTY=new vo;class Co extends Pt{constructor(t,e=A){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Co.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Co.IGNORE_ATTRS={width:"",height:""};class So extends Co{constructor(t,e){super(t,e),this.add(this._text=new Le(t,void 0)),this._text.anchor=ve.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 gi(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 Le(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 go(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=xe.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._icon;let e=0;const i=this._text.bbox(),s=i.width,r=i.height;let n,o=s,a=r,h=0,l=0,c=0,d=0;if(this._box=void 0,t){const i=t.bbox();switch(e=f(this._model.options.iconGap,0),h=i.width,l=i.height,this._model.getIconPos()){case"left":case"right":o+=e+h,a=Math.max(l,r);break;default:a+=e+l,o=Math.max(h,s)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),c=parseFloat(n.paddingLeft)||0,d=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,o+c+(parseFloat(n.paddingRight)||0),a+d+(parseFloat(n.paddingBottom)||0),n.rx)),t)switch(this._model.getIconPos()){case"left":t.trans(c,(a-l)/2),c+=h+e,o-=h+e;break;case"right":t.trans(c+o-h,(a-l)/2),o-=h+e;break;case"top":t.transX((o-h)/2),d+=l+e;break;case"bottom":t.trans((o-h)/2,d+r+e)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":c+=o/2,this._text.anchor=ve.MIDDLE;break;case"right":c+=o,this._text.anchor=ve.END;break;default:this._text.anchor=ve.START}return this._text.trans(c,d),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,d)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Lo extends Pt{constructor(t,e=A){super(t,e,"g"),Pt.DEBUGGING&&(this.add(this._debugRect=new gi(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 gi(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 Ao extends Lo{constructor(t,e,i){super(t,e),this._margins=new bt,this._paddings=new bt,this.add(this._background=new gi(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 Co{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 ko extends So{constructor(t){super(t,"rm-map-widget-title")}}class Po extends So{constructor(t){super(t,"rm-map-widget-footer")}}class Io extends Ao{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new ko(t)),this.add(this._footerView=new Po(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 No extends mt{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 Eo extends Lo{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new gi(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Le(t,"rm-legend-item-label")),this._label.anchor=ve.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():ht,n=ct(this._label.bbox());return this._gap=f(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:p(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=f(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 To extends Io{constructor(t){super(t,To.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new No(this,Eo)}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=f(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,k=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=k,"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 g,m,f,b;h.forEach(((e,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||gs.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=[],g=m=0,_.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=p(i,t.mw),r=p(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=p(m,s),g+=i,u.push(i),this._wMarkers.push(r)})),g+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%s===0?(_.push(f=[b]),g=b.mw,w++,y++):(g+=l+b.mw,g<=r?(f.push(b),w++,y++):w=0);g=m=0,_.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=p(i,t.mh)})),e+=l*(t.length-1),g=p(g,e),m+=i,u.push(i)})),m+=c*(_.length-1)}return 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),{width:g,height:m}}}To.LEGEND_CLASS="rm-legend";const Vo={};class Do extends Ao{static register(...t){t.forEach((t=>{Vo[t[0].type]=t[1]}))}constructor(t,e){super(t,Do.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)}}Do.CLASS_NAME="rm-annotation";class Ro{static interpolate(t,e){if(e instanceof pr==!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=mr(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 $o{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($o.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($o.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 pr?Ro.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 Oo extends Et{renderLat(t,e,i,s,r){let n=r.project([e,t]),o=Ci(n)?`M${n[0]},${n[1]}`:"";if(r.latElliptic){let a=e+s;const h=t=>{n=r.project(t),Ci(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=Ci(n)?`M${n[0]},${n[1]}`:"";if(r.lonElliptic){let a=e+s;const h=t=>{n=r.project(t),Ci(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 Fo extends Lo{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new No(this,Oo),this._lonPool=new No(this,Oo)}_doInitStyles(){this.ignorePointer()}prepare(t){this._latPool.prepare((t.y2-t.y1)/t.latStep+1,null,(t=>{At.setNoScale(t.dom)})),this._lonPool.prepare((t.x2-t.x1)/t.lonStep+1,null,(t=>{At.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 vo.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;At.setImportantStyle(this.dom.style,"pointer-events","none"),At.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 Bo extends It{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new It(t,"rm-axis-tick-labels")),this._labelPool=new No(this._labelLayer,Le)}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 zo extends Lo{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Fo(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)),vo.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 jo extends So{}class Go extends Lo{constructor(t,e){super(t),this.add(this._pathView=new Et(t)),e.add(this._labelView=new jo(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof zs?"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 Et(this.doc)),this.add(a=this._toView=new Et(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=$o.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=$o.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return $o.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(...$o.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath($o.coordsToPath(_.map((t=>r.project(t))))),a.push(...$o.verticalLineToUp(d,h,l,o));const u=$o.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath($o.coordsToPath(u.map((t=>r.project(t))))),a.push(...$o.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(...$o.verticalLineToUp(o,l,c,n));const d=[...a],_=$o.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath($o.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath($o.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return $o.coordsToPath($o.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=$o.ellipse(t[0],t[1],e,i,s)}else r=$o.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);Ci(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);Ci(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);Ci(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);Ci(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class Ho extends Co{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new gi(t,"rm-crosshair-flag-back")),this.add(this._text=new Le(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 Wo extends Lo{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Oo(t,"rm-crosshair-line")),this.add(this._lonLine=new Oo(t,"rm-crosshair-line")),At.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),At.setImportantStyle(this._latLine.dom.style,"fill","none"),At.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),At.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Ho(t)),this.add(this._lonFlag=new Ho(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 pr?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 pr;_?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 pr;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 Yo="rm_map_globe_fill";class Zo extends Et{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=ti.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof pr)){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=ti.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(Yo),a){const e={id:Yo,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Wt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${Yo})`),this.internalSetStyleOrClass(e._style),i}}class Uo extends Et{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){at.isNum(t)?this.setPath(ti.line(t,e,i,s)):t&&this.setPath(ti.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(ti.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(ti.line(t,e,t,i))}setHLine(t,e,i){this.setPath(ti.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(ti.line(e,t,i,t))}}class Xo extends Et{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){at.isNum(t[0])?this.setPath(ti.lines(...t)):s(t[0])?this.setPath(ti.lines3(...t)):this.setPath(ti.lines2(...t))}}var Ko;class qo extends No{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Jo extends So{constructor(t){super(t,"rm-point-label")}}class Qo extends It{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new No(this,Jo),new No(this,Jo)],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 ta extends Co{constructor(t){super(t),this.add(this._line=new Xo(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Et(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Et(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(ti.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=oa.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 ea extends Vt{constructor(t){super(t),this.add(this._back=new gi(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Et(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(ti.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(ti.rect(t).concat(ti.rect(e))):this._mask.setPath(ti.rect(t)),this}}class ia extends It{constructor(t,e){super(t,e),this._callouts=new No(this,ta),this._map={},this.add(this._maskLayer=new It(t)),this._masks=new No(this._maskLayer,ea),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 sa extends Tt{constructor(t,e=!1){super(t,oa.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 ra extends It{}const na={};class oa extends Lo{static register(...t){t.forEach((t=>{na[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof Ko)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>ti[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 It(t)),this._pointLayer.add(this._pointContainer=new ra(t,"rm-series-points")),this.add(this._calloutContainer=new ia(t,"rm-series-callouts")),i&&(this._labelContainer=new Qo(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 Rn?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 Rn||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 f(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&at.log("CLICKED: ",t.point.name,t.point.getValue())}}Ko=oa,oa.POINT_CLASS="rm-point",oa.DATA_HOVER="hover",oa.DATA_UNHOVER="unhover",oa.LEGEND_MARKER="rm-legend-item-marker",oa._drawers=Object.assign({circle:t=>ti.circle(0,0,t)},Ko._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class aa extends sa{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class ha extends oa{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class la extends sa{prepare(t,e){return this.point=t,this._ext=at.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 ca extends oa{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class da extends la{constructor(t){super(t,!0),this.add(this._contentLayer=new It(t)),this.add(this._baseLine=new Uo(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class _a extends ca{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,f(t._minValue,i.min)),i.max=Math.max(i.max,f(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 ua extends sa{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class pa extends oa{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class ga extends Do{constructor(t){super(t,ga.CLASS_NAME),this.add(this._imageView=new go(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)}}ga.CLASS_NAME="rm-image-annotation";class ma extends Do{constructor(t){super(t,ma.CLASS_NAME),this.add(this._shapeView=new Et(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),ti.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)}}ma.CLASS_NAME="rm-shape-annotation";class fa extends Do{constructor(t){super(t,fa.CLASS_NAME),this.add(this._textView=new Le(t)),this._textView.anchor=ve.START,this._richText=new Ve}_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:f(n.width,a.width),height:f(n.height,a.height)}}_doLayout(t){this._richText.layout(this._textView,getComputedStyle(this._textView.dom).textAlign,this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}fa.CLASS_NAME="rm-text-annotation";class ba{static reveal(t,e){new wa(t,e)}static grow(t,e){new va(t,e)}static spread(t,e){new Ca(t,e)}static fadeIn(t){new ya(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 ya extends ba{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:pt.DURATION,fill:"none"})}}class wa extends ba{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:pt.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:$(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:$(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class xa extends pt{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 va extends xa{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Ca extends xa{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Sa extends Et{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(ti.bar(t-i/2,e,i,-s,r,n))}}class La extends da{constructor(t){super(t),this._bars=new No(this._contentLayer,Sa)}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(ti.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 Aa extends aa{tooltipColor(){return getComputedStyle(this.dom).fill}}class Ma extends Et{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=A,i=A){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 ti.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 ti.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 ka=function(t){return isNaN(t)?0:t};class Pa{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return o(t)?this._path.push("M",ka(t),ka(e)):this._path.push("M",ka(t.x),ka(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",ka(t),ka(e)):this._path.push("m",ka(t.x),ka(t.y)),this}movep(t,e){return o(t)?this._path.push("M",O(t),O(e)):this._path.push("M",O(t.x),O(t.y)),this}line(t,e){return o(t)?this._path.push("L",ka(t),ka(e)):this._path.push("L",ka(t.x),ka(t.y)),this}linep(t,e){return o(t)?this._path.push("L",O(t),O(e)):this._path.push("L",O(t.x),O(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",ka(t[e]),ka(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",ka(t[e].x),ka(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 Ia extends Et{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 Pa;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 Na=class extends Et{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new Pa).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class Ea extends ua{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 Le(t,"rm-circle-gauge-text")),this.add(this._handContainer=new It(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 Ia(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 Na(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=u(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.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",$(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 Ta 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 Va extends pt{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 Da extends ua{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Ta(t,"rm-clock-gauge-face")),this.add(this._rimView=new Ma(t,"rm-clock-gauge-rim")),this.add(this._labelView=new Le(t,"rm-clock-gauge-label")),this._labelView.layout=Ce.MIDDLE,this.add(this._tickContainer=new It(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new It(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Et(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Et(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Et(t,"rm-clock-gauge-second")),this.add(this._pinView=new Ta(t,"rm-clock-gauge-pin")),this._tickViews=new No(this._tickContainer,Uo,"rm-clock-gauge-tick"),this._tickLabelViews=new No(this._tickLabelContainer,Le,"rm-clock-gauge-tick-label")}prepare(t,e){const i=Math.round(12/p(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?i:0,(t=>{t.layout=Ce.MIDDLE})),this._zoneCallback=e.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),g(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.options.animatable&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.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-u,m=I,f=P/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+d(m)*p,h+_(m)*p,a+d(m)*g,h+_(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,i=P/12*e;m=I,n.get(0).text="12",g=p-(u+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+d(m)*g,h+_(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=b(t.timezone,null===(e=this._zoneCallback)||void 0===e?void 0:e.call(this,t.coord[0],t.coord[1]),60*Math.round(t.coord[0]/15)),r=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 Pa;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=P*(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=P*(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?P*(this._aniSec+this._secRate)/60:P*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 Va(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class Ra extends sa{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.add(this._figure=new Et(t)),this._back.add(this._textView=new So(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=At.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 $a extends sa{constructor(t){super(t,!0),this.add(this._imageView=new go(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 Oa{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:pt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:$(t.width)}],this.$_aniOptions())}}let Fa=class extends da{constructor(t){super(t),this._contentLayer.addAll(this._back=new gi(t),this._area=new Et(t,"rm-line-series-area"),this._line=new Et(t,"rm-line-series-line"),this._lowLine=new Et(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 Pa;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 Ba="rm-map-series-id-";class za extends sa{static idClass(t){return Ba+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Ba))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(za.idClass(this.model))}this.setBoolData("selected",s&&s._selected)}reset(){this.model=null}}class ja extends Et{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Ga extends Et{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 Ha extends Et{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 Wa extends oa{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new qo(this._pointContainer,za),this._insetPool=new No(this._pointContainer,Ha)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s,r;const n=this._hoverArea;if(t!==n){const r=this.model;if(n&&(n.setBoolData(oa.DATA_HOVER,!1),n.point&&(null===(e=this._labelContainer.get(n.point,0))||void 0===e||e._text.setBoolData(oa.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&&i(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(oa.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(oa.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=za.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 It(t,"rm-map-series-internals")),this._internalPool=new No(this._internalContainer,ja)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),r.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new It(t,"rm-map-series-externals")),this._externalPool=new No(this._externalContainer,ja)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),r.hasBorders&&a.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new It(t,"rm-map-series-borders")),this._borderPool=new No(this._borderContainer,Ga))),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(),At.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"),At.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"),At.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),At.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)=>{At.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&&ba.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 wr){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 Ya extends Lo{constructor(t,e,i){super(t,e),this._paddings=new bt,this.add(this._background=new Et(t,i)),this.add(this._textView=new Le(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const n=e.options.text;n?(e.prepareRich(n),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;r(a)&&(a=a(e.series.getPointArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,i=this.width;let s=0;this._renderBackgrouond(this._background,i,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":s+=i/2,e.anchor=ve.MIDDLE;break;case"right":s+=i,e.anchor=ve.END;break;default:e.anchor=ve.START}e.trans(s,this._paddings.top)}}class Za extends Ya{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(ti.bar(0,i,e,-i,s,0))}}class Ua extends Ya{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(ti.bar(0,i,e,-i,0,s))}}class Xa extends sa{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.addAll(this._borderView=new gi(t),this._headerView=new Za(t),this._bodyView=new Ua(t),this._divider=new Uo(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 Ka extends Ma{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class qa extends la{constructor(t){super(t,!0),this._sectors=new No(this,Ka,null,.5),this._rdRate=1,this.add(this._circle=new Ta(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:g(t.angle),clockwise:o}),t.internalClearStyleAndClass(),n[r]&&n[r].color&&t.setFill(n[r].color)}}))}}class Ja extends aa{constructor(t){super(t,!0),this.add(this._pin=new Et(t))}render(t){this._pin.setPath(ti.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Ta(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 Qa extends aa{}class th extends sa{constructor(t){super(t,!0),this.add(this._line=new Et(t)),this.add(this._arrow=new Et(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=R(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 eh extends la{constructor(t){super(t,!0),this._cells=new No(this,Et)}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(ti.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 ih extends ca{constructor(t){super(t,"rm-waffle-series"),this._waffles=new qo(this._pointContainer,eh)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&ba.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 sh extends Do{constructor(t){super(t,sh.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=sh.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(f(n.width,Tr.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 rh(t,e){return new(Vo[e._type()])(t)}sh.CLASS_NAME="rm-html-annotation",sh.HTML_VIEW_CLASS="rm-html-annotation-view",oa.register([Rn,Wa],[qn,class extends ha{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new qo(t,Qa)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&ba.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=oa.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)}}}))}}],[Un,class extends ha{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new qo(t,Ja)}_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)}}))}}],[Qr,class extends _a{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new qo(this._pointContainer,La)}_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,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&ba.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,k,P;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&&(k=u.get(y,0))&&k.setVisible(t._static)&&k.layout().transp(d(b.x+r/2,b.y+n/2,k.bbox(),r/2,n/2,_)),g&&L&&(P=g.get(y))&&P.setVisible(t._static)&&P.render(p,y,L.flat().map(((t,e)=>t*l[e%2])),null)}}))}}],[In,class extends _a{constructor(t){super(t,"rm-line-series"),this._lines=new qo(this._pointContainer,Fa)}_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,f(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Oa(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)}}))}}],[Wn,class extends ca{constructor(t){super(t,"rm-pie-series"),this._pies=new qo(this._pointContainer,qa)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&ba.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)}}))}}],[Cn,class extends oa{constructor(t){super(t,"rm-figure-series"),this._figures=new No(this._pointContainer,Ra)}_doPrepeare(t,e,i){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&ba.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())}}}))}}],[io,ih],[to,class extends oa{constructor(t){super(t,"rm-route-series",!1),this._lines=new qo(this._pointContainer,th,"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(f(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&ba.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"),At.setNoScale(i._line.dom),i._arrow.setStroke("none"),At.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(ot){const t=f(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=f(t,1),this._lines.forEach(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,r,o){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(s(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const s=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(s.length=s.length*o|0),t.render(e,1/this._scale,s,"none"!==r&&(o<1||"moving"!==r))}}$_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=D(t[1]),r=D(t[0]),n=D(e[1]),o=D(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[R(Math.atan2(d,c)),R(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=D(r[1]),o=D(r[0]),a=n+s*Math.sin(Math.PI/2);return[R(o+s*Math.cos(Math.PI/2)),R(a)]}}],[ls,class extends ha{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new qo(t,Aa)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&ba.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(),p=s.getSubLabelOff(),g=s.getCallout(),m=this._calloutViews(),{min:f,max:b}=s.getPixelMinMax(u(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,u=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(u)))){const e=this._getPointPositioner(r.position||h,"center"),x=oa.getDrawer(s.getShape());let v,C,S,L,A,M,k=(t._radius=s.getRadius(r.getValue(),f,b))*r.vrate()*i;g&&(v=r.getCallout(u))&&(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*k,2*k),w.x+=k,w.y+=k;const P=()=>{t.setPath(x(k,k)),t.trans(w.x,w.y).rotate(o)},I=()=>{if(n instanceof pr){const e=n.r,i=this.chart().width,s=u[1]*Math.PI/180,r=k/2*(360/i),o=r/Math.cos(s),a=r;n.r=_r*this._scale;const h=$o.geoCircle(u[0],u[1],o,a,n,!0);n.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else P()};if(this.model.alignToSurface?I():P(),d&&((A=d.get(r,0))&&this._layoutLabel(A,t.dom).transp(l(w.x,w.y,A.bbox(),k,k,_)),(A=d.get(r,1))&&this._layoutLabel(A,t.dom).transp(c(w.x,w.y,A.bbox(),k,k,p))),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],k),M.render(g,r,e,t.getFill())}}}))}}],[An,class extends oa{constructor(t){super(t,"rm-image-series"),this._images=new qo(this._pointContainer,$a)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&ba.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())}}}))}}],[jn,class extends oa{constructor(t){super(t,"rm-panel-series"),this._panels=new qo(this._pointContainer,Xa)}_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&&ba.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=f(u.rx,0);let g,m,b;this._panels.forEach(((u,f)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const f=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,b=f(C,S,m.width,m.height),u.trans(b.x,b.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(b.x+m.width/2,b.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())}}}))}}],[io,ih],[cn,class extends pa{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new qo(t,Ea)}_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&&ba.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)}}))}}],[xn,class extends pa{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new qo(t,Da)}_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,_,p;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),_=u(t,e),p=m(x,v,_,_),g.trans(p.x,p.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(o(p.x+_/2,p.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)}}))}}]),Do.register([Rr,fa],[Vr,ga],[Dr,ma],[Tr,sh]);class nh extends pt{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 oh extends pt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class ah extends It{constructor(t,e,i){super(t,""),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new zo(t,i)),this.add(this.tickLayer=new Bo(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(na[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&&at.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 hh extends It{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new It(t)),this.add(this._labelLayer=new It(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 Go(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 lh extends Lo{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new gi(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Zo(t)),this.add(this._contentLayer=new It(t,"rm-body-content")),this.add(this._crosshairView=new Wo(t)),this._contentLayer.add(this._annotationContainer=new It(t)),this._contentLayer.add(this._axisGuideContainer=new hh(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new hh(t,!1)),this._contentLayer.add(this._seriesContainer=new ah(t,new It(t),!1)),this._contentLayer.add(this._secondContainer=new ah(t,new It(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 hh(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new hh(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new It(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),vo.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 nh(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 oh(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)||rh(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 ch extends Ao{constructor(t,e){super(t,e?ch.SUBTITLE_CLASS:ch.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Le(t)),this._richText=new Ve}_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 dh;ch.TITLE_CLASS="rm-title",ch.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(dh||(dh={}));class _h extends Pt{constructor(t){super(t,_h.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 Et(t,"rm-tooltip-back")),this.add(this._top=new Et(t,"rm-tooltip-top")),this.add(this._textView=new Le(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+kt.SHADOW_FILTER+")"),this._textView.anchor=ve.START,this._richText=new Ve,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,g=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=p(l.minWidth||0,b.width+16),w=p(l.minHeight||0,b.height+12);this._top.setFill((null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,C=e.getBounds(),S=_.getBounds();let L;L=i-y/2-p(0,u(i-y/2,g-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=dh.TOP;this.drawTooltip(0,0,y,w,A,L),s-=w+v,i=p(0,u(i-=y/2,g-y)),s=p(0,u(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:Nr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?G(e,i):{},a=G(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.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 dh.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 dh.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 dh.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 dh.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===dh.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)}}_h.CLASS_NAME="rm-tooltip";class uh extends Io{constructor(t){super(t,uh.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new It(t);this.add(e),e.add(this._boxLayer=new It(t)),this._boxes=new No(this._boxLayer,gi,"rm-color-scale-box"),e.add(this._splitLayer=new It(t)),this._splits=new No(this._splitLayer,Uo,"rm-color-scale-split"),e.add(this._markerLabel=new So(t,void 0)),e.add(this._marker=new Et(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new It(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new It(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new It(t,"rm-color-scale-null")),this._tickLines=new No(this._tickLineLayer,Uo),this._tickLabels=new No(this._tickLabelLayer,So),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`${uh.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(e,i){const s=e.createElementNS(t,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(e.createElementNS(t,"stop")),s.appendChild(e.createElementNS(t,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?At.setAttrs(t,i?uh.VERT_FILL_I:uh.VERT_FILL):At.setAttrs(t,i?uh.HORZ_FILL_I:uh.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][bi]=i,e++)})),r.forEach((t=>{const e=t[bi];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 gi(t,"rm-color-scale-box")),e.add(this._nullLabel=new So(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)}}uh.SCALE_CLASS="rm-color-scale",uh.SCALE_FILL="rm-color-scale-fill",uh.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},uh.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},uh.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},uh.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class ph extends Pt{constructor(t,e,i){super(t,ph.STYLE),this.add(this._back=new gi(t,ph.BACK_STYLE)),this.add(this._textView=new Le(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(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Ce.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),s=getComputedStyle(this._back.dom),r=(new bt).applyPadding(s);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+i.width/2,r.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+r.left+r.right,height:i.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}ph.STYLE="rm-button",ph.BACK_STYLE="rm-button-background";class gh extends ph{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class mh extends Lo{}class fh extends mh{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new gh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new gh(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new gh(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(wi,r<=100),this._btnDec.setBoolData(wi,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 bh extends mh{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)[yi]),!0}_doMeasure(t,e,i,s){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new No(this,Le,"rm-drilldown-text"),this._seperators=new No(this,Le,"rm-drilldown-separator"));const t=e.chart.firstVisible,i=this._history=t.getHistory();this._textViews.prepare(i.length,((t,e)=>{t.text=i[e].displayName(),t.anchor=ve.START,t[yi]=i[e]})),this._seperators.prepare(i.length-1,(t=>{t.text=">",t.anchor=ve.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new gh(t,"<",(()=>{e.chart.drillup()}))),r.layout();const i=r.bbox();n=i.width,o=i.height}return{width:n,height:o}}_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 yh extends Io{constructor(t){super(t,yh.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new It(t);this.add(e),e.add(this._bubbleLayer=new It(t)),e.add(this._lineLayer=new It(t)),e.add(this._labelLayer=new It(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,Ta,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Pt.fit(t,this._lineLayer,this._lines,r,Uo,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Pt.fit(t,this._labelLayer,this._labels,r,So,"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)}))}}}yh.SCALE_CLASS="rm-bubble-scale";class wh extends Io{constructor(t){super(t,wh.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}wh.SCALE_CLASS="rm-map-scale";class xh extends Mo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new ch(t,!1)),this.add(this.subtitleView=new ch(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=i,u=0,g=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,g=+n.options.titleGap||0):d.setModel(n),n.options.position){case"left":case"right":u=p(h,c),_=a+g+l;break;default:u=h+g+c,_=p(_,a+l)}return u>0&&(u+=this.titleView.visible?f(r.options.gap,0):f(n.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,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=p(this._hTitle,this._hSub);m=p(m,m+t(s,e,this._hTitle)),y=p(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(b=p(b,b+_(s,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=b;break;case"right":w=b+this._wTitle-this._wSub;break;default:w=b+(this._wTitle-this._wSub)/2}else w=p(w,w+_(r,h,this._wSub))},g=f(o.titleGap,0);let m=0,b=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":b=w+this._wSub+g,d();break;case"right":switch(w=b+this._wTitle+g,o.align){case"center":w=p(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=p(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;case"right":switch(o.position){case"left":switch(b+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":w+=h-this._wSub,b=w-g-this._wTitle,d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;default:switch(o.position){case"left":switch(b+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(b-w-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":switch(b+=(a-this._wTitle)/2,o.align){case"left":w=b+this._wTitle+g;break;case"center":w=b+this._wTitle+g,w+=(h-w-this._wSub)/2;break;case"right":w+=h-g-this._wSub}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}}e.resizeByMeasured().layout().trans(b,m),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 vh extends Io{constructor(t){super(t,vh.GROUP_CLASS,"rm-map-widget-group-background"),this.add(this._widgetLayer=new It(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 vo;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(Ch[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}vh.GROUP_CLASS="rm-map-widget-group";const Ch={legend:To,colorScale:uh,bubbleScale:yh,group:vh};class Sh extends Mo{constructor(t,e){super(t),this._loc=e,this._horz=e==Q.TOP||e==Q.BOTTOM,this._vert=e==Q.LEFT||e==Q.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){return this._views.get(t)}_setWidgets(t,e,i){return s(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof To&&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=f(+e.chartOptions.options.widgetGap,0),o=new vo;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=p(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=p(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=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(Ch[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 Lh extends Lo{constructor(t){super(t,"rm-credits"),this.add(this._textView=new Le(t)),this._textView.anchor=ve.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 Ah extends It{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new It(t,"rm-annotations")),this.add(this._bodyView=new lh(t,this)),this.add(this._titleSectionView=new xh(t)),this.add(this._widgetLayer=new It(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new It(t,"rm-front-annotations")),this.add(this._zoomPanelView=new fh(t)),this.add(this._drilldownPanelView=new bh(t)),this.add(this._mapScaleView=new wh(t)),this.add(this._creditView=new Lh(t)),this.add(this._tooltipView=new _h(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(Q)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Sh(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===Q.BOTTOM||r===Q.TOP?h-=l.height+t:r!==Q.RIGHT&&r!==Q.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._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===Q.RIGHT||n===Q.LEFT?(o.resize(o.mw,i),o.layout()):n===Q.TOP||n===Q.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.chartOptions.getWidgetSectionGap(n);switch(n){case Q.BOTTOM:r-=o.height+a;break;case Q.TOP:r-=o.height+a,d+=o.height+a;break;case Q.RIGHT:s-=o.width+a;break;case Q.LEFT:s-=o.width+a,c+=o.width+a}}}const p=_t.create(c,d,s,r);if(h.visible){const t=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 Q.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case Q.TOP:d=o+0,c=(e-s.width)/2;break;case Q.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case Q.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this._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 Wa&&(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)||rh(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 kh extends kt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Ah(t)),this.addElement(this._loadingView=new mo(t)),this.addElement(this._errorView=new Le(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new po(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(t="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=Ce.MIDDLE,this._errorView.text=t,this._errorView.stain();const{width:e,height:i}=this._errorView.bbox(),s=16+e/2,r=16+i/2;this._errorView.trans(s,r)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new xo(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=kh.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)}}kh.LOADING_VIEW_LENGTH=128;const Ph={chartControl:kh};class Ih{static getVersion(){return"1.0.11"}static setLicenseKey(t){xt.code=t}static setDebugging(t){Pt.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static getDistance(t,e){return at.getDistance(t,e)}static setGlobals(t){Object.assign(Ph,t)}static createChart(t,e,s,r=!0,n){C.loadConfigAsync(s,!0);const o=new Ph.chartControl(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[uo]=o,o.chart}static async createChartAsync(t,e,s,r=!0,n){const o=new Ph.chartControl(t,e);o.chart[uo]=o;try{o.showLoadingView(),await C.loadConfigAsync(s),i(s)&&o.chart.load(s,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 cr.createStockInset(t,e)}}class Nh{constructor(){this._moduleMap=new Map}static getInstance(){return Nh.instance||(Nh.instance=new Nh),Nh.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Nh.instance=null,Nh.ModuleNames={realchart:"realchart"};const Eh=Ih.getVersion,Th=Ih.setDebugging,Vh=Ih.setLogging,Dh=Ih.setGlobals,Rh=Ih.getDistance,$h=Ih.createChart,Oh=Ih.createChartAsync,Fh=Ih.preset,Bh=Ih.setLicenseKey;export{si as Annotation,Do as AnnotationView,_i as BandSeriesType,Qr as BarSeries,ho as Body,lh as BodyView,ls as BubbleSeries,Er as ChartAnnotationType,kh as ChartControl,Lo as ChartElement,Oe as ChartItem,_o as ChartObject,Ah as ChartView,Ta as CircleElement,cn as CircleGauge,xn as ClockGauge,xe as Color,bs as ColorRanger,Ke as Credits,Ei as DataPoint,Di as DataPointLabel,At as Dom,bo as DragTracker,No as ElementPool,Is as Exporter,Nh as ExternalModuleManager,ai as FeatureSeriesType,Cn as FigureSeries,li as HeatmapSeriesType,Tr as HtmlAnnotation,Vr as ImageAnnotation,An as ImageSeries,It as LayerElement,ms as Legend,Uo as LineElement,In as LineSeries,wr as MapArea,Hs as MapAxis,Bs as MapAxisBandGuide,Os as MapAxisGuide,Fs as MapAxisLineGuide,zs as MapAxisRangeGuide,po as MapChart,Gs as MapCrosshair,Rn as MapSeries,oi as MapSeriesType,xo as MapTool,Ji as MarkerSeries,qi as MarkerSeriesPoint,aa as MarkerSeriesPointView,ha as MarkerSeriesView,I as ORG_ANGLE,ss as OrthogonalSparkSeries,P as PI_2,jn as PanelSeries,Et as PathElement,Wn as PieSeries,Un as PinSeries,sa as PointElement,Jo as PointLabelView,qn as PointSeries,qo as PointViewPool,Xo as PolyLineElement,E as RAD_DEG,gi as RectElement,Pt as RmElement,to as RouteSeries,ni as RouteSeriesType,pi as SankeySeriesType,Mo as SectionView,Ma as SectorElement,Zi as Series,ba as SeriesAnimation,oa as SeriesView,Dr as ShapeAnnotation,vo as Size,es as SparkSeries,Ir as Subtitle,ui as TableSeriesType,ve as TextAnchor,Rr as TextAnnotation,Le as TextElement,Ce as TextLayout,ci as TiledWebSeriesType,Pr as Title,di as TrackSeriesType,at as Utils,Xi as ValuePoint,Ki as ValueSeries,hi as VectorSeriesType,io as WaffleSeries,ot as _isIE,g as absv,h as assignObj,W as calcPercent,m as copyObj,d as cos,$h as createChart,Oh as createChartAsync,lt as createRect,Re as extend,V as fixnum,Rh as getDistance,Eh as getVersion,x as incv,s as isArray,dt as isEmptyRect,i as isObject,n as isString,p as maxv,u as minv,H as parsePercentSize,f as pickNum,y as pickProp,w as pickProp3,$ as pixel,Fh as preset,ct as rectToSize,Th as setDebugging,Dh as setGlobals,Bh as setLicenseKey,Vh as setLogging,_ as sin};
|
|
7
|
+
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=Object.assign,l=Math.floor,c=Math.ceil,d=Math.cos,_=Math.sin,u=Math.min,p=Math.max,g=Math.abs,m=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},f=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},b=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},y=function(t,e){return void 0!==t?t:e},w=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},x=(t,e,i)=>t+(e-t)*i;class v{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}v._debugging=!1;class C{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(s(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=s(t.map)?t.map:[t.map];for(const t of r)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const r=s(t.series)?t.series:[t.series];for(const t of r)!i(t.data)&&!s(t.data)&&n(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 S={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 L=S.ko;const A=void 0,M="%".charCodeAt(0),P=Math.PI,k=2*P,I=-P/2,N=P/180,E=180/P;function T(t){return t>k?t%k:t}function V(t){return parseFloat(t.toPrecision(12))}function D(t){return t*Math.PI/180}function R(t){return 180*t/Math.PI}function $(t){return t+"px"}function O(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function F(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const i={};return i[t]=e,i}function H(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)===M&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;X(L.invalidSizeValue,t)}}return{size:s,fixed:i}}function W(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const Y={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"},Z=function(t){const e=Y[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Y[t]=e,e}return e};var U;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(U||(U={}));const X=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),i=f(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const Q={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},tt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const et="undefined"!=typeof navigator?navigator.userAgent:"",it=et?navigator.appVersion:"",st=!!et.match(/Trident.*rv\:11\./),rt=-1!==it.indexOf("MSIE 10"),nt=-1!==it.indexOf("MSIE 9"),ot=st||rt||nt;class at{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&&at.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(u(i,at.month_days[at.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-tt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=p(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=s(t)?[]:{};for(let i of Object.keys(t))e[i]=at.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(),at.log(t,+new Date-i+"ms")}static clamp(t,e,i){return p(e,u(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=p(e,t)),isNaN(i)||(t=u(i,t)),t}static makeIntArray(t,e){const i=new Array(p(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,i){const s=g(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*N,s=(e[1]-t[1])*N,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*N)*Math.cos(e[0]*N)*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=u(e,t[s]),i=p(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||s(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}}at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.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 ht=Object.freeze({x:0,y:0,width:0,height:0}),lt=function(t,e,i,s){return{x:t,y:e,width:i,height:s}};function ct(t){return{width:t.width,height:t.height}}function dt(t){return t.width<=0||t.height<=0}class _t{static create(t,e,i,s){const r=arguments.length;return at.isObject(t)?new _t(t.x,t.y,t.width,t.height):r<2?new _t(t,t,t,t):r<3?new _t(t,e,t,e):new _t(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 _t(this.x,this.y,this.width,this.height)}getInner(){return new _t(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}_t.Empty=new _t,_t.Temp=new _t;const ut={inOutSine:t=>-(d(P*t)-1)/2};class pt{constructor(){this.delay=0,this.duration=pt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=u(1,p(0,V(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=f(t,pt.DURATION),this.delay=e||0,this._easing=ut[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}}pt.DURATION=700,pt.SHORT_DURATION=300;let gt=0;class mt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(gt++))}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 ft extends mt{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 bt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new bt(t,t,t,t):new bt(t,t,e,e):new bt(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 bt(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=f(t.paddingLeft,0),this.right=f(t.paddingRight,0),this.top=f(t.paddingTop,0),this.bottom=f(t.paddingBottom,0),this}applyMargin(t){return this.left=f(t.marginLeft,0),this.right=f(t.marginRight,0),this.top=f(t.marginTop,0),this.bottom=f(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}var yt;bt.Empty=Object.freeze(new bt),bt.Temp=new bt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(yt||(yt={}));const wt={name:"RealMap",version:"1.0.12",license:"enterprise",code:""},xt={name:"RealMap",version:"1.0.12",license:"enterprise",code:null};class vt{static decode(t){const e=vt.CHARS,i=vt.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}}vt.PAD="=",vt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ct{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=Ct.xor,s=Ct.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=Ct.xor,s=Ct.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=Ct.kb,s=Ct._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*Ct.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=Ct._decryptBlock;let s=Ct._init(e),r=[],n=vt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ct.POW24|n[a+1]*Ct.POW16|n[a+2]*Ct.POW8|n[a+3],h.right=n[a+4]*Ct.POW24|n[a+5]*Ct.POW16|n[a+6]*Ct.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)}}Ct.POW2=Math.pow(2,2),Ct.POW3=Math.pow(2,3),Ct.POW4=Math.pow(2,4),Ct.POW8=Math.pow(2,8),Ct.POW16=Math.pow(2,16),Ct.POW24=Math.pow(2,24),Ct.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 St{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=Ct.decrypt(t,"dkdl"+this._getLDKey(Ct.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 Lt=651212;class At{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;)At.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-"+Lt++}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){v.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){!ot&&t.setAttribute("vector-effect","non-scaling-stroke")}}const Mt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Pt extends mt{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=xt.code||realMapLic,!e)return!1}catch(t){return!1}const i=St.decrypt(e);if("RealMap"!=i.name||"RealMap"!==wt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(wt.license!=yt.Developer&&!St.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(yt).includes(n))return!1;if(wt.code=i.code,wt.license=i.lic,n==yt.Evaluation||n==yt.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||Pt.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),At.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(){At.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(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new $t(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,kt.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(e,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=e.getElementById(i),this._container instanceof HTMLDivElement||X(L.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(t,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Nt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(e,i){let s=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");s.setAttribute("id",Pt.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=At.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()}at.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()}}Pt.CLASS_NAME="rm-control",Pt.SHADOW_FILTER="rm-shadow-filter",Pt._animatable=!0;class kt extends mt{static createElement(e,i){return e.createElementNS(t,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(e,i,s=A){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,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(e,i){const s=e.createElementNS(t,i);return this._dom.appendChild(s),s}insertElement(e,i,s){const r=e.createElementNS(t,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 F(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return _t.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=at.isValidNum(t)?t:this._tx,e=at.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=at.isValidNum(t)?t:this._tx,e=at.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&&at.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.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!==A&&(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(Z(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(Z(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(Z(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(Z(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){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let i=!1;if(t){for(let s in t)if(s in Mt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(f(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Mt){const i=Mt[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 Mt||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 Mt&&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]=y(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const 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 Ot(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 kt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(at.isValidNum(e)||at.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),at.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")");const r=at.getNum(this._scaleX,1),n=at.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}kt.TESTING=!1,kt.DEBUGGING=!1,kt.ASSET_KEY="_asset_",kt.TEMP_KEY="_temp_";class It extends kt{constructor(t,e=void 0){super(t,e,"g")}}class Nt extends kt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Et extends kt{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 kt{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}path(){return this._path}setPath(t){const e=n(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Vt extends kt{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Dt extends kt{constructor(t){super(t,A,"mask");const e=this._id=at.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Rt extends kt{constructor(t){super(t,A,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class $t extends Rt{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new kt(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 Ot extends Rt{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 Bt;!function(t){t.SIDO="sido"}(Bt||(Bt={}));const Ft="shuffle",zt="random";var jt;class Gt{constructor(t){this.source=t}hasDef(){return!0}}class Ht extends Gt{getElement(t,e){throw new Error("Method not implemented.")}}Ht.TYPE="shape";class Wt extends Gt{getElement(t,e){throw new Error("Method not implemented.")}}Wt.TYPE="image";class Yt extends Gt{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),o=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=s(o)?o[0]:o,l=s(o)&&o.length>1?o[1]:"white",c=s(a)?a[0]:a,d=s(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(r),i.appendChild(n)}}class Zt extends Yt{getElement(e,i){const s=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,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}}Zt.TYPE="lineargradient";class Ut extends Yt{getElement(e,i){const s=e.createElementNS(t,"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(e,s),s}}Ut.TYPE="radialgradient";class Xt extends Gt{getElement(e,s){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,l,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=jt.STOCK[+s.pattern%jt.STOCK.length];a=t.path,l=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(s.pattern)&&(a=s.pattern,c=s.width||s.height||20,d=s.height||s.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),l&&h(o.style,l),s.style&&h(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const i=e.createElementNS(t,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}jt=Xt,Xt.TYPE="pattern",Xt.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}],Xt.SELECT=Object.assign(jt.STOCK[4],{id:"rm-selected-area-fill",pattern:jt.STOCK[4].path,transform:"scale(0.5)"});class Kt extends Gt{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===zt?this._index=-1:(t.mode===Ft&&at.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=s(e.colors)?e.colors:[]}}Kt.TYPE="colors";class qt extends Gt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||qt.SIZE,height:e.height||e.width||qt.SIZE})}}qt.TYPE="images",qt.SIZE=20;class Jt{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new Xt(Xt.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(kt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(kt.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(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Xt.TYPE:s(t.colors)?e=Kt.TYPE:s(t.images)?e=qt.TYPE:null!=t.url?e=Wt.TYPE:null!=t.path&&(e=Ht.TYPE)),e)switch(e.toLowerCase()){case Ht.TYPE:return new Ht(t);case Wt.TYPE:return new Wt(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);case qt.TYPE:return new qt(t)}}}}const Qt="0".charCodeAt(0),te="#".charCodeAt(0),ee=",".charCodeAt(0),ie="s".charCodeAt(0),se="a".charCodeAt(0);class re{static getFormatter(t){let e=re.Formatters[t];return e||(re.Formatters[t]=e=new re(t)),e}static get Default(){return re.getFormatter(re.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)===Qt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===te;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Qt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ee){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===ie){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===se){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}re.DEFAULT_FORMAT="",re.Formatters={};const ne=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],oe=[".","/","-",":"],ae="Z".charCodeAt(0),he="z".charCodeAt(0),le="A".charCodeAt(0),ce="a".charCodeAt(0),de="y".charCodeAt(0),_e="M".charCodeAt(0),ue="m".charCodeAt(0),pe="W".charCodeAt(0),ge="w".charCodeAt(0),me="d".charCodeAt(0),fe="H".charCodeAt(0),be="h".charCodeAt(0),ye="S".charCodeAt(0),we="s".charCodeAt(0);class xe{static getFormatter(t){let e=xe.Formatters[t];return e||(xe.Formatters[t]=e=new xe(t)),e}static get Default(){return xe.getFormatter(L.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||L.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 de:s+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case _e:s+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case me:s+=a>1?z(t.getDate()):t.getDate();break;case pe:s+=a>1?z(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case ge:s+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case fe:s+=a>1?z(t.getHours()):t.getHours();break;case be:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?z(e):e}else s+=a>1?z(t.getHours()):t.getHours();break;case ue:s+=a>1?z(t.getMinutes()):t.getMinutes();break;case we:s+=a>1?z(t.getSeconds()):t.getSeconds();break;case ce:case le:t.getHours()<12?s+=L.am:s+=L.pm;break;case ye:let i=t.getMilliseconds();s+=3==a?j(i):2==a?z(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(oe.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),ne.indexOf(n)<0){let e=n.charCodeAt(0);(e>=le&&e<=ae||e>=ce&&e<=he)&&X(L.invalidDateFormat,t)}e.push(n)}if(r<s&&at.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&at.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||L.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}xe.Formatters={};const ve=["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"],Ce=["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 Se{static create(t){return n(t)?new Se(t):void 0}static isBright(t){return new Se(t).isBright()}static getContrast(t,e,i){return new Se(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Se(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(at.startsWith(t,"rgb(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(at.startsWith(t,"rgba(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(at.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Se.COLORS[t]&&this.$_parseNumber(Se.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 Se(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}var Le,Ae,Me;Se.COLORS=function(){const t={};for(let e=0;e<ve.length;e++)t[ve[e]]=Ce[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Le||(Le={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Ae||(Ae={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Me||(Me={}));class Pe extends kt{constructor(t,e=A){super(t,e,"text"),this._layout=Ae.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.bbox(),i=this.getAscent(isNaN(t)?e.height:t);let s;switch(this._layout){case Ae.MIDDLE:s=Math.floor(i/2);break;case Ae.BOTTOM:s=i-e.height;break;default:s=Math.ceil(i)}this.setAttr("y",s)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=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(Se.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 ke="$_TH",Ie="$_TW";class Ne{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]?re.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?xe.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),A),0===this._literals[2].length&&(this._literals[2]=A)}else this._literals.push(r,n,A,A);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ee extends Ne{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 Ee{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 Ve={t:class extends Ee{tag(){return"</t>"}},b:class extends Ee{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ee{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Te};class De{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 Ne).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 Ve){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 Ve[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 Re=/<br.*?>|\r\n|\n/;class $e{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,r,n,o){const a=e.doc,h=f(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];e.clearDom(),n=n||e;const u=e.getStyle("writing-mode"),g=u===K||u===q;for(let s=0;s<c;s++){const r=l[s];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,_=s===c-1&&h===r.words.length-1,b=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(i(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[Ie]=y.width,b[ke]=y.height,g?(u=p(u,b[Ie]),m+=b[ke]):(u+=b[Ie],m=p(m,b[ke])),f||(f=b),l instanceof Te){const i=a.createElementNS(t,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),e.appendDom(i)}}_.push(f),r[ke]=m*h,r[Ie]=u*h,d.push(0==s?r[Ie]/2:r[Ie])}if(c>0){let t=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(g?null!=_[i-1]&&(s=Math.floor(t[Ie]-e.getAscent(t[Ie]))+e.getAscent(l[i][Ie])):r=t[ke]-e.getAscent(t[ke])+e.getAscent(l[i][ke]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=e.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[Ie]=n.width,r[ke]=t[ke]=n.height,_[0]=r}switch(u){case K:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case q:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}t=l[i]}if(g){const t=e.parent.dom.classList.contains("rm-annotation"),i=e.bbox().width,[s]=_,r=s[Ie];if(t)s.setAttribute("dx",String(u===q?i-r/2:r/2));else switch(u){case K:s.setAttribute("x",String((i-r)/-2));break;case q:s.setAttribute("x",String((i-r)/2))}}else e.layoutText(l[0][ke])}}layout(t,e,i,s,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===K||h===q)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=Le.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=Le.END,a=n.height-r.bottom;break;default:t.anchor=Le.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Le.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=Le.END,o=i-r.right;break;default:t.anchor=Le.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(Re);for(let t of i)e.push((new De).parse(t))}}}let Oe=0;const Be=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},Fe=function(t,e){const r=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];s(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):i(n)?r[t]=Fe(r[t],n):r[t]=n}return r};class ze extends mt{constructor(t){super(),this.chart=t,Oe++}_init(){const t=this._op=Fe({},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 s=this,r=this._op;return void 0===t||this._doSetSimple(r,t)||Fe(r,t),this.$_applyOptions(r),i(t)&&function(t){if(s._children)s._children.forEach((e=>t.hasOwnProperty(e)&&s[e].updateOptions(t[e])));else{s._children=[];for(const e in s){const i=s[e];i instanceof ze&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0){if(this[t]instanceof ze)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]=!a(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,i=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;e.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),i&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=Fe({},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 ze&&(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 s=this._op.style;if(i(t)){let i=!1;s||(s=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),s[e]!==r&&(void 0===r?delete s[e]:s[e]=r,i=!0)}i&&(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 r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof ze?t[r]=this[r]._load(n):s(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):i(n)?t[r]=Object.assign({},n):t[r]=n)}}_doSetSimple(t,e){if(a(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`]=H(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){e.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let r=t[e];this._doLoadProp(e,r)||(this[e]instanceof ze?this[e].updateOptions(r):s(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):i(r)?this[e]=h({},r):this[e]=r)}}_doPrepareRender(t,e){}_doAfterRender(){}}ze.REFRESHED="refreshed",ze.defaults={visible:!0};class je{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 Ge extends ze{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=f(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?re.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 $e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(at.isValidNum(t)){const s=this._numSymbols&&e&&at.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;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(at.isValidNum(t)){const n=this._numSymbols&&e&&at.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}}Ge.defaults=Be(ze.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class He extends Ge{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 qt&&(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 qt?i.getImage(s):s}return this._root+t}}}He.defaults=Be(Ge.defaults,{iconPosition:"default",iconGap:2});class We extends ze{}We.defaults=Be(Ge.defaults,{});class Ye extends He{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return f(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}Ye.defaults=Be(He.defaults,{display:"auto"});class Ze extends ze{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 We(this.chart))._init(),t.title=(this._title=new Ye(this.chart))._init(),t.footer=(this._footer=new Ye(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=y(e.location,"bottom")}}Ze.defaults=Be(ze.defaults,{offsetX:0,offsetY:0});class Ue extends Ze{}class Xe extends Ze{_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}}Xe.defaults=Be(Ze.defaults,{direction:"vertical"});class Ke extends je{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._map[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(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,r=this._items=[],n=this._map={};if(s(t))t.forEach(((t,i)=>{r.push(this.$_loadItem(e,t,i))}));else if(i(t))r.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const i={};a(t)&&(i.visible=t),r.push(this.$_loadItem(e,i,0))}r.forEach((t=>{t.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 qe extends Ke{_collectionProp(){return"widgetGroup"}_createWidget(t){return new Xe(t)}}class Je extends Ue{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Je.defaults=Be(Ze.defaults,{});class Qe extends ze{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Qe.defaults=Be(ze.defaults,{text:"RealMap v1.0.12",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const ti=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),ei=.001,ii=Math.PI;class si{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=u(-s/2,i/2,r),["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=u(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=u(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=u(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=T(g(n-r)),l=2*ii-h<.01,c=h-ii<.01?0:1,u=o?1:0,p=d(r),m=_(r),f=d(n-=l?u?ei:-.001:0),b=_(n),y=[];return y.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=T(g(o-n)),l=2*ii-h<ei;let c=h-ii<ei?0:1;const u=a?1:0,p=d(n),m=_(n),f=d(o-=l?u?ei:-.001:0),b=_(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*p,e+s*m,"A",i,s,0,c,u,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-u,t+y*p,e+w*m),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*_(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,c=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*d(r),o+h*_(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*_(r),"L",n+l*d(r+p),o+c*_(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=si[e](0,0,2*i,2*s);break;default:r=si.circle(i,s,u(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const ri={minimumZoom:200,maximumZoom:1600},ni={};class oi extends ze{static register(...t){t.forEach((t=>{ni[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=W(this._widthDim,t):s<0&&(this._x+=s,s=-s),isNaN(r)?r=W(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(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`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){}}oi.defaults=Be(ze.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class ai extends je{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 oi)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};s(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(r,t,i,e))})):i(t)&&n.push(this.$_loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)})),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}$_loadItem(t,e,i,s){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a._init(),a.index=i,a._load(e),a}}const hi="route",li="map",ci="feature",di="vector",_i="heatmap",ui="tiledweb",pi="track",gi="band",mi="table",fi="sankey";class bi extends kt{static create(t,e,i,s,r,n,o=0){return new bi(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 yi={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 wi{constructor(t,e){}}const xi="_model_",vi="_tag_",Ci="disabled",Si="rm-legend-item-marker",Li=Object.freeze([0,0]);function Ai(t){return isFinite(t[0]+t[1])}function Mi(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function Pi(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=u(e,...t),i=u(i,...o),s=p(s,...t),r=p(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const ki="@_rm_state_",Ii="@_rm_add_",Ni="@_rm_update_",Ei="@_rm_delete_";let Ti=0;const Vi=[0,0];class Di{constructor(t){this.source=t,this.inset=Vi,this.pid=Ti++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.coordOfArea(this.id)||Li),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[ki]=t:delete this[ki]}_isAdding(){return this[ki]===Ii}_isUpdating(){return this[ki]===Ni}_isDeleting(){return this[ki]===Ei}_isStatic(){const t=this[ki];return t!==Ii&&t!==Ei}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){}_readObject(t,e){var i;if(this.id=y(t._idFielder(e),e.id),this.name=y(t._nameFielder(e),e.name),this.color=y(t._colorFielder(e),e.color),this.className=e.className,s(e.coord))this.coord=e.coord.slice(0,2);else if(n(e.coord)){const t=e.coord.split(/s\+/);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const 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)||Li),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=s(e.callout)&&this.$_parseCallout(e.callout),s(this.callout)||(this.offset=s(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),s(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(s(t))e.push(t.slice(0,2));else if(n(t)){const i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class Ri{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const $i={};class Oi extends He{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 at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return r(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}}Oi.defaults=Be(He.defaults,{visible:!0,position:"auto",distance:25});class Bi extends ze{}Bi.defaults=Be(ze.defaults,{shape:"circle",radius:2.5});class Fi extends ze{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new Bi(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}Fi.defaults=Be(ze.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class zi{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 ji extends pt{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 Gi extends pt{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 Hi extends ji{_init(t){super._init(t),t._setState(Ii)}}class Wi extends ji{_init(t){super._init(t),t._setState(Ei),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Yi extends ji{_init(t){super._init(t),t._setState(Ni)}}class Zi extends Gi{_init(t){t.forEach((t=>{t._setState(Ii),t._setVrate(0)}))}}class Ui extends Gi{_init(t){t.forEach((t=>{t._setState(Ei),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class Xi extends Gi{_init(t){t.forEach((t=>{t._setState(Ni),t._setVrate(0)}))}}class Ki extends ze{static register(...t){t.forEach((t=>{$i[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 Ri(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new zi(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new Fi(this))._init()}_createLabel(t){return new Oi(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?Ki.defaultTooltipText:null:t}}getTooltipParam(t,e,i){return Ki.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=at.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 f(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}coordOfArea(t){var e,i;return yi[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 Hi(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 r,n;if(!s(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 Zi(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=(r=this._op).onPointListAdded)||void 0===n||n.call(r,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,a;o(t)?t=this._points.get(t):n(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new Wi(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===(a=(r=this._op).onPointRemoved)||void 0===a||a.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];o(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Ui(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(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points.get(t)),t instanceof Di&&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 Yi(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 Xi(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 Di&&(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 a,h,l,c=this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;r(i)?a=i:s(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))||c})):l instanceof Kt?(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 r(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(t){this._idFielder=this._createFielder(t.idField),this._nameFielder=this._createFielder(t.nameField),this._colorFielder=this._createFielder(t.colorField)}_createLegendMarker(t,e){return bi.create(t,Si,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 wi);else if(s(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:u(s,e),i=isNaN(i)?s:p(s,i))})),{min:e,max:i}}}Ki.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",Ki.defaults=Be(ze.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:Ki.defaultTooltipText,loadAnimation:"default",hoverEffect:"default",legend:0});class qi extends je{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},s(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):i(t)&&this.$_loadItem(r,t,0),r.options.series=this._items.map((t=>t.options))}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(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 Ki?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,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 Di{_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:x(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class Qi extends Ki{_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")}}Qi.defaults=Be(Ki.defaults,{valueField:"value"});class ts extends Ji{}class es extends Qi{}es.defaults=Be(Qi.defaults,{});class is 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=s(this.values)?this.values.reduce(((t,e)=>t+f(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=s(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ss{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return bi.create(t,Si,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class rs extends Qi{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 s(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(s(t))return t.map((t=>new ss(t.name,t.color)))}}rs.defaults=Be(Qi.defaults,{position:"top"});class ns extends is{}class os extends rs{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new ze(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=at.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=f(this._minValue,i.min),e=f(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 f(W(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=f(+t.width,os.DEF_WIDTH),this._height=f(+t.height,os.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}os.DEF_WIDTH=80,os.DEF_HEIGHT=50,os.defaults=Be(rs.defaults,{width:os.DEF_WIDTH,height:os.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class as extends Ji{}class hs extends Qi{_doApply(t){super._doApply(t),this._width=f(+t.width||+t.size||+t.height,hs.DEF_SIZE),this._height=f(+t.height||+t.size||+t.width,hs.DEF_SIZE)}}hs.DEF_SIZE=60,hs.defaults=Be(Qi.defaults,{size:hs.DEF_SIZE});class ls extends hs{getValueRate(t){return(f(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=f(this._minValue,1/0),i=f(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=u(e,s),i=p(i,s))})),this._min=e,this._max=i}}ls.defaults=Be(hs.defaults,{minValue:10});class cs extends ts{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class ds extends Oi{}ds.defaults=Be(Oi.defaults,{visible:!1});class _s extends es{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new ds(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,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 f(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 cs(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=u(t,n)),isNaN(s)&&(e=p(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}_s.type="bubble",_s.defaults=Be(es.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class us extends ze{}us.defaults=Be(Je.defaults,{length:10});class ps extends He{getText(t){return at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}ps.defaults=Be(Je.defaults,{offset:4});class gs extends ze{_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=Be(Je.defaults,{});class ms extends Je{_doInit(t){super._doInit(t),t.tick=(this._tick=new gs(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof _s){let{min:n,max:o}=s.getPixelMinMax(u(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=f(i.minRadius,10),e=f(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(s(t)&&t.length>0){const s=this.tick.label;t.forEach((t=>{i(t)?e.push({value:+t.value,label:t.label||s.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:s.getText(+t),rd:0})}))}return e}}ms.defaults=Be(Je.defaults,{});class fs extends Ke{_collectionProp(){return"bubbleScale"}_createWidget(t){return new ms(t)}beforeRender(){this._collectVisibles()}}class bs extends ze{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}bs.MARKER_SIZE=10;class ys extends Ue{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 W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(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=H(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=H(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new bs(this,t))),e.reversed&&(this._items=this._items.reverse())}}ys.defaults=Be(Ze.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:bs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class ws extends Ke{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new ys(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class xs{constructor(t){this._color1=Se.create(t.minColor),this._color2=Se.create(t.maxColor),this._logger=at.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 Se.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return w(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class vs extends ze{_doInit(t){t.label=(this._label=new Ge(this.chart))._init()}get label(){return this._label}getMarkerSize(){return f(this._op.size,7)}}vs.defaults=Be(ze.defaults,{size:7});class Cs extends ze{}Cs.defaults=Be(ze.defaults,{length:6});class Ss extends He{getDefaultIconPos(){}}Ss.defaults=Be(He.defaults,{});class Ls extends ze{_doInit(t){t.line=(this._line=new Cs(this.chart))._init(),t.label=(this._label=new Ss(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ls.defaults=Be(ze.defaults,{});class As{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||bs.MARKER_SIZE;return bi.create(t,Si,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 Se.interpolate(i,s,(t-r)/(n-r)).toString();return w(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class Ms extends ze{}Ms.defaults=Be(ze.defaults,{});class Ps extends ze{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return f(+this._op.gap,0)}}Ps.defaults=Be(ze.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const ks="#fff",Is=Se.create("#000");class Ns extends Je{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new vs(e))._init(),t.stepLine=(this._stepLine=new Ms(e))._init(),t.tick=(this._tick=new Ls(e))._init(),t.nullStep=(this._nullStep=new Ps(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)),Se.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?W(this._barLengthDim,e):e,s=f(this._op.barWidth,12)):(s=this._barLengthDim?W(this._barLengthDim,t):t,r=f(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=f(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=f(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=f(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=Se.create(t.minColor||ks),this._maxColor=t.maxColor&&Se.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(s(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:Se.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:Se.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=at.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)||Is,this._steps=this.$_buildSteps()}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>l(t/e)*e?t=l(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),V(t)}$_parseColor(t){return t&&t.endsWith("%")?Se.interpolate(this._minColor,this._endColor,parseFloat(t)/100):Se.create(t)}$_buildSteps(){const t=this._op,e=t.steps,i=[],r=this._min,n=this._max;let o=r,a=n;if(this._valueSteps=null,s(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 As(h,l,c,d,s.label))})),this._logger=null}else if(o>=a)i.push(new As(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,s=i?Math.max(0,1-o):0,h=this._valueSteps=[],l=Math.max(1,f(t.stepCount,1));if(t.integralSteps)i&&(o=i(o),a=i(a)),h.push(...at.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(V(h[e-1]+t));h.push(V(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]-=s,t.integralSteps||(h[0]=r,h[l]=n)}}return i.length>1?i:void 0}}Ns.defaults=Be(ze.defaults,{display:"scale",minColor:ks,layout:"auto",barWidth:12,barLength:"40%"});class Es extends Ke{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 Ns(t)}beforeRender(){this._collectVisibles()}}class Ts extends ze{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)}}Ts.defaults=Be(ze.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Vs extends ze{_doSetSimple(t,e){return at.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Vs.defaults=Be(ze.defaults,{});class Ds extends ze{_doInit(t){t.line=(this._line=new Vs(this.chart))._init(),t.lonLine=(this._lonLine=new Vs(this.chart))._init(),t.latLine=(this._latLine=new Vs(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,b(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,b(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}}Ds.defaults=Be(ze.defaults,{visible:!1,fitTo:"map"});class Rs extends ze{}Rs.defaults=Be(ze.defaults,{visible:!1});class $s extends ze{}$s.defaults=Be(ze.defaults,{visible:!1});class Os extends Ge{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||Os.defaults.dirSymbols}}Os.defaults=Be(Ge.defaults,{dirSymbols:"NSEW",suffix:"°°"});class Bs extends ze{_doInit(t){t.line=(this._line=new $s(this.chart))._init(),t.label=(this._label=new Os(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,b(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,b(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=s(t.positions)?t.positions:[]}}Bs.defaults=Be(ze.defaults,{visible:!1,positions:["top","right"],interval:1});class Fs extends He{getDefaultIconPos(){return"left"}}Fs.defaults=Be(He.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class zs extends ze{_doInit(t){t.label=(this._label=new Fs(this.chart))._init()}get label(){return this._label}}zs.defaults=Be(ze.defaults,{front:!0,zindex:0});class js extends zs{}js.defaults=Be(zs.defaults,{});class Gs extends zs{}Gs.defaults=Be(zs.defaults,{});class Hs extends zs{}Hs.defaults=Be(zs.defaults,{});class Ws extends ze{}Ws.defaults=Be(ze.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Ys extends ze{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new Ws(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=re.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 r(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Ys.defaults=Be(ze.defaults,{visible:!1});class Zs extends ze{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new Rs(this.chart))._init(),this.options.leftLine=(this._leftLine=new Rs(this.chart))._init(),this.options.rightLine=(this._rightLine=new Rs(this.chart))._init(),this.options.topLine=(this._topLine=new Rs(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new Rs(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new Rs(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new Rs(this.chart))._init(),this.options.grid=(this._grid=new Ds(this.chart))._init(),this.options.tick=(this._tick=new Bs(this.chart))._init(),this.options.crosshair=(this._crosshair=new Ys(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),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(s(e)?e:[e]))}this._lonInterval=Math.max(1,b(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,b(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Hs(this.chart):"line"===t.type?new js(this.chart):"band"===t.type?new Gs(this.chart):new js(this.chart),i._init(),i._load(t),e.push(i)}))}}function Us(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 Xs(t,e){let i=!1;Us(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Us(t,e[s])&&(i=!i);return i}Zs.defaults=Be(ze.defaults,{interval:5});class Ks{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 Ks(o,this.capacity),new Ks(a,this.capacity),new Ks(h,this.capacity),new Ks(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 qs{constructor(t,e){var i;this.worldBBox=t,this.root=new Ks(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 Xs(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(Xs(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const Js="37630",Qs={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"},tr={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"},er={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"},ir={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"},sr={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"},rr={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"},nr={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},or={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},ar={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 hr{constructor(t){this.id=t}}class lr extends hr{constructor(t,e){super(t),this.props=e}}class cr extends lr{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=Pi(this.polygons[t]),r=Pi(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 dr{constructor(t,e,i){this.name=t,this.closed=i,s(e)&&e.length>=2&&(this.border=[at.makeArray(e[0]),at.makeArray(e[1])])}}class _r extends hr{constructor(t,e){super(t),this.polygon=e}}class ur extends mt{static createStockInset(t,e){let s,r=!1;switch(t){case"제주":case"제주도":s=Qs;break;case"제주_B":case"제주도_B":s=Qs,r=!0;break;case"울릉":case"울릉도":s=tr;break;case"울릉_B":case"울릉도_B":s=tr,r=!0;break;case"백령":case"백령도":s=er;break;case"백령_B":case"백령도_B":s=er,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=ir;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=ir,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=sr;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=sr,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=rr;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=rr,r=!0;break;default:switch(t.toLowerCase()){case"alaska":s=nr;break;case"hawaii":s=or;break;case"okinawa":s=ar;break;case"okinawa_b":s=ar,r=!0}}return s&&(a(e)?s=Object.assign({visible:e},s):i(e)&&(s=Object.assign({},s,e)),r&&s.border&&delete s.frame),s}constructor(t,e){var r,o,a;super(),this._excludes={};const h=null!==(r=t.source)&&void 0!==r?r:t.map,l=t.insets,c=s(l)?l:i(l)||n(l)?[l]:void 0;this.name=t.name,this.enabled=y(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==h?void 0:h.meta)?at.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=J(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this._excludes={},s(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},c&&c.length>0&&c.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?ur.createStockInset(t.substring(1),!1):ur.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:s(t.polygons)?t.polygons.slice():s(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:s(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&at.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new dr(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 pr{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 gr=90,mr=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class fr extends pr{constructor(){super(),this._rotation=[0,0],this._r=gr,this.bounds={x1:-90,x2:gr,y1:-90,y2:gr},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=mr(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=mr(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;mr(-90-t),mr(90-t),mr(90+e),mr(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*N,r=[Math.cos(s)*Math.sin(e*N)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/gr,i=t[1]/gr,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)/N,Math.asin(s&&i*n/s)/N];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}_rotate(t){const e=this._rotation[0]*N,i=(this._rotation[1]||0)*N,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]*N+e,h=t[1]*N,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)/N,Math.asin(u*n+d*o)/N]}_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 br extends ur{static loadMap(t,e){if(i(t)){const r=t.source;if(i(r)&&"Topology"===r.type&&i(r.objects)&&s(r.arcs))return new br(t,e);const n=t.map;if(i(n)&&"Topology"===n.type&&i(n.objects)&&s(n.arcs))return new br(t,e)}}_doLoad(t,e){const r=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>r(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(i(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const i=d[t].geometries;if(s(i)&&i.forEach((t=>{const e=new lr(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=r(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};s(e.excludeInternal)?e.excludeInternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),at.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};s(e.excludeExternal)?e.excludeExternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),at.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 lr&&(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 _r(r.name,e))}}e.push(...s)}}function yr(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*N,a=t[0]*N,h=e[1]*N,l=e[0]*N,c=h-o,d=l-a,_=r(c/2)*r(c/2)+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/N,p/N])}}return m}function wr(t,e){const i=t._base,r=t.off;let o,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof Cr?o=i:i[0]>=0&&(l=e.readBounds(i),h=r||h)}if(n(t.frame)&&t.frame.length>0){const e=J(t.frame);let{h1:i,v1:s,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=u(i,o[t].h1),s=u(s,o[t].v1),n=p(n,o[t].h2),a=p(a,o[t].v2);const c=i+h[0]-e.l,d=n+h[0]+e.r,_=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,_],[d,_],[d,g],[c,g]],t.bounds=r?{h1:c-r[0],h2:d-r[0],v1:g-r[1],v2:_-r[1]}:{h1:c,h2:d,v1:g,v2:_}}else if(a=t.border){let e,c;if(n(a)){let{h1:t,v1:i,h2:s,v2:r}=o?o[0]:l;if(o)for(let e=1;e<o.length;e++)t=u(t,o[e].h1),i=u(i,o[e].v1),s=p(s,o[e].h2),r=p(r,o[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else s(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=r?{h1:l.h1-r[0],h2:l.h2-r[0],v1:l.v1-r[1],v2:l.v2-r[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const xr=Math.min,vr=Math.max;class Cr extends mt{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=xr(i,t[0]+e[0]),s=vr(s,t[0]+e[0]),r=xr(r,t[1]+e[1]),n=vr(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,r=t.offset;let n=[0,0];return s(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),s(r)&&r.length>0&&(n[0]+=f(r[0],0),n[1]+=f(r[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=xr(o,i[0]),a=vr(a,i[0]),h=xr(h,i[1]),l=vr(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=yr(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){yr(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=xr(e,t[0]),i=vr(i,t[0]),s=xr(s,t[1]),r=vr(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=xr(e,t[0]),i=vr(i,t[0]),s=xr(s,t[1]),r=vr(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=xr(e,t[0]),i=vr(i,t[0]),s=xr(s,t[1]),r=vr(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=xr(t,e[0]),s=xr(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,Li)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Li))):this.$_readBound(this.source.polygon,Li),i=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Li))):this.$_readBound(this.source.polygon,Li);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,Li)}))):(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?Li:i),e.externals&&this.$_readExternal(t,this._insetChilds?Li: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 Sr extends mt{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 Lr extends mt{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 Lr)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new qs({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,s(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof br&&this.source.internals}get hasExternals(){return this.source instanceof br&&this.source.externals}get hasBorders(){return this.source instanceof br&&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&&Mi(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 fr)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=gr,this.y2=gr;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=xr(i,c.h1),s=vr(s,c.h2),r=xr(r,c.v1),n=xr(90,vr(n,c.v2)),o=xr(o,c.x1),a=vr(a,c.x2),h=xr(h,c.y1),l=vr(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof ur){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=vr(-180,i),this.v1=vr(-90,r),this.h2=xr(180,s),this.v2=xr(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=xr(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=vr(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=xr(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=vr(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,r=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",a=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._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 lr){const s=y(e.props[r],e.id);if(s&&t.included(s)){const t=i[s],r=new Cr(e,t);t&&(delete i[s],t._area=r,_.push(t)),h&&h.indexOf(s)>=0?(l.unshift(r),r.dummy=!0):l.push(r),c[r.id=s]=r,r.name=y(e.props[n],e[n])}}else if(e instanceof _r){const t=new Sr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(o(e.polygons)||s(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const r=c[t[i]];if(r){const n=e.polygons[i];r.inset=e,r._insetChilds=s(n)?n:[n],e._parent=t[i],e._base=r._insetChilds,e._area=r,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=s(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(s(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],r=e._children=[];if(s(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=xr(t,r.h1),s=xr(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 s of e.children){const e=c[s];if(e){const n=e.inset={area:s,offset:i};t.push(e),n._area=e,r.push(n)}}_.push(e)}}if(a&&!isNaN(+t.dokdo)){const e=c[a.group];e&&(e.source=new cr(e.source,+t.dokdo,+a.index,+a.parent))}this.reset(),_.forEach((t=>wr(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 Lr(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Ar extends He{getText(t){return at.isValidNum(t)?this._getText(null,t,g(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ar.defaults=Be(Je.defaults,{offset:4});class Mr extends Je{_doInit(t){super._doInit(t),t.label=(this._label=new Ar(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}}Mr.defaults=Be(Je.defaults,{visible:!1});class Pr extends ze{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Pr.ITEM_GAP}}Pr.ITEM_GAP=4,Pr.defaults=Be(ze.defaults,{offsetX:8,offsetY:8,itemGap:3});class kr extends Pr{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:kr.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:kr.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)}}kr.BUTTON_SIZE=24,kr.defaults=Be(Pr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Ir extends Pr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Ir.defaults=Be(Pr.defaults,{type:"text",align:"left",verticalAlign:"top"});class Nr extends mt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,s=!1){let r;return s&&(r=this.clear()),t&&i(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const 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 Er extends ze{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Er.defaults=Be(ze.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Tr extends Er{}Tr.defaults=Be(Er.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Vr extends ze{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=y(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?re.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?xe.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Vr.defaults=Be(ze.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});const Dr="chart";class Rr extends oi{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&&!F(this._op.html)}_doSetSimple(t,e){return n(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},at.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}}Rr.DEF_SIZE=100,Rr.type="html",Rr.defaults=Be(oi.defaults,{width:Rr.DEF_SIZE});class $r extends oi{_isVisible(){return this._op.visible&&!F(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}$r.type="image",$r.defaults=Be(oi.defaults,{});class Or extends oi{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||Or.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Or.type="shape",Or.defaults=Be(oi.defaults,{width:64,height:64,shape:"square"});class Br extends oi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!F(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?re.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?xe.getFormatter(t):void 0)}(t.timeFormat)}}Br.type="text",Br.defaults=Be(oi.defaults,{text:"Text"});class Fr extends pr{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 zr=1.340264,jr=-.081106,Gr=893e-6,Hr=.003796,Wr=Math.sqrt(3)/2,Yr=74.03120656864502;class Zr extends pr{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=N,i=Math.asin(Wr*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)*Yr/(Wr*(zr+3*jr*s+r*(7*Gr+9*Hr*s))),i*Yr*(zr+jr*s+r*(Gr+Hr*s))]}backward(t){const e=t[0]/Yr,i=t[1]/Yr,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*(zr+jr*r+n*(Gr+Hr*r))-i,a=zr+3*jr*r+n*(7*Gr+9*Hr*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*Wr*e*(zr+3*jr*r+n*(7*Gr+9*Hr*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/Wr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const Ur=63.78137,Xr=Math.PI/180;class Kr extends pr{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*Xr);return[Ur*(t[0]+this.offset[0]-this.scroll)*Xr,Ur*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(Ur*Xr),(2*Math.atan(Math.exp((t[1]-this.offset[1])/Ur))-Math.PI/2)/Xr]}}const qr=Math.PI/4,Jr=Math.PI/180,Qr=63.78137;class tn extends pr{project(t){return[(t[0]+this.offset[0]-this.scroll)*Jr*Qr,79.7267125*Math.log(Math.tan(qr+.4*(t[1]+this.offset[1])*Jr))]}backward(t){return[(t[0]-this.offset[0])/Qr/Jr,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/Qr*.8))-qr)/Jr]}}class en extends ns{}class sn extends os{_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 en(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return bi.create(t,Si,0,0,e,e,2)}}sn.type="bar",sn.defaults=Be(os.defaults,{barWidth:.7,overflow:!1,barOrder:"normal"});class rn extends ze{constructor(t){super(t.chart),this.gauge=t}}class nn extends rn{}nn.defaults=Be(ze.defaults,{visible:!1});class on extends rn{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}on.defaults=Be(ze.defaults,{});class an extends rn{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}an.defaults=Be(ze.defaults,{thickness:"100%",stroked:!1});class hn extends rn{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}hn.defaults=Be(ze.defaults,{visible:!1,radius:3,length:"100%",offset:0});class ln extends rn{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}ln.defaults=Be(ze.defaults,{visible:!1,radius:5});class cn extends Ge{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}cn.defaults=Be(Ge.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class dn{constructor(){this.setCenterX(un.DEF_CENTER),this.setCenterY(un.DEF_CENTER),this.setRadius(un.DEF_RADIUS),this.setInnerRadius(un.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=H(y(t,un.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=H(y(t,un.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(y(t,un.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=H(y(t,un.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=H(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),i=u(e,this._innerDim?W(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?W(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=f(t%360,0),s=p(0,u(360,f(e,360)));this._startRad=I+N*i,this._handRad=N*i,this._sweepRad=N*s}}class _n extends as{_readObject(t,e){super._readObject(t,e)}}class un extends ls{_doInit(t){super._doInit(t),t.face=(this._face=new nn(this))._init(),t.rim=(this._rim=new on(this))._init(),t.valueRim=(this._valueRim=new an(this))._init(),t.hand=(this._hand=new hn(this))._init(),t.pin=(this._pin=new ln(this))._init(),t.gaugeLabel=(this._gaugeLabel=new cn(this.chart))._init(),this._props=new dn}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 _n(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)}}un.DEF_CENTER="50%",un.DEF_RADIUS="50%",un.DEF_INNER="80%",un.type="gauge",un.defaults=Be(ls.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class pn extends ze{constructor(t){super(t.chart),this.gauge=t}}class gn extends pn{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}gn.defaults=Be(ze.defaults,{thickness:3});class mn extends pn{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}mn.defaults=Be(ze.defaults,{thickness:1.5,length:"55%"});class fn extends mn{}fn.defaults=Be(mn.defaults,{thickness:1,length:"80%"});class bn extends mn{}bn.defaults=Be(mn.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class yn extends pn{}yn.defaults=Be(ze.defaults,{length:5});class wn extends pn{}wn.defaults=Be(ze.defaults,{step:1,offset:0});class xn extends pn{}xn.defaults=Be(ze.defaults,{radius:4});class vn extends Ge{}vn.defaults=Be(Ge.defaults,{text:"RealMap",position:"top"});class Cn extends as{getTime(){const t=this.time;return t instanceof Date?t:n(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=f(e.time,NaN),this.timezone=f(e.timezone,NaN)}}class Sn extends hs{_doInit(t){super._doInit(t),t.face=(this._face=new ze(this.chart))._init(),t.rim=(this._rim=new gn(this))._init(),t.hourHand=(this._hourHand=new mn(this))._init(),t.minuteHand=(this._minuteHand=new fn(this))._init(),t.secondHand=(this._secondHand=new bn(this))._init(),t.tick=(this._tick=new yn(this))._init(),t.tickLabel=(this._tickLabel=new wn(this))._init(),t.pin=(this._pin=new xn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new vn(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=u(t,e)*i;return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new Cn(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=H(y(e._centerX=t,Sn.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=H(y(e._centerY=i,Sn.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=H(y(e._radius=s,Sn.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Sn.DEF_CENTER="50%",Sn.DEF_RADIUS="50%",Sn.type="clock",Sn.defaults=Be(hs.defaults,{centerX:Sn.DEF_CENTER,centerY:Sn.DEF_CENTER,radius:Sn.DEF_RADIUS,active:!0,size:70});class Ln extends ts{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class An extends ze{getSize(){return{width:this._op.width,height:this._op.height}}}An.defaults=Be(ze.defaults,{});class Mn extends Qi{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Oi(this.chart))._init(),t.innerImage=(this._innerImage=new An(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 Ln(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}$_calcBox(t){if(s(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}Mn.type="figure",Mn.defaults=Be(Qi.defaults,{position:"top"});class Pn extends Oi{}Pn.defaults=Be(Oi.defaults,{visible:!1});class kn extends Di{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class In extends Ki{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Pn(t)}_createPoint(t){return new kn(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+="/")}}In.type="image",In.defaults=Be(Ki.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Nn extends kt{constructor(t,e){super(t,Si),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 En extends ns{}class Tn extends ze{}Tn.defaults=Be(os.defaults,{visible:!1});class Vn extends os{_doInit(t){super._doInit(t),t.area=(this._area=new Tn(this.chart))._init()}get area(){return this._area}_createPoint(t){return new En(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Nn(t,e)}}Vn.type="line",Vn.defaults=Be(os.defaults,{});class Dn 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?y(super.getParam(t),this.area.source.props[t]):super.getParam(t)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class Rn extends ze{}Rn.defaults=Be(ze.defaults,{enabled:!0,autoMapChange:!0});class $n extends ze{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return n(e)?(t.name=e,!0):super._doSetSimple(t,e)}}$n.defaults=Be(ze.defaults,{});class On extends ze{constructor(t,e){super(e.chart),this.name=t,this.series=e}}On.defaults=Be(ze.defaults,{visible:!1});class Bn extends He{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"}}Bn.defaults=Be(He.defaults,{visible:void 0});class Fn extends Oi{}Fn.defaults=Be(Oi.defaults,{visible:!1,hoverColor:"white"});class zn extends Qi{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Rn(this.chart))._init(),t.insetLabel=(this._insetLabel=new Bn(this.chart))._init(),t.internalBorder=(this._internalBorder=new On(null,this))._init(),t.externalBorder=(this._externalBorder=new On(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 Dn||(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 Fn(t)}$_createDetail(){return this._detail||(this._detail=new zn(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){if(this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),e.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(s(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new Dn(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var r;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:s(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,i(e.colorRange)){const t=m(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new xs(t)}else this._colorRanger=null===(r=t.getColorScale(this._op.colorScale))||void 0===r?void 0:r.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(s(t)?t[0]:t)||"id",r=(s(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[r]]:o[t.source[r]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Se(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new $n(t.name,this);i._init(),i._load(t),e.push(i)}))}}zn.type="map",zn.defaults=Be(Qi.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class jn extends Oi{}jn.defaults=Be(Oi.defaults,{visible:!1});class Gn extends Ji{}class Hn extends ze{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 $e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}Hn.defaults=Be(ze.defaults,{});class Wn extends Hn{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Wn.defaults=Be(Hn.defaults,{text:"${name}"});class Yn extends Hn{}Yn.defaults=Be(Hn.defaults,{text:"${value}"});class Zn extends Qi{_doInit(t){super._doInit(t),t.header=(this._header=new Wn(this))._init(),t.divider=(this._divider=new ze(this.chart))._init(),t.body=(this._body=new Yn(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:f(this._width,at.clampEx(t,this._minWidth,this._maxWidth)),height:f(this._height,at.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new jn(t)}_createPoint(t){return new Gn(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}}Zn.DEF_MIN_WIDTH=80,Zn.DEF_MIN_HEIGHT=50,Zn.type="panel",Zn.defaults=Be(Qi.defaults,{orientation:"vertical",minWidth:Zn.DEF_MIN_WIDTH,minHeight:Zn.DEF_MIN_HEIGHT,position:"top"});class Un extends is{}class Xn{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class Kn extends rs{getRadius(t){return f(W(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 Un(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=f(e.startAngle%360,0),s=p(0,u(360,f(e.totalAngle,360)));this._startRad=I+N*i,this._totalRad=N*s}$_parseThresholds(t){return s(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new Xn(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new Xn(t.value,t.radius,t.style)]:void 0}}Kn.type="pie",Kn.defaults=Be(rs.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class qn extends Tt{constructor(t,e){super(t,Si),this._rd=e,this.setPath(si.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 Jn extends ts{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class Qn extends es{getExt(t,e){const i=f(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=f(t.radius,Qn.DEF_RADIUS),this._innerRd=f(t.innerRadius,0)}_createPoint(t){return new Jn(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new qn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Se(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()}}Qn.DEF_RADIUS=9,Qn.type="pin",Qn.defaults=Be(es.defaults,{radius:Qn.DEF_RADIUS,innerRadius:0,position:"top"});class to extends kt{constructor(t,e){super(t,Si),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);si.setShape(this._marker,this._shape,e,e)}}class eo extends ts{_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 io extends es{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(){return this._op.shape||this._shape}getRadius(){return f(this._op.radius,io.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new eo(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 to(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),u(e,2*this._op.radius)),i}}io.type="point",io.defaults=Be(es.defaults,{radius:5,position:"center"});class so extends kt{constructor(t,e){super(t,Si),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=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 ro extends Di{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return h(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,r;const o=function(t){let e=[];return s(t)?t.forEach((t=>{s(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(r=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==r?r:[],this.path=null!=e.path?o(e.path):void 0}}class no extends Ki{needMapScale(){return!0}_createPoint(t){return new ro(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(s(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const i=h({},t);if(s(i.coords)){const t=i.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new so(t,e)}}no.type=hi,no.defaults=Be(Ki.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class oo extends is{}class ao extends rs{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 oo(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||ao.ROW_COUNT,this._colCount=t.colCount||ao.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||ao.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||ao.CELL_SIZE,this._gap=f(t.gap,ao.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=s(t.values)?t.values.reduce(((t,e)=>t+f(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*f(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}}ao.ROW_COUNT=10,ao.COL_COUNT=10,ao.THRESHOLD=1,ao.CELL_SIZE=5,ao.GAP=2,ao.type="waffle",ao.defaults=Be(rs.defaults,{rowCount:ao.ROW_COUNT,colCount:ao.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:ao.THRESHOLD,cellSize:ao.CELL_SIZE,gap:ao.GAP});class ho extends ur{static loadMap(t,e){return i(t)&&i(t.source)&&s(t.source.features)||i(t)&&i(t.map)&&s(t.map.features)?new ho(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new lr(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 lo extends pt{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=f(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 co extends pt{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=f(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 _o extends ze{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}_o.defaults=Be(Ki.defaults,{visible:void 0,globeFill:"lightblue"});const uo={zoom:1,panX:1,panY:1};class po extends ze{constructor(t){super(t),this._prj=(new Fr).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new ai(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new _o(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 fr?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof fr?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,_=f(this._op.panX*d,0),u=f(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,b=c/d*a,y=c/d*l,w=s.x1+a/2-b/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=_t.create(w,x,b,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,_=f(this._op.panX*d,0),u=f(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,b=l/d*h,y=s+a/2-m/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=_t.create(y,w,m,b),{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 s,n;o(e)?n=e:r(e)?(s=e,n=300):i(e)&&(s=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new lo(this,t,n,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new co(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={...ri,...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 co(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 co(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 uo;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 uo)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o,a;const h=this;var l;super._doApply(t),e.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new fr;break;case"equalearth":h._prj=(new Zr).prepareSecond();break;case"miller":h._prj=(new tn).prepareSecond();break;case"mercator":h._prj=(new Kr).prepareSecond();break;default:h._prj=(new Fr).prepareSecond()}return!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof fr&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,f(t,100)))}(t.zoom);const u=this._points={};s(t.points)&&t.points.forEach((t=>{s(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=s(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}po.defaults=Be(ze.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class go extends zn{}class mo extends ze{constructor(){super(...arguments),this._widgetGaps=new bt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}mo.defaults=Be(ze.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class fo extends ft{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=ti.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Jt,this._series=new qi(this),this._annotations=new ai(this),this._widgetGroups=new qe(this),this._legends=new ws(this),this._colorScales=new Es(this),this._bubbleScales=new fs(this),(this._chartOptions=new mo(this))._init(),(this._axis=new Zs(this))._init(),(this._body=new po(this))._init(),(this._exporter=new Ts(this))._init(),(this._title=new Er(this))._init(),(this._subtitle=new Tr(this))._init(),(this._zoomPanel=new kr(this))._init(),(this._drilldownPanel=new Ir(this))._init(),(this._mapScale=new Mr(this))._init(),(this._credits=new Qe(this))._init(),(this._tooltip=new Vr(this))._init(),this.options=Object.assign({},fo.defaults),i(t)?this._load(t):this._initOptions(),this._selection=new Nr(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 n(t)&&$i[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ni[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 Fr).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 Lr?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 zn))}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 zn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}requestRender(t){this._fireEvent("onRequestRender",t)}mapByName(t){return this._maps.find((e=>e&&e.name===t))}mapAt(t){return this._maps[t]}getMap(t){return n(t)?this.mapByName(t):this.mapAt(+t)}getSeries(t){return o(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}_collectWidgets(){const t={};for(const e of Object.values(Q))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(Q)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Fe(n={},r.base),i(r[s])&&(n||(n={}),Fe(n,r[s])),n?Fe(n,t):t}_setProperties(t,e=!0){const i=this.options;for(const e in fo.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(y(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const r=s(t.map)?t.map:i(t.map)?[t.map]:null;return s(r)&&(r.forEach(((t,e)=>{if(!1!==t.enabled){const i=br.loadMap(t,e)||ho.loadMap(t,e),s=i&&new Lr(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,go),this._series.get(0)instanceof zn||!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(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=h({},s))}["@series","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return Fe(Fe({},i),t)}else s(e)&&e.forEach((e=>{let i=this._templates[e];return i?Fe(Fe({},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(i(t)){this._setProperties(t,!1);for(const e in t){const i=this[e];(i instanceof ze||i instanceof je||i instanceof Jt)&&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 zn&&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 zn&&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 r(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 Ue){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()})}}fo.defaults={type:"map",startOfWeek:0},Ki.register(zn,io,Qn,sn,Kn,Mn,_s,no,In,Vn,Zn,ao,un,Sn),oi.register($r,Or,Br,Rr);const bo="$ctrl";class yo{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new fo(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 n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart ";at.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new fo(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",Oe),at.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,s){var r;if(!i(t))return this;const n=this[bo];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const i="load chart ";at.LOGGING&&console.time(i),await C.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new fo(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",Oe),at.LOGGING&&console.timeEnd(i),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 zn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof zn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof zn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof zn&&this._obj.drillup(e)}}class wo extends kt{constructor(t,e,i){super(t,i,"image"),this._dirty=!0,this._bounds=ht,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 xo extends kt{constructor(t,e){super(t,xo.STYLE),this._spinnerWrapper=new kt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new wo(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=xo.LOADING_SPINNER,this._spinner.width=xo.SPINNER_LENGTH,this._spinner.height=xo.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-xo.SPINNER_LENGTH/2,t.height/2-xo.SPINNER_LENGTH/2)}}xo.STYLE="rm-loading-indicator",xo.BACK_STYLE="rm-loading-background",xo.SPINNER_LENGTH=64,xo.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class vo{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?U.DOWN:n>135&&n<=225?U.LEFT:n>225&&n<=315?U.UP:U.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 Co extends mt{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 So extends Co{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class Lo extends Co{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 Ao extends vo{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof Lo&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=ot?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 Di){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/f(Math.max(1,e.options.wheelZoomFactor),4),t.preventDefault(),!0}}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,i){const s=this.$_chart();return s.isGlobe?new So(this.control):s.body.isScrollable()||s.body.movable?new Lo(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 Dn&&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 Po extends kt{constructor(t,e=A){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Po.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Po.IGNORE_ATTRS={width:"",height:""};class ko extends Po{constructor(t,e){super(t,e),this.add(this._text=new Pe(t,void 0)),this._text.anchor=Le.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 bi(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 Pe(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 wo(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=Se.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._icon;let e=0;const i=this._text.bbox(),s=i.width,r=i.height;let n,o=s,a=r,h=0,l=0,c=0,d=0;if(this._box=void 0,t){const i=t.bbox();switch(e=f(this._model.options.iconGap,0),h=i.width,l=i.height,this._model.getIconPos()){case"left":case"right":o+=e+h,a=Math.max(l,r);break;default:a+=e+l,o=Math.max(h,s)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),c=parseFloat(n.paddingLeft)||0,d=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,o+c+(parseFloat(n.paddingRight)||0),a+d+(parseFloat(n.paddingBottom)||0),n.rx)),t)switch(this._model.getIconPos()){case"left":t.trans(c,(a-l)/2),c+=h+e,o-=h+e;break;case"right":t.trans(c+o-h,(a-l)/2),o-=h+e;break;case"top":t.transX((o-h)/2),d+=l+e;break;case"bottom":t.trans((o-h)/2,d+r+e)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":c+=o/2,this._text.anchor=Le.MIDDLE;break;case"right":c+=o,this._text.anchor=Le.END;break;default:this._text.anchor=Le.START}return this._text.trans(c,d),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,d)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Io extends kt{constructor(t,e=A){super(t,e,"g"),kt.DEBUGGING&&(this.add(this._debugRect=new bi(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),kt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new bi(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 No extends Io{constructor(t,e,i){super(t,e),this._margins=new bt,this._paddings=new bt,this.add(this._background=new bi(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 Eo extends Po{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 To extends ko{constructor(t){super(t,"rm-map-widget-title")}}class Vo extends ko{constructor(t){super(t,"rm-map-widget-footer")}}class Do extends No{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new To(t)),this.add(this._footerView=new Vo(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 Ro extends mt{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 $o extends Io{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new bi(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Pe(t,"rm-legend-item-label")),this._label.anchor=Le.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():ht,n=ct(this._label.bbox());return this._gap=f(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:p(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=f(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 Oo extends Do{constructor(t){super(t,Oo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Ro(this,$o)}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=f(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 g,m,f,b;h.forEach(((e,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||bs.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=[],g=m=0,_.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=p(i,t.mw),r=p(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=p(m,s),g+=i,u.push(i),this._wMarkers.push(r)})),g+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%s===0?(_.push(f=[b]),g=b.mw,w++,y++):(g+=l+b.mw,g<=r?(f.push(b),w++,y++):w=0);g=m=0,_.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=p(i,t.mh)})),e+=l*(t.length-1),g=p(g,e),m+=i,u.push(i)})),m+=c*(_.length-1)}return 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),{width:g,height:m}}}Oo.LEGEND_CLASS="rm-legend";const Bo={};class Fo extends No{static register(...t){t.forEach((t=>{Bo[t[0].type]=t[1]}))}constructor(t,e){super(t,Fo.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)}}Fo.CLASS_NAME="rm-annotation";class zo{static interpolate(t,e){if(e instanceof fr==!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=yr(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 jo{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(jo.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(jo.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 fr?zo.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 Go extends Tt{renderLat(t,e,i,s,r){let n=r.project([e,t]),o=Ai(n)?`M${n[0]},${n[1]}`:"";if(r.latElliptic){let a=e+s;const h=t=>{n=r.project(t),Ai(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=Ai(n)?`M${n[0]},${n[1]}`:"";if(r.lonElliptic){let a=e+s;const h=t=>{n=r.project(t),Ai(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 Ho extends Io{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new Ro(this,Go),this._lonPool=new Ro(this,Go)}_doInitStyles(){this.ignorePointer()}prepare(t){this._latPool.prepare((t.y2-t.y1)/t.latStep+1,null,(t=>{At.setNoScale(t.dom)})),this._lonPool.prepare((t.x2-t.x1)/t.lonStep+1,null,(t=>{At.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;At.setImportantStyle(this.dom.style,"pointer-events","none"),At.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 Wo extends It{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new It(t,"rm-axis-tick-labels")),this._labelPool=new Ro(this._labelLayer,Pe)}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 Yo extends Io{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Ho(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 Zo extends ko{}class Uo extends Io{constructor(t,e){super(t),this.add(this._pathView=new Tt(t)),e.add(this._labelView=new Zo(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Hs?"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=jo.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=jo.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return jo.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(...jo.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath(jo.coordsToPath(_.map((t=>r.project(t))))),a.push(...jo.verticalLineToUp(d,h,l,o));const u=jo.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath(jo.coordsToPath(u.map((t=>r.project(t))))),a.push(...jo.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(...jo.verticalLineToUp(o,l,c,n));const d=[...a],_=jo.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath(jo.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(jo.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return jo.coordsToPath(jo.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=jo.ellipse(t[0],t[1],e,i,s)}else r=jo.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);Ai(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);Ai(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);Ai(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);Ai(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class Xo extends Po{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new bi(t,"rm-crosshair-flag-back")),this.add(this._text=new Pe(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 Ko extends Io{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Go(t,"rm-crosshair-line")),this.add(this._lonLine=new Go(t,"rm-crosshair-line")),At.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),At.setImportantStyle(this._latLine.dom.style,"fill","none"),At.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),At.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Xo(t)),this.add(this._lonFlag=new Xo(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 fr?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 fr;_?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 fr;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 qo="rm_map_globe_fill";class Jo 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=si.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof fr)){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=si.circle(n+h,o+h,h),a!==this._globeFill){if(this.control.removeDef(qo),a){const e={id:qo,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Ut(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${qo})`),this.internalSetStyleOrClass(e._style),i}}class Qo extends Tt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){at.isNum(t)?this.setPath(si.line(t,e,i,s)):t&&this.setPath(si.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(si.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(si.line(t,e,t,i))}setHLine(t,e,i){this.setPath(si.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(si.line(e,t,i,t))}}class ta extends Tt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){at.isNum(t[0])?this.setPath(si.lines(...t)):s(t[0])?this.setPath(si.lines3(...t)):this.setPath(si.lines2(...t))}}var ea;class ia extends Ro{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class sa extends ko{constructor(t){super(t,"rm-point-label")}}class ra extends It{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Ro(this,sa),new Ro(this,sa)],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 na extends Po{constructor(t){super(t),this.add(this._line=new ta(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(si.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=da.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 oa extends Dt{constructor(t){super(t),this.add(this._back=new bi(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(si.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(si.rect(t).concat(si.rect(e))):this._mask.setPath(si.rect(t)),this}}class aa extends It{constructor(t,e){super(t,e),this._callouts=new Ro(this,na),this._map={},this.add(this._maskLayer=new It(t)),this._masks=new Ro(this._maskLayer,oa),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 ha extends Vt{constructor(t,e=!1){super(t,da.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 la extends It{}const ca={};class da extends Io{static register(...t){t.forEach((t=>{ca[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof ea)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>si[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=kt.createElement(t,"defs")),this.add(this._pointLayer=new It(t)),this._pointLayer.add(this._pointContainer=new la(t,"rm-series-points")),this.add(this._calloutContainer=new aa(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 zn?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 zn||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 ra(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 f(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&at.log("CLICKED: ",t.point.name,t.point.getValue())}}ea=da,da.POINT_CLASS="rm-point",da.DATA_HOVER="hover",da.DATA_UNHOVER="unhover",da.LEGEND_MARKER="rm-legend-item-marker",da._drawers=Object.assign({circle:t=>si.circle(0,0,t)},ea._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class _a extends ha{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class ua extends da{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 pa extends ha{prepare(t,e){return this.point=t,this._ext=at.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 ga extends da{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class ma extends pa{constructor(t){super(t,!0),this.add(this._contentLayer=new It(t)),this.add(this._baseLine=new Qo(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class fa extends ga{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,f(t._minValue,i.min)),i.max=Math.max(i.max,f(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 ba extends ha{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class ya extends da{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class wa extends Fo{constructor(t){super(t,wa.CLASS_NAME),this.add(this._imageView=new wo(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)}}wa.CLASS_NAME="rm-image-annotation";class xa extends Fo{constructor(t){super(t,xa.CLASS_NAME),this.add(this._shapeView=new Tt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),si.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)}}xa.CLASS_NAME="rm-shape-annotation";class va extends Fo{constructor(t){super(t,va.CLASS_NAME),this.add(this._textView=new Pe(t)),this._textView.anchor=Le.START,this._richText=new $e}_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:f(n.width,a.width),height:f(n.height,a.height)}}_doLayout(t){this._richText.layout(this._textView,getComputedStyle(this._textView.dom).textAlign,this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}va.CLASS_NAME="rm-text-annotation";class Ca{static reveal(t,e){new La(t,e)}static grow(t,e){new Ma(t,e)}static spread(t,e){new Pa(t,e)}static fadeIn(t){new Sa(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 Sa extends Ca{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:pt.DURATION,fill:"none"})}}class La extends Ca{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:pt.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:$(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:$(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class Aa extends pt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof kt}_stop(){super._stop(),this._series=null}}class Ma extends Aa{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Pa extends Aa{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ka extends Tt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(si.bar(t-i/2,e,i,-s,r,n))}}class Ia extends ma{constructor(t){super(t),this._bars=new Ro(this._contentLayer,ka)}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(si.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 Na extends _a{tooltipColor(){return getComputedStyle(this.dom).fill}}class Ea extends Tt{static create(t,e,i,s,r,n,o,a,h=!0){return new Ea(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 Ea(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=A,i=A){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 si.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 si.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 Ta=function(t){return isNaN(t)?0:t};class Va{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return o(t)?this._path.push("M",Ta(t),Ta(e)):this._path.push("M",Ta(t.x),Ta(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",Ta(t),Ta(e)):this._path.push("m",Ta(t.x),Ta(t.y)),this}movep(t,e){return o(t)?this._path.push("M",O(t),O(e)):this._path.push("M",O(t.x),O(t.y)),this}line(t,e){return o(t)?this._path.push("L",Ta(t),Ta(e)):this._path.push("L",Ta(t.x),Ta(t.y)),this}linep(t,e){return o(t)?this._path.push("L",O(t),O(e)):this._path.push("L",O(t.x),O(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ta(t[e]),Ta(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ta(t[e].x),Ta(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 Da 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 Va;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 Ra=class extends Tt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new Va).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class $a extends ba{constructor(t){super(t),this.add(this._faceView=new Ea(t,"rm-circle-gauge-face")),this.add(this._rimView=new Ea(t,"rm-circle-gauge-rim")),this.add(this._valueView=new Ea(t,"rm-circle-gauge-value")),this.add(this._textView=new Pe(t,"rm-circle-gauge-text")),this.add(this._handContainer=new It(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 Da(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 Ra(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=u(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.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",$(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 Oa extends kt{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 Ba extends pt{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 Fa extends ba{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Oa(t,"rm-clock-gauge-face")),this.add(this._rimView=new Ea(t,"rm-clock-gauge-rim")),this.add(this._labelView=new Pe(t,"rm-clock-gauge-label")),this._labelView.layout=Ae.MIDDLE,this.add(this._tickContainer=new It(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new It(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Tt(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Tt(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Tt(t,"rm-clock-gauge-second")),this.add(this._pinView=new Oa(t,"rm-clock-gauge-pin")),this._tickViews=new Ro(this._tickContainer,Qo,"rm-clock-gauge-tick"),this._tickLabelViews=new Ro(this._tickLabelContainer,Pe,"rm-clock-gauge-tick-label")}prepare(t,e){const i=Math.round(12/p(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?i:0,(t=>{t.layout=Ae.MIDDLE})),this._zoneCallback=e.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),g(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.options.animatable&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.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-u,m=I,f=k/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+d(m)*p,h+_(m)*p,a+d(m)*g,h+_(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,i=k/12*e;m=I,n.get(0).text="12",g=p-(u+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+d(m)*g,h+_(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=b(t.timezone,null===(e=this._zoneCallback)||void 0===e?void 0:e.call(this,t.coord[0],t.coord[1]),60*Math.round(t.coord[0]/15)),r=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 Va;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=k*(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=k*(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?k*(this._aniSec+this._secRate)/60:k*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 Ba(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class za extends ha{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.add(this._figure=new Et(t)),this._back.add(this._textView=new ko(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=kt.createElement(t,"use"),this._textView.dom),At.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,At.setAttrs(this._figure.dom,{x:i,y:r}),At.setAttrs(e,{x:n,y:o})}if(i.visible){const t=i.bbox(),e=At.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 ja extends ha{constructor(t){super(t,!0),this.add(this._imageView=new wo(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 Ga{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:pt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:$(t.width)}],this.$_aniOptions())}}let Ha=class extends ma{constructor(t){super(t),this._contentLayer.addAll(this._back=new bi(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 Va;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 Wa="rm-map-series-id-";class Ya extends ha{static idClass(t){return Wa+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Wa))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(Ya.idClass(this.model))}this.setBoolData("selected",s&&s._selected)}reset(){this.model=null}}class Za extends Tt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Ua 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 Xa 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=u(e,t[n][0]),s=p(s,t[n][0]),i=u(i,t[n][1]),r=p(r,t[n][1]);this._center=[e+(s-e)/2,i+(r-i)/2]}return this._center}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=this._pts=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);this._pts=[n],i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`,this._pts.push(n);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class Ka extends ko{constructor(t){super(t,"rm-point-label rm-point-inset")}}class qa extends It{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new Ro(this,Ka),new Ro(this,Ka)],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 Ja extends da{constructor(t){super(t,"rm-map-series",!0,!1),this._areas={},this._insetLabelContainer=new qa(t),this._areaPool=new ia(this._pointContainer,Ya),this._insetPool=new Ro(this._pointContainer,Xa)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s,r;const n=this._hoverArea;if(t!==n){const r=this.model;if(n&&(n.setBoolData(da.DATA_HOVER,!1),n.point&&(null===(e=this._labelContainer.get(n.point,0))||void 0===e||e._text.setBoolData(da.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&&i(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(da.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(da.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=Ya.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 It(t,"rm-map-series-internals")),this._internalPool=new Ro(this._internalContainer,Za)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),r.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new It(t,"rm-map-series-externals")),this._externalPool=new Ro(this._externalContainer,Za)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),r.hasBorders&&a.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new It(t,"rm-map-series-borders")),this._borderPool=new Ro(this._borderContainer,Ua))),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(),At.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"),At.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"),At.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),At.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)=>{At.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&&Ca.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 Cr){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 Qa extends Io{constructor(t,e,i){super(t,e),this._paddings=new bt,this.add(this._background=new Tt(t,i)),this.add(this._textView=new Pe(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const n=e.options.text;n?(e.prepareRich(n),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;r(a)&&(a=a(e.series.getPointArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,i=this.width;let s=0;this._renderBackgrouond(this._background,i,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":s+=i/2,e.anchor=Le.MIDDLE;break;case"right":s+=i,e.anchor=Le.END;break;default:e.anchor=Le.START}e.trans(s,this._paddings.top)}}class th extends Qa{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(si.bar(0,i,e,-i,s,0))}}class eh extends Qa{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(si.bar(0,i,e,-i,0,s))}}class ih extends ha{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.addAll(this._borderView=new bi(t),this._headerView=new th(t),this._bodyView=new eh(t),this._divider=new Qo(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 sh extends Ea{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class rh extends pa{constructor(t){super(t,!0),this._sectors=new Ro(this,sh,null,.5),this._rdRate=1,this.add(this._circle=new Oa(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:g(t.angle),clockwise:o}),t.internalClearStyleAndClass(),n[r]&&n[r].color&&t.setFill(n[r].color)}}))}}class nh extends _a{constructor(t){super(t,!0),this.add(this._pin=new Tt(t))}render(t){this._pin.setPath(si.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Oa(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 oh extends _a{}class ah extends ha{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=R(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 hh extends pa{constructor(t){super(t,!0),this._cells=new Ro(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(si.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 lh extends ga{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new ia(this._pointContainer,hh)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ca.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 ch extends Fo{constructor(t){super(t,ch.CLASS_NAME),this.add(this._foreignObj=new kt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=ch.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(f(n.width,Rr.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 dh(t,e){return new(Bo[e._type()])(t)}ch.CLASS_NAME="rm-html-annotation",ch.HTML_VIEW_CLASS="rm-html-annotation-view",da.register([zn,Ja],[io,class extends ua{constructor(t){super(t,"rm-point-series",!0,!0)}_createMarkers(t){return new ia(t,oh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ca.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=da.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)}}}))}}],[Qn,class extends ua{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new ia(t,nh)}_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)}}))}}],[sn,class extends fa{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._bars=new ia(this._pointContainer,Ia)}_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,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ca.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)}}))}}],[Vn,class extends fa{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new ia(this._pointContainer,Ha)}_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,f(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Ga(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)}}))}}],[Kn,class extends ga{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new ia(this._pointContainer,rh)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ca.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 da{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new ia(this._pointContainer,za)}$_createFigure(t){const e=kt.createElement(t,"symbol");return e.append(kt.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=kt.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const s=e.figureBox,r=e.innerImage.options;At.setAttr(this._figure,"viewBox",s?`0 0 ${s[0]} ${s[1]}`:null),At.setAttr(this._figure.firstElementChild,"d",e.path),At.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&&Ca.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())}}}))}}],[ao,lh],[no,class extends da{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new ia(this._pointContainer,ah,"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(f(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&Ca.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"),At.setNoScale(i._line.dom),i._arrow.setStroke("none"),At.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(ot){const t=f(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=f(t,1),this._lines.forEach(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,r,o){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(s(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const s=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(s.length=s.length*o|0),t.render(e,1/this._scale,s,"none"!==r&&(o<1||"moving"!==r))}}$_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=D(t[1]),r=D(t[0]),n=D(e[1]),o=D(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[R(Math.atan2(d,c)),R(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=D(r[1]),o=D(r[0]),a=n+s*Math.sin(Math.PI/2);return[R(o+s*Math.cos(Math.PI/2)),R(a)]}}],[_s,class extends ua{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new ia(t,Na)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,f(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ca.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(),p=s.getSubLabelOff(),g=s.getCallout(),m=this._calloutViews(),{min:f,max:b}=s.getPixelMinMax(u(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,u=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(y=n.getVisible(u)))){const e=this._getPointPositioner(r.position||h,"center"),x=da.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(u))&&(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 fr){const e=n.r,i=this.chart().width,s=u[1]*Math.PI/180,r=P/2*(360/i),o=r/Math.cos(s),a=r;n.r=gr*this._scale;const h=jo.geoCircle(u[0],u[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,p))),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())}}}))}}],[In,class extends da{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new ia(this._pointContainer,ja)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ca.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())}}}))}}],[Zn,class extends da{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new ia(this._pointContainer,ih)}_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&&Ca.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=f(u.rx,0);let g,m,b;this._panels.forEach(((u,f)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const f=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,b=f(C,S,m.width,m.height),u.trans(b.x,b.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(b.x+m.width/2,b.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())}}}))}}],[ao,lh],[un,class extends ya{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new ia(t,$a)}_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&&Ca.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)}}))}}],[Sn,class extends ya{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new ia(t,Fa)}_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,_,p;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),_=u(t,e),p=m(x,v,_,_),g.trans(p.x,p.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())&&this._layoutLabel(C,g.dom).transp(o(p.x+_/2,p.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)}}))}}]),Fo.register([Br,va],[$r,wa],[Or,xa],[Rr,ch]);class _h extends pt{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 uh extends pt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class ph extends It{constructor(t,e,i){super(t,""),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new Yo(t,i)),this.add(this.tickLayer=new Wo(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(ca[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&&at.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 gh extends It{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new It(t)),this.add(this._labelLayer=new It(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 Uo(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 mh extends Io{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new bi(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Jo(t)),this.add(this._contentLayer=new It(t,"rm-body-content")),this.add(this._crosshairView=new Ko(t)),this._contentLayer.add(this._annotationContainer=new It(t)),this._contentLayer.add(this._axisGuideContainer=new gh(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new gh(t,!1)),this._contentLayer.add(this._seriesContainer=new ph(t,new It(t),!1)),this._contentLayer.add(this._secondContainer=new ph(t,new It(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 gh(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new gh(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new It(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 _h(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 uh(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)||dh(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 fh extends No{constructor(t,e){super(t,e?fh.SUBTITLE_CLASS:fh.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Pe(t)),this._richText=new $e}_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 bh;fh.TITLE_CLASS="rm-title",fh.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(bh||(bh={}));class yh extends kt{constructor(t){super(t,yh.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(t,"rm-tooltip-back")),this.add(this._top=new Tt(t,"rm-tooltip-top")),this.add(this._textView=new Pe(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Pt.SHADOW_FILTER+")"),this._textView.anchor=Le.START,this._richText=new $e,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,g=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=p(l.minWidth||0,b.width+16),w=p(l.minHeight||0,b.height+12);this._top.setFill((null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,C=e.getBounds(),S=_.getBounds();let L;L=i-y/2-p(0,u(i-y/2,g-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=bh.TOP;this.drawTooltip(0,0,y,w,A,L),s-=w+v,i=p(0,u(i-=y/2,g-y)),s=p(0,u(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:Vr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?G(e,i):{},a=G(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.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 bh.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 bh.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 bh.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 bh.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===bh.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)}}yh.CLASS_NAME="rm-tooltip";class wh extends Do{constructor(t){super(t,wh.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new It(t);this.add(e),e.add(this._boxLayer=new It(t)),this._boxes=new Ro(this._boxLayer,bi,"rm-color-scale-box"),e.add(this._splitLayer=new It(t)),this._splits=new Ro(this._splitLayer,Qo,"rm-color-scale-split"),e.add(this._markerLabel=new ko(t,void 0)),e.add(this._marker=new Tt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new It(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new It(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new It(t,"rm-color-scale-null")),this._tickLines=new Ro(this._tickLineLayer,Qo),this._tickLabels=new Ro(this._tickLabelLayer,ko),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`${wh.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(e,i){const s=e.createElementNS(t,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(e.createElementNS(t,"stop")),s.appendChild(e.createElementNS(t,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?At.setAttrs(t,i?wh.VERT_FILL_I:wh.VERT_FILL):At.setAttrs(t,i?wh.HORZ_FILL_I:wh.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][xi]=i,e++)})),r.forEach((t=>{const e=t[xi];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 bi(t,"rm-color-scale-box")),e.add(this._nullLabel=new ko(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)}}wh.SCALE_CLASS="rm-color-scale",wh.SCALE_FILL="rm-color-scale-fill",wh.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},wh.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},wh.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},wh.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class xh extends kt{constructor(t,e,i){super(t,xh.STYLE),this.add(this._back=new bi(t,xh.BACK_STYLE)),this.add(this._textView=new Pe(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(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Ae.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),s=getComputedStyle(this._back.dom),r=(new bt).applyPadding(s);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+i.width/2,r.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+r.left+r.right,height:i.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}xh.STYLE="rm-button",xh.BACK_STYLE="rm-button-background";class vh extends xh{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class Ch extends Io{}class Sh extends Ch{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new vh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new vh(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new vh(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 Lh extends Ch{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)[vi]),!0}_doMeasure(t,e,i,s){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new Ro(this,Pe,"rm-drilldown-text"),this._seperators=new Ro(this,Pe,"rm-drilldown-separator"));const t=e.chart.firstVisible,i=this._history=t.getHistory();this._textViews.prepare(i.length,((t,e)=>{t.text=i[e].displayName(),t.anchor=Le.START,t[vi]=i[e]})),this._seperators.prepare(i.length-1,(t=>{t.text=">",t.anchor=Le.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new vh(t,"<",(()=>{e.chart.drillup()}))),r.layout();const i=r.bbox();n=i.width,o=i.height}return{width:n,height:o}}_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 Ah extends Do{constructor(t){super(t,Ah.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new It(t);this.add(e),e.add(this._bubbleLayer=new It(t)),e.add(this._lineLayer=new It(t)),e.add(this._labelLayer=new It(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;kt.fit(t,this._bubbleLayer,this._bubbles,r,Oa,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&kt.fit(t,this._lineLayer,this._lines,r,Qo,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&kt.fit(t,this._labelLayer,this._labels,r,ko,"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)}))}}}Ah.SCALE_CLASS="rm-bubble-scale";class Mh extends Do{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 Ph extends Eo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new fh(t,!1)),this.add(this.subtitleView=new fh(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,_=i,u=0,g=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,g=+n.options.titleGap||0):d.setModel(n),n.options.position){case"left":case"right":u=p(h,c),_=a+g+l;break;default:u=h+g+c,_=p(_,a+l)}return u>0&&(u+=this.titleView.visible?f(r.options.gap,0):f(n.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,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=p(this._hTitle,this._hSub);m=p(m,m+t(s,e,this._hTitle)),y=p(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(b=p(b,b+_(s,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=b;break;case"right":w=b+this._wTitle-this._wSub;break;default:w=b+(this._wTitle-this._wSub)/2}else w=p(w,w+_(r,h,this._wSub))},g=f(o.titleGap,0);let m=0,b=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":b=w+this._wSub+g,d();break;case"right":switch(w=b+this._wTitle+g,o.align){case"center":w=p(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=p(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;case"right":switch(o.position){case"left":switch(b+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":w+=h-this._wSub,b=w-g-this._wTitle,d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}break;default:switch(o.position){case"left":switch(b+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(b-w-this._wSub)/2;break;case"right":w=b-g-this._wSub}d();break;case"right":switch(b+=(a-this._wTitle)/2,o.align){case"left":w=b+this._wTitle+g;break;case"center":w=b+this._wTitle+g,w+=(h-w-this._wSub)/2;break;case"right":w+=h-g-this._wSub}d();break;case"top":u(),m=y+this._hSub+g;break;default:u(),y=m+this._hTitle+g}}e.resizeByMeasured().layout().trans(b,m),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 kh extends Do{constructor(t){super(t,kh.GROUP_CLASS,"rm-map-widget-group-background"),this.add(this._widgetLayer=new It(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(Ih[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}kh.GROUP_CLASS="rm-map-widget-group";const Ih={legend:Oo,colorScale:wh,bubbleScale:Ah,group:kh};class Nh extends Eo{constructor(t,e){super(t),this._loc=e,this._horz=e==Q.TOP||e==Q.BOTTOM,this._vert=e==Q.LEFT||e==Q.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){return this._views.get(t)}_setWidgets(t,e,i){return s(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof Oo&&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=f(+e.chartOptions.options.widgetGap,0),o=new Mo;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=p(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=p(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=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(Ih[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 Eh extends Io{constructor(t){super(t,"rm-credits"),this.add(this._textView=new Pe(t)),this._textView.anchor=Le.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 Th extends It{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new It(t,"rm-annotations")),this.add(this._bodyView=new mh(t,this)),this.add(this._titleSectionView=new Ph(t)),this.add(this._widgetLayer=new It(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new It(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Sh(t)),this.add(this._drilldownPanelView=new Lh(t)),this.add(this._mapScaleView=new Mh(t)),this.add(this._creditView=new Eh(t)),this.add(this._tooltipView=new yh(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(Q)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Nh(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===Q.BOTTOM||r===Q.TOP?h-=l.height+t:r!==Q.RIGHT&&r!==Q.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._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===Q.RIGHT||n===Q.LEFT?(o.resize(o.mw,i),o.layout()):n===Q.TOP||n===Q.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.chartOptions.getWidgetSectionGap(n);switch(n){case Q.BOTTOM:r-=o.height+a;break;case Q.TOP:r-=o.height+a,d+=o.height+a;break;case Q.RIGHT:s-=o.width+a;break;case Q.LEFT:s-=o.width+a,c+=o.width+a}}}const p=_t.create(c,d,s,r);if(h.visible){const t=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 Q.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case Q.TOP:d=o+0,c=(e-s.width)/2;break;case Q.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case Q.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this._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 Ja&&(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)||dh(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 Vh;!function(t){t.EXPORT="$$realmap_export"}(Vh||(Vh={}));class Dh extends Pt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Th(t)),this.addElement(this._loadingView=new xo(t)),this.addElement(this._errorView=new Pe(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new yo(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===Vh.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(t="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=Ae.MIDDLE,this._errorView.text=t,this._errorView.stain();const{width:e,height:i}=this._errorView.bbox(),s=16+e/2,r=16+i/2;this._errorView.trans(s,r)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new Ao(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=Dh.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)}}Dh.LOADING_VIEW_LENGTH=128;const Rh={chartControl:Dh};class $h{static getVersion(){return"1.0.12"}static setLicenseKey(t){xt.code=t}static setDebugging(t){kt.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static getDistance(t,e){return at.getDistance(t,e)}static setGlobals(t){Object.assign(Rh,t)}static createChart(t,e,s,r=!0,n){C.loadConfigAsync(s,!0);const o=new Rh.chartControl(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[bo]=o,o.chart}static async createChartAsync(t,e,s,r=!0,n){const o=new Rh.chartControl(t,e);o.chart[bo]=o;try{o.showLoadingView(),await C.loadConfigAsync(s),i(s)&&o.chart.load(s,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 ur.createStockInset(t,e)}}class Oh{constructor(){this._moduleMap=new Map}static getInstance(){return Oh.instance||(Oh.instance=new Oh),Oh.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Oh.instance=null,Oh.ModuleNames={realchart:"realchart"};const Bh=$h.getVersion,Fh=$h.setDebugging,zh=$h.setLogging,jh=$h.setGlobals,Gh=$h.getDistance,Hh=$h.createChart,Wh=$h.createChartAsync,Yh=$h.preset,Zh=$h.setLicenseKey;export{oi as Annotation,Fo as AnnotationView,gi as BandSeriesType,sn as BarSeries,po as Body,mh as BodyView,_s as BubbleSeries,Dr as ChartAnnotationType,Dh as ChartControl,Io as ChartElement,ze as ChartItem,fo as ChartObject,Th as ChartView,Oa as CircleElement,un as CircleGauge,Sn as ClockGauge,Se as Color,xs as ColorRanger,Qe as Credits,Di as DataPoint,Oi as DataPointLabel,At as Dom,Co as DragTracker,Ro as ElementPool,Ts as Exporter,Oh as ExternalModuleManager,ci as FeatureSeriesType,Mn as FigureSeries,_i as HeatmapSeriesType,Rr as HtmlAnnotation,$r as ImageAnnotation,In as ImageSeries,It as LayerElement,ys as Legend,Qo as LineElement,Vn as LineSeries,Cr as MapArea,Zs as MapAxis,Gs as MapAxisBandGuide,zs as MapAxisGuide,js as MapAxisLineGuide,Hs as MapAxisRangeGuide,yo as MapChart,Ys as MapCrosshair,zn as MapSeries,li as MapSeriesType,Ao as MapTool,es as MarkerSeries,ts as MarkerSeriesPoint,_a as MarkerSeriesPointView,ua as MarkerSeriesView,I as ORG_ANGLE,os as OrthogonalSparkSeries,k as PI_2,Zn as PanelSeries,Tt as PathElement,Kn as PieSeries,Qn as PinSeries,ha as PointElement,sa as PointLabelView,io as PointSeries,ia as PointViewPool,ta as PolyLineElement,E as RAD_DEG,bi as RectElement,kt as RmElement,no as RouteSeries,hi as RouteSeriesType,fi as SankeySeriesType,Eo as SectionView,Ea as SectorElement,Ki as Series,Ca as SeriesAnimation,da as SeriesView,Or as ShapeAnnotation,Mo as Size,rs as SparkSeries,Tr as Subtitle,mi as TableSeriesType,Le as TextAnchor,Br as TextAnnotation,Pe as TextElement,Ae as TextLayout,ui as TiledWebSeriesType,Er as Title,pi as TrackSeriesType,at as Utils,Ji as ValuePoint,Qi as ValueSeries,di as VectorSeriesType,ao as WaffleSeries,ot as _isIE,g as absv,h as assignObj,W as calcPercent,m as copyObj,d as cos,Hh as createChart,Wh as createChartAsync,lt as createRect,Be as extend,V as fixnum,Gh as getDistance,Bh as getVersion,x as incv,s as isArray,dt as isEmptyRect,i as isObject,n as isString,p as maxv,u as minv,H as parsePercentSize,f as pickNum,y as pickProp,w as pickProp3,$ as pixel,Yh as preset,ct as rectToSize,Fh as setDebugging,jh as setGlobals,Zh as setLicenseKey,zh as setLogging,_ as sin};
|