realmap 1.1.12 → 1.1.13

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * Realmap v1.1.12
3
+ * Realmap v1.1.13
4
4
  * Copyright (C) 2023-2026 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",i=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,o=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,c=Math.cos,d=Math.sin,_=Math.min,u=Math.max,p=Math.abs,g=function(t){if(t&&"object"==typeof t&&!r(t))return l({},t)},m=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},f=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},b=function(t,e){return void 0!==t?t:e},y=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},w=(t,e,i)=>t+(e-t)*i;class x{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}x._debugging=!1;class v{static async loadConfigAsync(t,e=!1){if(t&&!t.map&&console.warn("지도 설정이 비어 있습니다. map 옵션을 지정하세요."),t&&t.map){if(n(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const i=r(t.map)?t.map:[t.map];for(const t of i){const i=s(t.source),r=t.url&&n(t.url);i||r?i||(r&&e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url)):console.warn("지도 소스가 지정되지 않았습니다. source 옵션을 사용하거나 url옵션을 지정하세요. 만약 url 옵션을 사용한다면, 반드시 RealMap.createChartAsync()로 생성해야 합니다.")}}if(t&&t.series){const i=r(t.series)?t.series:[t.series];for(const t of i)if(!s(t.data)&&!r(t.data)&&t.dataUrl&&n(t.dataUrl))if(e)console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl);else{const e=await this.fetchJson(t.dataUrl);delete t.dataUrl,r(e)&&o(t.dataFilter)?t.data=e.filter(t.dataFilter):t.data=e}}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const C={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 S=C.ko;const L=void 0,M="%".charCodeAt(0),A=Math.PI,P=2*A,k=-A/2,I=A/180,N=180/A;function E(t){return t>P?t%P:t}const T=Math.floor,V=Math.ceil;function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function F(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const i={};return i[t]=e,i}function W(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===M&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;q(S.invalidSizeValue,t)}}return{size:s,fixed:i}}function Y(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const Z={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},U=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var X;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(X||(X={}));const q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),i=m(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]);return{l:isNaN(o)?isNaN(s)?i:s:o,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const it="undefined"!=typeof navigator?navigator.userAgent:"",st=it?navigator.appVersion:"",rt=!!it.match(/Trident.*rv\:11\./),ot=-1!==(null==st?void 0:st.indexOf("MSIE 10")),nt=-1!==(null==st?void 0:st.indexOf("MSIE 9")),at=rt||ot||nt;let ht=class t{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(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(_(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),o=new Date(r,s,1).getDay(),n=new Date(r,s+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!r(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(r(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-et}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=u(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=u(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=r(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(e,i){const s=+new Date;i(),t.log(e,+new Date-s+"ms")}static clamp(t,e,i){return u(e,_(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=u(e,t)),isNaN(i)||(t=_(i,t)),t}static makeIntArray(t,e){const i=new Array(u(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=p(t);if(s>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*I,s=(e[1]-t[1])*I,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*I)*Math.cos(e[0]*I)*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=_(e,t[s]),i=u(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(null!=e&&""!==e&&(this.isObject(t)||r(t))){const i=String(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),o=10**Math.floor(Math.log10(r)),n=r/o;let a;a=n<=1?1:n<=2?2:n<=5?5:10,a*=o;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(D(h+t*a));return l}};ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];const lt=Object.freeze({x:0,y:0,width:0,height:0});function ct(t){return{width:t.width,height:t.height}}class dt{static create(t,e,i,s){const r=arguments.length;return ht.isObject(t)?new dt(t.x,t.y,t.width,t.height):r<2?new dt(t,t,t,t):r<3?new dt(t,e,t,e):new dt(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new dt(this.x,this.y,this.width,this.height)}getInner(){return new dt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}dt.Empty=new dt,dt.Temp=new dt;const _t={inOutSine:t=>-(c(A*t)-1)/2};class ut{constructor(){this.delay=0,this.duration=ut.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=_(1,u(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return isNaN(t)||(this.duration=t),this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,i=null){this._started&&this._stop(),this.duration=m(t,ut.DURATION),this.delay=e||0,this._easing=_t[i],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}ut.DURATION=700,ut.SHORT_DURATION=300;const pt=Object.prototype.hasOwnProperty,gt=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},mt=Array.isArray,ft=Math.min,bt=Math.max,yt=Math.abs;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const wt="undefined"!=typeof navigator?navigator.userAgent:"",xt=wt?navigator.appVersion:"";wt.match(/Trident.*rv\:11\./),xt?.indexOf("MSIE 10"),xt?.indexOf("MSIE 9");const vt=(new Date).getTime(),Ct=class t{static setLogging(t){this.LOGGING=t}static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static warn(...t){this.LOGGING&&console.warn(...t)}static warnIf(t,...e){this.LOGGING&&t&&console.warn(...e)}static now(){return+new Date}static parseDate(t,e){const i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(ft(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),o=new Date(r,s,1).getDay(),n=new Date(r,s+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-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&&!mt(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return mt(t)?t:void 0}static makeArray(t,e=!1){return null!=t?mt(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return mt(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(mt(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 mt(t)?t:null!=t?[t]:null}static copyArray(t){return mt(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-vt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=bt(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=bt(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=mt(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return bt(e,ft(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=bt(e,t)),isNaN(i)||(t=ft(i,t)),t}static makeIntArray(t,e){const i=new Array(bt(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=yt(t);if(s>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],i=t[0];for(let s=1;s<t.length;s++)e=ft(e,t[s]),i=bt(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||mt(t))?e.split(".").reduce(((t,e)=>t?t[e]:void 0),t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let o=0;o<s;o++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};Ct.LOGGING=!1,Ct.week_days=["일","월","화","수","목","금","토"],Ct.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],Ct.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];let St=Ct;const Lt=["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"],Mt=["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"],At=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(St.startsWith(e,"rgb(")&&St.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(St.startsWith(e,"rgba(")&&St.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(St.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return"string"==typeof e?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,o=.5){const n=new t(null);return r<o?(n.r=Math.ceil(e.r+(i.r-e.r)*(r/o)),n.g=Math.ceil(e.g+(i.g-e.g)*(r/o)),n.b=Math.ceil(e.b+(i.b-e.b)*(r/o)),n.a=(i.a+e.a)/2):(n.r=Math.ceil(i.r+(s.r-i.r)*((r-o)/(1-o))),n.g=Math.ceil(i.g+(s.g-i.g)*((r-o)/(1-o))),n.b=Math.ceil(i.b+(s.b-i.b)*((r-o)/(1-o))),n.a=(s.a+i.a)/2),n}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};At.TRANSPARENT=new At("rgba(0,0,0,0)"),At.WHITE=new At("rgb(255,255,255)"),At.BLACK=new At("rgb(0,0,0)"),At.COLORS=function(){const t={};for(let e=0;e<Lt.length;e++)t[Lt[e]]=Mt[e];return t}();let Pt=0;class kt{constructor(){this._hash=++Pt,this._disposed=!1,this._disposing=!1}dispose(){return this._disposed||this._disposing||(this._disposing=!0,this._doDispose(),this._disposed=!0),null}_doDispose(){}get hash(){return this._hash}get disposing(){return this._disposing}get orphaned(){return this._disposed}_throwError(t){throw new Error(t)}}class It extends Error{}const Nt=function(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(mt(t)&&mt(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Nt(t[i],e[i]))return!1;return!0}if(gt(t)&&gt(e)){const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;for(const s of i){if(!pt.call(e,s))return!1;if(!Nt(t[s],e[s]))return!1}return!0}return!1},Et=function(t,e){const i=gt(t)?t:{};for(const t in e)if(pt.call(e,t)){let s=e[t];mt(s)?i[t]=s.slice(0):s instanceof Date?i[t]=new Date(s):gt(s)?i[t]=Et(i[t],s):i[t]=s}return i},Tt=class t extends kt{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}_doDispose(){this._children&&(this._children.forEach((t=>t.dispose())),this._children=void 0)}prop(t,e){const i=this._op[t];return void 0!==i?i:void 0!==e?e:this.constructor.defaults[t]}num(t,e){return function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t}(this._op[t],e,this.constructor.defaults[t])}bool(t,e,i=!1){const s=this._op[t];return void 0===s?e??this.constructor.defaults[t]??i:Boolean(s)}propAt(t,e){const i=this._resolvePath(t);if(-1!==i)return 0===i?this.prop(t,e):i.rest?i.child.propAt(i.rest,e):void 0}numAt(t,e){const i=this._resolvePath(t);return-1===i?NaN:0===i?this.num(t,e):i.rest?i.child.numAt(i.rest,e):NaN}boolAt(t,e,i=!1){const s=this._resolvePath(t);return-1!==s&&(0===s?this.bool(t,e,i):!!s.rest&&s.child.boolAt(s.rest,e,i))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){const t=e[r];s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);return e?e.saveOptions():this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t){return this.clearOptions(!0),this.$_load(t)}saveOption(t){return this._children&&this._children.has(t)?this._findChild(t).saveOptions():this._op[t]}saveOptions(t,e=!1,i=!1){const s={};let r,o;return mt(t)?r=t:gt(t)&&(r=Object.keys(t),o=t),this._doSave(s,r,this.constructor.defaults,e,i,o),s}saveTo(t,e,i=!1,s=!1){let r,o;return mt(e)?r=e:gt(e)&&(r=Object.keys(e),o=e),this._doSave(t,r,this.constructor.defaults,i,s,o),t}updateOptions(t,e=!0){const i=this._op;let s,r;if(void 0!==t&&!this._doSetSimple(i,t)){const e={};for(const i in t)this._findChild(i)?(s??=[]).push(i):t[i]!==this.prop(i)&&(this.$_validateOptions(i,t[i]),e[i]=t[i],(r??=[]).push(i));Et(i,e)}return this._doApply(i),s?.forEach((e=>this._findChild(e).updateOptions(t[e]))),e&&this._optionChanged(r),this}updateOption(t,e,i=!0,s=!1){const r=this._findChild(t);if(r)r.updateOptions(e);else{const r=this._op;(s||e!==this.prop(t))&&(this.$_validateOptions(t,e),mt(e)?e=e.slice(0):e instanceof Date?e=new Date(e):gt(e)&&(e=Et({},e)),r[t]=e,this._doApply(r),i&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r="boolean"!=typeof s||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(t,e=!0){const i=this._op,s=this._findChild(t);return s?s.clearOptions(!0):pt.call(i,t)&&(delete i[t],this._doApply(i),e&&this._optionChanged(t)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);return-1===r?this:0===r?this.updateOption(t,e,i,s):r.rest?r.child.updateAt(r.rest,e,i,s):(r.child.updateOptions(e,i),this)}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}removeAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.removeAt(i.rest,e):(i.child.clearOptions(!0,e),this)}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach((t=>e(t))),i._doApply(i._op)}(this),e&&this._optionChanged(),this}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))Nt(s[t],r[t])&&delete s[t];t&&i._children&&i._children.forEach((t=>e(t)))}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e._init(),e}_findChild(t){return this._children?.get(t)}_isChildCollection(t){return!1}_getChildItem(t,e){}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._findChild(i);if(r)return{child:r,rest:s};if(s&&this._isChildCollection(i)){const t=s.indexOf("."),e=t<0?s:s.substring(0,t),r=this._getChildItem(i,e);if(r)return{child:r,rest:t<0?"":s.substring(t+1)}}return e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_doLoad(t,e){for(const i in e)if(pt.call(e,i)){let s,r=e[i];this._doLoadProp(i,r)||((s=this._findChild(i))?s.$_load(r):mt(r)?t[i]=r.slice(0):r instanceof Date?t[i]=new Date(r):gt(r)?t[i]=Object.assign({},r):t[i]=r)}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doApply(t){}_doSave(t,e,i,s,r,o){const n=this._op,a=e&&e.length>0,h=a?e:Object.keys(n);for(const e of h){if(this._children?.has(e))continue;const s=pt.call(n,e);if(!s&&!r)continue;const o=s?n[e]:i[e],a=i[e];!r&&Nt(o,a)||this._doSaveProp(e,o)||(mt(o)?t[e]=this._doSaveArray(e,o)||o.slice():void 0!==o&&(t[e]=o))}this._children?.forEach(((i,n)=>{if(a&&e.indexOf(n)<0)return;const h=null!=o&&pt.call(o,n);if(s||h){const e=h&&gt(o[n])?o[n]:void 0,s=i.saveOptions(e,!0,r);(r||Object.keys(s).length>0)&&(t[n]=s)}}))}_doSaveProp(t,e){return!1}_doSaveArray(e,i){return i.map((e=>e instanceof t?e.saveOptions([],!0):e))}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof It?e:new It(`Invalid value for option "${t}": ${e.message}`)}}_doValidateOptions(t,e){}};Tt.defaults={};let Vt=Tt;class Dt extends kt{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 Rt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new Rt(t,t,t,t):new Rt(t,t,e,e):new Rt(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 Rt(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=m(t.paddingLeft,0),this.right=m(t.paddingRight,0),this.top=m(t.paddingTop,0),this.bottom=m(t.paddingBottom,0),this}applyMargin(t){return this.left=m(t.marginLeft,0),this.right=m(t.marginRight,0),this.top=m(t.marginTop,0),this.bottom=m(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 $t;Rt.Empty=Object.freeze(new Rt),Rt.Temp=new Rt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}($t||($t={}));const Ot={name:"RealMap",version:"1.1.12",license:"enterprise",code:""},Ft={name:"RealMap",version:"1.1.12",license:"enterprise",code:null};class Bt{static decode(t){const e=Bt.CHARS,i=Bt.PAD;let s=t.split(""),r=[],o=s.length;for(;s[--o]==i;);for(let t=0;t<o;){let i=e.indexOf(s[t++])<<18;t<=o&&(i|=e.indexOf(s[t++])<<12),t<=o&&(i|=e.indexOf(s[t++])<<6),t<=o&&(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}}Bt.PAD="=",Bt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class zt{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 o=e.s0[255&t];let n=(o>>16)+(r>>16)+((65535&o)+(65535&r)>>16)<<16|(65535&o)+(65535&r)&65535;return n=(n>>16^s>>16)<<16|65535&(65535&n^65535&s),(n>>16)+(i>>16)+((65535&n)+(65535&i)>>16)<<16|(65535&n)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=zt.xor,s=zt.union;let r=t.left,o=t.right;r=i(r,e.p[0]),o=i(o,i(s(r,e),e.p[1])),r=i(r,i(s(o,e),e.p[2])),o=i(o,i(s(r,e),e.p[3])),r=i(r,i(s(o,e),e.p[4])),o=i(o,i(s(r,e),e.p[5])),r=i(r,i(s(o,e),e.p[6])),o=i(o,i(s(r,e),e.p[7])),r=i(r,i(s(o,e),e.p[8])),o=i(o,i(s(r,e),e.p[9])),r=i(r,i(s(o,e),e.p[10])),o=i(o,i(s(r,e),e.p[11])),r=i(r,i(s(o,e),e.p[12])),o=i(o,i(s(r,e),e.p[13])),r=i(r,i(s(o,e),e.p[14])),o=i(o,i(s(r,e),e.p[15])),r=i(r,i(s(o,e),e.p[16])),t.right=r,t.left=i(o,e.p[17])}static _decryptBlock(t,e){const i=zt.xor,s=zt.union;let r=t.left,o=t.right;r=i(r,e.p[17]),o=i(o,i(s(r,e),e.p[16])),r=i(r,i(s(o,e),e.p[15])),o=i(o,i(s(r,e),e.p[14])),r=i(r,i(s(o,e),e.p[13])),o=i(o,i(s(r,e),e.p[12])),r=i(r,i(s(o,e),e.p[11])),o=i(o,i(s(r,e),e.p[10])),r=i(r,i(s(o,e),e.p[9])),o=i(o,i(s(r,e),e.p[8])),r=i(r,i(s(o,e),e.p[7])),o=i(o,i(s(r,e),e.p[6])),r=i(r,i(s(o,e),e.p[5])),o=i(o,i(s(r,e),e.p[4])),r=i(r,i(s(o,e),e.p[3])),o=i(o,i(s(r,e),e.p[2])),r=i(r,i(s(o,e),e.p[1])),t.right=r,t.left=i(o,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=zt.kb,s=zt._encryptBlock;let r,o,n,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*zt.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,n=c.p.length;r<n;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(o=0,n=c["s"+r].length;o<n;)s(l,c),c["s"+r][o++]=l.left,c["s"+r][o++]=l.right;return c}static decrypt(t,e){const i=zt._decryptBlock;let s=zt._init(e),r=[],o=Bt.decode(t),n=o.length>>3,a=0,h={left:null,right:null};for(let t=0;t<n;t++){h.left=o[a]*zt.POW24|o[a+1]*zt.POW16|o[a+2]*zt.POW8|o[a+3],h.right=o[a+4]*zt.POW24|o[a+5]*zt.POW16|o[a+6]*zt.POW8|o[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)}}zt.POW2=Math.pow(2,2),zt.POW3=Math.pow(2,3),zt.POW4=Math.pow(2,4),zt.POW8=Math.pow(2,8),zt.POW16=Math.pow(2,16),zt.POW24=Math.pow(2,24),zt.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 jt{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 o=r.split(".").length,n=r.indexOf("*");if(o>=2&&o<=4&&n>=2){const t=r.substring(0,n);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=zt.decrypt(t,"dkdl"+this._getLDKey(zt.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],o=s[1];o&&o.length>0&&(e[r]=o)}return e}}let Gt=651212;class Ht{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static isChildOf(t,e){let i=t;for(;i;){if(i.classList.contains(e))return i;i=i.parentElement}}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,o=e.documentElement,n=i.pageYOffset||o.scrollTop||r.scrollTop,a=i.pageXOffset||o.scrollLeft||r.scrollLeft,h=o.clientTop||r.clientTop||0,l=o.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+n-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 o=t.style;o.left=e+"px",o.top=i+"px",o.width=s+"px",o.height=r+"px"}static setBoundsEx(t,e,i,s,r){const o=t.style;!isNaN(e)&&(o.left=e+"px"),!isNaN(i)&&(o.top=i+"px"),!isNaN(e)&&(o.width=s+"px"),!isNaN(e)&&(o.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;)Ht.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,o="none"){const n={},a={};return n[e]=i,a[e]=s,t.animate([n,a],{duration:r,fill:o})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+Gt++}static 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){x.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!at&&t.setAttribute("vector-effect","non-scaling-stroke")}static isIntersectRectPath(t,e,i=1){const s=t.getBBox(),r=e.getBBox(),o=t.getCTM(),n=e.getCTM();if(!o||!n)return console.warn("CTM is null — element may not be in DOM or in an <svg> tree"),!1;const a=[new DOMPoint(s.x,s.y).matrixTransform(o),new DOMPoint(s.x+s.width,s.y).matrixTransform(o),new DOMPoint(s.x,s.y+s.height).matrixTransform(o),new DOMPoint(s.x+s.width,s.y+s.height).matrixTransform(o)],h=[new DOMPoint(r.x,r.y).matrixTransform(n),new DOMPoint(r.x+r.width,r.y).matrixTransform(n),new DOMPoint(r.x,r.y+r.height).matrixTransform(n),new DOMPoint(r.x+r.width,r.y+r.height).matrixTransform(n)],l=Math.min(...a.map((t=>t.x))),c=Math.max(...a.map((t=>t.x))),d=Math.min(...a.map((t=>t.y))),_=Math.max(...a.map((t=>t.y))),u=Math.min(...h.map((t=>t.x))),p=Math.max(...h.map((t=>t.x))),g=Math.min(...h.map((t=>t.y))),m=Math.max(...h.map((t=>t.y)));if(c<u||p<l||_<g||m<d)return!1;const f=e.getTotalLength(),b=t.ownerSVGElement.createSVGPoint();for(let t=0;t<=f;t+=i){const{x:i,y:s}=e.getPointAtLength(t);b.x=i,b.y=s;const r=b.matrixTransform(n);if(r.x>=l&&r.x<=c&&r.y>=d&&r.y<=_)return!0}const y=n.inverse();for(const t of a){const i=t.matrixTransform(y);if(e.isPointInFill(i))return!0}return!1}}const Wt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Yt extends kt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this.$_updateBlockDrag(t),this._doTouchStart(t),null===(e=this._tool)||void 0===e||e.touchStart(t)},this._touchMoveHandler=t=>{var e;t.touches.length<2&&this._scrolling?t.preventDefault():(this._doTouchMove(t),null===(e=this._tool)||void 0===e||e.touchMove(t))},this._touchEndHandler=t=>{var e;this._doTouchEnd(t),null===(e=this._tool)||void 0===e||e.touchEnd(t)},this._pointerDownHandler=t=>{var e;this.$_updateBlockDrag(t),this._doPointerDown(t)||null===(e=this._tool)||void 0===e||e.pointerDown(t)},this._pointerMoveHandler=t=>{var e;this._doPointerMove(t),null===(e=this._tool)||void 0===e||e.pointerMove(t)},this._pointerUpHandler=t=>{var e;this._doPointerUp(t),null===(e=this._tool)||void 0===e||e.pointerUp(t),this._blockDrag=!0},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t),this._blockDrag=!0},this._pointerLeaveHandler=t=>{var e;this._doPointerLeave(t),null===(e=this._tool)||void 0===e||e.pointerLeave(t)},this._keyPressHandler=t=>{var e;this._doKeyPress(t),null===(e=this._tool)||void 0===e||e.keyPress(t)},this._wheelHandler=t=>{var e;this._doWheel(t)&&(null===(e=this._tool)||void 0===e||e.wheel(t))},function(){const t=location.hostname;let e;try{if(e=Ft.code||realMapLic,!e)return!1}catch(t){return!1}const i=jt.decrypt(e);if("RealMap"!=i.name||"RealMap"!==Ot.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Ot.license!=$t.Developer&&!jt.includedDomains(s,t.toLowerCase(),r))return!1;const o=i.lic.toLowerCase();if(!Object.values($t).includes(o))return!1;if(Ot.code=i.code,Ot.license=i.lic,o==$t.Evaluation||o==$t.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||Yt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(this._dom),this._inited=!0,this._blockDrag=!0,this.invalidate(!0)):console.error("need license!")}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Ht.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)}isLoading(){return!1}isDraggable(){return!this._blockDrag}clearDefs(){const t=Array.from(this._defs.children).filter((t=>"true"===t.dataset.essential));for(const e of t)this._defs.removeChild(e);Ht.clearChildren(this._defs);for(const e of t)this._defs.appendChild(e)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}removeElement(t){this._root.removeChild(t)}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}hasDef(t){return!!this._defs.querySelector("#"+t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new ee(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,Zt.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,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler),this.$_addListener(this.doc(),"pointermove",this._pointerMoveHandler),this.$_addListener(this.doc(),"pointerup",this._pointerUpHandler)}_unresigterEventHandlers(t){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler),this.doc().removeEventListener("pointermove",this._pointerMoveHandler),this.doc().removeEventListener("pointerup",this._pointerUpHandler)}_prepareRenderers(t){}_initControl(t,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=t.getElementById(i),this._container instanceof HTMLDivElement||q(S.invalidOuterDiv,i);const r=this._container.ownerDocument,o=this._dom=r.createElement("div");Object.assign(o.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)"}),o.className=s,this._container.appendChild(o);const n=this._svg=r.createElementNS(e,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",n.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),n.appendChild(h),o.appendChild(n),this._root=new Xt(this),n.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),o.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),o.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,i){let s=t.createElementNS(e,"filter");s.dataset.essential="true";const r=t.createElementNS(e,"feDropShadow");s.setAttribute("id",Yt.SHADOW_FILTER),r.setAttribute("dx","0"),r.setAttribute("dy","4"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.4"),r.setAttribute("stdDeviation","2"),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=Ht.getPadding(this._root.dom),s=i.left,r=i.top,o=this._svg.clientWidth-s-i.right,n=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:o,height:n});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(o-t.width)/2+"px",a.style.top=r+(n-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender()}ht.log("render in "+(+new Date-t)+"ms.")}}_setBackgroundStyle(t){Object.assign(this._dom.style,t)}setDebug(t){this._debugger.textContent=t,this.invalidateLayout()}_doBeforeRender(t){}_doAfterRender(){}_doClick(t){}_doDblClick(t){}_doTouchStart(t){}_doTouchMove(t){return!0}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){return!0}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),i):this.invalidateLayout())}$_updateBlockDrag(t){const e=t.target&&!0===this.dom().contains(t.target);this._blockDrag=!e}}Yt.CLASS_NAME="rm-control",Yt.SHADOW_FILTER="rm-shadow-filter",Yt._animatable=!0;class Zt extends kt{static createElement(t,i){return t.createElementNS(e,i)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,o){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,o);e.add(s),i.push(s)}}constructor(t,i,s=L){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,s||"g"),(this._styleName=i)&&this.setAttr("class",i),this._doInitStyles()}_doInitStyles(){}_doDispose(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom.style.display=this._visible?"":"none"),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}append(t){if(t){const e=t._parent;t._parent=this,this._dom.appendChild(t._dom),e!=this&&t._doAttached(this)}return t}addAll(...t){t.forEach((t=>this.add(t)))}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent?this._parent.removeChild(this):this._dom.remove(),this}appendElement(t,i){const s=t.createElementNS(e,i);return this._dom.appendChild(s),s}insertElement(t,i,s){const r=t.createElementNS(e,i);return this._dom.insertBefore(r,s),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}setAttrEx(t,e){return z(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return dt.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}hasSavedStyles(){return void 0!==this._saveStyle||void 0!==this._saveClass}saveStyles(){let t=this._dom.getAttribute("style"),e=this._dom.getAttribute("class");t||(t=""),e||(e=""),this._saveStyle=t,this._saveClass=e}restoreStyles(){null!=this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",""===this._saveStyle&&(this._styles={}),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(U(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}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(s(t)){const e=this.dom.style;for(let i in t)e.setProperty(U(i),this._styles[i]=t[i],"important")}}resetStyles(t){this.clearStyles(),this.internalSetStyles(t)}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let i=!1;if(t){for(let s in t)if(s in Wt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(m(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Wt){const i=Wt[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let i=!1;return t in Wt&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=b(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}hasClip(){return this.hasAttr("clip-path")}setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}clipRect(t,e,i,s,r=0){const o=this.control.clipBounds(t,e,i,s,r);return this.setClip(o),o}clipPath(t){const e=this.control.clip(new ie(this.doc).setPath(t));return this.setClip(e),e}createClipId(t){return"url(#"+(t.id||t)+")"}sort(t){t.forEach((t=>t&&this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}onScrollStart(){}onScrollEnd(){}onRotationStart(){}onRotationEnd(){}_testing(){return Zt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(ht.isValidNum(e)||ht.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),ht.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")");const r=ht.getNum(this._scaleX,1),o=ht.getNum(this._scaleY,1);1===r&&1===o||s.push("scale("+r+" "+o+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}Zt.TESTING=!1,Zt.DEBUGGING=!1,Zt.ASSET_KEY="_asset_",Zt.TEMP_KEY="_temp_";class Ut extends Zt{constructor(t,e=void 0){super(t,e,"g")}}class Xt extends Zt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class qt extends Zt{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 Kt extends Zt{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 Jt extends Zt{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 Qt extends Zt{constructor(t){super(t,L,"mask");const e=this._id=ht.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class te extends Zt{constructor(t){super(t,L,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ee extends te{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,o=0,n=0){super(t);const a=this._rect=new Zt(t,null,"rect");a.setAttr("fill","none"),o>0&&a.setAttr("rx",String(o)),n>0&&a.setAttr("ry",String(n)),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 ie extends te{constructor(t,e){super(t),this._path=new Kt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var se;!function(t){t.SIDO="sido"}(se||(se={}));const re="shuffle",oe="random";var ne;class ae{constructor(t){this.source=t}hasDef(){return!0}}class he extends ae{getElement(t,e){throw new Error("Method not implemented.")}}he.TYPE="shape";class le extends ae{getElement(t,e){throw new Error("Method not implemented.")}}le.TYPE="image";class ce extends ae{_setStops(t,i){const s=t.createElementNS(e,"stop"),o=t.createElementNS(e,"stop"),n=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=r(n)?n[0]:n,l=r(n)&&n.length>1?n[1]:"white",c=r(a)?a[0]:a,d=r(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",h),s.setAttribute("stop-opacity",c),o.setAttribute("offset","1"),o.setAttribute("stop-color",l),o.setAttribute("stop-opacity",d),i.appendChild(s),i.appendChild(o)}}class de extends ce{getElement(t,i){const s=t.createElementNS(e,"linearGradient");let{x1:r,x2:o,y1:n,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),i.dir){case"up":n=1;break;case"right":o=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",n),s.setAttribute("x2",o),s.setAttribute("y2",a),s}}de.TYPE="lineargradient";class _e extends ce{getElement(t,i){const s=t.createElementNS(e,"radialGradient");return B(i.cx)||s.setAttribute("cx",i.cx),B(i.cy)||s.setAttribute("cy",i.cy),B(i.r)||s.setAttribute("r",i.r),this._setStops(t,s),s}}_e.TYPE="radialgradient";class ue extends ae{getElement(t,i){const r=t.createElementNS(e,"pattern"),o=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+i.pattern>=0){const t=ne.STOCK[+i.pattern%ne.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(i.pattern)&&(a=i.pattern,c=i.width||i.height||20,d=i.height||i.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),h&&l(o.style,h),i.style&&l(o.style,i.style),_&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const i=t.createElementNS(e,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return i.transform&&r.setAttribute("patternTransform",i.transform),r.append(o),r}}ne=ue,ue.TYPE="pattern",ue.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}],ue.SELECT=Object.assign(ne.STOCK[4],{id:"rm-selected-area-fill",pattern:ne.STOCK[4].path,transform:"scale(0.5)"});class pe extends ae{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===oe?this._index=-1:(t.mode===re&&ht.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=r(e.colors)?e.colors:[]}}pe.TYPE="colors";class ge extends ae{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||ge.SIZE,height:e.height||e.width||ge.SIZE})}}ge.TYPE="images",ge.SIZE=20;class me{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(s(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new ue(ue.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(Zt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(Zt.ASSET_KEY,"1"),e.addDef(s)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ue.TYPE:r(t.colors)?e=pe.TYPE:r(t.images)?e=ge.TYPE:null!=t.url?e=le.TYPE:null!=t.path&&(e=he.TYPE)),e)switch(e.toLowerCase()){case he.TYPE:return new he(t);case le.TYPE:return new le(t);case de.TYPE:return new de(t);case _e.TYPE:return new _e(t);case ue.TYPE:return new ue(t);case pe.TYPE:return new pe(t);case ge.TYPE:return new ge(t)}}}}const fe="0".charCodeAt(0),be="#".charCodeAt(0),ye=",".charCodeAt(0),we="s".charCodeAt(0),xe="a".charCodeAt(0),ve=".".charCodeAt(0);class Ce{static getFormatter(t){let e=Ce.Formatters[t];return e||(Ce.Formatters[t]=e=new Ce(t)),e}static get Default(){return Ce.getFormatter(Ce.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){for(let i=0;i<e;i++){const e=t.charCodeAt(i);e!==fe&&e!==be&&e!==ve&&e!==ye&&e!==we&&e!==xe&&q(`Invalid number format: ${t}`,t)}const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===fe;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===be;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===fe;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ye){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===we){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===xe){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}Ce.DEFAULT_FORMAT="",Ce.Formatters={};const Se=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Le=[".","/","-",":"],Me="Z".charCodeAt(0),Ae="z".charCodeAt(0),Pe="A".charCodeAt(0),ke="a".charCodeAt(0),Ie="y".charCodeAt(0),Ne="M".charCodeAt(0),Ee="m".charCodeAt(0),Te="W".charCodeAt(0),Ve="w".charCodeAt(0),De="d".charCodeAt(0),Re="H".charCodeAt(0),$e="h".charCodeAt(0),Oe="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(S.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||S.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,o=i.length;r<o;r++){var n=i[r],a=n.length;switch(n.charCodeAt(0)){case Ie:s+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case Ne:s+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case De:s+=a>1?j(t.getDate()):t.getDate();break;case Te:s+=a>1?j(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case Ve:s+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case Re:s+=a>1?j(t.getHours()):t.getHours();break;case $e:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?j(e):e}else s+=a>1?j(t.getHours()):t.getHours();break;case Ee:s+=a>1?j(t.getMinutes()):t.getMinutes();break;case Fe:s+=a>1?j(t.getSeconds()):t.getSeconds();break;case ke:case Pe:t.getHours()<12?s+=S.am:s+=S.pm;break;case Oe:let i=t.getMilliseconds();s+=3==a?G(i):2==a?j(i):i.toString().substring(0,a);break;default:s+=n}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let o=i.charAt(r);if(Le.indexOf(o)>=0)e.push(o),r++;else{let n=r++;for(;r<s&&i.charAt(r)==o;)r++;if(o=i.substring(n,r),Se.indexOf(o)<0){let e=o.charCodeAt(0);(e>=Pe&&e<=Me||e>=ke&&e<=Ae)&&q(S.invalidDateFormat,t)}e.push(o)}if(r<s&&ht.isWhiteSpace(o=i.charAt(r)))for(e.push(o);r<s&&ht.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||S.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Be.Formatters={};const ze=["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"],je=["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 Ge{static create(t){return n(t)?new Ge(t):void 0}static isBright(t){return new Ge(t).isBright()}static getContrast(t,e,i){return new Ge(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Ge(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=(e.a+t.a)/2,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(ht.startsWith(t,"rgba(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(ht.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Ge.COLORS[t]&&this.$_parseNumber(Ge.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 Ge(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 He,We,Ye;Ge.COLORS=function(){const t={};for(let e=0;e<ze.length;e++)t[ze[e]]=je[e];return t}(),t.TextAnchor=void 0,(He=t.TextAnchor||(t.TextAnchor={})).START="start",He.MIDDLE="middle",He.END="end",t.TextLayout=void 0,(We=t.TextLayout||(t.TextLayout={})).TOP="top",We.MIDDLE="middle",We.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ye||(Ye={}));class Ze extends Zt{constructor(e,i=L){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.bbox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=s-i.height;break;default:r=Math.ceil(s)}this.setAttr("y",r)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,o=0,n=i.length;do{r=Math.ceil((o+n)/2);s.getSubStringLength(0,r)>t?n=r-1:o=r}while(o<n);for(this.text=i.substring(0,o)+"…";o>0&&this.calcWidth()>t;)this.text=i.substring(0,--o)+"…"}setContrast(t,e,i){return this.internalSetStyleOrClass(Ge.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in Wt||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i&&this.layoutText(),i}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this.dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e&&this.layoutText(),e}clearDom(){super.clearDom(),this._dirty=!0}bbox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Ue="$_TH",Xe="$_TW";class qe{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 o=e.callback(t,i[r+1]);if("number"==typeof o&&!isNaN(o)||"bigint"==typeof o)try{const t=i[r+3]?Ce.getFormatter(i[r+3]):e.numberFormatter;t&&(o=t.toStr(o))}catch(t){console.warn(`Failed to apply number format "${i[r+3]}" to ${o}:`,t)}else if(o instanceof Date)try{const t=i[r+3]?Be.getFormatter(i[r+3]):e.timeFormatter;t&&(o=t.toStr(o,e.startOfWeek||0))}catch(t){console.warn(`Failed to apply date format "${i[r+3]}" to ${o}:`,t)}else null==o&&(o=i[r+2]||"");s=s.replace(i[r],o)}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),o=r.substring(2,r.length-1),n=o.indexOf(";");if(n>0){const t=o.indexOf(";",n+1);t>=n?this._literals.push(r,o.substring(0,n),o.substring(n+1,t),o.substring(t+1)):this._literals.push(r,o.substring(0,n),o.substring(n+1),L);const e=this._literals.length-2;0===this._literals[e].length&&(this._literals[e]=L)}else this._literals.push(r,o,L,L);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ke extends qe{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,o=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,o),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],o=e.indexOf(s,r+7);o>0&&o<i&&t.setAttribute("style",e.substring(r+7,o))}}}class Je extends Ke{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 Qe={t:class extends Ke{tag(){return"</t>"}},b:class extends Ke{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ke{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Je};class ti{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 qe).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 Qe){const e=t.indexOf(">",s+2);if(e>=0){const o="</"+i+">",n=t.indexOf(o,e+1);if(n>=0){const e=t.substring(s,n+o.length);r=(new Qe[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 ei=/<br.*?>|\r\n|\n/;class ii{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,i,s,r,o,n=!0){const a=t.doc,h=m(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];t.clearDom(),r=r||t;const p=t.getStyle("writing-mode"),g=p===K||p===J;for(let i=0;i<c;i++){const s=l[i];let p=0,m=0,f=null;for(let[h,l]of s.words.entries()){const d=0===i&&0===h,_=i===c-1&&h===s.words.length-1,b=l.prepareSpan(t.appendElement(a,"tspan"),r,o);if(r instanceof Vt){const t=d&&n&&r.prop("prefix")||"",e=_&&n&&r.prop("suffix")||"";b.textContent=t+(b.textContent||"")+e}const y=b.getBBox();if(b[Xe]=y.width,b[Ue]=y.height,g?(p=u(p,b[Xe]),m+=b[Ue]):(p+=b[Xe],m=u(m,b[Ue])),f||(f=b),l instanceof Je){const i=a.createElementNS(e,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),t.appendDom(i)}}_.push(f),s[Ue]=m*h,s[Xe]=p*h,d.push(0==i?s[Xe]/2:s[Xe])}if(c>0){let e=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(g?null!=_[i-1]&&(s=Math.floor(e[Xe]-t.getAscent(e[Xe]))+t.getAscent(l[i][Xe])):r=e[Ue]-t.getAscent(e[Ue])+t.getAscent(l[i][Ue]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();s+=o.width,r[Xe]=o.width,r[Ue]=e[Ue]=o.height,_[0]=r}switch(p){case K:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case J:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}e=l[i]}if(g){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=_,r=s[Xe];if(e)s.setAttribute("dx",String(p===J?i-r/2:r/2));else switch(p){case K:s.setAttribute("x",String((i-r)/-2));break;case J:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(l[0][Ue])}}layout(e,i,s,r,o){const n=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===K||l===J)switch(a=o.left+(s-o.left-o.right-n.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=o.top+(r-o.top-o.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=n.height-o.bottom;break;default:e.anchor=t.TextAnchor.START,h=o.top}else switch(h=o.top+(r-o.top-o.bottom-n.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=o.left+(s-o.left-o.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-o.right;break;default:e.anchor=t.TextAnchor.START,a=o.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(ei);for(let t of i)e.push((new ti).parse(t))}}}let si=0;const ri=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},oi=["__proto__","constructor","prototype"],ni=function(t,e){const o=s(t)?t:{};for(const t in e)if(i.call(e,t)&&!oi.includes(t)){let i=e[t];r(i)?o[t]=i.slice(0):i instanceof Date?o[t]=new Date(i):s(i)?o[t]=ni(o[t],i):o[t]=i}return o};class ai extends Vt{constructor(t){super(),this.chart=t,si++}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this.prop("visible")}_doSetSimple(t,e){return h(e)?(t.visible=e,!0):super._doSetSimple(t,e)}_addChild(t,e){return super._addChild(t,e)}_doLoad(t,e){var i;if(null!=(null==e?void 0:e.template)){const t=null===(i=this.chart)||void 0===i?void 0:i.assignTemplates;t&&(e=t(e))}super._doLoad(t,e)}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,s=!0){if(!t)return this;let r=this._op.style,o=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&i.call(r,t)&&(delete r[t],o=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),o=!0),o&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,e=!1,i=!0){let r=!1,o=this._op.style;if(e&&o&&(delete this._op.style,r=!0,o=this._style=void 0),s(t)){o||(o=this._style=this._op.style={});for(const e in t){let i=t[e];o[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete o[e]:o[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._optionChanged()),this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=W(this[i]=s,!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t,e){}_doAfterRender(){}}ai.REFRESHED="refreshed",ai.defaults=ri(Vt.defaults,{visible:!0});class hi{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 li extends ai{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=m(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?Ce.getFormatter(t):null)}_setText(t){t!==this._text&&this.prepareRich(this._text=t);const e=this.prop("lineHeight");return!isNaN(e)&&this._richTextImpl&&(this._richTextImpl.lineHeight=e),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,o,n=!0){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,o,n),e&&this._richTextImpl.build(e,i,s,r,o,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ii),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.prop("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(t.text)}$_getNumberText(t,e,i){if(ht.isValidNum(t)){const s=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(r=o+r),a&&(r+=a),r}getNumberText(t,e,i,s){let r="";if(ht.isValidNum(t)){const o=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?o?this._numberFormatter.toStrEx(o.value,s)+o.symbol:this._numberFormatter.toStrEx(t,s):o?o.value+o.symbol:String(t)}const o=this.prop("prefix"),n=this.prop("suffix");return o&&(r=o+r),n&&(r+=n),r}}li.defaults=ri(ai.defaults,{effect:"none",autoContrast:!1,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ci extends li{getIconPos(){const t=this.prop("iconPosition");return"default"===t?this.getDefaultIconPos():t}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof ge&&(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 ge?i.getImage(s):s}return this._root+t}}}ci.defaults=ri(li.defaults,{iconPosition:"default",iconGap:2});class di extends ai{}di.defaults=ri(li.defaults,{});class _i extends ci{getDisplay(t){const e=this.prop("display");return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return m(this.prop("gap"),t?10:5)}_isVisible(){return this.prop("visible")&&!!this.prop("text")}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}_i.defaults=ri(ci.defaults,{display:"auto"});class ui extends ai{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){const t=this.prop("order");return isNaN(t)?1/0:t}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){this._addChild("background",this._background=new di(this.chart)),this._addChild("title",this._title=new _i(this.chart)),this._addChild("footer",this._footer=new _i(this.chart))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=b(e.location,"bottom")}}ui.defaults=ri(ai.defaults,{offsetX:0,offsetY:0});class pi extends ui{}class gi extends ui{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this.prop("direction")}}gi.defaults=ri(ui.defaults,{direction:"vertical"});class mi extends hi{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(t)?this._dic[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,i=this._items=[],o=this._dic={};if(r(t))t.forEach(((t,s)=>{i.push(this.$_loadItem(e,t,s))}));else if(s(t))i.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const s={};h(t)&&(s.visible=t),i.push(this.$_loadItem(e,s,0))}i.forEach((t=>{t.prop("name")&&(o[t.prop("name")]=t)}))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s.init(),s._setIndex(i),s.loadOptions(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class fi extends mi{_collectionProp(){return"widgetGroup"}_createWidget(t){return new gi(t)}beforeRender(){this._collectVisibles()}}class bi extends ai{constructor(){super(...arguments),this.index=-1,this._offsetX=0,this._offsetY=0}get name(){return this._name}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:(this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX)||0,y:(this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY)||0}}getSize(t,e){let i,s;return isNaN(i)&&(i=Y(this._widthDim,t)),isNaN(s)&&(s=Y(this._heightDim,e)),{width:i,height:s}}getPosition(t,e,i,s,r,o){let n,a,h;switch(n=this.getOffset(r,o),a=t,this.prop("align")||this._getDefaultAlign()){case"center":a+=(i-r)/2+n.x;break;case"right":a+=i-n.x-r;break;default:a+=n.x}switch(n=n||this.getOffset(r,o),h=e,this.prop("verticalAlign")){case"middle":h+=(s-o)/2-n.y;break;case"bottom":h+=s-n.y-o;break;default:h+=n.y}return{x:a,y:h}}_doApply(t){const e=this,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`${this._getNamePrefix()} ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_getDefaultAlign(){return"left"}}bi.defaults=ri(ai.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class yi extends hi{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const i=this.chart,o=this._items=[],n=this._map={};r(t)?t.forEach(((t,s)=>{o.push(this._loadItem(i,t,s,e))})):s(t)&&o.push(this._loadItem(i,t,0,e)),o.forEach((t=>{t.name&&(n[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender()}))}}class wi extends pi{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}wi.defaults=ri(ui.defaults,{});class xi extends ai{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}xi.defaults=ri(ai.defaults,{text:"RealMap v1.1.12",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const vi="_model_",Ci="_tag_",Si="disabled",Li="rm-legend-item-marker",Mi=Object.freeze([0,0]),Ai=/s\+/;function Pi(t){return isFinite(t[0]+t[1])}function ki(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function Ii(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const o of t){const t=o.map((t=>t[0])),n=o.map((t=>t[1]));e=_(e,...t),i=_(i,...n),s=u(s,...t),r=u(r,...n)}return{h1:e,v1:i,h2:s,v2:r}}const Ni=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Ei=.001,Ti=Math.PI;class Vi{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,o){return r>0?o>0?(r=_(-s/2,i/2,r),["M",t,e-(o=_(-s/2,i/2,o)),"v",s+o+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-o,"a",o,o,0,0,1,-o,o,"h",2*o-i,"a",o,o,0,0,1,-o,-o,"Z"]):["M",t,e,"v",s+(r=_(-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"]:o>0?["M",t,e-(o=_(-s/2,i/2,o)),"v",s+o,"h",i,"v",-s-o,"a",o,o,0,0,1,-o,o,"h",2*o-i,"a",o,o,0,0,1,-o,-o,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=_(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,o,n,a=!1){const h=E(p(o-r)),l=2*Ti-h<.01,_=h-Ti<.01?0:1,u=n?1:0,g=c(r),m=d(r),f=c(o-=l?u?Ei:-.001:0),b=d(o),y=[];return y.push("M",t+i*g,e+s*m,"A",i,s,0,_,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,o,n,a){const h=E(p(n-o)),l=2*Ti-h<Ei;let _=h-Ti<Ei?0:1;const u=a?1:0,g=c(o),m=d(o),f=c(n-=l?u?Ei:-.001:0),b=d(n),y=i*r,w=s*r,x=[];return x.push("M",t+i*g,e+s*m,"A",i,s,0,_,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,_,1-u,t+y*g,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 o=t+i/2,n=e+s/2+(s/2-s/2*d(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,_=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",o+a*c(r),n+h*d(r));for(let t=0;t<5;t++)g.push("L",o+a*c(r),n+h*d(r),"L",o+l*c(r+p),n+_*d(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Vi[e](0,0,2*i,2*s);break;default:r=Vi.circle(i,s,_(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,o=["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&&o.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),o}}const Di={minimumZoom:200,maximumZoom:1600},Ri={};class $i extends bi{static register(...t){t.forEach((t=>{Ri[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"annotation",this._type())),super._doLoad(t,e)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}$i.defaults=ri(bi.defaults,{front:!1});class Oi extends yi{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof $i)return e}load(t,e){super.load(t,e)}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):void 0}))}_loadItem(t,e,i,s){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a.init(),a.index=i,a.loadOptions(e),a}}const Fi="geo",Bi="chart",zi="route";class ji extends Zt{static create(t,e,i,s,r,o,n=0){return new ji(t,e,{x:i,y:s,width:r,height:o,r:n})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}class Gi{constructor(t,e){}}const Hi="@_rm_state_",Wi="@_rm_add_",Yi="@_rm_update_",Zi="@_rm_delete_";let Ui=0;const Xi=[0,0];class qi{constructor(t){this.source=t,this.inset=Xi,this.pid=Ui++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.chart.coordOfArea(this.id)),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[Hi]=t:delete this[Hi]}_isAdding(){return this[Hi]===Wi}_isUpdating(){return this[Hi]===Yi}_isDeleting(){return this[Hi]===Zi}_isStatic(){const t=this[Hi];return t!==Wi&&t!==Zi}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){var i,s,o,n,a,h;const l=t.prop("fields");if(r(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(i=t._idFielder)||void 0===i?void 0:i.call(t,e),this.name=null===(s=t._nameFielder)||void 0===s?void 0:s.call(t,e),this.color=null===(o=t._colorFielder)||void 0===o?void 0:o.call(t,e),this.coord=[null===(n=t._lonFielder)||void 0===n?void 0:n.call(t,e),null===(a=t._latFielder)||void 0===a?void 0:a.call(t,e)],this.value=null===(h=t._valueFielder)||void 0===h?void 0:h.call(t,e)}_readObject(t,e){var i;if(this.id=b(t._idFielder(e),e.id),this.name=b(t._nameFielder(e),e.name),this.color=b(t._colorFielder(e),e.color),this.className=e.className,r(e.coord))this.coord=[+e.coord[0],+e.coord[1]];else if(n(e.coord)){const t=e.coord.split(Ai);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const s=t._lonFielder(e),r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);isNaN(s)||isNaN(r)||(this.coord=[s,r])}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=this.id&&t.chart.coordOfArea(this.id)),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=r(e.callout)&&this.$_parseCallout(e.callout),r(this.callout)||(this.offset=r(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),r(t)&&(e=[],a(t[0])?e.push(t):t.forEach((t=>{if(r(t))e.push(t.slice(0,2));else if(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 Ki{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Ji={};class Qi extends ci{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}getValue(t,e){const i=this.prop("textField");if(n(i)){const e=t.getProp(i);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return o(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}_doApply(t){super._doApply(t),o(t.positionCallback)?this._getPosition=t=>{const e=this.prop("positionCallback"),i=this.prop("position");return e({point:t,chart:this.chart.wrapper})||i||Qi.DEFAULT_POSITION}:this._getPosition=()=>this.prop("position")||Qi.DEFAULT_POSITION}}Qi.DEFAULT_POSITION="auto",Qi.defaults=ri(ci.defaults,{visible:!0,position:Qi.DEFAULT_POSITION});class ts extends ai{}ts.defaults=ri(ai.defaults,{shape:"circle",radius:2.5});class es extends ai{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),this._addChild("anchorPoint",this._anchorPoint=new ts(this.chart))}get anchorPoint(){return this._anchorPoint}}es.defaults=ri(ai.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class is{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 ss extends ut{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class rs extends ut{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class os extends ss{_init(t){super._init(t),t._setState(Wi)}}class ns extends ss{_init(t){super._init(t),t._setState(Zi),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class as extends ss{_init(t){super._init(t),t._setState(Yi)}}class hs extends rs{_init(t){t.forEach((t=>{t._setState(Wi),t._setVrate(0)}))}}class ls extends rs{_init(t){t.forEach((t=>{t._setState(Zi),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class cs extends rs{_init(t){t.forEach((t=>{t._setState(Yi),t._setVrate(0)}))}}class ds extends ai{static register(...t){t.forEach((t=>{Ji[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}getProp(t,e){return this.prop(t,e)}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 Ki(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new is(this.$_createPointArgs(),this.chart.wrapper),this._addChild("pointLabel",this._pointLabel=this._createLabel(this.chart)),this._addChild("callout",this._callout=new es(this))}_createLabel(t){return new Qi(t)}getTooltipText(t,e){var i;const s=this.prop("tooltipText"),r=this.prop("tooltipCallback");return"function"==typeof r?(this._getPointArgs(this._pointArgs,e),null!==(i=r(this._pointArgs))&&void 0!==i?i:n(s)?s:ds.defaultTooltipText):"boolean"==typeof s?s?ds.defaultTooltipText:null:s}getTooltipParam(t,e,i){return ds.getPointTooltipParam(t,e,i)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this.prop("label")||this.name}_type(){return this.constructor.type}get index(){return this._index}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}get cluster(){return null}displayName(){return this.prop("label")||this.name||`Series${this.index}`}get data(){return this._data}$_setData(t,e){if(t!==this._data||e!==this._dataPath)return this._data=ht.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}get needAnimate(){return this._needAnimate}set needAnimate(t){this._needAnimate=t}get dataLoaded(){return this._dataLoaded}set dataLoaded(t){this._dataLoaded=t}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}needTranslate(){return!0}contains(t){return this._points.contains(t)}isExcluded(t){return!1}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e&&e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?{isCallbackExecuted:!0,label:s}:{label:i,isCallbackExecuted:!1}}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){const e=this.prop("styleCallback");if("function"==typeof e)return e(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if("function"==typeof this.pointLabel.prop("styleCallback"))return this.pointLabel.prop("styleCallback")(this._getPointArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.prop("zoomLevel");return this._pointLabel.isVisible()&&this.pointLabelCount()>0&&(isNaN(t)||this.chart.body.zoom>=t)}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!0===e.visible)}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.prop("layoutOnly")}getLegendSources(t,e){this._legend===t&&e.push(this)}getLabelOff(){return m(this._pointLabel.prop("offset"),this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){return this.$_setData(t,this.prop("dataPath"))&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s;const r=this.$_addPoint(t,-1);return this._points.insert(e,r),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(r._prev={},r._prev.ani=new os(this,r,(t=>{var e;null===(e=this.prop("onPointAdded"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(s=this.prop("onPointAdded"))||void 0===s||s(this._getPointArgs(this._pointArgs,r)),r}addPointList(t,e=-1,i=500){var s;if(!r(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new hs(this,o,(t=>{var e;null===(e=this.prop("onPointListAdded"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(s=this.prop("onPointListAdded"))||void 0===s||s(this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r;a(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 ns(this,t,(t=>{var e;this._points.remove(t),null===(e=this.prop("onPointRemoved"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(r=this.prop("onPointRemoved"))||void 0===r||r(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];a(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new ls(this,t,(t=>{var e;this._points.removeAll(t),null===(e=this.prop("onPointListRemoved"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(i=this.prop("onPointListRemoved"))||void 0===i||i(this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s;if(n(t)?t=this._points.pointById(t):a(t)&&(t=this._points.get(t)),t instanceof qi&&this._points.contains(t)){let r=t._prev;return r&&r.ani&&r.ani.stop(),r=t.updateValues(this,e),r&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?r.ani=new as(this,t,(t=>{var e;null===(e=this.prop("onPointUpdated"))||void 0===e||e(this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(s=this.prop("onPointUpdated"))||void 0===s||s(this._getPointArgs(this._pointArgs,t))),!!r}return!1}updatePointList(t,e,i=300){var s;const r=this.$_points(t).filter((t=>this._points.contains(t)));r.length>0&&(r.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new cs(this,r,(t=>{var e;null===(e=this.prop("onPointListUpdated"))||void 0===e||e(this._getPointListArgs(t))})).setDuration(i).start():null===(s=this.prop("onPointListUpdated"))||void 0===s||s(this._getPointListArgs(r)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){const e=this.prop("onPointClick");if(e)return this._getPointArgs(this._pointArgs,t),e(this._pointArgs)}show(t=!1,e=!0){this.visible&&!t||(e?this.chart.requestShowSeries(this,!0):this.visible=!0)}hide(t=!0){this.visible&&(t?this.chart.requestShowSeries(this,!1):this.visible=!1)}getCalloutShape(t){return this.callout.anchorPoint.prop("shape")||"circle"}canSelect(){return!1}select(t){t&&(t.setSelected(!0),this.$_bringToFront(t),this.chart._selectionChanged(this,[t]))}unselect(t){t.setSelected(!1),this.chart._selectionChanged(this,[t])}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0),this.$_bringToFront(t);this.chart._selectionChanged(this,e)}unselectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!1);this.chart._selectionChanged(this,e)}$_bringToFront(t){t instanceof qi&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0)}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_isPointsDirty(){return this._dataSourceDirty}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._isPointsDirty()){const t=this._doLoadData(this._data);this.$_loadPoints(t),this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))}else this._optionsDirty||this._dataDirty?(this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);this._visPoints.forEach((t=>t._excluded=this.isExcluded(t))),super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let s,h,l;this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,o(i)?s=i:r(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),s?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||s(this._getPointArgs(this._pointArgs,t))})):l instanceof pe?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e++)}$_addPoint(t,e){const i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return o(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 ji.create(t,Li,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"series",this._type())),super._doLoad(t,e)}_doLoadData(t){if(t instanceof Gi);else if(r(t))return t}$_loadPoints(t){var e;this._doLoadPoints(t),null===(e=this.prop("onPointsLoaded"))||void 0===e||e(this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){const e=this._pointLabel.prop("textCallback"),i=this._pointLabel.prop("visibleCallback");this._pointLabelCallback=o(e)?e:null,this._pointLabelVisCallback=o(i)?i:null,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:_(s,e),i=isNaN(i)?s:u(s,i))})),{min:e,max:i}}}ds.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",ds.defaults=ri(ai.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:ds.defaultTooltipText,loadAnimation:"default",legend:0});class _s extends hi{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const i=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(i,t,e)})):s(t)&&this.$_loadItem(i,t,0)}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.prop("legend"),null)))),this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t,e){const i=this.$_loadItem(this.chart,t,this._items.length);return i&&(i.needAnimate=e),i}remove(t){let e;if(t instanceof ds?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>t._setIndex(e))),e}$_loadItem(t,e,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const o=new r(t);return o.init(),o.isDataSeries()&&o._setIndex(i,t._seriesIndex++),o.loadOptions(e),this.$_addSeries(o,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 us extends qi{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_readArray(t,e){super._readArray(t,e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:w(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}_valuesChanged(t){const e=super._valuesChanged(t),i=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],s=this.value!==t.value;return e||s||i}}class ps extends ds{_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")}}ps.defaults=ri(ds.defaults,{valueField:"value"});class gs extends ps{isExcludedCoord(t){if(this._excludes)for(let e=0;e<this._excludes.length;e++){const i=this._excludes[e];if(t[0]>=i[0][0]&&t[0]<=i[1][0]&&t[1]>=i[1][1]&&t[1]<=i[0][1])return!0}}isExcluded(t){return this.isExcludedCoord(t.coord)}_doApply(t){if(super._doApply(t),i.call(t,"excludeBounds")){const i=t.excludeBounds,s=[];if(e=i,Array.isArray(e)&&e.length>0)for(let t=0;t<i.length;t+=2){const e=i[t],o=i[t+1];if(r(e)&&r(o)){const t=+e[0],i=+e[1],r=+o[0],n=+o[1];isNaN(t)||isNaN(i)||isNaN(r)||isNaN(n)||s.push([[_(t,r),u(i,n)],[u(t,r),_(i,n)]])}}this._excludes=s.length>0?s:void 0}var e}}gs.defaults=ri(ps.defaults,{});class ms extends us{}class fs extends gs{}fs.defaults=ri(gs.defaults,{});class bs extends us{getPoints(t,e,i){const s=t.length,r=[];const o=i-e;for(let i=0;i<s;i++){const n=t[i],a=5+i/(s-1)*90,h=10+(isNaN(n)||0==o?80:80*(1-(n-e)/o));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=r(this.values)?this.values.reduce(((t,e)=>t+m(e,0)),0):0:this._sum}_readObject(t,e){var i;super._readObject(t,e);const s=this.value;if(r(s)){const e=t.getProp("nullAsBase"),r=null!==(i=t.getProp("baseValue"))&&void 0!==i?i:0,o=e?r:NaN;this.values=s.map((t=>null==t?o:t))}else this.values=isNaN(s)?[]:[s]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ys{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return ji.create(t,Li,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class ws extends gs{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t);const e=this.prop("categories");this._categories=this.$_parseCategories(e)}_createValueFielder(t){const e=this.prop("valueFields");return r(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this.prop("legendByCategory")&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new ys(t.name,t.color)))}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{const i=e;t=Math.max(t,i.values?i.values.length:0)})),t<2)return[this._calcedColor];{const e=Ge.create("white"),i=Ge.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=Ge.interpolate(e,i,r/(2*t)).toString();return s}}}ws.defaults=ri(gs.defaults,{position:"top"});class xs extends bs{}class vs extends ws{_doInit(t){super._doInit(t),this._addChild("baseLine",this._baseLine=new ai(this.chart))}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=ht.getMinMax(t),s=i.base=this.prop("baseValue");if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=m(this._minValue,i.min),e=m(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 m(Y(this._paddingDim,t),0)}_doApply(t){super._doApply(t);const e=this.prop("width"),i=this.prop("height"),s=this.prop("minValue"),r=this.prop("maxValue"),o=this.prop("valueDomain");this._width=m(+e,vs.DEF_WIDTH),this._height=m(+i,vs.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+s,this._maxValue=+r,this._pointDomain="point"===o}}vs.DEF_WIDTH=80,vs.DEF_HEIGHT=50,vs.defaults=ri(ws.defaults,{width:vs.DEF_WIDTH,height:vs.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Cs extends us{}class Ss extends gs{_doApply(t){super._doApply(t),this._width=m(+t.width||+t.size||+t.height,Ss.DEF_SIZE),this._height=m(+t.height||+t.size||+t.width,Ss.DEF_SIZE)}}Ss.DEF_SIZE=60,Ss.defaults=ri(gs.defaults,{size:Ss.DEF_SIZE});class Ls extends Ss{getValueRate(t){return(m(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=this.num("minValue"),this._maxValue=this.num("maxValue")}_doPrepareRender(t){let e=m(this._minValue,1/0),i=m(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t,r=s.getValue();s.isNull||isNaN(r)||(e=_(e,r),i=u(i,r))})),this._min=e,this._max=i}}Ls.defaults=ri(Ss.defaults,{minValue:10});class Ms extends ms{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}}class As extends Qi{}As.defaults=ri(Qi.defaults,{visible:!1});class Ps extends fs{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new As(this.chart))}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:Y(this._minSizeDim,t),max:Y(this._maxSizeDim,t)}}getRadius(t,e,i){if(isNaN(t))return 0;let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"===this.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return m(this._subLabel.prop("offset"),0)}_doApply(t){super._doApply(t);const e=this.prop("minValue"),i=this.prop("maxValue"),s=this.prop("alignToSurface");this._setDims(t,"minSize","maxSize"),this._extMin=+e,this._extMax=+i,this._alignToSurface=s}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ms(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 o=r.getValue();r.isNull||isNaN(o)||(isNaN(i)&&(t=_(t,o)),isNaN(s)&&(e=u(e,o)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}Ps.type="bubble",Ps.defaults=ri(fs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class ks extends ai{}ks.defaults=ri(wi.defaults,{length:10});class Is extends ci{getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Is.defaults=ri(wi.defaults,{offset:4});class Ns extends ai{_doInit(t){this._line=this._addChild("line",new ks(this.chart)),this._label=this._addChild("label",new Is(this.chart))}get line(){return this._line}get label(){return this._label}}Ns.defaults=ri(wi.defaults,{});class Es extends wi{_doInit(t){super._doInit(t),this._tick=this._addChild("tick",new Ns(this.chart))}get tick(){return this._tick}getSteps(t,e){const i=this._series,s=this._steps;if(i instanceof Ps){let{min:r,max:o}=i.getPixelMinMax(_(t,e));isNaN(this.prop("minRadius"))||(r=this.prop("minRadius")),isNaN(this.prop("maxRadius"))||(o=this.prop("maxRadius")),s.forEach((t=>{t.rd=i.getRadius(t.value,r,o)}))}else if(s.length>0){const t=m(this.prop("minRadius"),10),e=m(this.prop("maxRadius"),50)-t,i=s[0].value,r=s[s.length-1].value-i;s.forEach((s=>{s.rd=t+e*(s.value-i)/r}))}return s}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){this._op;const t=this.prop("steps"),e=[];if(r(t)&&t.length>0){const i=this.tick.label;t.forEach((t=>{s(t)?e.push({value:+t.value,label:t.label||i.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:i.getText(+t),rd:0})}))}return e}}Es.defaults=ri(wi.defaults,{});class Ts extends mi{_collectionProp(){return"bubbleScale"}_createWidget(t){return new Es(t)}beforeRender(){this._collectVisibles()}}class Vs extends ai{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Vs.MARKER_SIZE=10;class Ds extends pi{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this.prop("layout")||"body"===t)return this.prop("layout");switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("maxWidth"))!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=W(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=W(t,!0))}(this.prop("maxHeight"))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new Vs(this,t))),this.prop("reversed")&&(this._items=this._items.reverse())}}Ds.defaults=ri(ui.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:Vs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class Rs extends mi{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new Ds(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class $s{constructor(t){this._color1=Ge.create(t.minColor),this._color2=Ge.create(t.maxColor),this._logger=ht.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return Ge.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return y(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class Os extends ai{_doInit(t){this._label=this._addChild("label",new li(this.chart))}get label(){return this._label}getMarkerSize(){return m(this.prop("size"),7)}}Os.defaults=ri(ai.defaults,{size:7});class Fs extends ai{}Fs.defaults=ri(ai.defaults,{length:6});class Bs extends ci{getDefaultIconPos(){}}Bs.defaults=ri(ci.defaults,{});class zs extends ai{_doInit(t){this._line=this._addChild("line",new Fs(this.chart)),this._label=this._addChild("label",new Bs(this.chart))}get line(){return this._line}get label(){return this._label}}zs.defaults=ri(ai.defaults,{});class js{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||Vs.MARKER_SIZE;return ji.create(t,Li,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,o=this.to;if(i&&s)return Ge.interpolate(i,s,(t-r)/(o-r)).toString();return y(s,e,i).brighten(1-(t-r)/(o-r)).toString()}}class Gs extends ai{}Gs.defaults=ri(ai.defaults,{});class Hs extends ai{getLabel(){var t;return null!==(t=this.prop("label"))&&void 0!==t?t:"No Data"}getGap(){return m(+this.prop("gap"),0)}}Hs.defaults=ri(ai.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const Ws=Ge.create("#000");class Ys extends wi{_doInit(t){super._doInit(t);const e=this.chart;this._marker=this._addChild("marker",new Os(e)),this._stepLine=this._addChild("stepLine",new Gs(e)),this._tick=this._addChild("tick",new zs(e)),this._nullStep=this._addChild("nullStep",new Hs(e))}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(this._logger&&(i=this._logger(i)),r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=this._min?r[0]._color1.toString():s.toString()}return Ge.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this.nullStep.prop("visible"))return this.nullStep.prop("color")}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get endColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this.prop("layout")){case"horizontal":case"vertical":return this.prop("layout");default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?Y(this._barLengthDim,e):e,s=m(this.prop("barWidth"),12)):(s=this._barLengthDim?Y(this._barLengthDim,t):t,r=m(this.prop("barWidth"),12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,o=s?s.length:r?r.length-1:0,n=e?o+1:o,a=[];if(e&&(t-=i),o>0)for(let e=0;e<o;e++)a.push((e+1)/n*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 o,n=[];if(e){o=e.length,n.push({pos:e[0].from=m(e[0].from,s)});for(let t=1;t<o;t++)n.push({pos:e[t].from=m(e[t].from,e[t-1].to)});n.forEach(((t,i)=>t.label=e[i].label)),n.push({pos:e[o-1].to=m(e[o-1].to,r)})}else if(i){o=i.length,n.push({pos:i[0]});for(let t=1;t<o-1;t++)n.push({pos:i[t]});n.push({pos:i[o-1]})}else n=[{pos:s},{pos:r}];const a=this._logBase;return o=n.length-1,n.forEach(((e,i)=>{if(null==e.label){const s=this._logger?Math.pow(a,e.pos):e.pos;e.label=t.getNumberText(s,!1,!1,0===i?"trunc":i===o?"ceil":void 0)}})),n}getSteps(){return this._steps}getLegendSources(t){"legend"!==this.prop("display")&&"both"!==this.prop("display")||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||Ws,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t);const e=this.prop("colors"),i=this.prop("minColor"),s=this.prop("maxColor");this._setDim(t,"barLength"),this._minColor=Ge.create(i),this._maxColor=t.maxColor&&Ge.create(s),this._colors=this.$_parseColorStops(e)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this.prop("name")}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(r(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:Ge.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:Ge.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+this.prop("minValue"),this._max=+this.prop("maxValue"),this._logger=ht.getLogger(this._logBase=this.prop("logBase")),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?Ge.interpolate(this._minColor,this._endColor,parseFloat(t)/100):Ge.create(t)}$_buildSteps(){const t=this.prop("solidFill"),e=this.prop("steps"),i=[],s=this._min,o=this._max;let n=s,a=o;if(this._valueSteps=null,r(e)&&e.length>0){let s="0%";e.forEach(((r,o)=>{var h;let l,c,d=this.$_parseValue(r.from,n,a),_=this.$_parseValue(r.to,n,a);if(0===o&&isNaN(d)&&(d=n),o===e.length-1&&isNaN(_)&&(_=a),r.fromColor&&r.toColor)l=this.$_parseColor(r.fromColor),c=this.$_parseColor(s=r.toColor);else if(t){let t=r.toColor||r.fromColor||r.color;t=0===o?t||"0%":t||"100%",c=l=this.$_parseColor(t)}else l=this.$_parseColor(r.fromColor||s),c=this.$_parseColor(s=(null!==(h=r.toColor)&&void 0!==h?h:r.color)||"100%");i.push(new js(d,_,l,c,r.label))}))}else if(n>=a)i.push(new js(n,a,t?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(n)&&!isNaN(a)){const e=this.prop("logBase"),s=this._logger&&n>=0&&a-n>=e?this._logger:null,r=this._valueSteps=[],o=Math.max(1,m(this.prop("stepCount"),1));if(s&&(n=s(n),a=s(a)),this.prop("integralSteps"))r.push(...ht.normalizeToSteps([n,a],o+1));else{const t=(a-n)/o;r.push(n);for(let e=1;e<o;e++)r.push(D(r[e-1]+t));r.push(D(a))}if(this._min=r[0],this._max=r[o],t){const t=this._minColor,e=this._endColor,s=r.length-1;for(let o=1;o<=s;o++){const n=Ge.interpolate(t,e,o/s);i.push(new js(r[o-1],r[o],n,n,void 0))}}}return i.length>1?i:void 0}}Ys.defaults=ri(ai.defaults,{display:"scale",minColor:"#fff",layout:"auto",barWidth:12,barLength:"40%"});class Zs extends mi{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.prop("display")))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new Ys(t)}beforeRender(){this._collectVisibles()}}class Us extends ai{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e){this._module&&this._module.exportToImage(t,e)}}Us.defaults=ri(ai.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1});class Xs extends ai{_doSetSimple(t,e){return ht.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Xs.defaults=ri(ai.defaults,{});class qs extends ai{_doInit(t){this._addChild("line",this._line=new Xs(this.chart)),this._addChild("lonLine",this._lonLine=new Xs(this.chart)),this._addChild("latLine",this._latLine=new Xs(this.chart))}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this.prop("fitTo")}getLonStep(){return Math.max(0,f(this._lonLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}getLatStep(){return Math.max(0,f(this._latLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}_doApply(t){super._doApply(t)}$_defaultStep(){return 10}}qs.defaults=ri(ai.defaults,{visible:!1,fitTo:"map"});class Ks extends ai{}Ks.defaults=ri(ai.defaults,{visible:!1});class Js extends ai{}Js.defaults=ri(ai.defaults,{visible:!1});class Qs extends li{getText(t,e){let i=this.prop("suffix");if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this.prop("prefix")&&(i=this.prop("prefix")+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=this.prop("dirSymbols")}}Qs.defaults=ri(li.defaults,{dirSymbols:"NSEW",suffix:"°°"});class tr extends ai{_doInit(t){this._addChild("line",this._line=new Js(this.chart)),this._addChild("label",this._label=new Qs(this.chart))}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,f(this.prop("lonInterval"),this.prop("interval"),1))|0}getLatInterval(){return Math.max(1,f(this.prop("latInterval"),this.prop("interval"),1))|0}_doApply(t){super._doApply(t);const e=this.prop("positions");this._positions=r(e)?e:[]}}tr.defaults=ri(ai.defaults,{visible:!1,positions:["top","right"],interval:1});class er extends ci{getDefaultIconPos(){return"left"}}er.defaults=ri(ci.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ir extends ai{_doInit(t){this._addChild("label",this._label=new er(this.chart))}get label(){return this._label}}ir.defaults=ri(ai.defaults,{front:!0,zindex:0});class sr extends ir{}sr.defaults=ri(ir.defaults,{});class rr extends ir{}rr.defaults=ri(ir.defaults,{});class or extends ir{}or.defaults=ri(ir.defaults,{});class nr extends ai{}nr.defaults=ri(ai.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class ar extends ai{constructor(t){super(t.chart),this.axis=t}_doInit(t){this._addChild("flag",this._flag=new nr(this.chart)),this._args={chart:this.chart.wrapper,axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag;let i=Ce.getFormatter(e.prop("numberFormat")).toStr(t);const s=e.prop("prefix"),r=e.prop("suffix");return s&&(i=s+i),r&&(i+=r),i}moved(t,e,i){}_doSetSimple(t,e){return o(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}ar.defaults=ri(ai.defaults,{visible:!1});class hr extends ai{constructor(){super(...arguments),this._guides=[]}_doInit(t){this._addChild("line",this._line=new Ks(this.chart)),this._addChild("leftLine",this._leftLine=new Ks(this.chart)),this._addChild("rightLine",this._rightLine=new Ks(this.chart)),this._addChild("topLine",this._topLine=new Ks(this.chart)),this._addChild("bottomLine",this._bottomLine=new Ks(this.chart)),this._addChild("equatorLine",this._equatorLine=new Ks(this.chart)),this._addChild("meridianLine",this._meridianLine=new Ks(this.chart)),this._addChild("grid",this._grid=new qs(this.chart)),this._addChild("tick",this._tick=new tr(this.chart)),this._addChild("crosshair",this._crosshair=new ar(this))}get line(){return this._line}get leftLine(){return this._leftLine}get rightLine(){return this._rightLine}get topLine(){return this._topLine}get bottomLine(){return this._bottomLine}get equatorLine(){return this._equatorLine}get meridianLine(){return this._meridianLine}get grid(){return this._grid}get tick(){return this._tick}get crosshair(){return this._crosshair}get guides(){return this._guides.slice()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),i.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}const e=this.prop("lonInterval"),s=this.prop("latInterval"),o=this.prop("interval");this._lonInterval=Math.max(1,f(e,o,10)),this._latInterval=Math.max(1,f(s,o,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new or(this.chart):"line"===t.type?new sr(this.chart):"band"===t.type?new rr(this.chart):new sr(this.chart),i.init(),i.loadOptions(t),e.push(i)}))}}function lr(t,e){const[i,s]=t;let r=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){const[n,a]=e[t],[h,l]=e[o];a>s!=l>s&&i<(h-n)*(s-a)/(l-a)+n&&(r=!r)}return r}function cr(t,e){let i=!1;lr(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)lr(t,e[s])&&(i=!i);return i}hr.defaults=ri(ai.defaults,{interval:5});class dr{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,o=(e+s)/2,n={minLon:t,minLat:o,maxLon:r,maxLat:s},a={minLon:r,minLat:o,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:o},l={minLon:r,minLat:e,maxLon:i,maxLat:o};this.children=[new dr(n,this.capacity),new dr(a,this.capacity),new dr(h,this.capacity),new dr(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 _r{constructor(t,e){var i;this.worldBBox=t,this.root=new dr(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 cr(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(cr(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const ur="37630",pr={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"},gr={area:ur,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"},mr={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"},fr={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"},br={area:ur,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"},yr={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"},wr={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},xr={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},vr={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 Cr{constructor(t){this.id=t}}class Sr extends Cr{constructor(t,e){super(t),this.props=e}}class Lr extends Sr{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],o=[];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());o.push(i)}r[i]=o,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=Ii(this.polygons[t]),r=Ii(this.polygons[e]);let o,n,a=0,h=0;if((o=s.h1-r.h2)>0&&(n=r.v1-s.v2,o>n&&(a=-o*i,h=n*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 Mr{constructor(t,e,i){this.name=t,this.closed=i,r(e)&&e.length>=2&&(this.border=[ht.makeArray(e[0]),ht.makeArray(e[1])])}}class Ar extends Cr{constructor(t,e){super(t),this.polygon=e}}class Pr extends kt{static createStockInset(t,e){let i,r=!1;switch(t){case"제주":case"제주도":i=pr;break;case"제주_B":case"제주도_B":i=pr,r=!0;break;case"울릉":case"울릉도":i=gr;break;case"울릉_B":case"울릉도_B":i=gr,r=!0;break;case"백령":case"백령도":i=mr;break;case"백령_B":case"백령도_B":i=mr,r=!0;break;case"읍면동_제주":case"읍면동_제주도":i=fr;break;case"읍면동_제주_B":case"읍면동_제주도_B":i=fr,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":i=br;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":i=br,r=!0;break;case"읍면동_백령":case"읍면동_백령도":i=yr;break;case"읍면동_백령_B":case"읍면동_백령도_B":i=yr,r=!0;break;default:if(!t)return void console.warn("등록된 Inset 프리셋이 존재하지 않습니다.");switch(t.toLowerCase()){case"alaska":i=wr;break;case"hawaii":i=xr;break;case"okinawa":i=vr;break;case"okinawa_b":i=vr,r=!0}}return i&&(h(e)?i=Object.assign({visible:e},i):s(e)&&(i=Object.assign({},i,e)),r&&i.border&&delete i.frame),i}constructor(t,e){var i,o,h;super(),this._excludes={};const l=null!==(i=t.source)&&void 0!==i?i:t.map,c=t.insets,d=r(c)?c:s(c)||n(c)?[c]:void 0;this.name=t.name,this.enabled=b(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=s(null==l?void 0:l.meta)?ht.deepClone(l.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=Q(null!==(h=t.padding)&&void 0!==h?h:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this.bounds=r(t.bounds)&&4===t.bounds.length&&t.bounds.every(a)?t.bounds:void 0,this._excludes={},r(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},d&&d.length>0&&d.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?Pr.createStockInset(t.substring(1),!1):Pr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,name:t.name,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&ht.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new Mr(t.name,t.border,!0===t.closed))})),l&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(l,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class kr{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}get h1(){return((-180+this._scroll)%360+540)%360-180}get scroll(){return this._scroll}set scroll(t){this._scroll=((t||0)%360+540)%360-180,this._sec&&(this._sec._scroll=this._scroll>0?(this._scroll-360)%360:(this.scroll+360)%360),this.second=0===this._scroll?void 0:this._sec}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this._sec&&(this._sec._offset=this._offset)}prepareSecond(){return this._sec=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}projectCoord(t){if(this.second){const e=this._scroll,i=t[0];return i>=-180+e&&i<=180+e?this.project(t):this.second.project(t)}return this.project(t)}getVisible(t){if(this.isVisible(t))return this.projectCoord(t)}inSecond(t){return this.second&&(t<-180+this._scroll||t>180+this._scroll)}isClipping(){return!0}getScrolledLon(t){return((t+this._scroll)%360+540)%360-180}}const Ir=90,Nr=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Er extends kr{constructor(){super(),this._rotation=[0,0],this._r=Ir,this.bounds={x1:-90,x2:Ir,y1:-90,y2:Ir},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Nr(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Nr(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;Nr(-90-t),Nr(90-t),Nr(90+e),Nr(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*I,r=[Math.cos(s)*Math.sin(e*I)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Ir,i=t[1]/Ir,s=Math.sqrt(e*e+i*i),r=Math.asin(s),o=Math.sin(r),n=Math.cos(r),a=[Math.atan2(e*o,s*n)/I,Math.asin(s&&i*o/s)/I];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}inSecond(t){return!1}_rotate(t){const e=this._rotation[0]*I,i=(this._rotation[1]||0)*I,s=Math.cos(i),r=Math.sin(i),o=Math.cos(0),n=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*I+e,h=t[1]*I,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*o-u*n,c*s-_*r)/I,Math.asin(u*o+d*n)/I]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,o=Math.cos(r);let n=Math.cos(s)*o,a=Math.sin(s)*o,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*n+_*a-p*d*h,y:-u*_*n+d*a+p*_*h,z:p*n+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class Tr extends Pr{static loadMap(t,e){if(s(t)){const i=t.source;if(s(i)&&"Topology"===i.type&&s(i.objects)&&r(i.arcs))return new Tr(t,e);const o=t.map;if(s(o)&&"Topology"===o.type&&s(o.objects)&&r(o.arcs))return new Tr(t,e)}}_doLoad(t,e){const i=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>i(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(s(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let o=0,n=0;const a=r.map((r=>((r=r.slice())[0]=(o+=r[0])*t+i,r[1]=(n+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const s=d[t].geometries;if(r(s)&&s.forEach((t=>{const e=new Sr(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=i(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};r(e.excludeInternal)?e.excludeInternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":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)}))}))}})),ht.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};r(e.excludeExternal)?e.excludeExternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":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)}))}))}})),ht.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,o=[],n=[];e.forEach((t=>{t instanceof Sr&&(i[0].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)))}));const a=o.flat(1/0),h=n.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 Ar(r.name,e))}}e.push(...s)}}function Vr(t,e){const{atan2:i,cos:s,sin:r,sqrt:o}=Math,n=t[1]*I,a=t[0]*I,h=e[1]*I,l=e[0]*I,c=h-n,d=l-a,_=r(c/2)*r(c/2)+s(n)*s(h)*r(d/2)*r(d/2),u=2*i(o(_),o(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(n)*s(a)+c*s(h)*s(l),_=t*s(n)*r(a)+c*s(h)*r(l),p=i(t*r(n)+c*r(h),o(d*d+_*_)),g=i(_,d);m.push([g/I,p/I])}}return m}function Dr(t,e){const i=t._base,s=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 Or?o=i:i[0]>=0&&(l=e.readBounds(i),h=s||h)}if(n(t.frame)&&t.frame.length>0){const e=Q(t.frame);let{h1:i,v1:r,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=_(i,o[t].h1),r=_(r,o[t].v1),n=u(n,o[t].h2),a=u(a,o[t].v2);const c=i+h[0]-e.l,d=n+h[0]+e.r,p=a+h[1]+e.t,g=r+h[1]-e.b;t.box=[[c,p],[d,p],[d,g],[c,g]],t.bounds=s?{h1:c-s[0],h2:d-s[0],v1:g-s[1],v2:p-s[1]}:{h1:c,h2:d,v1:g,v2:p}}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=_(t,o[e].h1),i=_(i,o[e].v1),s=u(s,o[e].h2),r=u(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 o=0;o<2;o++){const n=i[2*r+o],a=+n;if(isNaN(a)){const i=n.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===o?e.h1:e.v1))}else s.push(a+(0===o?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else r(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=s?{h1:l.h1-s[0],h2:l.h2-s[0],v1:l.v1-s[1],v2:l.v2-s[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const Rr=Math.min,$r=Math.max;class Or extends kt{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,o=this.v2;t[0].forEach((t=>{i=Rr(i,t[0]+e[0]),s=$r(s,t[0]+e[0]),r=Rr(r,t[1]+e[1]),o=$r(o,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=o}$_readInset(t,e){const i=t.coord,s=t.offset;let o=[0,0];return r(i)&&i.length>0&&(o[0]=isNaN(i[0])?0:+i[0]-e.h1,o[1]=isNaN(i[1])?0:+i[1]-e.v1),r(s)&&s.length>0&&(o[0]+=m(s[0],0),o[1]+=m(s[1],0)),t.off=o}$_toPath(t,e,i,s){const r=t.isGlobe,o=e[0].slice();if(i){for(let t=0;t<o.length;t++)o[t]=o[t].slice(0);o.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let n=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=o.map((e=>{const i=t.project(e);return i.outside||(n=Rr(n,i[0]),a=$r(a,i[0]),h=Rr(h,i[1]),l=$r(l,i[1])),i}));let d;if(this.x1=n,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=Vr(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(o),d=[];for(let r=0;r<c.length;r++){const n=o[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=n,o.push(n),c.push(a)),s&&i){Vr(i,n).forEach((e=>d.push(t.project(e))))}d.push(a),i=n,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 o of t)this.source.polygons[o][0].forEach((t=>{e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const o of t)for(const t of o)e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){const i=t.second;let s;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,r=!e||!1!==e.visible;if(e){if(r)if(this._insetChilds){let t=1/0,i=1/0;this.source.polygons.forEach(((e,s)=>{this._insetChilds.indexOf(s)>=0&&e[0].forEach((e=>{t=Rr(t,e[0]),i=Rr(i,e[1])}))})),s=this.$_readInset(e,{h1:t,v1:i}),this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Mi)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Mi))):this.$_readBound(this.source.polygon,Mi),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Mi))):this.$_readBound(this.source.polygon,Mi);s&&(this._insetChilds?(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Mi)}))):(this.h1+=s[0],this.h2+=s[0],this.v1+=s[1],this.v2+=s[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;const o=t.inSecond(this.h1),n=o?i:t,a=o?t:i,h=o!==t.inSecond(this.h2);let l="",c="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?r&&(l+=this.$_toPath(n,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))):(l+=this.$_toPath(n,t,null,!0),h&&(c+=this.$_toPath(a,t,null,!0)))})):r&&this.source.polygons.forEach(((t,e)=>{l+=this.$_toPath(n,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))})):r&&(l=this.$_toPath(n,this.source.polygon,s,!0),h&&(c=this.$_toPath(a,this.source.polygon,s,!0))),this._path=l+c}return e.internals&&this.$_readInternal(t,this._insetChilds?Mi:s),e.externals&&this.$_readExternal(t,this._insetChilds?Mi:s),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Or;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Fr extends kt{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 Br extends kt{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 Br)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new _r({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,r(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof Tr&&this.source.internals}get hasExternals(){return this.source instanceof Tr&&this.source.externals}get hasBorders(){return this.source instanceof Tr&&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&&ki(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 o=this._areas[r],n=o.inset;let{h1:a,h2:h,v1:l,v2:c}=o.readBounds();if(null==n?void 0:n.coord){const[t,e]=n.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 Er)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=Ir,this.y2=Ir;else{let i=1/0,s=-1/0,r=1/0,o=-1/0,n=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=Rr(i,c.h1),s=$r(s,c.h2),r=Rr(r,c.v1),o=Rr(90,$r(o,c.v2)),n=Rr(n,c.x1),a=$r(a,c.x2),h=Rr(h,c.y1),l=$r(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof Pr){const e=this.source.paddings;r-=e.b,o+=e.t,i-=e.l,s+=e.r;const c=t.project([i,o]),d=t.project([s,r]);h=Math.min(d[1],h-e.b),l=Math.max(c[1],l+e.t),n=Math.min(c[0],n-e.l),a=Math.max(d[0],a+e.r)}o>83.63&&this.source.alignArctic&&(o=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,o])[1]),(this._world=i<=-180&&s>=180)&&(n=Math.min(n,-a),a=Math.max(-n,a)),this.h1=$r(-180,i),this.v1=$r(-90,r),this.h2=Rr(180,s),this.v2=Rr(90,o),this.x1=n,this.y1=h,this.x2=a,this.y2=l;const c=this.source instanceof Pr?this.source.bounds:void 0;c&&4===c.length?this.$_setBoundsByOption(c,t):this.$_hasArea()?this._world=this.h1<=-180&&this.h2>=180:this.$_setBoundaryByWorld(t),this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_hasArea(){return 0!==this._areas.length}$_setBoundaryByWorld(t){this.h1=-180,this.v1=-90,this.h2=180,this.v2=90;const e=t.project([this.h1,this.v2]),i=t.project([this.h2,this.v1]),s=t.project([this.h1,this.v1]),r=t.project([this.h2,this.v2]);this.x1=Math.min(e[0],i[0],s[0],r[0]),this.x2=Math.max(e[0],i[0],s[0],r[0]),this.y1=Math.min(e[1],i[1],s[1],r[1]),this.y2=Math.max(e[1],i[1],s[1],r[1]),this._world=!0}$_setBoundsByOption(t,e){let i=t[0],s=t[1],r=t[2],o=t[3],n=e.project([i,o]),a=e.project([r,s]),h=e.project([i,s]),l=e.project([r,o]);if([n,a,h,l].every((t=>function(t){if(!t)return!1;const e=isFinite(t[0]+t[1]),i=-180<=t[0]&&t[0]<=180,s=-90<=t[1]&&t[1]<=90;return e&&i&&s}(t))))this.h1=i,this.v1=s,this.h2=r,this.v2=o;else{if(this.$_hasArea())return;this.$_setBoundaryByWorld(e)}this.x1=Math.min(n[0],a[0],h[0],l[0]),this.x2=Math.max(n[0],a[0],h[0],l[0]),this.y1=Math.min(n[1],a[1],h[1],l[1]),this.y2=Math.max(n[1],a[1],h[1],l[1]),this._world=t[0]<=-180&&t[2]>=180}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const o=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,o=r&&r[s];if(!o)continue;const n=t.readPolygonBounds(o);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=n),t.mainLandBounds.x1=Rr(t.mainLandBounds.x1,n.x1),t.mainLandBounds.x2=$r(t.mainLandBounds.x2,n.x2),t.mainLandBounds.y1=Rr(t.mainLandBounds.y1,n.y1),t.mainLandBounds.y2=$r(t.mainLandBounds.y2,n.y2)}t.mainLandBounds||(t.mainLandBounds=o)}$_load(t){var e;const i=t.insets,s=t.idKey,o=null!==(e=t.nameKey)&&void 0!==e?e:"name",n=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 Sr){const r=b(e.props[s],e.id);if(r&&t.included(r)){const t=i[r],s=new Or(e,t);t&&(delete i[r],t._area=s,_.push(t)),h&&h.indexOf(r)>=0?(l.unshift(s),s.dummy=!0):l.push(s),c[s.id=r]=s,s.name=b(e.props[o],e[o])}}else if(e instanceof Ar){const t=new Fr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const s=c[t[i]];if(s){const o=e.polygons[i];s.inset=e,s._insetChilds=r(o)?o:[o],e._parent=t[i],e._base=s._insetChilds,e._area=s,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=r(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(r(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],s=e._children=[];if(r(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=Rr(t,r.h1),s=Rr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const r of e.children){const e=c[r];if(e){const o=e.inset={area:r,offset:i};t.push(e),o._area=e,s.push(o)}}_.push(e)}}if(n&&!isNaN(+t.dokdo)){const e=c[n.group];if(e){const i=+t.dokdo;if(e.source=new Lr(e.source,i,+n.index,+n.parent),0===i){const t=+n.index;for(const e of _)if(e._parent===n.group&&r(e._base)){const i=e._base;i.indexOf(t)>=0&&(e._base=i.filter((e=>e!==t)))}}}}this.reset(),_.forEach((t=>Dr(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 Br(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class zr extends ci{getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}zr.defaults=ri(wi.defaults,{offset:4});class jr extends wi{_doInit(t){super._doInit(t),this._label=this._addChild("label",new zr(this.chart))}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}jr.defaults=ri(wi.defaults,{visible:!1});class Gr extends ai{getItemGap(){var t;return null!==(t=this.prop("itemGap"))&&void 0!==t?t:Gr.ITEM_GAP}}Gr.ITEM_GAP=4,Gr.defaults=ri(ai.defaults,{offsetX:8,offsetY:8,itemGap:3});class Hr extends Gr{get vertical(){return"vertical"===this.prop("direction")}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this.prop("buttonWidth"))&&void 0!==t?t:this.prop("buttonHeight"))&&void 0!==e?e:Hr.BUTTON_SIZE,height:null!==(s=null!==(i=this.prop("buttonHeight"))&&void 0!==i?i:this.prop("buttonWidth"))&&void 0!==s?s:Hr.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this.prop("zoomFactor"))&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.body.prop("zoomable")&&(this.chart.body.isZoomed||this.prop("showAlways"))}}Hr.BUTTON_SIZE=24,Hr.defaults=ri(Gr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Wr extends Gr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Wr.defaults=ri(Gr.defaults,{type:"text",align:"left",verticalAlign:"top"});class Yr extends kt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,i=!1){const s=e.filter(Boolean);let r;return i&&(r=this.clear()),this._items.push(...s),t.selectList(s),this._owner.selectionItemAdded(s),this._changed(),r}remove(t,e){const i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,1),t.unselect(e),this._owner.selectionItemRemoved([e]),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,[e])}_changed(){this._owner.selectionChanged([this])}}class Zr extends ai{isVisible(){return this.visible&&!B(this.prop("text"))}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Zr.defaults=ri(ai.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Ur extends Zr{}Ur.defaults=ri(Zr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Xr extends ai{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=b(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?Ce.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)}}Xr.defaults=ri(ai.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:25,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",mode:"line"});const qr=/(.*)/,Kr=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))');class Jr{static getFormatter(t){let e=Jr.Formatters[t];return e||(Jr.Formatters[t]=e=new Jr(t)),e}constructor(t){this._pattern=qr,this._replace="$1",this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(Kr);if(e.length>1){let t=e[0].trim(),i=e[1].trim();t&&i&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==i.charAt(0)&&(i=t.substr(1,i.length-2)),i&&(this._pattern=new RegExp(t,e[2]||""),this._replace=i)))}}}}Jr.Formatters={};class Qr extends $i{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(this._paramRegx,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(e[0]):this._params[e[0]];if(void 0===i&&(i=e[1]),e.length>3)switch(e[3]){case"t":i=Jr.getFormatter(e[2]).toStr(String(i));break;case"d":if(n(i))i=new Date(i);else{const t=parseFloat(i);isNaN(t)||(i=new Date(t))}i instanceof Date&&(i=Be.getFormatter(e[2]).toStr(i,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(i);isNaN(t)||(i=Ce.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=Jr.getFormatter(e[2]).toStr(String(i))):i=Ce.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this.prop("visible")&&!z(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({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=o(i)?i:null}}Qr.type="html",Qr.defaults=ri($i.defaults,{});class to extends $i{_isVisible(){return this.prop("visible")&&!z(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}to.type="image",to.defaults=ri($i.defaults,{});class eo extends $i{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||eo.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}eo.type="shape",eo.defaults=ri($i.defaults,{width:64,height:64,shape:"square"});class io extends $i{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this.prop("visible")&&!z(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?Ce.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Be.getFormatter(t):void 0)}(t.timeFormat)}}io.type="text",io.defaults=ri($i.defaults,{text:"Text"});class so extends kr{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 ro=1.340264,oo=-.081106,no=893e-6,ao=.003796,ho=Math.sqrt(3)/2,lo=74.03120656864502;class co extends kr{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=I,i=Math.asin(ho*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)*lo/(ho*(ro+3*oo*s+r*(7*no+9*ao*s))),i*lo*(ro+oo*s+r*(no+ao*s))]}backward(t){const e=t[0]/lo,i=t[1]/lo,s=180/Math.PI;let r,o,n,a,h,l=i;for(let t=0;t<12&&(r=l*l,o=r*r*r,n=l*(ro+oo*r+o*(no+ao*r))-i,a=ro+3*oo*r+o*(7*no+9*ao*r),l-=h=n/a,!(Math.abs(h)<1e-9));++t);r=l*l,o=r*r*r;const c=s*ho*e*(ro+3*oo*r+o*(7*no+9*ao*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/ho);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const _o=63.78137,uo=Math.PI/180;class po extends kr{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*uo);return[_o*(t[0]+this.offset[0]-this.scroll)*uo,_o*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(_o*uo),(2*Math.atan(Math.exp((t[1]-this.offset[1])/_o))-Math.PI/2)/uo]}}const go=Math.PI/4,mo=Math.PI/180,fo=63.78137;class bo extends kr{project(t){return[(t[0]+this.offset[0]-this.scroll)*mo*fo,79.7267125*Math.log(Math.tan(go+.4*(t[1]+this.offset[1])*mo))]}backward(t){return[(t[0]-this.offset[0])/fo/mo,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/fo*.8))-go)/mo]}}class yo extends xs{}class wo extends vs{_doInit(t){super._doInit(t),this._addChild("subLabel",this._subLabel=this._createLabel(this.chart))}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this.prop("barOrder")}getFieldColors(){return this._fieldColors}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new yo(t)}_defLabelOff(){return this.$_isLabelCenter()?wo.LABEL_OFFSET_CENTER:wo.LABEL_OFFSET_AUTO}_createLegendMarker(t,e){return ji.create(t,Li,0,0,e,e,2)}setCalcedColor(t,e){if(super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories){const t=this.prop("fieldColors");r(t)?this._fieldColors=t:this._fieldColors=this._splitColors()}}$_isLabelCenter(){return"center"===this.pointLabel.prop("position")}}wo.LABEL_OFFSET_CENTER=0,wo.LABEL_OFFSET_AUTO=2,wo.type="bar",wo.defaults=ri(vs.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class xo extends ai{constructor(t){super(t.chart),this.gauge=t}}class vo extends xo{}vo.defaults=ri(ai.defaults,{visible:!1});class Co extends xo{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Co.defaults=ri(ai.defaults,{});class So extends xo{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}So.defaults=ri(ai.defaults,{thickness:"100%",stroked:!1});class Lo extends xo{getExtents(t){return{radius:Y(this._radiusDim,t,0),length:Y(this._lengthDim,t,0),offset:Y(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Lo.defaults=ri(ai.defaults,{visible:!1,radius:3,length:"100%",offset:0});class Mo extends xo{getRadius(t){return Y(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}Mo.defaults=ri(ai.defaults,{visible:!1,radius:5});class Ao extends li{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:Y(this._offsetXDim,t,0),y:Y(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ao.defaults=ri(li.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class Po{constructor(){this.setCenterX(Io.DEF_CENTER),this.setCenterY(Io.DEF_CENTER),this.setRadius(Io.DEF_RADIUS),this.setInnerRadius(Io.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=W(b(t,Io.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(b(t,Io.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(b(t,Io.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(b(t,Io.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),i=_(e,this._innerDim?Y(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?Y(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=m(t%360,0),s=u(0,_(360,m(e,360)));this._startRad=k+I*i,this._handRad=I*i,this._sweepRad=I*s}}class ko extends Cs{_readObject(t,e){super._readObject(t,e)}}class Io extends Ls{_doInit(t){super._doInit(t),this._face=this._addChild("face",new vo(this)),this._rim=this._addChild("rim",new Co(this)),this._valueRim=this._addChild("valueRim",new So(this)),this._hand=this._addChild("hand",new Lo(this)),this._pin=this._addChild("pin",new Mo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Ao(this.chart)),this._props=new Po}get face(){return this._face}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}_createPoint(t){return new ko(t)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}_doPrepareRender(t){super._doPrepareRender(t),this._props.prepareAngles(this.prop("startAngle"),this.prop("sweepAngle"))}}Io.DEF_CENTER="50%",Io.DEF_RADIUS="50%",Io.DEF_INNER="80%",Io.type="gauge",Io.defaults=ri(Ls.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class No extends ai{constructor(t){super(t.chart),this.gauge=t}}class Eo extends No{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Eo.defaults=ri(ai.defaults,{thickness:3});class To extends No{getLength(t){return Y(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}To.defaults=ri(ai.defaults,{thickness:1.5,length:"55%"});class Vo extends To{}Vo.defaults=ri(To.defaults,{thickness:1,length:"80%"});class Do extends To{}Do.defaults=ri(To.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Ro extends No{}Ro.defaults=ri(ai.defaults,{length:5});class $o extends No{}$o.defaults=ri(ai.defaults,{step:1,offset:0});class Oo extends No{}Oo.defaults=ri(ai.defaults,{radius:4});class Fo extends li{}Fo.defaults=ri(li.defaults,{text:"RealMap",position:"top"});class Bo extends Cs{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=m(e.time,NaN),this.timezone=m(e.timezone,NaN)}}class zo extends Ss{_doInit(t){super._doInit(t),this._face=this._addChild("face",new ai(this.chart)),this._rim=this._addChild("rim",new Eo(this)),this._hourHand=this._addChild("hourHand",new To(this)),this._minuteHand=this._addChild("minuteHand",new Vo(this)),this._secondHand=this._addChild("secondHand",new Do(this)),this._tick=this._addChild("tick",new Ro(this)),this._tickLabel=this._addChild("tickLabel",new $o(this)),this._pin=this._addChild("pin",new Oo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Fo(this.chart))}get face(){return this._face}get rim(){return this._rim}get hourHand(){return this._hourHand}get minuteHand(){return this._minuteHand}get secondHand(){return this._secondHand}get tick(){return this._tick}get tickLabel(){return this._tickLabel}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}getExtents(t,e,i){const s=_(t,e)*i;return{cx:Y(this._centerXDim,t,t/2),cy:Y(this._centerYDim,e,e/3),rd:Y(this._radiusDim,s,s/2)}}_createPoint(t){return new Bo(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=W(b(e._centerX=t,zo.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=W(b(e._centerY=i,zo.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=W(b(e._radius=s,zo.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}zo.DEF_CENTER="50%",zo.DEF_RADIUS="50%",zo.type="clock",zo.defaults=ri(Ss.defaults,{centerX:zo.DEF_CENTER,centerY:zo.DEF_CENTER,radius:zo.DEF_RADIUS,active:!0,size:70});class jo extends ms{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Go extends ai{getSize(){return{width:this.prop("width"),height:this.prop("height")}}}Go.defaults=ri(ai.defaults,{});class Ho extends gs{_doInit(t){super._doInit(t),this._innerLabel=this._addChild("innerLabel",new Qi(this.chart)),this._innerImage=this._addChild("innerImage",new Go(this.chart))}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this.prop("figure")}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this.prop("width"),i=this.prop("height");return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(this.prop("figureBox"))}_createPoint(t){return new jo(t)}_defLabelOff(){return 2}getValueRange(){return{min:this._minValue,max:this._maxValue}}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._visPoints,{min:s,max:r}=this._calcMinMax(i);this._minValue=s,this._maxValue=r}$_calcBox(t){if(r(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}Ho.type="figure",Ho.defaults=ri(gs.defaults,{position:"top"});class Wo extends us{_readObject(t,e){super._readObject(t,e)}}class Yo extends Qi{}Yo.defaults=ri(ds.defaults,{visible:!1});class Zo extends ps{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}getSize(){return{width:+this._op.htmlWidth,height:+this._op.htmlHeight}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t,e){return e.replace(this._paramRegx,((e,i)=>this.$_apply(t,i)))}_createLabel(t){return new Yo(t)}_createPoint(t){return new Wo(t)}_createFielders(t){super._createFielders(t),this._htmlFielder=this._createFielder(t.htmlField||"html")}_defLabelOff(){return 2}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=o(i)?i:null}$_apply(t,e){const i=e.split(";");let s=b(this._paramCallback?this._paramCallback(i[0]):this._params[i[0]],t.getParam(i[0]));if(void 0===s&&(s=i[1]),i.length>3)switch(i[3]){case"t":s=Jr.getFormatter(i[2]).toStr(String(s));break;case"d":if(n(s))s=new Date(s);else{const t=parseFloat(s);isNaN(t)||(s=new Date(t))}s instanceof Date&&(s=Be.getFormatter(i[2]).toStr(s,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(s);isNaN(t)||(s=Ce.getFormatter(i[2]).toStr(t))}else if(i.length>2){const t=+s;isNaN(t)?s&&(s=Jr.getFormatter(i[2]).toStr(String(s))):s=Ce.getFormatter(i[2]).toStr(t)}return s||""}}Zo.DEF_SIZE=100,Zo.type="html",Zo.defaults=ri(ds.defaults,{position:"center"});class Uo extends Qi{}Uo.defaults=ri(Qi.defaults,{visible:!1});class Xo extends qi{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class qo extends ds{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Uo(t)}_createPoint(t){return new Xo(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this.prop("rootUrl")||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}qo.type="image",qo.defaults=ri(ds.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Ko extends Zt{constructor(t,e){super(t,Li),this.add(this._area=new Kt(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new Kt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class Jo extends xs{}class Qo extends ai{}Qo.defaults=ri(vs.defaults,{visible:!1});class tn extends vs{_doInit(t){super._doInit(t),this._addChild("area",this._area=new Qo(this.chart))}get area(){return this._area}_createPoint(t){return new Jo(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Ko(t,e)}}tn.type="line",tn.defaults=ri(vs.defaults,{});class en extends us{_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?b(super.getParam(t),this.area.source.props[t]):super.getParam(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class sn extends ai{}sn.defaults=ri(ai.defaults,{enabled:!0,autoMapChange:!0});class rn extends ai{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)}}rn.defaults=ri(ai.defaults,{});class on extends ai{constructor(t,e){super(e.chart),this.name=t,this.series=e}}on.defaults=ri(ai.defaults,{visible:!1});class nn extends ci{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(o(i.textCallback)){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if("function"==typeof this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(o(this._op.visibleCallback))return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}nn.defaults=ri(ci.defaults,{visible:void 0});class an extends Qi{}an.defaults=ri(Qi.defaults,{visible:!1,hoverColor:"white"});class hn extends ps{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),this._drilldown=this._addChild("drilldown",new sn(this.chart)),this._insetLabel=this._addChild("insetLabel",new nn(this.chart)),this._internalBorder=this._addChild("internalBorder",new on(null,this)),this._externalBorder=this._addChild("externalBorder",new on(null,this))}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t){return this._map.get(t)}pointOf(t){return this._areaPts.get(t.id)}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 en||(t=this.pointById(t)),t.center||t.area.getCenter()}getValueRange(){return{min:this._minValue,max:this._maxValue}}getDetailed(){return this._detailed?this._detail:this}showDetail(){this._detail&&!this._detailed&&(this._detailed=!0,this._detail.show(!0,!0),this.hide(!0))}showParent(){this._parent&&this._parent._detail===this&&(this.hide(!0),this._parent._detailed=!1,this._parent.show(!0,!0))}isMapSeries(){return!0}_createLabel(t){return new an(t)}$_createDetail(){return this._detail||(this._detail=new hn(this.chart),this._addChild("detail",this._detail),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),s(e.detail)&&this.$_createDetail().loadOptions(e.detail)}_doApply(t){if(this.getDetailed()||(s(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),i.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(r(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new en(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:r(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,s(e.colorRange)){const t=g(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new $s(t)}else this._colorRanger=null===(i=t.getColorScale(this.getColorScale()))||void 0===i?void 0:i.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(r(t)?t[0]:t)||"id",s=(r(t)?t.length>1?t[1]:t[0]:t)||"id",o="id"===s,n=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{const e=t;e.area=o?n[e[s]]:n[e.source[s]],e.area&&a.set(e.area.id,e)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ge(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t){t&&(t.setSelected(!0),this.chart._selectionChanged(this,[t]))}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0);this.chart._selectionChanged(this,e)}isEmpty(t){return 0===this.map.areaCount}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new rn(t.name,this);i.init(),i.loadOptions(t),e.push(i)}))}}hn.type="map",hn.defaults=ri(ps.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class ln extends Qi{}ln.defaults=ri(Qi.defaults,{visible:!1});class cn extends us{}class dn extends ai{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 ii),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}dn.defaults=ri(ai.defaults,{});class _n extends dn{getMinSize(t){return Y(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}_n.defaults=ri(dn.defaults,{text:"${name}"});class un extends dn{}un.defaults=ri(dn.defaults,{text:"${value}"});class pn extends gs{_doInit(t){super._doInit(t),this._header=this._addChild("header",new _n(this)),this._divider=this._addChild("divider",new ai(this.chart)),this._body=this._addChild("body",new un(this))}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:m(this._width,ht.clampEx(t,this._minWidth,this._maxWidth)),height:m(this._height,ht.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new ln(t)}_createPoint(t){return new cn(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t);const e=this.prop("orientation"),i=this.prop("minWidth"),s=this.prop("minHeight");this._vertical="horizontal"!==e,this._minWidth=+i,this._minHeight=+s}}pn.DEF_MIN_WIDTH=80,pn.DEF_MIN_HEIGHT=50,pn.type="panel",pn.defaults=ri(gs.defaults,{orientation:"vertical",minWidth:pn.DEF_MIN_WIDTH,minHeight:pn.DEF_MIN_HEIGHT,position:"top"});class gn extends bs{}class mn{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class fn extends ws{getRadius(t){return m(Y(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}getFieldColors(){return this._fieldColors}_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=m(this.prop("startAngle")%360,0),s=u(0,_(360,m(this.prop("totalAngle"),360)));this._startRad=k+I*i,this._totalRad=I*s}setCalcedColor(t,e){this._op,super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories&&(r(this.prop("fieldColors"))?this._fieldColors=this.prop("fieldColors"):this._fieldColors=this._splitColors())}$_parseThresholds(t){return r(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new mn(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new mn(t.value,t.radius,t.style)]:void 0}}fn.type="pie",fn.defaults=ri(ws.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class bn extends Kt{constructor(t,e){super(t,Li),this._rd=e,this.setPath(Vi.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 yn extends ms{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class wn extends fs{getExt(t,e){const i=m(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t);const e=this.prop("radius"),i=this.prop("innerRadius");this._rd=m(e,wn.DEF_RADIUS),this._innerRd=m(i,0)}_createPoint(t){return new yn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new bn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ge(this._calcedColor)}getColorScale(){return this.prop("colorScale")}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);this._minValue=r,this._maxValue=o,this._colorRanger=null===(i=t.getColorScale(this.prop("colorScale")))||void 0===i?void 0:i.getRanger()}}wn.DEF_RADIUS=9,wn.type="pin",wn.defaults=ri(fs.defaults,{radius:wn.DEF_RADIUS,innerRadius:0,position:"top"});class xn extends Zt{constructor(t,e){super(t,Li),this._size=e,this.add(this._marker=new Kt(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);Vi.setShape(this._marker,this._shape,e,e)}}class vn extends ai{get acitve(){return this.visible&&this._runner&&this._runner.active}get clusters(){return this.visible&&this._runner?this._runner.clusters:null}run(t,e,i,s,r,o){t.forEach((t=>t.cluster=null)),this._runner="grid"===this._op.algorithm?new Sn:new Cn,this._runner.prepare(this,e,i).run(this,t,s,r,o)}stop(){}updateClusters(){this._runner.updateClusers()}clear(){var t;null===(t=this._runner)||void 0===t||t.clear()}isVisible(t){return this.acitve&&t.points.length>1||!this.acitve&&t.points.length>=this._op.minDensity}getRange(t){const e=this._ranges;if(e){const i=t.points.length;for(const t of e)if(i>=t.from&&i<t.to)return t}return{radius:this._op.radius}}isExpandable(){return!1!==this._op.expandable}_doApply(t){super._doApply(t),t.distance=m(t.distance,40),t.minDensity=m(t.minDensity,2),t.maxIteration=m(t.maxIteration,100),t.stepDuration=m(t.stepDuration,50),t.radius=m(t.radius,15),this._ranges=this.$_parseRanges(t.ranges)}$_parseRanges(t){const e=[];if(r(t)&&t.length){const i=this._op.radius;let r=-1/0;t.forEach(((t,o)=>{if(s(t)){const s={from:m(r,t.from),to:m(t.to,1/0),radius:m(t.radius,i),color:t.color};e.push(s),r=s.to}e.length>1&&e.sort(((t,e)=>t.from-e.from))}))}return e.length>0?e:null}}vn.defaults=ri(ai.defaults,{visible:!1,distance:40,minDensity:2,maxIteration:100,stepDuration:50,zoomLimit:300,radius:15});class Cn{constructor(){this._ani=null}get active(){return this._clusters&&this._clusters.length>0&&!this._completed}get clusters(){return this._clusters}prepare(t,e,i){return this}run(t,e,i,s,r){const o=this._clusters=this.$_buildDensitySeeds(t,e);if(o.length>0&&!this._completed){const n=this.$_iterate(t,e,o),a=e=>{if(e-this._last>=t.prop("stepDuration")){const t=n.next();t.done?r(o):(s(t.value.step,t.value.clusters),this._ani=requestAnimationFrame(a)),this._last=e}else o.forEach((t=>{t.points.forEach((t=>t.moves+=1/Cn.MOVE_STEPS))})),s(-1,null),this._ani=requestAnimationFrame(a)};this._completed=!1,i(o),a(this._last=performance.now())}else this._completed=!0}stop(){null!==this._ani&&(cancelAnimationFrame(this._ani),this._ani=null),this._completed=!0}updateClusers(){this._clusters&&this.$_updateCentroids(this._clusters)}clear(){this._clusters&&(this._clusters.forEach((t=>{t.points.forEach((t=>t.cluster=void 0))})),this._clusters=null)}$_buildDensitySeeds(t,e){const i=2*t.prop("distance"),s=new Map;for(const t of e){const e=`${Math.floor(t.px/i)},${Math.floor(t.py/i)}`;s.has(e)||s.set(e,[]),s.get(e).push(t),t.cluster=null,t.moves=1}const r=[];for(const t of s.values()){const e=t.reduce(((t,e)=>t+e.px),0)/t.length,i=t.reduce(((t,e)=>t+e.py),0)/t.length;r.push({cx:e,cy:i,points:[],prevs:[]})}return r}$_assignPoints(t,e,i,s){s*=s,i.forEach((t=>{t.prevs=t.points,t.points=[]}));for(const r of e){let e=i[0],o=1/0;for(const t of i){const i=(r.px-t.cx)**2+(r.py-t.cy)**2;i<o&&(o=i,e=t)}(r.px-e.cx)**2+(r.py-e.cy)**2<=s&&(e.points.push(r),e.points.length>=t.prop("minDensity")&&e.points.forEach((t=>{t.cluster!==e&&(t.cluster=e,t.moves=0)})))}this._completed=!0;for(const t of i)if(!ht.equalArrays(t.points,t.prevs)){this._completed=!1;break}for(const t of i)for(const e of t.points)this._completed?e.moves=1:e.moves+=1/Cn.MOVE_STEPS}$_updateCentroids(t){for(const e of t){const t=e.points.length;t>0&&(e.cx=e.points.reduce(((t,e)=>t+e.px),0)/t,e.cy=e.points.reduce(((t,e)=>t+e.py),0)/t)}}*$_iterate(t,e,i){for(let s=0;s<t.prop("maxIteration")&&!this._completed;s++)this.$_assignPoints(t,e,i,t.prop("distance")),this.$_updateCentroids(i),yield{step:s,clusters:i}}}Cn.MOVE_STEPS=10;class Sn{get active(){return!1}get clusters(){return null}prepare(t,e,i){return this}run(t,e,i,s,r){}stop(){}updateClusers(){}clear(){}}class Ln extends ms{_readObject(t,e){super._readObject(t,e)}}class Mn extends fs{constructor(t){super(t),this._shape=t.getNextPointShape()}_doInit(t){super._doInit(t),this._cluster=this._addChild("cluster",new vn(this.chart))}getShape(){return this.prop("shape")||this._shape}getRadius(){return this.prop("radius")}setLegendMarkerStyle(t){this._stroke&&(t.internalSetStyle("stroke",this._stroke),t.internalSetStyle("stroke-width",this._strokeWidth))}get cluster(){return this._cluster}_createPoint(t){return new Ln(t)}_defLabelOff(){return 2}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(),_(e,2*this.prop("radius"))),i}}Mn.type="point",Mn.defaults=ri(fs.defaults,{radius:5,position:"center"});class An extends Zt{constructor(t,e){super(t,Li),this.add(this._line=new Kt(t)),this.add(this._arrow=new Kt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=$(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,o="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),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 Pn extends qi{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return l(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,s;const o=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(s=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==s?s:[],this.path=null!=e.path?o(e.path):void 0,this.imageUrl=e.imageUrl||t.imageFielder(e)}}class kn extends ds{get imageFielder(){return this._imageFielder}getImageUrl(t,e=!0){const i=e?this._root:"";return t.imageUrl?i+t.imageUrl:this._imageUrl?i+this._imageUrl:null}getRouteMode(){return this.chart.isGlobe?Fi:this._op.routeMode}getLineWidth(){return m(this._op.lineWidth,0)}getCurvePoint(t,e,i){const s=this.chart.getProjection(),r=t.getProp("curveFactor")||this._op.curveFactor,o=s.scroll;let n;return s.scroll=0,n=0===r?[e,i].map((t=>s.project(t))):this.$_getCurvePointBycurveFactor(e,i,r),s.scroll=o,n}needMapScale(){return!0}_createPoint(t){return new Pn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;s(e)&&(t=t.map((t=>{const i=l({},t);if(r(i.coords)){const t=i.coords.slice();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 An(t,e)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_doApply(t){super._doApply(t),this._root=this._op.imageRootUrl||"",this._imageUrl=this._op.imageUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}$_getCurvePointBycurveFactor(t,e,i){const s=this.chart.getProjection(),r=e[0]-t[0]>0?1:-1,o=s.project(t),n=s.project(e),a=n[0]-o[0],h=n[1]-o[1],l=(o[0]+n[0])/2,c=(o[1]+n[1])/2,d=Math.sqrt(a*a+h*h),_=l+-h/d*i*r,u=c+a/d*i*r,p=a/d,g=h/d,m=d/8;return[[_-p*m,u-g*m],[_+p*m,u+g*m]]}}kn.type=zi,kn.defaults=ri(ds.defaults,{routeMode:"geo",lineType:"air",arrowDisplay:"always",arrowWidth:5,arrowLength:13,curveFactor:0,imageWidth:42,imageHeight:42});class In extends bs{}class Nn extends ws{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),o={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(o);else this.$_fillColFirst(o);return{grid:s,count:r,rows:o.rows,cols:o.cols}}_createPoint(t){return new In(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Nn.ROW_COUNT,this._colCount=t.colCount||Nn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Nn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Nn.CELL_SIZE,this._gap=m(t.gap,Nn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=r(t.values)?t.values.reduce(((t,e)=>t+m(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*m(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 o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,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=o,t.cols=n}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,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=o,t.cols=n}}Nn.ROW_COUNT=10,Nn.COL_COUNT=10,Nn.THRESHOLD=1,Nn.CELL_SIZE=5,Nn.GAP=2,Nn.type="waffle",Nn.defaults=ri(ws.defaults,{rowCount:Nn.ROW_COUNT,colCount:Nn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Nn.THRESHOLD,cellSize:Nn.CELL_SIZE,gap:Nn.GAP});class En extends Pr{static loadMap(t,e){return s(t)&&s(t.source)&&r(t.source.features)||s(t)&&s(t.map)&&r(t.map.features)?new En(t,e):s(t)&&r(t.bounds)&&4===t.bounds.length&&t.bounds.every(a)?new En({...t,map:{features:[]}},e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Sr(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 Tn extends ai{}class Vn extends ai{}class Dn extends bi{constructor(t,e){super(t),this.inBody=e,this._zoom=100,this._panX=0,this._panY=0,this.scroll=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))}}_doInit(t){t.target=(this._target=new Tn(this.chart)).init(),t.connector=(this._connector=new Vn(this.chart)).init()}get target(){return this._target}get connector(){return this._connector}prepareLayout(t,e){return this.$_prepareLayout(t,e)}refresh(){}_getNamePrefix(){return"mapregion"}_doPrepareRender(t,e){const i=this._map=t.map,s=t.getProjection(),r=e.bounds,o=Math.abs(r[0][0]-r[1][0]),n=Math.abs(r[0][1]-r[1][1]),a=Math.abs(i.x2-i.x1)/o,h=Math.abs(i.y2-i.y1)/n,l=[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2],[c,d]=s.project(l);this._zoom=100*Math.min(a,h),s.isGlobe||(t.body.isScrollable()?this.scroll=l[0]:this._panX=c-i.cx,this._panY=-d+i.cy)}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:o,y2:n}=i,a=this._wMap=r-s,h=n-o,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=m(this._panX*d,0),u=m(this._panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(o+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=o+h/2-b/2-this._panY;return this._vRect=dt.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}}Dn.defaults=ri(ai.defaults,{width:200});class Rn extends yi{getRegion(t){const e=this._map[t];if(e instanceof Dn)return e}_loadItem(t,e,i,s){const r=new Dn(t,s);return r.init(),r.index=i,r.loadOptions(e),r}}class $n extends ut{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=m(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 On extends ut{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=m(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 Fn extends ai{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}Fn.defaults=ri(ds.defaults,{visible:void 0,globeFill:"lightblue"});const Bn={zoom:1,panX:1,panY:1};class zn extends ai{constructor(t){super(t),this._prj=(new so).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new Oi(this)}_doInit(t){super._doInit(t),this._addChild("mapBackground",this._mapBackground=new Fn(this.chart))}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){var t;return(null===(t=this._map)||void 0===t?void 0:t.isWorld)&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof Er?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Er?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){return this._prj.scroll}set scroll(t){this.updateOption("scroll",t)}get movable(){return!1!==this.prop("movable")}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this.prop("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.chart.globalMapBound,e=[t.x1+(t.x2-t.x1)/2,t.y1+(t.y2-t.y1)/2];return this._prj?this._prj.backward(e):e}get map(){return this._map}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}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.chart.globalMapBound,r=i.getYRange(s.v1,s.v2),o=i.project([s.h1,r[0]]),n=i.project([s.h2,r[1]]),a=this._wMap=n[0]-o[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=this.$_calculateRate(t,e,a,l),d=this._scale=this._zoom/100*c,_=m(this.prop("panX")*d,0),u=m(this.prop("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*a/360,g=t/2-(o[0]+a/2)*d-(this._panX+p)*d,f=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=dt.create(w,x,b,y),{scale:d,wMap:a,hMap:l,tx:g,ty:f}}$_prepareLayout(t,e){const i=this.chart.globalMapBound,{x1:s,x2:r,y1:o,y2:n}=i,a=this._wMap=r-s,h=n-o,l=this.$_calculateRate(t,e,a,h),c=this._zoom/100,d=this._scale=c*l,_=m(this.prop("panX")*d,0),u=m(this.prop("panY")*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(o+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=o+h/2-b/2-this._panY;return this._vRect=dt.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}$_calculateRate(t,e,i,s){const r=Math.min(t/i,e/s);return 0!==r?r:1}getPoint(t){return this._points[t]}toVisible(t){if(this.isFlatWorld)return this._prj.getVisible(t);{const e=this._prj.getVisible(t);if(e&&this._vRect.contains(e[0],e[1]))return e}}isScrollable(){var t;return this.prop("scrollable")&&(null===(t=this.map)||void 0===t?void 0:t.isWorld)}setZoom(t,e=300){let i,r;a(e)?r=e:o(e)?(i=e,r=300):s(e)&&(i=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new $n(this,t,r,i).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}zoomByFactor(t,e=!0){if(!isNaN(t)){const i=this.zoom;e?this.setZoom(i+i*t/100):this.zoom=i+i*t/100}}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new On(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){var r;const o={...Di,...s},n=null===(r=this.map)||void 0===r?void 0:r.areaOf(t);if(!n)return;const a=n.getCenter(),{x1:h,x2:l,y1:c,y2:d}=n.mainLandBounds,{zoom:_}=this.calcZoomInfo([h,c],[l,d],e),u=Math.min(o.maximumZoom,Math.max(o.minimumZoom,_));new On(this,u,a,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:o}=this.calcZoomInfo(t,e,s);try{new On(this,o,r,i,null).start()}catch(t){console.error(t)}}calcZoomInfo(t,e,i){const s=this.map,r=Math.abs(e[0]-t[0]),o=Math.abs(e[1]-t[1]),n=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=Math.abs(s.x2-s.x1)/r*i,h=Math.abs(s.y2-s.y1)/o*i;return{center:n,zoom:100*Math.min(a,h)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this.chart.globalMapBound,i=e.x1+(e.x2-e.x1)/2,s=e.y1+(e.y2-e.y1)/2,[r,o]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(0!==this.scroll||this.isScrollable()?this.scroll=t[0]:this.panX=r-i,this.panY=-o+s)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Bn;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 Bn)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,o;const a=this;var h;super._doApply(t),i.call(t,"annotations")&&(h=t.annotations)!==a._anns&&(a._anns=h,a._annotations.load(h,!0));const l=this._zoom;let c=function(t){if(void 0!==t&&t!==a._projection){switch(a._projection=t,a._projection.toLowerCase()){case"orthographic":a.scroll=0,a.panX=0,a.panY=0,a._prj=new Er;break;case"equalearth":a._prj=(new co).prepareSecond();break;case"miller":a._prj=(new bo).prepareSecond();break;case"mercator":a._prj=(new po).prepareSecond();break;default:a._prj=(new so).prepareSecond()}return!0}}(t.projection);const d=this._prj;if(d&&(c||void 0!==t.scroll&&t.scroll!==this._rawScroll)){d.scroll=t.scroll,this._rawScroll=t.scroll,c=!0;const i=null===(e=this.chart)||void 0===e?void 0:e.firstMapSeries;i&&i.setOptionsDirty(!0)}d instanceof Er&&(c=d.setRotation(t.rotationX,t.rotationY)||c),function(t){void 0!==t&&(a._zoom=Math.max(100,m(t,100)))}(t.zoom);const _=this._points={};r(t.points)&&t.points.forEach((t=>{r(t)&&t.length>=3&&n(t[0])?_[t[0]]=[t[1],t[2]]:s(t)&&n(t.id)&&(_[t.id]=r(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(c&&this.chart.projectionChanged(),this._zoom!==l&&(this.chart.zoomChanged(this._zoom,l),null===(o=this.prop("onZoomChanged"))||void 0===o||o({chart:this.chart.wrapper,zoom:this._zoom,oldZoom:l})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}zn.defaults=ri(ai.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:5});class jn extends hn{}class Gn extends ai{constructor(){super(...arguments),this._widgetGaps=new Rt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=this.prop("widgetSectionGap");n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}Gn.defaults=ri(ai.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,resizeDelay:50,wheelDisabled:!1,animatable:!0,clickable:!0,hoverable:!0,draggable:!0});class Hn extends Dt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Ni.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new me,this._series=new _s(this),this._annotations=new Oi(this),this._mapRegions=new Rn(this),this._widgetGroups=new fi(this),this._legends=new Rs(this),this._colorScales=new Zs(this),this._bubbleScales=new Ts(this),(this._global=new Gn(this)).init(),(this._axis=new hr(this)).init(),(this._body=new zn(this)).init(),(this._exporter=new Us(this)).init(),(this._title=new Zr(this)).init(),(this._subtitle=new Ur(this)).init(),(this._zoomPanel=new Hr(this)).init(),(this._drilldownPanel=new Wr(this)).init(),(this._mapScale=new jr(this)).init(),(this._credits=new xi(this)).init(),(this._tooltip=new Xr(this)).init(),this._op=Object.assign({},Hn.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},s(t)?this._load(t):this._initOptions(),this._selection=new Yr(this)}_initOptions(){return this._op=Object.assign({},Hn.defaults)}get wrapper(){return this._wrapper}get exporter(){return this._exporter}get options(){return this._op}get global(){return this._global}get isGlobe(){return this.getProjection().isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return n(t)&&Ji[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ri[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return this._global.prop("animatable")}hoverable(){return this._global.prop("hoverable")}clickable(){return this._global.prop("clickable")}draggable(){return this._global.prop("draggable")}loadAnimatable(){return this._loadAnimatable}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i;this._fireEvent("onModelChanged",t,"selection");new is({series:t},this._wrapper)._points=e,null===(i=this._global.prop("onSelectionChanged"))||void 0===i||i({chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new so).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this.$_resetGlobalMapBound(),this._fireEvent("onProjectionChanged",this.body._prj)}zoomChanged(t,e){this._fireEvent("onZoomChanged",t,e)}mapChanged(t){this._fireEvent("onMapChanged",t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,i){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this._op.type}get legend(){return this._legends.first}get credits(){return this._credits}get globalMapBound(){return this._globalMapBound}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof Br?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 hn))}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 hn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}isEmpty(){return!this.map}coordOfArea(t){var e,i;return(null===(i=null===(e=this._baseMap)||void 0===e?void 0:e.areaOf(t))||void 0===i?void 0:i.getCenter())||Mi}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 a(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}mapRegionByName(t){return this._mapRegions.getRegion(t)}_collectWidgets(){const t={};for(const e of Object.values(tt))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(tt)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,i){const r=this._bases[e];let o;return s(r.base)&&ni(o={},r.base),s(r[i])&&(o||(o={}),ni(o,r[i])),o?ni(o,t):t}_setProperties(t,e=!0){const i=this._op;for(const e in Hn.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const e=this._op;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(b(t.asset,t.assets)),this._global.loadOptions(t.chart),this._body.loadOptions(t.body);const i=r(t.map)&&4===t.map.length&&t.map.every(a)?{bounds:t.map}:t.map,o=r(i)?i:s(i)?[i]:null;if(r(o)&&o.forEach(((t,e)=>{if(!1!==t.enabled){const i=Tr.loadMap(t,e)||En.loadMap(t,e);if(!i)return;const s=i&&new Br(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),0===this._maps.length){const t=new Br(this,new En({map:{features:[]}},0),0);this._maps.push(t)}return this.setBaseMap(void 0),this.$_resetGlobalMapBound(),this.$_resolveGrid(t),this._axis.loadOptions(t.axis),this._title.loadOptions(t.title),this._subtitle.loadOptions(t.subtitle),this._zoomPanel.loadOptions(t.zoomPanel),this._drilldownPanel.loadOptions(t.drilldownPanel),this._credits.loadOptions(t.credits),this._tooltip.loadOptions(t.tooltip),this._seriesIndex=0,this._series.load(t.series,jn),!1===this._global.prop("alwaysMap")||0!==this._series.count&&this._series.get(0).isMapSeries()||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._mapRegions.load(t.mapRegions||t.mapRegion,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale.loadOptions(t.mapScale),this._exporter.loadOptions(t.exporting),this._loading=!1,this}$_resolveGrid(t){if(!(1===this._maps.length&&0===this._maps[0].areaCount&&this.globalMapBound))return;const e=this.globalMapBound;t.axis||(t.axis={}),"boolean"==typeof t.axis.grid?t.axis.grid={visible:!!t.axis.grid}:t.axis.grid||(t.axis.grid={});const i=t.axis.grid;i.visible=!0;let s=Hn.DEFAULT_GRID_STEP;if("orthographic"!==this._body.prop("projection")){const t=Math.min(Math.abs(e.h2-e.h1),Math.abs(e.v2-e.v1));for(const e of Hn.ZOOM_STEP_MAP)if(t<=e.diff){s=e.step;break}}void 0!==s&&(i.line||(i.line={}),"number"!=typeof i.line&&void 0===i.line.step&&(i.line.step=s))}$_loadTemplates(t){const e=this._bases;if(s(t)){const i=this._templates={};for(const e in t){const r=t[e];s(r)&&(i[e]=l({},r))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return ni(ni({},i),t)}else r(e)&&e.forEach((e=>{let i=this._templates[e];return i?ni(ni({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._widgetGroups.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._mapRegions.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){if("chart"===e){this._global.updateOptions(t[e],!1);continue}const i=this[e];(i instanceof ai||i instanceof hi||i instanceof me)&&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,e);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof hn&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.prop("enabled"))return;s.prop("dataUrl")&&(s.updateOption("data",await fetch(s.prop("dataUrl")).then((t=>t.json()))),s.removeOption("dataUrl"));const r=t.map,o=this.getMap(s.prop("map"))||r;i.prop("autoMapChange")&&o!==r&&this.setBaseMap(o),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof hn&&t.parent))return;const e=t.drilldown;if(!e.prop("enabled"))return;const i=t.parent,s=this.map;e.prop("autoMapChange")&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return o(this._global.prop("onClick"))}click(t){var e;null===(e=this._global.prop("onClick"))||void 0===e||e(t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof pi){const i=t.get(e.prop("group"),e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}$_resetGlobalMapBound(){const t={x1:0,x2:0,y1:0,y2:0,h1:0,h2:0,v1:0,v2:0};let e=1/0,i=-1/0,s=1/0,r=-1/0,o=1/0,n=-1/0,a=1/0,h=-1/0;if(this._maps.forEach((t=>{isFinite(t.x1)&&(e=Math.min(e,t.x1)),isFinite(t.x2)&&(i=Math.max(i,t.x2)),isFinite(t.y1)&&(s=Math.min(s,t.y1)),isFinite(t.y2)&&(r=Math.max(r,t.y2)),isFinite(t.h1)&&(o=Math.min(o,t.h1)),isFinite(t.h2)&&(n=Math.max(n,t.h2)),isFinite(t.v1)&&(a=Math.min(a,t.v1)),isFinite(t.v2)&&(h=Math.max(h,t.v2))})),isFinite(e))this._globalMapBound={x1:e,x2:i,y1:s,y2:r,h1:o,h2:n,v1:a,v2:h};else{const e=this._baseMap;this._globalMapBound=e?{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,h1:e.h1,h2:e.h2,v1:e.v1,v2:e.v2}:t}}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s;null===(s=this._body.prop("onHoverArea"))||void 0===s||s({chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i;null===(i=this._body.prop("onClickArea"))||void 0===i||i({chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}Hn.ZOOM_STEP_MAP=[{diff:1,step:.2},{diff:10,step:1},{diff:50,step:5}],Hn.DEFAULT_GRID_STEP=10,Hn.defaults={type:"map",startOfWeek:0},ds.register(hn,Mn,wn,wo,fn,Ho,Ps,kn,qo,tn,pn,Nn,Zo,Io,zo),$i.register(to,eo,io,Qr);class Wn extends Zt{constructor(t,e,i=!1){super(t,e,"image"),this._dirty=!0,this._bounds=lt,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},i&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Yn extends Zt{constructor(t,e){super(t,Yn.STYLE),this._spinnerWrapper=new Zt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Wn(t,"rm-loading-spinner",!0)),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=Yn.LOADING_SPINNER,this._spinner.width=Yn.SPINNER_LENGTH,this._spinner.height=Yn.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-Yn.SPINNER_LENGTH/2,t.height/2-Yn.SPINNER_LENGTH/2)}}Yn.STYLE="rm-loading-indicator",Yn.BACK_STYLE="rm-loading-background",Yn.SPINNER_LENGTH=64,Yn.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class Zn{constructor(t,e){this._visible=!1,this._doc=t,this._container="string"==typeof e?t.getElementById(e):e,this._svg=t.createElementNS("http://www.w3.org/2000/svg","svg"),this._svg.style.position="absolute",this._svg.style.top="0",this._svg.style.left="0",this._svg.style.width="100%",this._svg.style.height="100%",this._svg.style.pointerEvents="none",this._svg.style.zIndex="9999",this._loadingElement=new Yn(t),this._svg.appendChild(this._loadingElement.dom),this._setVisible(!1)}show(){this._visible||(this._container.appendChild(this._svg),this._setVisible(!0),this._layout())}hide(){this._visible&&(this._setVisible(!1),this._svg.parentNode===this._container&&this._container.removeChild(this._svg))}dispose(){var t;this.hide(),null===(t=this._loadingElement)||void 0===t||t.dispose(),this._loadingElement=null,this._svg=null}_setVisible(t){this._visible=t,this._loadingElement.visible=t}_layout(){const t=this._container.clientWidth,e=this._container.clientHeight,i=Zn.LOADING_VIEW_LENGTH;this._loadingElement.layout({width:i,height:i});const s=t/2-i/2,r=e/2-i/2;this._loadingElement.trans(s,r)}}Zn.LOADING_VIEW_LENGTH=128;class Un{static handleChartInitError(t,e){throw console.error(t),null==e||e.showErrorView(null==t?void 0:t.message),t}}const Xn="$ctrl";class qn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Hn(t,this),this._loaded=s(t),null==e||e(this._obj,null)}get type(){return this._obj.type}get body(){return this._obj.body}get assets(){return this._obj._assets}get map(){return this._obj.map}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get series(){return this._obj.firstVisible}get firstMapSeries(){return this._obj.firstMapSeries}get legend(){return this._obj.legend}get credits(){return this._obj._credits}get colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}get widgetGroup(){return this._obj.widgetGroup}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}get global(){return this._obj.global}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart ";ht.LOGGING&&console.time(s);let o=this._obj,n=o;this._loaded?(o.dispose(),n=this._obj=new Hn(null,this)):(this._loaded=!0,o=null),n._load(t),n._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",si),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,n,o)}return this}async loadAsync(t,e=!1,i){var r;const o=this[Xn];if(!s(t))return this;const n=o.doc(),a=o.dom().parentElement,h=new Zn(n,a);h.show();try{o.setLoading(!0),o.hideErrorView();const s="load chart ";ht.LOGGING&&console.time(s),await v.loadConfigAsync(t);let n=this._obj,a=n;return this._loaded?(n.dispose(),a=this._obj=new Hn(null,this)):(this._loaded=!0,n=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",si),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,n),this}catch(t){Un.handleChartInitError(t,o)}finally{o.setLoading(!1),h.hide(),h.dispose()}}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,i){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof hn?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof hn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof hn?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof hn&&this._obj.drillup(e)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[Xn]=null===(t=this[Xn])||void 0===t?void 0:t.dispose(),this._obj=null,this.$_disposed=!0)}isDestroying(){return this.$_disposing||this.$_disposed}}class Kn{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}pointerDown(t){let e;return e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=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._clickX,this._clickY,i,s,t.shiftKey)&&(this._clearTouchEffects(),i===this._prevX&&s===this._prevY||!this.control.isDraggable()?this._stopEvent(t):this.$_doDrag(t,e,i,s))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this._pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i&&this.control.isDraggable()?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,s){return null}$_startDrag(t,e,i,s,r,o){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i,o)),!!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 o=i[s-2];if(r.t-o.t<=100)for(let t=s-3;t>=0&&(o=i[t],!(r.t-o.t>100));t--);const n=o.x,a=o.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-o.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,o=Math.round(180*Math.atan2(l-a,h-n)/Math.PI);if(o<0&&(o=360+o),r=o>45&&o<=135?X.DOWN:o>135&&o<=225?X.LEFT:o>225&&o<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class Jn extends kt{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 Qn extends Jn{_doStart(t,e,i,s,r){return this.control.chartView().onRotationStart(),!0}_doDrag(t,e,i,s,r){const o=this.control.model.body;o.rotationX+=(s-e)/2,o.rotationY-=(r-i)/2}}class ta extends Jn{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,this.control.chartView().onScrollStart(),super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const o=this.control.model.body,n=this._oldX-(s-this._xStart)/o.scale,a=this._oldY-(r-this._yStart)/o.scale;if(o.isScrollable()){const t=360;o.scroll+=t/(o.calcedMapWidth*o.scale)*(e-s)}else o.panX=n;return o.panY=a,!0}$_mapView(){return this.control.model.body}}class ea extends Zt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return ea.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ea.IGNORE_ATTRS={width:"",height:""};class ia extends ea{constructor(e,i){super(e,i),this.add(this._text=new Ze(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.prop("effect");return this._model=e,this._text.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new ji(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(e.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Ze(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),i?this._icon||(this.add(this._icon=new Wn(t)),this._icon.url=i,this._icon.width=e.prop("width"),this._icon.height=e.prop("height")||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.prop("autoContrast")&&this._text.setContrast(t,this._model.prop("darkStyle")||"rm-label-dark",this._model.prop("lightStyle")||"rm-label-light"),this._outline&&this._outline.parent){const t=Ge.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._text,i=this._outline,s=this._icon;let r=0;const o=e.bbox(),n=o.width,a=o.height;let h,l=n,c=a,d=0,_=0,u=0,p=0;if(this._box=void 0,s){const t=s.bbox();switch(r=m(this._model.prop("iconGap"),0),d=t.width,_=t.height,this._model.getIconPos()){case"left":case"right":l+=r+d,c=Math.max(_,a);break;default:c+=r+_,l=Math.max(d,n)}}if(this._back&&this._back.parent&&(h=getComputedStyle(this._back.dom),u=parseFloat(h.paddingLeft)||0,p=parseFloat(h.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(h.paddingRight)||0),c+p+(parseFloat(h.paddingBottom)||0),h.rx)),s)switch(this._model.getIconPos()){case"left":s.trans(u,(c-_)/2),u+=d+r,l-=d+r;break;case"right":s.trans(u+l-d,(c-_)/2),l-=d+r;break;case"top":s.transX((l-d)/2),p+=_+r;break;case"bottom":s.trans((l-d)/2,p+a+r)}switch(h||(h=getComputedStyle(e.dom)),h.textAlign){case"center":u+=l/2,e.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,e.anchor=t.TextAnchor.END;break;default:e.anchor=t.TextAnchor.START}return e.trans(u,p),i&&(i.anchor=e.anchor,i.setAttr("y",e.getAttr("y")),i.trans(u,p)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class sa extends Jn{constructor(t,e,i,s){super(t),this.mode=i,this.shift=s,this._body=e}_doStart(t,e,i,s,r){const o=this.control.getBounds(),n=this._body.getBackBounds();this._xStart=u(0,e-n.x+o.x),this._yStart=u(0,i-n.y+o.y),this._body.addFeedback(this._feedback=new ji(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new ia(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new ia(this.control.doc(),"rm-bounds-tracker-tag"));const a=new ai(this._body.chart());return a.init(),a.loadOptions({effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}),this._fromTag.setModel(document,a,null,null),this._toTag.setModel(document,a,null,null),!0}_hideFeedback(){this._feedback.remove(),this._fromTag.remove(),this._toTag.remove()}_doCompleted(t,e,i){const s=this.$_calcBound(e,i),{from:r,to:o}=this._body.boundsToMap(s,!1,!0);if("zoom"===this.mode)this._body.model.zoomToBounds(r,o);else{const t=this._body.firstMap;if(t){const e=t.chart(),i=t.getIntersectedAreas(this._feedback.dom);this.shift||e.selection.clear(),e.selection.add(t.model,i.map((t=>t.point)),!1)}}}_doDrag(t,e,i,s,r){const o=this.$_calcBound(s,r),{from:n,to:a}=this._body.boundsToMap(o,!1,!0),h=Ce.getFormatter(",0.000");return this._feedback.setRect(o),this._fromTag.setText(`(${h.toStr(n[0])}°, ${h.toStr(n[1])}°)`).layout(),this._fromTag.trans(o.x-this._fromTag.bbox().width/2,o.y-this._fromTag.bbox().height-4),this._toTag.setText(`(${h.toStr(a[0])}°, ${h.toStr(a[1])}°)`).layout(),this._toTag.trans(o.x+o.width-this._toTag.bbox().width/2,o.y+o.height+4),!0}$_calcBound(t,e){const i=this.control.getBounds(),s=this._body.getBackBounds(),r=this.control.width(),o=this.control.height();return t=u(0,_(r,t-s.x+i.x)),e=u(0,_(o,e-s.y+i.y)),{x:_(this._xStart,t),y:_(this._yStart,e),width:p(this._xStart-t),height:p(this._yStart-e)}}}class ra extends Kn{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.$_chart().map&&this.$_chart().hoverable()&&(this.dragging?this.dragTracker instanceof ta&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target))}_doClick(t){const e=this.$_chart();if(!e.clickable())return;const i=t.target,s=t.shiftKey,r=at?t.ctrlKey:t.metaKey,o=this.$_chartView(),n=e.global.prop("clickAction"),a=o.getButton(i);let h,l,c;if(a)a.click();else if(h=o.legendByDom(i))if(h.source instanceof qi){const t=h.source;e.seriesByPoint(t)}else h.source.canHide()&&(h.source.visible=!h.source.visible);else if(i===this._clickElement){const a=this._pointerToPoint(t);if(a.x-=o.tx,a.y-=o.ty,l=o.seriesByDom(i))l.click(i,a);else if(c=o.creditByDom(i))c.click(i);else if(o.drilldownPanelView().click(i))return;switch(n){case"select":l&&l.model.canSelect()&&(r?l.toggleSelect(i,a):l.select(i,a,!s));break;case"drilldown":this.$_drildown(e,t,o)}o.click(t,i,l)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.global.prop("dblClickAction");"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.prop("zoomable")){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=m(Math.max(1,e.prop("wheelZoomFactor")),5);return e.zoom,e.zoomByFactor(-i/s,!1),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,s){const r=this.$_chart(),o=r.global.prop("dragAction");if(r.draggable())return"zoom"===o||"select"===o?new sa(this.control,this.$_chartView().bodyView(),o,s):r.isGlobe?new Qn(this.control):r.body.isScrollable()||r.body.movable?new ta(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=this._pointerToPoint(e),o=e.target,n=i.bodyView().getSeries(s).pointByDom(o,r);n&&n.point instanceof en&&t.drilldown(t.firstMapSeries,n.point.area.id)}}}class oa{static empty(){return new oa}static create(t=0,e=0){return new oa(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 oa(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+"}"}}oa.EMPTY=new oa;class na extends Zt{constructor(t,e=L){super(t,e,"g"),Zt.DEBUGGING&&(this.add(this._debugRect=new ji(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.internalSetStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Zt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ji(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 aa extends na{constructor(t,e,i){super(t,e),this._margins=new Rt,this._paddings=new Rt,this.add(this._background=new ji(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 o=this._paddings;o.applyPadding(r);const n=this._doMeasure(t,e,i,s);if(n.width+=o.left+o.right,n.height+=o.top+o.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=n.width+=t.left+t.right,this.mh=n.height+=t.top+t.bottom}return this.mw=n.width,this.mh=n.height,n}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 ha extends ea{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 la extends ia{constructor(t){super(t,"rm-map-widget-title")}}class ca extends ia{constructor(t){super(t,"rm-map-widget-footer")}}class da extends aa{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new la(t)),this.add(this._footerView=new ca(t))}_setBackgroundStyle(t){t.setVisible(this.model.background.visible)&&t.internalSetStyleOrClass(this.model.background._style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.prop("text")),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class _a extends kt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDispose(){this._owner=null,this._creator=null,super._doDispose()}get owner(){return this._owner}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,o=this._views;for(let t of o)t.parent;for(t=Math.max(0,t);o.length>t;)r.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(s);o.push(e),i&&i(e,o.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 ua extends na{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new ji(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Ze(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.prop("markerVisible"))?this._marker.bbox():lt,o=ct(this._label.bbox());return this._gap=m(e.legend.prop("markerGap"),0),{width:r.width+this._gap+o.width,height:u(r.height,o.height)}}_doLayout(t){const e=this._rMarker,i=m(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 pa extends da{constructor(t){super(t,pa.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new _a(this,ua)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=m(e.prop("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,r);const n=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?n.height=Math.max(n.height,this._rTitle.height):n.width=Math.max(n.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?n.height=Math.max(n.height,this._rFooter.height):n.width=Math.max(n.width,this._rFooter.width)),n}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("sameTextColor"),s=this._sizes,r=t.prop("itemsAlign"),o=t.prop("lineGap")||0,n=t.prop("itemGap")||0,a=this._margins,h=this._paddings,l=this._vertical,c=this._titleView,d=this._footerView,_=this._rTitle,u=c.visible?_.height:0,p=c.visible?_.width:0,g=this._rFooter,m=d.visible?g.height:0,f=d.visible?g.width:0,b=d.visible?this._gapFooter:0;let y,w,x,v=a.left+h.left,C=a.top+h.top,S=this.width-v-a.right-h.right,L=this.height-C-a.bottom-h.bottom;if(c.visible)if(this._inTitle){switch(w=C,t.title.prop("verticalAlign")){case"top":break;case"bottom":w+=L-u;break;default:w+=(L-u)/2}c.trans(v,w),v+=p,S-=p}else{switch(t.title.prop("align")){case"center":y=Math.max(v,v+(S-_.width)/2);break;case"right":y=Math.max(v,v+S-_.width);break;default:y=v}c.trans(y,C),C+=u,L-=u}const M=v,A=C;if(d.visible){if(this._inFooter){switch(y=M+S-f,w=C,t.footer.prop("verticalAlign")){case"top":break;case"bottom":w+=L-m;break;default:w+=(L-m)/2}S-=f+b}else{switch(w=C+L-m,t.footer.prop("align")){case"center":y=Math.max(v,v+(S-g.width)/2);break;case"right":y=Math.max(v,v+S-g.width);break;default:y=v}L-=m+b}d.trans(y,w)}this._itemViews.forEach((t=>{var e;const s=t.model.source,r=s.legendColor();t._marker.setColor(r),null===(e=s.setLegendMarkerStyle)||void 0===e||e.call(s,t._marker),i&&s.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{if(l){const i=this._wMarkers;t.forEach((t=>{t.mw=s[e],t.resizeByMeasured().layout(i[e])})),C=A,"center"!==r&&"end"!==r||(x=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1),C+="center"===r?(L-x)/2:L-x),t.forEach((t=>{t.trans(v,C),C+=t.height+n})),v+=s[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),v=M,"center"!==r&&"end"!==r||(x=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1),v+="center"===r?(S-x)/2:S-x),t.forEach((t=>{t.trans(v,C),v+=t.width+n})),C+=s[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,o){const n=e.items(),a=this._itemViews,h=e.prop("itemGap")||0,l=e.prop("lineGap")||0,c=a.count,d=this._rowViews=[],_=this._sizes=[];let p,g,m,f;a.forEach(((i,s)=>{i.setMarker(n[s].source.legendMarker(t,+e.prop("markerSize")||Vs.MARKER_SIZE)),i.measure(t,n[s],r,o)}));let b=0,y=0;if(i){for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),g=f.mh,y++,b++):(g+=h+f.mh,g<=o?(m.push(f),y++,b++):y=0);this._wMarkers=[],p=g=0,d.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=u(i,t.mw),r=u(r,t._rMarker.width),t._col=e})),s+=h*(t.length-1),g=u(g,s),p+=i,_.push(i),this._wMarkers.push(r)})),p+=l*(d.length-1)}else{for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),p=f.mw,y++,b++):(p+=h+f.mw,p<=r?(m.push(f),y++,b++):y=0);p=g=0,d.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=u(i,t.mh)})),e+=h*(t.length-1),p=u(p,e),g+=i,_.push(i)})),g+=l*(d.length-1)}return this._titleView.visible&&(this._inTitle?p+=this._rTitle.width:g+=this._rTitle.height),this._footerView.visible&&(this._inFooter?p+=this._rFooter.width+this._gapFooter:g+=this._rFooter.height+this._gapFooter),{width:p,height:g}}}pa.LEGEND_CLASS="rm-legend";const ga={};class ma extends aa{static register(...t){t.forEach((t=>{ga[t[0].type]=t[1]}))}constructor(t,e){super(t,ma.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 o=s.tx,n=s.ty;switch(this._op.align){case"left":o-=this.width+t.x;break;case"right":o+=i+t.x;break;default:o+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":n+=(r-this.height)/2+t.y;break;case"bottom":n+=r+t.y;break;default:n-=this.height+t.y}return{x:o,y:n}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doLayout(t){const e=this.model.prop("rotation");this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}ma.CLASS_NAME="rm-annotation";class fa{static interpolate(t,e){if(e instanceof Er==!1)return t;const i=[];let s=null,r=null,o=!1;for(let n=0;n<t.length;n++){const a=t[n],h=e.project(a);if(h.outside)o=!0;else{if(s||(s=a,t.push(a)),o&&r){const t=Vr(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,o=!1}}return i}}class ba{static box(t,e,i,s,r){const o=Math.floor(Math.abs(i-t)/20),n=this.boxPoints(t,e,i,s,o);return this.coordsToPath(ba.toPixelCoord(r,n))}static ellipse(t,e,i,s,r,o=40){const n=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,o);return this.coordsToPath(ba.toPixelCoord(r,n))}static geoCircle(t,e,i,s,r,o=!1,n=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,n);let h=this.toPixelCoord(r,a);return o&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Er?fa.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 o=e;for(;o<=i&&(r.push([o,t]),o+s<=i);)o+=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 o=i;for(;o>=e&&(r.push([o,t]),o-s>=e);)o-=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 o=e;for(;o<=i&&(r.push([t,o]),o+s<=i);)o+=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 o=i;for(;o>=e&&(r.push([t,o]),o-s>=e);)o-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const o=[],[n,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),o.push(...this.horizontalLineToRight(h,n,a,r)),o.push(...this.verticalLineToUp(a,h,l,r)),o.push(...this.horizontalLineToLeft(l,n,a,r)),o.push(...this.verticalLineToDown(n,h,l,r)),o}static arcCoords(t,e,i,s,r,o,n,a=64){const h=2*Math.PI,l=o-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?n?-h:h:l;c||(n&&d>0&&(d-=h),!n&&d<0&&(d+=h));const _=d/a,u=[];for(let o=0;o<=a;o++){const n=r+_*o;u.push([t+Math.cos(n)*Math.abs(i),e+Math.sin(n)*Math.abs(s)])}return u}}class ya extends Kt{renderLat(t,e,i,s,r){const o=r.second,n=o?2:1;let a="";for(let h=0;h<n;h++){const n=0===h?r:o;let l=n.project([e,t]);if(a+=Pi(l)?`M${l[0]},${l[1]}`:"",n.latElliptic){const r=t=>{l=n.project(t),Pi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},o=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+o;for(;h<=i-o+1e-9;)r([h,t]),h+=o;e<i&&r([i,t])}else l=n.project([i,t]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLatGlobe(t,e,i,s,r){let o,n=e,a=r.project([n,t]);for(;a.outside&&n<=i;)n+=s,a=r.project([n,t]);if(n<i){let e=`M${a[0]},${a[1]}`;for(n+=s;n<=i;)a=r.project([n,t]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}renderLon(t,e,i,s,r){const o=r.second,n=o?2:1;let a="";for(let h=0;h<n;h++){const n=0===h?r:o;let l=n.project([t,e]);if(a+=Pi(l)?`M${l[0]},${l[1]}`:"",n.lonElliptic){const r=t=>{l=n.project(t),Pi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},o=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+o;for(;h<=i-o+1e-9;)r([t,h]),h+=o;e<i&&r([t,i])}else l=n.project([t,i]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLonGlobe(t,e,i,s,r){let o,n=e,a=r.project([t,n]);for(;a.outside&&n<=i;)n+=s,a=r.project([t,n]);if(n<i){let e=`M${a[0]},${a[1]}`;for(n+=s;n<=i;)a=r.project([t,n]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}}class wa extends na{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new _a(this,ya),this._lonPool=new _a(this,ya)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{Ht.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{Ht.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,e.x1),y1:Math.max(-90,e.y1),x2:Math.min(180,e.x2),y2:Math.min(90,e.y2),latStep:e.latStep,lonStep:e.lonStep}}_doMeasure(t,e,i,s){return oa.create(i,s)}_doLayout(t){const e=this.model,i=e.chart,s=e.line,r=e.lonLine,o=e.latLine,n=i.getProjection();n.second;const a=n.isGlobe,h=this._bounds;let l;Ht.setImportantStyle(this.dom.style,"pointer-events","none"),Ht.setImportantStyle(this.dom.style,"fill","none");const c=h.x1,d=h.x2;let _=h.latStep;if(l=i.axis.latInterval,a)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(o._style),t.renderLatGlobe(h.y1+e*_,c,d,l,n)}));else{const t=Math.ceil(h.y1/_)*_;this._latPool.forEach(((e,i)=>{const r=t+i*_;(e.visible=r<=h.y2&&r>=h.y1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(o._style),e.renderLat(r,c,d,l,n))}))}const u=h.y1,p=h.y2;if(_=h.lonStep,l=i.axis.lonInterval,a)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLonGlobe(h.x1+e*_,u,p,l,n)}));else{const t=Math.ceil(h.x1/_)*_;this._lonPool.forEach(((e,i)=>{const o=t+i*_;(e.visible=o<=h.x2&&o>=h.x1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(r._style),e.renderLon(o,u,p,l,n))}))}}}class xa extends Ut{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new Ut(t,"rm-axis-tick-labels")),this._labelPool=new _a(this._labelLayer,Ze)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),o=e.getLatInterval(),n=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*o,h=1+((i.x2-i.x1)/n|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,o,n,a,h,l=0,c=s.x1,d=s.y1;(o=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,o.forEach(((s,o)=>{n=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(n[0]*i,n[1]*-i),c+=r})),l+=this._topCount),(o=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(o.forEach(((t,e)=>{})),l+=this._bottomCount),(o=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),o.forEach(((e,s)=>{n=t.project([a,h]),e.text=h+"°",e.trans(n[0]*i-e.bbox().width/2,n[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(o=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(o.forEach(((t,e)=>{})),l+=this._leftCount)}}}class va extends na{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new wa(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,o=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(r,o),this._gridView.measure(t,r,i,s)),oa.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.globalMapBound,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:o,y1:n,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:n,x2:o,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 Ca extends ia{}class Sa extends na{constructor(t,e){super(t),this.add(this._pathView=new Kt(t)),e.add(this._labelView=new Ca(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof or?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.prop("type"),s=this._pathView,r=this._labelView;let o,n=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(e.label.prop("text")),"range"===i){const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderRange(e,t,r),s.internalSetStyle("strokeWidth",`${i}px`)}else if("band"===i){n||(this.add(n=this._fromView=new Kt(this.doc)),this.add(a=this._toView=new Kt(this.doc))),n.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),n.internalSetStyle("fill","none"),n.internalSetStyle("transform",t.trans),a.internalSetStyle("fill","none"),a.internalSetStyle("transform",t.trans);const i=(parseFloat(getComputedStyle(n.dom).strokeWidth)||1)/t.tf.scale;n.internalSetStyle("strokeWidth",`${i}px`),a.internalSetStyle("strokeWidth",`${i}px`),o=this.$_renderBand(e,t,r),s.internalSetStyle("stroke","none")}else{const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderLine(e,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${i}px`)}s.setPath(o).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:o,lonInterval:n}=e;let a;if("lat"===t.prop("axis")){const r=t.prop("position"),n=s.h1,h=s.h2;a=ba.horizontalLineToRight(r,n,h,o),this.$_renderLatLabel(n,r,e,i)}else{const o=t.prop("position"),h=s.v1,l=s.v2;a=ba.verticalLineToUp(o,h,l,n),this.$_renderLonLabel(o,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return ba.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:o,lonInterval:n}=e;let a=[];if("lat"===t.prop("axis")){const h=Math.min(t.prop("from"),t.prop("to")),l=Math.max(t.prop("from"),t.prop("to")),c=s.h1,d=s.h2;a.push(...ba.horizontalLineToRight(h,c,d,o));const _=[...a];this._fromView.setPath(ba.coordsToPath(_.map((t=>r.project(t))))),a.push(...ba.verticalLineToUp(d,h,l,n));const u=ba.horizontalLineToLeft(l,c,d,o);a.push(...u),this._toView.setPath(ba.coordsToPath(u.map((t=>r.project(t))))),a.push(...ba.verticalLineToDown(c,h,l,n)),this.$_renderLatLabel(c,l,e,i)}else{const n=Math.min(t.prop("from"),t.prop("to")),h=Math.max(t.prop("from"),t.prop("to")),l=s.v1,c=s.v2;a.push(...ba.verticalLineToUp(n,l,c,o));const d=[...a],_=ba.verticalLineToDown(h,l,c,o);a.push(..._),this._fromView.setPath(ba.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(ba.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(n,c,r,e.tf,i)}return ba.coordsToPath(ba.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=e;let r;const[o,n]=t.prop("from"),[a,h]=t.prop("to");if(t.prop("elliptic")){const t=[Math.min(o,a),Math.min(n,h)],e=Math.abs(a-o),i=Math.abs(h-n);r=ba.ellipse(t[0],t[1],e,i,s)}else r=ba.box(o,n,a,h,s);if(i.visible){const t=Math.min(o,a),r=Math.max(n,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:o,tf:n}=i;let a=0,h=0;const l=s.bbox(),c=r.project([o.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*n.scale+n.tx+16,h=d[1]*-n.scale+n.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let o=0,n=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,o=l*s.scale+s.tx,n=c*-s.scale+s.ty+a.height/2,"line"===this.model.prop("type")?o+=t>=0?-a.width-6:6:o+=6,r.trans(o,n)}}class La extends ea{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new ji(t,"rm-crosshair-flag-back")),this.add(this._text=new Ze(t))}prepare(t){this.internalResetStyleOrClass(t._style),this._back.internalResetStyleOrClass(t.prop("backgroundStyle"))}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,o,n){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(o-l.width,Math.max(0,n.tx+h[0]*n.scale-l.width/2)),Math.max(0,n.ty-a[1]*n.scale-l.height))}renderLatFlag(t,e,i,s,r,o){const n=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,o.tx+n[0]*o.scale-a.width),Math.max(0,Math.min(r-a.height,o.ty-n[1]*o.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),o=e.rotationY<=0,n=e.project([0,o?90:-90]);this.trans(s.tx+n[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-n[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,o,n,a){const h=e.project([i,s]),l=e.project([n,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(o-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class Ma extends na{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new ya(t,"rm-crosshair-line")),this.add(this._lonLine=new ya(t,"rm-crosshair-line")),Ht.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Ht.setImportantStyle(this._latLine.dom.style,"fill","none"),Ht.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Ht.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new La(t)),this.add(this._lonFlag=new La(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.internalSetStyle("transform",e),this._lonLine.internalSetStyle("transform",e),this._latLine.internalSetStyle("strokeWidth",`${i}px`),this._lonLine.internalSetStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag),this._lonFlag.prepare(this.model.flag),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.globalMapBound,o=t[0],n=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(!(_<=o&&o<=u&&p<=n&&n<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(),y=b instanceof Er?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,o=r.chart.globalMapBound,n=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof Er;_?l.renderLonGlobe(h,n,a,e,s):l.renderLon(h,n,a,e,s);const u=this.calcTopY(i,o,s,n),p=r.chart.getProjection().getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,o=r.chart.globalMapBound,n=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 Er;u?l.renderLatGlobe(h,n,a,e,s):l.renderLat(h,n,a,e,s);const p=u?90-s.rotationX:n,g=s.project(t),m=this.calcRightX(i,s,_,o,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 o=[NaN,NaN];const n=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){o=t;break}r[0]+=n}return Number.isNaN(o[1])?s:o[1]}calcRightX(t,e,i,s,r){const o=[(i.width-t.vx-t.tx)/t.scale,r];let n=e.backward(o);return Number.isNaN(n[0])?s.x2:n[0]}}const Aa="rm_map_globe_fill";class Pa extends Kt{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,o){const n=e.map,a=this.parent,h=e.body.projection;n||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,o,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=Vi.rectangle(i,s,r,o);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof Er)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,o,n){const a=e.prop("globeFill"),h=Math.max(s,r)/2;let l=!this.control.hasDef(Aa);return i=Vi.circle(o+h,n+h,h),a!==this._globeFill&&(this.control.removeDef(Aa),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${Aa})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:Aa,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new _e(i).getElement(t,i)),this._globeFill=e}}class ka extends Kt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){ht.isNum(t)?this.setPath(Vi.line(t,e,i,s)):t&&this.setPath(Vi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(Vi.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(Vi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(Vi.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(Vi.line(e,t,i,t))}}class Ia extends Kt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){ht.isNum(t[0])?this.setPath(Vi.lines(...t)):r(t[0])?this.setPath(Vi.lines3(...t)):this.setPath(Vi.lines2(...t))}}var Na;class Ea extends _a{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Ta extends ia{constructor(t){super(t,"rm-point-label")}}class Va extends Ut{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new _a(this,Ta),new _a(this,Ta)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,o){const{label:n,isCallbackExecuted:a}=r.getPointText(s,i,o.prop("text"));e.point=s,e.setModel(t,o,null,null),e._text.internalResetStyleOrClass(o._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),n?(o.prepareRich(n),o.buildSvg(e._text,e._outline,NaN,NaN,o,o.getTextDomain(s),!a)):(e.setText(o.getText(o.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),o=this._labels,n=i.getLabeledPoints(),a=this._maps,h=s[0]._style;o[0].prepare(n.length),a[0]={},o[1].prepare(r>1?n.length:0),a[1]={},n.forEach(((r,n)=>{for(let h=0;h<r.labelCount();h++){const l=o[h].get(n);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.internalSetStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){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 Da extends ea{constructor(t){super(t),this.add(this._line=new Ia(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Kt(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new Kt(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.series,o=this._anchor,n=this._line;if(this._dummy.setPath(Vi.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=za.getDrawer(t.series.getCalloutShape(e)),n=t.anchorPoint.prop("radius");o.internalClearStyleAndClass(),t.prop("useSeriesColor")&&o.internalSetStyleOrClass(r._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(s(n,n)),o.trans(i[0],i[1])}return n.internalClearStyleAndClass(),t.prop("useSeriesColor")&&this._line.internalSetStyleOrClass(r._style),n.internalSetStyleOrClass(t._style),n.setLines(i,!1),s&&t.prop("usePointColor")&&(o.visible&&o.setFill(s),n.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Ra extends Qt{constructor(t){super(t),this.add(this._back=new ji(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Kt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(Vi.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(Vi.rect(t).concat(Vi.rect(e))):this._mask.setPath(Vi.rect(t)),this}}class $a extends Ut{constructor(t,e){super(t,e),this._callouts=new _a(this,Da),this._map={},this.add(this._maskLayer=new Ut(t)),this._masks=new _a(this._maskLayer,Ra),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,o=t.getLabeledPoints(),n=i._style,a=this._map={};r.prepare(o.length,(t=>{})),s.prepare(o.length),o.forEach(((t,i)=>{const o=s.get(i);o.setVisible(e.isPointCalloutVisible(t))&&(o.setAttr("mask",`url(#${r.get(i).id}`),o.index=i,a[t.pid]=o)})),this.internalSetStyleOrClass(n)}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 Oa extends Jt{constructor(t,e=!1){super(t,za.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){za.seriesOf(this).setPointLabelVisible(this.point,!1)}return e}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const o=.35,n={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}),n.x=-c.x*_*o,n.y=-c.y*_*o;const i=u+a.x,g=p+a.y,m=t[r].x+n.x,f=t[r].y+n.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*o,a.y=c.y*_*o,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.internalSetStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.internalSetStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Fa extends Ut{}const Ba={};class za extends na{static register(...t){t.forEach((t=>{Ba[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof Na)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Vi[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,o)=>({x:t-=i.width/2,y:e+=r+o}),top:(t,e,i,s,r,o)=>({x:t-=i.width/2,y:e-=r+o+i.height}),right:(t,e,i,s,r,o)=>({x:t+=s+o,y:e-=i.height/2}),left:(t,e,i,s,r,o)=>({x:t-=s+o+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,o)=>({x:t-=i.width/2,y:e-=i.height/2+o})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverPts=[],this._inRegion=!1,s&&this.addDom(this._defs=Zt.createElement(t,"defs")),this.add(this._pointLayer=new Ut(t)),this._pointLayer.add(this._pointContainer=new Fa(t,"rm-series-points")),this.add(this._calloutContainer=new $a(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}resolveBoundsClip(t,e,i,s,r){return t}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e,i){const s=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,r=this._labelContainer,o=this._calloutContainer;this._scroll=i,this.setModel(e),this.internalSetStyle("pointerEvents",e.prop("disabled")?"none":""),e instanceof hn?this.setData("index",e._seriesIndex%10):this.setData("index",e._seriesIndex%12),null==r||r.setVisible(e.isPointLabelsVisible()),o.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),r&&r.visible&&r.prepare(t,this),o.visible&&o.prepare(t,this)):(r&&r.visible&&(null==r?void 0:r.isEmpty())&&r.prepare(t,this),o.visible&&o.isEmpty()&&o.prepare(t,this)),isNaN(this._aniOpacity)||this.internalSetStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e,i){const s=this.model;if(this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),!(s instanceof hn)&&!s.isEmpty(!0)&&this.chart().animatable()){const t=s&&s.prop("loadAnimation"),e=!this.control.loaded&&this.chart().loadAnimatable();this._runShowEffect(t&&(e||s.dataLoaded||s.needAnimate)&&!s.isEmpty(!0))}s.dataLoaded=!1,s.needAnimate=!1}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t,e,i,s){var r;return null===(r=this._getPointPool())||void 0===r?void 0:r.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}defaultAnimation(){return"grow"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}pointByDom(t,e){return this._getPointPool().elementOf(t)}click(t,e){const i=this.pointByDom(t,e);if(i)i.point?!0!==this.model.pointClicked(i.point)&&this._doPointClicked(i):this._doPointClicked(i);else{const e=this.model.cluster;if(e&&e.isExpandable()){const e=this._clusterOfDom(ja.isClusterView(t));if(e){const t=e._cluster.points;let i=t[0],s=i.lon,r=i.lon,o=i.lat,n=i.lat;for(let e=1;e<t.length;e++)i=t[e],s=_(s,i.lon),r=u(r,i.lon),o=_(o,i.lat),n=u(n,i.lat);const a=.1*(r-s),h=.1*(n-o);this.chart().body.zoomToBounds([s-a,o-a],[r+a,n+h])}}}}_clusterOfDom(t){}select(t,e,i){const s=this.pointByDom(t,e);s&&this.chart().selection.add(this.model,[s.point],i)}toggleSelect(t,e){const i=this.pointByDom(t,e);i&&this.chart().selection.toggle(this.model,i.point)}runPointAddAnimation(t){}setPointLabelVisible(t,e){const i=this._labelViews();if(!i)return;const s=i.get(t,0);s&&s.setVisible(e)}zoomChanged(t,e){}get growRate(){return this._growRate}_createLabelContainer(t,e){return new Va(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 m(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&ht.log("CLICKED: ",t.point.name,t.point.getValue())}}Na=za,za.POINT_CLASS="rm-point",za.DATA_HOVER="hover",za.DATA_UNHOVER="unhover",za.LEGEND_MARKER="rm-legend-item-marker",za._drawers=Object.assign({circle:t=>Vi.circle(0,0,t)},Na._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ja extends Zt{static isClusterView(t){return Ht.isChildOf(t,this.CLASS_NAME)}constructor(t){super(t,"rm-point-cluster"),this.add(this._shape=new Kt(t)),this.add(this._label=new Ze(t,"rm-point-cluster-label"))}setCluster(t){this._cluster=t}render(t,e){const i=[],s=P-.001;let r=0;this._cluster.points.forEach((t=>{t.moves>=1&&r++})),t--,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=3,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=2,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s),"Z"),this._shape.setPath(i.join(" ")),this._label.text=String(r),this._label.transY(-this._label.bbox().height/2),e&&this.internalSetStyle("fill",e)}}ja.CLASS_NAME="rm-point-cluster";class Ga extends Oa{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class Ha extends za{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}}class Wa extends Oa{prepare(t,e){return this.point=t,this._ext=ht.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Ya extends za{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.prop("minSize")}}}class Za extends Wa{constructor(t){super(t,!0),this.add(this._contentLayer=new Ut(t)),this.add(this._baseLine=new ka(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class Ua extends Ya{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,m(t._minValue,i.min)),i.max=Math.max(i.max,m(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.prop("inverted");let r=s?e._height:e._width;const o=e.getPadding(r);this._ext.inverted=s,this._ext.pad=o,this._ext[s?"height":"width"]=r-2*o}}class Xa extends Oa{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class qa extends za{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Ka extends ma{constructor(t){super(t,Ka.CLASS_NAME),this.add(this._imageView=new Wn(t)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.prop("imageUrl"),this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ka.CLASS_NAME="rm-image-annotation";class Ja extends ma{constructor(t){super(t,Ja.CLASS_NAME),this.add(this._shapeView=new Kt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),Vi.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)}}Ja.CLASS_NAME="rm-shape-annotation";class Qa extends ma{constructor(e){super(e,Qa.CLASS_NAME),this.add(this._textView=new Ze(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ii}_doMeasure(t,e,i,s){const r=e.getSize(i,s),o=this._textView;e.prop("writingMode")&&this._textView.setStyle("writingMode",e.prop("writingMode")),e.prop("textOrientation")&&this._textView.setStyle("textOrientation",e.prop("textOrientation")),this._deflatePaddings(r),this._richText.setFormat(e.prop("text")),this._richText.build(o,i,s,null,e._domain);const n=ct(this._textView.bbox());return{width:m(r.width,n.width),height:m(r.height,n.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)}}Qa.CLASS_NAME="rm-text-annotation";class th{static reveal(t,e){new ih(t,e)}static grow(t,e){new rh(t,e)}static spread(t,e){new oh(t,e)}static fadeIn(t){new eh(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 eh extends th{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:ut.DURATION,fill:"none"})}}class ih extends th{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:ut.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,i){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class sh extends ut{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Zt}_stop(){super._stop(),this._series=null}}class rh extends sh{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class oh extends sh{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class nh extends Kt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,o){this.x=t,this.setPath(Vi.bar(t-i/2,e,i,-s,r,o))}}class ah extends Za{constructor(t){super(t),this._groupCenter=null,this._bars=new _a(this._contentLayer,nh)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}getGroupCenter(){return this._groupCenter}render(t,e,i,s,r,o,n){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c}=t.getPointExtents(i,e),d=i.length,_=r/d,u=_*s.barWidth,p=s.barWidth>1&&!s.overflow,g=s.pad;let m=1/0,f=-1/0,b=1/0,y=-1/0,w=!1;this._bars.forEach(((e,s)=>{const d=i[s];if(e.setVisible(!isNaN(d))){const i=c!==l?(d-l)/(c-l)*o*n:0;let x=g+_*s+(_-u)/2;p&&(x+u>g+r&&(x=g+r-u),x=Math.max(x,g)),e.setPath(Vi.bar(x,o,u,-i,0,0));const v=x+u/2,C=o-i/2,S=u/2,L=i/2;v-S<m&&(m=v-S),v+S>f&&(f=v+S),C-L<b&&(b=C-L),C+L>y&&(y=C+L),w=!0,e.internalClearStyleAndClass(),a[s]&&a[s].color?e.setFill(a[s].color):h&&e.setFill(h[s%h.length]);const M=t._style;M&&"string"!=typeof M&&M.stroke&&e.setStroke(M.stroke)}})),this._groupCenter=w?{cx:(m+f)/2,cy:(b+y)/2,halfW:(f-m)/2,halfH:(y-b)/2}:null,this._renderBaseLine(t.baseLine,!1,this.width,this.height)}}class hh extends Ua{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._hoverBar=null,this._bars=new Ea(this._pointContainer,ah)}_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,m(this.growRate,1))}_doReset(){this._hoverBar=null}_doPointerMoved(t,e,i){var s,r,o,n;const a=this._bars.elementOf(i)||null;if(a!==this._hoverBar&&((null===(s=this._hoverBar)||void 0===s?void 0:s.point)&&(null===(o=null===(r=this._labelContainer)||void 0===r?void 0:r.get(this._hoverBar.point,0))||void 0===o||o._text.restoreStyles()),this._hoverBar=a,null==a?void 0:a.point)){const t=this.model.pointLabel.prop("hoverStyle"),e=null===(n=this._labelContainer)||void 0===n?void 0:n.get(a.point,0);e&&t&&(e._text.saveStyles(),e._text.internalSetStyleOrClass(t))}return!0}_runShowEffect(t){t&&th.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 o=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,o)}))}$_layoutBars(t,e,i){const s=this.model,r=s.pointLabel,o=s._width,n=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=this._labelViews(),p=s.getCallout(),g=this._calloutViews(),m={pad:this._ext.pad,barWidth:s.prop("barWidth"),overflow:s.prop("overflow")};let f,b;this._bars.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"center"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let C,S,L,M,A,P;if(p&&(C=r.getCallout(y))&&(S=C.map((t=>l.project(t))),f=S[S.length-1]),r.xPos=L=f[0],r.yPos=M=f[1],L*=c[0],M*=c[1],b=e(L,M,o,n),t.resize(o,n),t.render(s,a&&h,r.values,m,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),u&&(A=u.get(r,0))&&A.setVisible(t._static)){const e=_(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,b,o,n,A))}if(g&&S&&(P=g.get(r))&&P.setVisible(t._static)){const e=S.flat().map(((t,e)=>t*c[e%2]));g.setMask(P,e).setBounds(t.tx,t.ty,o,n),P.render(p,r,e,t.getFill())}}}))}$_resolveLabelPosition(t,e,i,s,r,o){const n=this._getLabelPositioner(e,"bottom");let a=i.x+s/2,h=i.y+r/2,l=s/2,c=r/2;if("center"===e){const e=t.getGroupCenter();e&&(a=i.x+e.cx,l=e.halfW,h=i.y+e.cy,c=e.halfH)}return n(a,h,o.bbox(),l,c,this.model.getLabelOff())}}class lh extends Ga{tooltipColor(){return getComputedStyle(this.dom).fill}}class ch extends Ha{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new Ea(t,lh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=(t,e,i)=>{t.setPath(p(e,e)),t.trans(i.x,i.y).rotate(l)},r=(t,e,i)=>{if(h instanceof Er){const s=h.r,r=this.chart().width,o=i[1]*Math.PI/180,n=e/2*(360/r),a=n/Math.cos(o),l=n;h.r=Ir*this._scale;const c=ba.geoCircle(i[0],i[1],a,l,h,!0);h.r=s,t.setPath(c),t.trans(0,0).rotate(0)}else s(t,e,C)},o=this.model,n=o.pointLabel,a=o.chart,h=a.getProjection(),l=+o.prop("rotation")||0,c=[this._scale,-this._scale],d=o.prop("position"),u=this._getLabelPositioner(o.subLabel.prop("position"),"right"),p=za.getDrawer(o.getShape()),g=this._labelViews(),m=o.getLabelOff(),f=o.getSubLabelOff(),b=o.getCallout(),y=this._calloutViews(),{min:w,max:x}=o.getPixelMinMax(_(a.width,a.height));let v,C;const S=n.getPosition;this._markers.forEach(((t,e)=>{const n=t.point,a=[n.lon,n.lat];if(t.setVisible(!n.isNull&&null!=(v=h.getVisible(a)))){const e=this._getPointPositioner(n.position||d,"center");let l,_,p,L,M,A,P=(t._radius=o.getRadius(n.getValue(),w,x))*n.vrate()*i;if(b&&(l=n.getCallout(a))&&(_=l.map((t=>h.project(t))),v=_[_.length-1]),n.xPos=p=v[0],n.xPos=L=v[1],p*=c[0],L*=c[1],C=e(p,L,2*P,2*P),C.x+=P,C.y+=P,this.model.alignToSurface?r(t,P,a):s(t,P,C),g){if(M=g.get(n,0)){let e=this._getLabelPositioner(S(n),"center");this._layoutLabel(M,t.dom).transp(e(C.x,C.y,M.bbox(),P,P,m))}(M=g.get(n,1))&&this._layoutLabel(M,t.dom).transp(u(C.x,C.y,M.bbox(),P,P,f))}if(y&&_&&(A=y.get(n))&&A.setVisible(t._static)){const e=_.flat().map(((t,e)=>t*c[e%2]));y.setMask(A,e).setCircle(e[e.length-2],e[e.length-1],P),A.render(b,n,e,t.getFill())}}}))}}class dh extends Kt{static create(t,e,i,s,r,o,n,a,h=!0){return new dh(t,e,{cx:i,cy:s,rx:r,ry:o,innerRadius:0,start:n,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,o,n,a,h,l=!0){return new dh(t,e,{cx:i,cy:s,rx:r,ry:o,innerRadius:n,start:a,angle:h,clockwise:l})}constructor(t,e=L,i=L){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 Vi.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 Vi.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 _h=function(t){return isNaN(t)?0:t};class uh{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return a(t)?this._path.push("M",_h(t),_h(e)):this._path.push("M",_h(t.x),_h(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",_h(t),_h(e)):this._path.push("m",_h(t.x),_h(t.y)),this}movep(t,e){return a(t)?this._path.push("M",F(t),F(e)):this._path.push("M",F(t.x),F(t.y)),this}line(t,e){return a(t)?this._path.push("L",_h(t),_h(e)):this._path.push("L",_h(t.x),_h(t.y)),this}linep(t,e){return a(t)?this._path.push("L",F(t),F(e)):this._path.push("L",F(t.x),F(t.y)),this}curve(t,e,i,s,r,o){return this._path.push("C",t,e,i,s,r,o),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",_h(t[e]),_h(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",_h(t[e].x),_h(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 ph extends Kt{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 uh;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 gh=class extends Kt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new uh).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class mh extends Xa{constructor(t){super(t),this.add(this._faceView=new dh(t,"rm-circle-gauge-face")),this.add(this._rimView=new dh(t,"rm-circle-gauge-rim")),this.add(this._valueView=new dh(t,"rm-circle-gauge-value")),this.add(this._textView=new Ze(t,"rm-circle-gauge-text")),this.add(this._handContainer=new Ut(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 ph(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 gh(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),o=this._size=_(e,i),n=t._props.getExtents(o*this.point._aniRate());this.$_renderBackground(t,r,n),this.$_renderValue(t,r,n,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,o=t._props,n=o._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:n,angle:o._sweepRad,clockwise:t.prop("clockwise")}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const o=t._props,n=s.getValue(),a=t.getValueRate(n)*r,h=t.valueRim.getThickness(i.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,r=i.value+(s.prop("stroked")?0:h/2),n=this._valueView;n.internalResetStyleOrClass(s._style),s.prop("stroked")&&(n.setFill("none"),n.internalSetStyle("strokeWidth",O(h))),n.setBoolData("stroked",s.prop("stroked")),n.setSectorEx({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:(r-h)/r,start:o._startRad,angle:o._sweepRad*a,clockwise:t.prop("clockwise")},s.prop("stroked"))}if(l.visible){const i=t.gaugeLabel;l.text=i.getNumberText(n,!1,!1,void 0),i.buildSvg(l,null,NaN,NaN,t,i._domain);const s=l.bbox(),r=i.getOffset(this.width,this.height);l.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class fh extends qa{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new Ea(t,mh)}_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&&th.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.pointLabel,o=s.chart.getProjection(),n=[this._scale,-this._scale],a=s.prop("position"),h=this._labelViews(),l=s.getLabelOff(),c=s.getCallout(),d=this._calloutViews(),_=r.getPosition;let u,p,g;this._gauges.forEach(((r,m)=>{const f=r.point,b=[f.lon,f.lat];if(r.setVisible(!f.isNull&&null!=(u=o.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"top");let y,w,x,v,C,S;if(c&&(y=f.getCallout(b))&&(w=y.map((t=>o.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=n[0],v*=n[1],r.render(s,t,e,i*f.vrate()),p=r._size,g=m(x,v,p,p),r.trans(g.x,g.y),h&&(C=h.get(f,0))&&C.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(C,r.dom).transp(t(g.x+p/2,g.y+p/2,C.bbox(),p/2,p/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)}}))}}class bh extends Zt{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 yh extends ut{constructor(t,e){super(),this.view=t,this.gauge=e}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.gauge,this.view._exts),!0}}class wh extends Xa{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new bh(e,"rm-clock-gauge-face")),this.add(this._rimView=new dh(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Ze(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new Ut(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new Ut(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Kt(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new Kt(e,"rm-clock-gauge-minute")),this.add(this._secondView=new Kt(e,"rm-clock-gauge-second")),this.add(this._pinView=new bh(e,"rm-clock-gauge-pin")),this._tickViews=new _a(this._tickContainer,ka,"rm-clock-gauge-tick"),this._tickLabelViews=new _a(this._tickLabelContainer,Ze,"rm-clock-gauge-tick-label")}prepare(e,i){const s=Math.round(12/u(1,Math.floor(i.tickLabel.prop("step"))||1));this._tickViews.prepare(i.tick.visible?12:0),this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=i.prop("timezoneCallback")}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.prop("active")&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),p(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.prop("animatable")&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const i=this._labelView,s=this._faceView,r=this._rimView,o=this._tickLabelViews,n=this._pinView,{cx:a,cy:h,rd:l}=e,_=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.prop("length")||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-_/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-_;let g=p-u,m=k,f=P/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+c(m)*p,h+d(m)*p,a+c(m)*g,h+d(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!o.isEmpty){const e=12/o.count,i=P/12*e;m=k,o.get(0).text="12",g=p-(u+t.tickLabel.prop("offset")||0),g-=.5*o.get(0).bbox().height,o.forEach(((s,r,o)=>{s.text=String(0===r?12:r*e),s.trans(a+c(m)*g,h+d(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}n.setVisible(t.pin.visible)&&(n.setCircle(a,h,t.pin.prop("radius")||2),n.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.prop("position")?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=f(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(),o=i.getSeconds(),n=s>=12,{cx:a,cy:h,rd:l}=e,c=new uh;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=P*(s/12+r/60/12+o/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=P*(r/60+o/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?P*(this._aniSec+this._secRate)/60:P*o/60,u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N),this._prevSec=o)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new yh(this,t);i.duration=t.secondHand.prop("duration")||200,i.start()}}}class xh extends qa{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new Ea(t,wh)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=i.pointLabel,r=this.model.chart.getProjection(),o=[this._scale,-this._scale],n=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),d=s.getPosition;let u,p,g;this._gauges.forEach(((s,m)=>{const f=s.point,b=[f.lon,f.lat];if(s.setVisible(!f.isNull&&null!=(u=r.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;if(l&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=o[0],v*=o[1],s.render(i,t,e),p=_(t,e),g=m(x,v,p,p),s.trans(g.x,g.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())){const t=this._getLabelPositioner(d(f),"bottom");this._layoutLabel(C,s.dom).transp(t(g.x+p/2,g.y+p/2,C.bbox(),p/2,p/2,h))}c&&w&&(S=c.get(f))&&S.setVisible(f._isStatic())&&S.render(l,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}class vh extends Oa{constructor(t){super(t,!0),this.add(this._back=new Ut(t)),this._back.add(this._figure=new qt(t)),this._back.add(this._textView=new ia(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,o=s.prop("text");this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=Zt.createElement(t,"use"),this._textView.dom),Ht.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!o)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(o),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t,e){const i=this._image,s=this._textView,r=this._rBox=this._figure.bbox();if(this._aniScale(this._back,e),i){const t=i.getBBox();let e,s,o,n;t.width>r.width?(e=(t.width-r.width)/2,r.width=t.width):o=(r.width-t.width)/2,t.height>r.height?(s=(t.height-r.height)/2,r.height=t.height):n=(r.height-t.height)/2,Ht.setAttrs(this._figure.dom,{x:e,y:s}),Ht.setAttrs(i,{x:o,y:n})}if(s.visible){const t=s.bbox(),e=Ht.getPadding(s._text.dom),i=r.width-e.left-e.right,o=r.height-e.top-e.bottom;s.trans(e.left+(i-t.width)/2,(o-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Ch extends za{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new Ea(this._pointContainer,vh)}$_createFigure(t){const e=Zt.createElement(t,"symbol");return e.append(Zt.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=Zt.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const s=e.figureBox,o=e.innerImage;Ht.setAttr(this._figure,"viewBox",s?`0 0 ${s[0]} ${s[1]}`:null),Ht.setAttr(this._figure.firstElementChild,"d",r(e.path)?e.path.join(" "):e.path),Ht.setAttrs(this._image,{href:o.prop("url"),width:o.prop("width"),height:o.prop("height")}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&th.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()},o=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,n=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,o,n)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(),i=this.model,s=i.pointLabel,r=[this._scale,-this._scale],o=+i.prop("rotation")||0,n=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=l&&"label"===l.prop("mode"),d=this._calloutViews(),_=s.getPosition,u=i.innerImage.prop("minSize"),p=i.getValueRange();let g,m;this._figures.forEach(((i,s)=>{const f=i.point,b=[f.lon,f.lat];if(i.setVisible(!f.isNull&&null!=(g=e.getVisible(b)))){const s=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S,L,M;l&&(y=f.getCallout(b))&&(w=y.map((t=>e.project(t))),c||(g=w[w.length-1])),f.xPos=x=g[0],f.yPos=v=g[1],x*=r[0],v*=r[1];const A=isNaN(u)?1:(f.value-p.min)/(p.max-p.min);if(i.render(A,t),L=i._rBox,m=s(x,v,L.width,L.height),i.trans(m.x,m.y).rotate(o),a&&(C=a.get(f,0))&&C.setVisible(i._static))if(this._layoutLabel(C,i.dom),M=C.bbox(),c&&w){const t=w.flat().map(((t,e)=>t*r[e%2])),e=this._getLabelPositioner("center","center");C.transp(e(t[t.length-2],t[t.length-1],M,0,0,h))}else{const t=this._getLabelPositioner(_(f),"bottom");C.transp(t(m.x+L.width/2,m.y+L.height/2,M,L.width/2,L.height/2,h))}if(d&&w&&(S=d.get(f))&&S.setVisible(i._static)){const t=w.flat().map(((t,e)=>t*r[e%2]));L.x=i.tx,L.y=i.ty,M&&(M.x=t[t.length-2],M.y=t[t.length-1]),d.setMask(S,t).setRects(L,M),S.render(l,f,t,i.getFill())}}}))}}class Sh extends Oa{constructor(t){super(t,!0),this.add(this._imageView=new Wn(t))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Lh extends za{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new Ea(this._pointContainer,Sh)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.prop("imageWidth"),s=t.prop("imageHeight");this._images.prepare(e.length,((r,o)=>{const n=r.point=e[o];r.setImage(t.getUrl(n),i,s),this._setPointStyle(r,t,n)}))}_layoutPoints(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=+e.prop("rotation")||0,o=[this._scale,-this._scale],n=e.prop("position"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews(),d=i.getPosition;let _,u;this._images.forEach(((e,i)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(_=s.getVisible(g)))){const i=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>s.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=o[0],y*=o[1],e.render(t),v=e._rBox,u=i(b,y,v.width,v.height),e.trans(u.x,u.y).rotate(r),h&&(w=h.get(p,0))&&w.setVisible(e._static)){const t=this._getLabelPositioner(d(p),"bottom");w.layout().transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,a))}if(c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*o[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}class Mh{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:ut.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}let Ah=class extends Za{constructor(t){super(t),this._contentLayer.addAll(this._back=new ji(t),this._area=new Kt(t,"rm-line-series-area"),this._line=new Kt(t,"rm-line-series-line"),this._lowLine=new Kt(t))}render(t,e,i,s,r,o){const{min:n,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,n,a,s,r,o),c=i.length,d=c>2&&t.prop("curved"),_=new uh;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,o){const n=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<n;i++){const d=t[i],_=h+i/(n-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*o-e)/c)*r);a.push({x:_,y:u})}return a}};class Ph extends Ua{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new Ea(this._pointContainer,Ah)}_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,m(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Mh(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=s.pointLabel,o=s._width,n=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews();let f,b;this._lines.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"top"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let C,S,L,M,A,P;if(g&&(C=r.getCallout(y))&&(S=C.map((t=>l.project(t))),f=S[S.length-1]),r.xPos=L=f[0],r.yPos=M=f[1],L*=c[0],M*=c[1],b=e(L,M,x,v),t.render(s,a&&h,r.values,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),p&&(A=p.get(r,0))&&A.setVisible(t._static)){const t=this._getLabelPositioner(_(r),"bottom");A.layout().transp(t(b.x+x/2,b.y+v/2,A.bbox(),x/2,v/2,u))}if(m&&S&&(P=m.get(r))&&P.setVisible(t._static)){const e=S.flat().map(((t,e)=>t*c[e%2]));m.setMask(P,e).setBounds(t.tx,t.ty,o,n),P.render(g,r,e,t.getFill())}}}))}}class kh{static interpolate(t,e){const i=Math.max(1,Math.ceil(Math.abs(e-t))),s=[];for(let r=0;r<=i;r++)s.push(t+(e-t)*r/i);return s}}const Ih="rm-map-series-id-";class Nh extends Oa{static idClass(t){return Ih+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Ih))return e.substring(17)}constructor(t){super(t)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i,s,r,o){var n;const a=this.point;if(r){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.internalSetStyleOrClass(e);else{const e=!this.point||a.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(Nh.idClass(this.model))}a&&(a.isSelected()&&!this.hasSavedStyles()?(this.saveStyles(),this.internalSetStyles({strokeWidth:"var(--rm-map-series-selected-stroke-width)",filter:"var(--rm-map-series-selected-filter)"}),this.internalSetStyleOrClass(i),this.strokeView||(this.strokeView=new Eh(this.doc,s)),this.strokeView.render(this,i),this.strokeView.attachToOwner()):a.isSelected()||!this.hasSavedStyles()||o||(this.restoreStyles(),null===(n=this.strokeView)||void 0===n||n.detachFromOwner()))}reset(){this.model=null}}class Eh extends Kt{constructor(t,e){super(t,"rm-map-series-hover"),this._owner=e}render(t,e){this._area=t;const i=t.dom,s=e&&"string"==typeof e;this.copyPath(),s?this.internalSetStyleOrClass(e):this.internalSetStyles({stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,filter:i.style.filter}),t.internalSetStyles({stroke:"none",strokeWidth:"0"})}refresh(){this._area&&this.copyPath()}attachToOwner(){this._owner.add(this)}detachFromOwner(){this._owner.removeChild(this)}_doInitStyles(){super._doInitStyles(),this.setClass("rm-point"),this.setAttr("vector-effect","non-scaling-stroke"),this.setBoolData("virtual",!0),this.ignorePointer()}copyPath(){this.setPath(this._area.path())}}class Th extends Kt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Vh extends Kt{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 Dh extends Kt{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 o=1;o<t.length;o++)e=_(e,t[o][0]),s=u(s,t[o][0]),i=_(i,t[o][1]),r=u(r,t[o][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 o=e.project([s[0],s[1]]);this._pts=[o],i=`M${o[0]} ${o[1]}`;for(let t=2;t<r;t+=2)o=e.project([s[t],s[t+1]]),i+=` L${o[0]} ${o[1]}`,this._pts.push(o);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class Rh extends ia{constructor(t){super(t,"rm-point-label rm-point-inset")}}class $h extends Ut{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new _a(this,Rh),new _a(this,Rh)],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(),o=i.pointLabelCount(),n=this._labels,a=this._maps;n[0].prepare(r.length),a[0].clear(),n[1].prepare(o>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{for(let h=0;h<o;h++){const o=n[h].get(r);o.setVisible(!0)&&(this.$_prepareInsetLabel(t,o,e[h],s,i),a[h].set(i,o))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const o=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)),o?(i.prepareRich(o),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class Oh extends za{constructor(t){super(t,"rm-map-series",!0,!1),this._boundsClip=null,this._areas={},this._insetLabelContainer=new $h(t),this._areaPool=new Ea(this._pointContainer,Nh),this._insetPool=new _a(this._pointContainer,Dh),this._hoverStrokeView=new Eh(t,this._pointContainer)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e;let i=t;const s=this._hoverArea;if(i&&(null===(e=i.model)||void 0===e?void 0:e.selected)&&(i=null),i!==s){const t=this.model;if(s){const t=this.getPointLabel(s);s.restoreStyles(),null==t||t._text.restoreStyles(),this._hoverStrokeView.detachFromOwner()}if(!i||i.point||t.prop("nullHovering")||(i=void 0),this._hoverArea=i,i){const t=this.getPointLabel(i);i.saveStyles(),null==t||t._text.saveStyles(),this.setHoverStyle(i,t),this._hoverStrokeView.render(i,this.model.prop("hoverStyle")),this._hoverStrokeView.attachToOwner()}i!=s&&t.chart._hoverAreaChanged(t,null==i?void 0:i.model,null==s?void 0:s.model)}}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=this.dom.contains(e)&&Nh.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}getIntersectedAreas(t){const e=[];return this._areaPool.forEach((i=>{Ht.isIntersectRectPath(t,i.dom,.4)&&e.push(i)})),e}needClip(){return!0}resolveBoundsClip(t,e,i,s,r){var o,n,a;const h=this.model.map,l=null==h?void 0:h.source;if(!(l instanceof Pr&&l.bounds)||h.isWorld)return null===(o=this._boundsClip)||void 0===o||o.remove(),this._boundsClip=null,t;if(r.isGlobe)return null===(n=this._boundsClip)||void 0===n||n.remove(),this._boundsClip=null,t;const c=h.h1,d=h.v1,_=h.h2,u=h.v2,p=(t,o)=>{const[n,a]=r.project([t,o]);return[n*e+i,-a*e+s]},g=[];kh.interpolate(c,_).forEach((t=>g.push(p(t,u)))),kh.interpolate(u,d).slice(1).forEach((t=>g.push(p(_,t)))),kh.interpolate(_,c).slice(1).forEach((t=>g.push(p(t,d)))),kh.interpolate(d,u).slice(1).forEach((t=>g.push(p(c,t))));const m=`M${g[0][0]},${g[0][1]} `+g.slice(1).map((t=>`L${t[0]},${t[1]}`)).join(" ")+" Z";return this._boundsClip&&this._boundsClip.dom.parentElement?this._boundsClip.setPath(m):(null===(a=this._boundsClip)||void 0===a||a.remove(),this._boundsClip=this.control.clip(new ie(this.doc).setPath(m))),this._boundsClip}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e,i){super.prepareModel(t,e,i);const s=this._insetLabelContainer;s.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?s.visible&&s.prepare(t,this):s.visible&&!s.isEmpty&&s.prepare(t,this)}_doPrepeare(t,e,i){const s=e.map,r=e.internalBorder._style,o=e.externalBorder._style,n=e.getMapBorders(),a=e.prop("bringToFront")?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new Ut(t,"rm-map-series-internals")),this._internalPool=new _a(this._internalContainer,Th)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new Ut(t,"rm-map-series-externals")),this._externalPool=new _a(this._externalContainer,Th)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&n.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new Ut(t,"rm-map-series-borders")),this._borderPool=new _a(this._borderContainer,Vh))),this._areaPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i),r=t.point=e.pointOf(s);t.setModel(s),r?(s.dummy||this._setPointStyle(t,e,r),a&&a.push(t)):t.internalClearStyleAndClass(),Ht.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(r)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"external"),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(o)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(n.length,((t,e)=>{const i=n[e];t.setModel(i),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),a&&a.length!==e.areaCount&&a.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Ht.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){return this.hoverArea=this.areaOfDom(i),!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){super.onScrollEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}onRotationStart(){super.onRotationStart(),this.hoverArea=null}onRotationEnd(){super.onRotationEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}$_layoutAreas(t,e){const i=this.chart(),s=i.isDirty,r=i.body,o=this.model,n=o.map,a=i.getProjection(),h=this._areas={},l=this._insets,c=o.prop("allAreas"),d=this._labelViews(),_=this._insetLabelContainer.visible?this._insetLabelContainer:null,u=o.insetLabel,p=o.prop("nullStyle"),g=o.prop("dummyStyle"),m=o.prop("selectStyle")||o.prop("selectedStyle"),f=this._scale,b=this._areaPool;b.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,n=d&&e&&d.get(e,0);if(h[i.id]=t,t.setVisible(i.visible&&(c||!!e)&&!o.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(p,g,m,this._pointContainer,s,a),n){const i=r.toVisible(o.getCenter(e));if(n.setVisible(!!i)){s&&this._layoutLabel(n,t.dom);const r=n.bbox();let[o,a]=i;e.xPos=o,e.yPos=a,o*=f,a*=-f,o-=r.width/2,a-=r.height/2,n.trans(o,a)}}}else n&&n.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=l[e];if(t.setVisible(!1!==i.visible)){const e=h[i.area],l=_&&!u.hideInsetLabel(i)&&_.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(d&&(c=d.get(e.point,0),c&&o.isPointLabelVisible(e.point))){const t=o.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const s=r.toVisible(t),n=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=f,e*=-f,t-=n.width/2,e-=n.height/2,c.trans(t,e)}}t.render(i,a)}}else{const e=i._base;if(e)if(e[0]instanceof Or){for(const t of e){if(!t.visible||o.isHiddenArea(t.id))return;if(d){const e=h[t.id];if(c=e&&d.get(e.point,0),c&&c.visible){const t=o.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const s=r.toVisible(t),n=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=f,e*=-f,t-=n.width/2,e-=n.height/2,c.trans(t,e)}}}}t.render(i,a)}else if(e[0]>=0){const e=n.areaOf(i._parent);e&&e.visible&&!o.isHiddenArea(e.id)&&t.render(i,a)}}if(l&&l.setVisible(!c)){s&&l.layout();const e=t.center,i=l.bbox();let[r,o]=e;r*=f,o*=-f,r-=i.width/2,o-=i.height/2,l.trans(r,o)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const i=this.model.prop("hoverColor"),s=this.model.prop("hoverStyle");t.internalSetStyles({filter:Oh.DefaultHoverFilter,strokeWidth:Oh.DefaultHoverStrokeWidth}),t.internalSetStyleOrClass(s),i&&t.internalSetStyle("fill",i),t.point||t.internalSetStyles({fill:"var(--rm-null-area-fill)",stroke:"var(--rm-null-area-stroke)"});const r=this.model.pointLabel.prop("hoverStyle");r&&(null==e||e._text.internalSetStyleOrClass(r))}}Oh.DefaultHoverFilter="var(--rm-map-series-hover-filter)",Oh.DefaultHoverStrokeWidth="var(--rm-map-series-hover-stroke-width)";class Fh extends na{constructor(t,e,i){super(t,e),this._paddings=new Rt,this.add(this._background=new Kt(t,i)),this.add(this._textView=new Ze(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=e.prop("text");r?(e.prepareRich(r),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const n=this._textView.bbox();let a=this.model.prop("backgroundStyle");o(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+n.width,this.mw=c.height=l.top+l.bottom+n.height,c}_doLayout(e){const i=this._textView,s=this.width;let r=0;this._renderBackgrouond(this._background,s,this.height,e);switch(getComputedStyle(i.dom).textAlign){case"center":r+=s/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=s,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}i.trans(r,this._paddings.top)}}class Bh extends Fh{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Vi.bar(0,i,e,-i,s,0))}}class zh extends Fh{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Vi.bar(0,i,e,-i,0,s))}}class jh extends Oa{constructor(t){super(t,!0),this.add(this._back=new Ut(t)),this._back.addAll(this._borderView=new ji(t),this._headerView=new Bh(t),this._bodyView=new zh(t),this._divider=new ka(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,o){const n=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(n).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(n).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,o)}}class Gh extends za{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new Ea(this._pointContainer,jh)}_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&&th.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,o=r.chart.getProjection(),n=[this._scale,-this._scale],a=r.prop("position"),h=this._getLabelPositioner(r.pointLabel.prop("position"),"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=m(u.rx,0);let g,f,b;this._panels.forEach(((u,m)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=o.getVisible(w)))){const m=this._getPointPositioner(y.position||a,"top");let x,v,C,S,L,M;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>o.project(t))),g=v[v.length-1]),y.xPos=C=g[0],y.yPos=S=g[1],C*=n[0],S*=n[1],u.render(t,r,e,i,p,s),f=u._rBox,b=m(C,S,f.width,f.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+f.width/2,b.y+f.height/2,L.bbox(),f.width/2,f.height/2,c)),_&&v&&(M=_.get(y))&&M.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*n[e%2]));f.x=u.tx,f.y=u.ty,_.setMask(M,t).setRects(f),M.render(d,y,t,u.getFill())}}}))}}class Hh extends dh{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Wh extends Wa{constructor(t){super(t,!0),this._sectors=new _a(this,Hh,null,.5),this._rdRate=1,this.add(this._circle=new bh(t)),this._circle.internalSetStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,o=0;if(e){this.$_calcAngles(t,[0],s);const n=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.prop("clockwise");let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:o,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),n[0]&&n[0].color&&a.setFill(n[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,o,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=e.length,r=t.prop("clockwise")?1:-1,o=e.reduce(((t,e)=>t+e),0),n=t._totalRad*i;let a=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),s>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=a,a+=t.angle=r*e*n}}));else if(1==s){const t=this._sectors.get(0);t.start=a,t.angle=n}}$_layoutSectors(t,e,i,s,r){const o=t._categories||[],n=t.getFieldColors(),a=t.prop("clockwise");this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const h=t.value;if(isNaN(h))t.setVisible(!1);else{const h=t.start;let l=0,c=0;t.trans(l,c).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:h,angle:p(t.angle),clockwise:a}),t.internalClearStyleAndClass(),o[r]&&o[r].color?t.setFill(o[r].color):n&&t.setFill(n[r%n.length])}}))}}class Yh extends Ya{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new Ea(this._pointContainer,Wh)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.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 o=i.prepare(e[r],s);this._setPointStyle(i,t,o)}))}$_layoutPies(t,e,i){const s=this.model,r=s.pointLabel,o=s.chart.getProjection(),n=[this._scale,-this._scale],a=s.prop("position"),h=r.getPosition,l=s.getLabelOff(),c=this._labelViews(),d=s.getCallout(),_=this._calloutViews(),u=s.getRadius(Math.min(t,e)),p=s.hasThreshold(),g=this._inRegion;let m,f;this._pies.forEach(((t,e)=>{const r=t.point,b=[r.lon,r.lat];if(t.setVisible(!r.isNull&&(g&&r._excluded||!g&&!r._excluded)&&null!=(m=o.getVisible(b)))){const e=this._getPointPositioner(r.position||a,"top"),g=u*t._rdRate;let y,w,x,v,C,S;if(d&&(y=r.getCallout(b))&&(w=y.map((t=>o.project(t))),m=w[w.length-1]),r.xPos=x=m[0],r.yPos=v=m[1],x*=n[0],v*=n[1],f=e(x,v,2*g,2*g),f.x+=g,f.y+=g,t.render(s,p&&s.getThreshold(r.getSum()),g,i*r.vrate()),t.trans(f.x,f.y),c&&(C=c.get(r,0))){const e=this._getLabelPositioner(h(r),"bottom");this._layoutLabel(C,t.dom).transp(e(f.x,f.y,C.bbox(),g,g,l))}if(_&&w&&(S=_.get(r))&&S.setVisible(t._static)){const e=w.flat().map(((t,e)=>t*n[e%2]));_.setMask(S,e).setCircle(e[e.length-2],e[e.length-1],g),S.render(d,r,e,t.getFill())}}}))}}class Zh extends Ga{constructor(t){super(t,!0),this.add(this._pin=new Kt(t))}render(t){this._pin.setPath(Vi.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new bh(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 Uh extends Ha{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new Ea(t,Zh)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(),i=this._getGrowRate(),s=this.model,r=s.pointLabel,o=[this._scale,-this._scale],n=+s.prop("rotation")||0,a=s.prop("position"),h=r.getPosition;s.pointLabel.prop("position");const l=this._labelViews(),c=s.getLabelOff(),d=s.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((r,g)=>{const m=r.point,f=[m.lon,m.lat];if(r.setVisible(!m.isNull&&null!=(u=e.getVisible(f)))){const g=this._getPointPositioner(m.position||a,"top"),b=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,M;if(d&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),m.xPos=C=u[0],m.yPos=S=u[1],C*=o[0],S*=o[1],p=g(C,S,y,w),t&&r.render(b),r.trans(p.x+y/2,p.y+w).rotate(n),l&&(L=l.get(m,0))&&L.setVisible(r._static)){t&&this._layoutLabel(L,r.dom);const e=this._getLabelPositioner(h(m),"bottom");L.transp(e(p.x+y/2,p.y+w/2,L.bbox(),y/2,w/2,c))}_&&v&&(M=_.get(m))&&M.setVisible(r._static)&&M.render(d,m,v.flat().map(((t,e)=>t*o[e%2])),null)}}))}}class Xh extends Ga{}class qh extends Ha{constructor(t){super(t,"rm-point-series",!0,!0),this._pointLayer.add(this._clusterContainer=new Ut(t,"rm-point-clusters"))}_createMarkers(t){return new Ea(t,Xh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){const e=this.model;t&&(this._runClustering(e)||th.grow(this))}_doViewRateChanged(t){this.$_layoutMarkers(t)}zoomChanged(t,e){this._runClustering(this.model)}_runClustering(t){const e=t.cluster;if(e.stop(),t._visPoints.forEach((t=>t.cluster=null)),e.visible&&(isNaN(e.prop("zoomLimit"))||t.chart.body.zoom<e.prop("zoomLimit")))return e.run(t._visPoints,this.width,this.height,(e=>{this.$_prepareClusters(t,e)}),((t,e)=>{this.$_layoutMarkers(this._getGrowRate())}),(t=>{this.$_layoutMarkers(this._getGrowRate())})),!0;t.chart.body.zoom>=e.prop("zoomLimit")&&e.clear()}_clusterOfDom(t){if(t)return this._clusterPool.find((e=>e.containsDom(t)))}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()})),t.cluster.clusters&&this.$_prepareClusters(t,t.cluster.clusters)}$_layoutMarkers(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=Math.max(0,e.getRadius()),o=[this._scale,-this._scale],n=+e.prop("rotation")||0,a=e.prop("position"),h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews(),_=e.cluster.acitve;let u,p;const g=i.getPosition;this._markers.forEach(((i,m)=>{var f;const b=i.point,y=[b.lon,b.lat];if(i.setVisible(!b.isNull&&(!_&&!b.cluster||_||b.moves<1)&&null!=(u=s.getVisible(y)))){const m=this._getPointPositioner(b.position||a,"center"),w=(null!==(f=i._radius)&&void 0!==f?f:r)*b.vrate(),x=w*t,v=za.getDrawer(e.getShape());let C,S,L,M,A,P;if(c&&(C=b.getCallout(y))&&(S=C.map((t=>s.project(t))),u=S[S.length-1]),b.xPos=L=u[0],b.yPos=M=u[1],L*=o[0],M*=o[1],p=m(L,M,2*w,2*w),p.x+=w,p.y+=w,b.px=p.x,b.py=p.y,b.cluster&&_&&b.moves>0&&(p.x=p.x+(b.cluster.cx-p.x)*Math.min(1,b.moves),p.y=p.y+(b.cluster.cy-p.y)*Math.min(1,b.moves)),i.setPath(v(x,x)),i.trans(p.x,p.y).rotate(n),h&&(A=h.get(b,0))&&A.setVisible(i._static)){this._layoutLabel(A,i.dom);let t=this._getLabelPositioner(g(b),"bottom");A.transp(t(p.x,p.y,A.bbox(),w,w,l))}if(d&&S&&(P=d.get(b))&&P.setVisible(i._static)){const t=S.flat().map(((t,e)=>t*o[e%2]));d.setMask(P,t).setCircle(t[t.length-2],t[t.length-1],w),P.render(c,b,t,null)}}})),this.$_layoutClusters()}$_prepareClusters(t,e){const i=t.cluster,s=i._style;this._clusterContainer.setBoolData("disabled",!i.isExpandable()),i.acitve&&!this._clusterPool&&(this._clusterPool=new _a(this._clusterContainer,ja)),this._clusterPool&&this._clusterPool.prepare(e.length,((t,i)=>{t.setCluster(e[i]),t.internalClearStyleAndClass(),t.internalSetStyles(s)}))}$_layoutClusters(){const t=this.model.cluster;this._clusterPool&&(t.updateClusters(),this._clusterPool.forEach((e=>{const i=e._cluster;if(e.setVisible(t.isVisible(i))){const s=t.getRange(i);e.render(s.radius,s.color),e.trans(i.cx,i.cy)}})))}}class Kh extends Oa{constructor(t){super(t,!0),this._arrowClipPath=null,this.add(this._line=new Kt(t)),this.add(this._arrow=new Kt(t)),this.add(this._secondArrow=new Kt(t)),this.add(this._image=this.$_createImage(t)),this.add(this._secondImage=this.$_createImage(t)),this._arrow.setStyleOrClass("rm-route-series-line"),this._arrow.setStyleOrClass("rm-route-series-arrow"),this._secondArrow.setStyleOrClass("rm-route-series-line"),this._secondArrow.setStyleOrClass("rm-route-series-arrow"),this._image.setStyleOrClass("rm-route-series-image"),this._secondImage.setStyleOrClass("rm-route-series-image")}get line(){return this._line}get arrow(){return this._arrow}get secondArrow(){return this._secondArrow}get image(){return this._image}get secondImage(){return this._secondImage}prepare(t){this._checkStatic();const e=t.getImageUrl(this.point,!1);e?this.point.imageUrl||(this.point.imageUrl=e):this.point.imageUrl=null}isEmpty(t,e,i){return t.length<=1||0===e.length||0===i.length}clear(){this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),this._secondImage.setVisible(!1)}render(t,e,i,s,r,o,n){if(i.length<=1||0===s.length||0===r.length)return this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),void this._secondImage.setVisible(!1);const a=t,h=i[i.length-2],l=i[i.length-1],c=$(Math.atan2(l[1]-h[1],l[0]-h[0]))-90,d=this.$_buildLinePath(s,r,o);if(this._line.setPath(d),this._arrow.setVisible(n)){this.$_drawArrow(this._arrow,l,a,e,c),this.$_drawImage(t,this.point,this._image,a,l,e);const s=this.$_createClipBoundary(t,l,a,e);let r=null,n=c;if(-1!==o){this._secondArrow.setVisible(!0);const s=i[o],h=o>0?i[o-1]:i[0];n=$(Math.atan2(s[1]-h[1],s[0]-h[0]))-90,this.$_drawArrow(this._secondArrow,s,a,e,n),this.$_drawImage(t,this.point,this._secondImage,a,s,e),r=this.$_createClipBoundary(t,s,a,e)}else this._secondArrow.setVisible(!1),this._secondImage.setVisible(!1);this.$_applyArrowClipping(i,o,s,c,l,r,n)}else this._arrowClipPath&&this._line.setClip(null)}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this._secondArrow.setVisible(!1),this}$_createInnerRect(t,e,i){const{minX:s,maxX:r,minY:o,maxY:n}=t,a=i[0],h=i[1],l=R(e),c=Math.cos(l),d=Math.sin(l),_=(t,e)=>{const i=t-a,s=e-h;return[a+i*c-s*d,h+i*d+s*c]},u=_(s,o),p=_(r,o),g=_(r,n),m=_(s,n);return`M ${u[0]} ${u[1]} L ${p[0]} ${p[1]} L ${g[0]} ${g[1]} L ${m[0]} ${m[1]} Z`}$_drawArrow(t,e,i,s,r){const o=i.prop("arrowWidth"),n=i.prop("arrowLength"),a=[`M ${e[0]} ${e[1]}`,`L ${e[0]-o*s} ${e[1]-n*s}`,`L ${e[0]+o*s} ${e[1]-n*s} Z`].join(" ");t.setPath(a),t.setRotation(e[0],e[1],r)}$_drawImage(t,e,i,s,r,o){const n=s.prop("imageWidth")*o,a=s.prop("imageHeight")*o;if(!e.imageUrl)return;const h=r[0]-n/2,l=r[1]-a/2;i.setVisible(!0),i.internalSetStyles({width:`${n}px`,height:`${a}px`,transformOrigin:`${n/2}px ${a/2}px`,transform:`translate(${h}px, ${l}px) scaleY(-1)`})}$_createClipBoundary(t,e,i,s){const r=i.prop("arrowWidth"),o=i.prop("arrowLength"),n=Math.max(r*s,t.getLineWidth()/2);return{minX:e[0]-n,maxX:e[0]+n,minY:e[1]-o*s,maxY:e[1]+5}}$_applyArrowClipping(t,e,i,s,r,o,n){let a="M -10000 -10000 L 10000 -10000 L 10000 10000 L -10000 10000 Z "+this.$_createInnerRect(i,s,r);if(o){const i=t[e];a+=" "+this.$_createInnerRect(o,n,i)}this._arrowClipPath?this._arrowClipPath.setPath(a):(this._arrowClipPath=this._line.clipPath(a),this._arrowClipPath.setAttr("clip-rule","evenodd"))}$_buildLinePath(t,e,i){const s=[];let r=0;for(let o=0;o<t.length;o++){const n=`${t[o][0]},${t[o][1]}`;if(-1!==i&&o===i+1){for(let t=o-1;t>=r;t--)s.push(`L ${e[t][0]},${e[t][1]}`);s.push("Z"),r=o,s.push(`M ${n}`)}else s.push(o===r?`M ${n}`:`L ${n}`)}for(let i=t.length-1;i>=r;i--)s.push(`L ${e[i][0]},${e[i][1]}`);return s.push("Z"),s.join(" ")}$_createImage(t){const e=new Wn(t);return e.setVisible(!1),e}}class Jh extends za{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new Ea(this._pointContainer,Kh,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t.line.setFill(e),t.arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(m(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"fill"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._pointContainer.setStroke("none"),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(t),i.line.setStroke("none"),Ht.setNoScale(i.line.dom),i.arrow.setStroke("none"),Ht.setNoScale(i.arrow.dom),i.image.setAttr("href",t.getImageUrl(r)||""),i.secondImage.setAttr("href",t.getImageUrl(r)||"")}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.prop("arrowDisplay");t=m(t,1),this._lines.forEach(((i,o)=>{this.$_layoutLine(i,e,s,r,t*i.point.vrate())}))}}$_layoutLine(t,e,i,s,o){const a=t.point,h=e.getRouteMode();let l=[];const c=this.chart().isGlobe,d=[a.lon1,a.lat1],_=[a.lon2,a.lat2];if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t.line.setPath(s.join(" "))}else{if(h===Bi)l=this.$_genCubicBezierPath(a,d,_,Jh.INTERPOLATION);else l=this.$_genGcnPath(d,_,Jh.INTERPOLATION);const r="none"!==s&&(o<1||"moving"!==s);let n=e.getLineWidth();n/=this._scale;!c&&this.$_checkBoundaryCrossing(l)?this.$_renderDuplicatedPaths(t,e,i,l,n,o,r):this.$_renderSinglePath(t,e,i,l,n,o,r)}}$_renderSinglePath(t,e,i,s,r,o,n){const a=s.map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(a.length=a.length*o|0);const{topPath:h,bottomPath:l}=this.$_generateOffsetPaths(a,0,r/2);t.render(e,1/this._scale,a,h,l,-1,n)}$_renderDuplicatedPaths(t,e,i,s,r,o,n){const a=this.model.chart.body.scroll,h=s.map((t=>t[0])),l=Math.min(...h);let c;Math.max(...h)>180+a?c=-360:l<-180+a&&(c=360);const d=s.map((t=>[t[0]+c,t[1]])),_=s.map((t=>i.project(t))).filter((t=>!t.outside)),u=d.map((t=>i.project(t))).filter((t=>!t.outside));if(o<1&&(_.length=_.length*o|0,u.length=u.length*o|0),0===_.length||0===u.length)return void t.clear();const p=[..._,...u],{topPath:g,bottomPath:m}=this.$_genSplitedOffsetPath(_,u,r/2);t.render(e,1/this._scale,p,g,m,_.length-1,n)}$_checkBoundaryCrossing(t){if(t.length<2)return!1;const e=this.chart().body.scroll,i=-180+e,s=180+e,r=t.map((t=>t[0])),o=Math.min(...r),n=Math.max(...r);return o<i||n>s}$_genSplitedOffsetPath(t,e,i){const{topPath:s,bottomPath:r}=this.$_generateOffsetPaths(t,0,i),{topPath:o,bottomPath:n}=this.$_generateOffsetPaths(e,0,i);return{topPath:[...s,...o],bottomPath:[...r,...n]}}$_genGcnPath(t,e,i){const s=[];let r=t[0];for(let o=0;o<=i;o++){const n=o/i,a=this.interpolate(t,e,n,r);s.push(a),r=a[0]}return s}$_genCubicBezierPath(t,e,i,s){const r=[],o=this.model.chart.getProjection(),n=this.model.chart.body.scroll,[a,h]=this.model.getCurvePoint(t,e,i);o.scroll=0;const l=o.project(e),c=o.project(i),d=a,_=h;let u=e[0];for(let t=0;t<=s;t++){const e=t/s,i=this.$_cubicBezier(l,d,_,c,e),n=o.backward(i);let a=n[0];const h=a-u;h>180?a-=360:h<-180&&(a+=360);const p=[a,n[1]];r.push(p),u=a}return o.scroll=n,r}$_cubicBezier(t,e,i,s,r){const o=r*r,n=o*r,a=1-r,h=a*a,l=h*a;return[l*t[0]+3*h*r*e[0]+3*a*o*i[0]+n*s[0],l*t[1]+3*h*r*e[1]+3*a*o*i[1]+n*s[1]]}interpolate(t,e,i,s){const r=R(t[1]),o=R(t[0]),n=R(e[1]),a=R(e[0]),h=Math.acos(Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos(a-o)),l=Math.sin((1-i)*h)/Math.sin(h),c=Math.sin(i*h)/Math.sin(h),d=l*Math.cos(r)*Math.cos(o)+c*Math.cos(n)*Math.cos(a),_=l*Math.cos(r)*Math.sin(o)+c*Math.cos(n)*Math.sin(a),u=l*Math.sin(r)+c*Math.sin(n),p=Math.sqrt(d*d+_*_+u*u),g=Math.asin(u/p);let m=$(Math.atan2(_,d));if(void 0!==s){const t=m-s;t>180?m-=360:t<-180&&(m+=360)}return[m,$(g)]}$_getNormalVector(t,e){let i;if(0===e){i=[t[1][0]-t[0][0],t[1][1]-t[0][1]]}else if(e===t.length-1){i=[t[e][0]-t[e-1][0],t[e][1]-t[e-1][1]]}else{i=[t[e+1][0]-t[e-1][0],t[e+1][1]-t[e-1][1]]}const s=Math.sqrt(i[0]*i[0]+i[1]*i[1]);return 0===s?[0,1]:[-i[1]/s,i[0]/s]}$_generateOffsetPaths(t,e,i){if(t.length<2)return{topPath:[],bottomPath:[]};const s=[],r=[];for(let o=0;o<t.length;o++){const n=t[o];let a=e+(i-e)*(o/(t.length-1));const h=1/this._scale;a=Math.max(a,h);const l=this.$_getNormalVector(t,o),c=[n[0]+l[0]*a,n[1]+l[1]*a],d=[n[0]-l[0]*a,n[1]-l[1]*a];s.push(c),r.push(d)}return{topPath:s,bottomPath:r}}}Jh.INTERPOLATION=80;class Qh extends Wa{constructor(t){super(t,!0),this._cells=new _a(this,Kt)}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(Vi.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const o=i*r.hCell+(i-1)*r.gap;let n=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[n][a])&&(n++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),o-n*r.hCell-(n>0?n*r.gap:0)),a++}))}}class tl extends Ya{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new Ea(this._pointContainer,Qh)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.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 o=i.prepare(e[r],s);this._setPointStyle(i,t,o)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.pointLabel,o=s.getWaffleInfo(),n=s.chart.getProjection(),a=+s.prop("rotation")||0,h=[this._scale,-this._scale],l=s.prop("position"),c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.prop("gap")},p=s.getCallout(),g=this._calloutViews();let m,f,b;this._waffles.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(m=n.getVisible(y)))){const e=this._getPointPositioner(r.position||l,"top");let w,x,v,C,S,L;if(p&&(w=r.getCallout(y))&&(x=w.map((t=>n.project(t))),m=x[x.length-1]),r.xPos=v=m[0],r.yPos=C=m[1],v*=h[0],C*=h[1],t.render(s,u,o,i*r.vrate()),f=t.bbox(),b=e(v,C,f.width,f.height),t.trans(b.x,b.y).rotate(a),_&&(S=_.get(r,0))&&S.setVisible(t._static)){const e=this._getLabelPositioner(c(r),"bottom");this._layoutLabel(S,t.dom).transp(e(b.x+f.width/2,b.y+f.height/2,S.bbox(),f.width/2,f.height/2,d))}g&&x&&(L=g.get(r))&&L.setVisible(t._static)&&L.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class el extends ma{constructor(t){super(t,el.CLASS_NAME),this.add(this._foreignObj=new Zt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=el.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.getSize(i,s),o=this._htmlView;let n=e.prop("html")||"";const a=(n.startsWith("#")||n.startsWith("."))&&t.querySelector(n);return this._htmlView.style.width=isNaN(r.width)?"max-content":"",this._foreignObj.resize(m(r.width,1e4),r.height),n=e.applyParams(a?a.innerHTML:n)||"<div></div>",n!==o.innerHTML&&(o.innerHTML=n),isNaN(r.width)&&(this._foreignObj.width=o.firstElementChild.offsetWidth),isNaN(r.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),a&&this._templateDom!==a&&(this._templateDom=a,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),oa.create(o.firstElementChild.offsetWidth,o.firstElementChild.offsetHeight)}_doLayout(t){super._doLayout(t)}_doDispose(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}el.CLASS_NAME="rm-html-annotation",el.HTML_VIEW_CLASS="rm-html-annotation-view";class il extends Oa{constructor(t){super(t,!0),this.add(this._foreignObj=new Zt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className="rm-html-series-view"}setHtml(t,e,i){const s=this._htmlView,r=m(e,1e4);this._htmlView.style.width=isNaN(e)?"max-content":"",this._foreignObj.resize(r,i),t!==s.innerHTML&&(s.innerHTML=t),isNaN(e)&&(this._foreignObj.width=s.firstElementChild.offsetWidth),isNaN(i)&&(this._foreignObj.height=s.firstElementChild.offsetHeight)}render(t){this._rbox=dt.create(0,0,this._htmlView.firstElementChild.offsetWidth,this._htmlView.firstElementChild.offsetHeight)}}class sl extends za{constructor(t){super(t,"rm-html-series",!0,!1),this._htmlViews=new Ea(this._pointContainer,il),this._observer=new MutationObserver((t=>{this.chart()._optionChanged(this.model)}))}_getPointPool(){return this._htmlViews}_doPrepeare(t,e,i){this.$_prepareHtmls(t,e,this._visPoints)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareHtmls(t,e,i){const s=e.getSize(),r=e.prop("html")||"",o=(r.startsWith("#")||r.startsWith("."))&&t.querySelector(r);this._htmlViews.prepare(i.length,((t,n)=>{const a=t.point=i[n],h=e.applyParams(a,o?o.innerHTML:r)||"<div></div>";t.setHtml(h,s.width,s.height),this._setPointStyle(t,e,a)})),o&&this._templateDom!==o&&(this._templateDom=o,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(),s=[this._scale,-this._scale],r=this._getLabelPositioner(e.pointLabel.prop("position"),"bottom"),o=e.getLabelOff(),n=this._labelViews(),a=e.getCallout(),h=this._calloutViews();let l,c;this._htmlViews.forEach(((d,_)=>{const u=d.point,p=[u.lon,u.lat];if(d.setVisible(!u.isNull&&null!=(l=i.getVisible(p)))){const _=this._getPointPositioner(e.prop("position"),"center");let g,m,f,b,y,w,x;if(a&&(g=u.getCallout(p))&&(m=g.map((t=>i.project(t))),l=m[m.length-1]),u.xPos=f=l[0],u.yPos=b=l[1],f*=s[0],b*=s[1],d.render(t),x=d._rbox,c=_(f,b,x.width,x.height),d.trans(c.x,c.y),n&&(y=n.get(u,0))&&y.setVisible(d._static)&&y.layout().transp(r(c.x+x.width/2,c.y+x.height/2,y.bbox(),x.width/2,x.height/2,o)),h&&m&&(w=h.get(u))&&w.setVisible(d._static)){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=d.tx,x.y=d.ty,h.setMask(w,t).setRects(x),w.render(a,u,t,d.getFill())}}}))}}function rl(t,e){return new(Ba[e._type()])(t)}function ol(t,e){return new(ga[e._type()])(t)}za.register([hn,Oh],[Mn,qh],[wn,Uh],[wo,hh],[tn,Ph],[fn,Yh],[Ho,Ch],[Nn,tl],[kn,Jh],[Ps,ch],[qo,Lh],[pn,Gh],[Zo,sl],[Io,fh],[zo,xh]),ma.register([io,Qa],[to,Ka],[eo,Ja],[Qr,el]);class nl extends ut{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class al extends ut{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class hl extends Ut{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new Ut(t)),this._axisLayer.add(this.axisView=new va(t,i)),this._axisLayer.add(this.tickLayer=new xa(t))}get firstMap(){for(const t of this.seriesViews)if(t instanceof Oh&&t.visible)return t}prepare(t,e,i){const s=e.visibleSeries,r=this.seriesMap,o=this.seriesViews,n=this._h1,a=this._h2;o.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),o.length=0,s.forEach((e=>{const s=r[e.hash]||rl(t,e);s.parent||(this.add(s),this.labelsContainer.add(s._labelContainer),this.labelsContainer.add(s.secondLabelContainer())),r[e.hash]=s,o.push(s),s._h1=n,s._h2=a,s.prepareModel(t,e,i)})),this.prevViews&&ht.equalArrays(this.prevViews,o)||(this.sort(o),this.labelsContainer.sort(o.map((t=>t._labelContainer)))),this.prevViews=o.slice(0)}prepareLayout(t){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}resetClip(t){this._axisLayer.setClip(t)}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}zoomChanged(t,e){}onScrollStart(){this.seriesViews.forEach((t=>t.visible&&t.onScrollStart()))}onScrollEnd(){this.seriesViews.forEach((t=>t.visible&&t.onScrollEnd()))}onRotationStart(){this.seriesViews.forEach((t=>t.visible&&t.onRotationStart()))}onRotationEnd(){this.seriesViews.forEach((t=>t.visible&&t.onRotationEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class ll extends Ut{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new Ut(t)),this.add(this._labelLayer=new Ut(t))}render(t,e,i,s,r){const o=e.guides.filter((t=>t.prop("front")==this.front));this.$_prepareGuides(t,o),this.$_layoutGuides(t,o,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 Sa(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((o,n)=>{o.measure(t,e[n],s,r),o.layout(i)}))}}class cl extends na{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._zoom=100,this._owner=e,this.add(this._back=new ji(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Pa(t)),this.add(this._contentLayer=new Ut(t,"rm-body-content")),this.add(this._feedbackContainer=new Ut(t,"rm-feedbacks")),this.add(this._crosshairView=new Ma(t)),this._contentLayer.add(this._annotationContainer=new Ut(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new ll(t,!1)),this._contentLayer.add(this._seriesContainer=new hl(t,new Ut(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new ll(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new Ut(t,"rm-front-annotations"))}getAnnotationAnchor(t){return this._annotationMap.get(t)}get firstMap(){return this._seriesContainer.firstMap}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),this._seriesContainer._h1=t+r,this._seriesContainer._h2=s}this.$_prepareSeries(t,e.chart,0),this.$_prepareAnnotations(t,e.getAnnotations())}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(this._mousePos),this._transformInfo),this.model&&(this.model.isScrollable()&&this.onScrollEnd(),this.model.projection.isGlobe&&this.onRotationEnd())}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,i){if(!this.model)return;const s=this.model.chart,r=this._owner.tx,o=this._owner.ty,{sv:n,pv:a}=function(s){let n,a;for(const h of s)h.pointerMoved(t,e,i)&&(n=h,a=h.getPointView(i,t-r,e-o,!0));if(!a)for(const h of s)if(a=h.getPointView(i,t-r,e-o,!0),a){n=h;break}return{sv:n,pv:a}}(this._seriesContainer.seriesViews),h=null==n?void 0:n.model,l=h&&this._owner.getScaleView(s.getColorScale(h.getColorScale()));return(null==a?void 0:a.point)?(this._owner.showTooltip(h,a,this,{x:t,y:e}),null==l||l.setValue(a.point.getValue())):(this._owner.hideTooltip(),null==l||l.setValue(NaN)),this._crosshairView.visible&&s&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!n}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 al(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}zoomChanged(t,e){this._seriesContainer.zoomChanged(t,e)}onScrollStart(){var t;(null===(t=this.model)||void 0===t?void 0:t.isScrollable)&&this._seriesContainer.onScrollStart()}onScrollEnd(){this.model.isScrollable&&this._seriesContainer.onScrollEnd()}onRotationStart(){this.model.projection.isGlobe&&this._seriesContainer.onRotationStart()}onRotationEnd(){this.model.projection.isGlobe&&this._seriesContainer.onRotationEnd()}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),oa.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=this._zoom,o=s._prj,n=s.chart,a=n.axis,h=n.map,l=this.height,c=this.width,{wMap:d,hMap:_,scale:u,tx:p,ty:g}=s.prepareLayout(c,l);let m=this._clip;if(this._back.resize(c,l),this._back.internalResetStyleOrClass(s._style),s.zoom!==r&&(this._zoom=s.zoom),h){this.$_prepareLayoutSeries(i),this._transformInfo={tx:p,ty:g,scale:u,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const t=`translate(${p}px, ${g}px) scale(${u}, ${-u})`,e=d*u,m=_*u,f=[this._seriesContainer],b=(c-e)/2-s.panX*u,y=(l-m)/2-s.panY*u,w=this.$_layoutClip(s,o,c,l,u);this._mapBack.setVisible(n.body.mapBackground.isVisible())&&this._mapBack.render(this.doc,n,b,y,e,m),f.forEach((n=>{const h=n.axisView,d=n.tickLayer;h.setScale(u),h.measure(i,a,c,l),h.resize(c,l),h.trans(p,g),d.setVisible(a.tick.visible)&&(d.prepare(i,a.tick,h.steps),d.resize(c,l),d.setScale(u),d.layout(s.projection),d.trans(p,g)),n.seriesViews.forEach((i=>{var s,n;i._scale=u,i.model.needMapScale()?(i._pointLayer.internalSetStyle("transform",t),i._calloutContainer.visible&&i._calloutContainer.internalSetStyles({transform:t})):i.model.needTranslate()?i.trans(p,g):(i.resize(c,l),i.trans(b,y)),i.move(p,g),i.resize(e,m),i.render(c,l,this._transformInfo),null===(s=i._labelContainer)||void 0===s||s.trans(p,g),null===(n=i.secondLabelContainer())||void 0===n||n.trans(p,g);const a=i.resolveBoundsClip(w,u,p,g,o);i.setClip(i.needClip()?a:null),r!==this._zoom&&i.zoomChanged(this._zoom,r)})),h.layout(),n.resetClip(w)})),this._crosshairView.visible&&this._crosshairView.prepare(u,t);const x={map:h,prj:o,tf:this._transformInfo,trans:t,latInterval:a.latInterval,lonInterval:a.lonInterval};this.$_layoutAxisGuides(i,a,x,c,l)}if(this.$_layoutAnnotations(c,l),m&&m.parent&&m.width===c&&m.height===l||(m&&m.dom.remove(),this._clip=this.clipRect(0,0,c,l)),this._requestShow&&this._requestShow.visible){const t=this.getSeries(this._requestShow);t&&(null===(e=this._requestShow.ani)||void 0===e||e.stop(),(this._requestShow.ani=new nl(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}mouseToMap(t,e=!0,i=!1){if(!this._transformInfo)return[NaN,NaN];const{tx:s,ty:r,scale:o,vx:n,vy:a}=this._transformInfo;let h=t.x-s,l=t.y-r;i||(h-=n,l-=a);const c=h/o,d=l/-o;return this.pointToMap(c,d,e)}boundsToMap(t,e=!0,i=!1){return{from:this.mouseToMap({x:t.x,y:t.y},e,i),to:this.mouseToMap({x:t.x+t.width,y:t.y+t.height},e,i)}}pointToMap(t,e,i){if(!this.model)return[NaN,NaN];const{projection:s,scroll:r}=this.model,o=s.backward([t,e]);return i||0===r||(o[0]=s.getScrolledLon(o[0])),o}mapToPoint(t){t=this.model.chart.getProjection().project(t);const{tx:e,ty:i,scale:s,vx:r,vy:o}=this._transformInfo;return{x:t[0]*s-(r-e),y:t[1]*-s-(o-i)}}boundsByCoord(t,e){const i=this.mapToPoint(t),s=this.mapToPoint(e);return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}$_prepareSeries(t,e,i){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e,i)}$_prepareLayoutSeries(t){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));o.forEach((t=>t.remove())),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ol(t,e);(e.prop("front")?s:i).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r),this._axisGuideContainer.setClip(this._clipMap),this._frontAxisGuideContainer.setClip(this._clipMap)}$_layoutClip(t,e,i,s,r){const o=()=>{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]}`))},n=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.dom.parentElement&&t.width===i&&t.height===s){if(t){if(this._prevPrj!==e){const e=o();t.setPath(e)}n(t),this._contentLayer.hasClip()}}else{const e=o();t&&t.remove(),this._clipMap=this.control.clip(new ie(this.doc).setPath(e)),n(this._clipMap),this._clipMap.resize(i,s)}}else this._clipMap&&(this._clipMap.remove(),this._clipMap=null);return this._clipMap}}class dl extends aa{constructor(t,e){super(t,e?dl.SUBTITLE_CLASS:dl.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Ze(t)),this._richText=new ii}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}dl.TITLE_CLASS="rm-title",dl.SUBTITLE_CLASS="rm-subtitle";const _l="circle",ul="header";var pl;!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(pl||(pl={}));class gl extends Zt{constructor(e){super(e,gl.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._gap=8,this._tailVisible=!0,this._circleRadius=6,this._circlePaddingX=12,this._circlePaddingY=5,this._linePaddingX1=5,this._linePaddingX2=6,this._linePaddingY=4,this._lineWidth=2,this._lineGap=4,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Kt(e,"rm-tooltip-back")),this.add(this._top=new Kt(e,"rm-tooltip-top")),this.add(this._border=new Kt(e,"rm-tooltip-border")),this.add(this._textView=new Ze(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Yt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ii,this.close(!0,!1)}show(t,e,i,s,r,o){var n;const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a),c=(null===(n=e.tooltipColor)||void 0===n?void 0:n.call(e))||t._calcedColor,d=h.prop("mode");if(!l)return;const p=h.prop("text")||l.getTooltipText(t,a);if(!p)return;const g=this.control,m=g.contentWidth(),f=g.contentHeight(),b=this._textView;this._richText.setFormat(p),this._richText.build(b,NaN,NaN,null,h.getTextDomain());const{w:y,h:w}=this.calcBounds(d,h);this._top.setFill(c);const x="visible"===this.getStyle("visibility")?300:0,v=h.prop("offset")+this._tailSize,C=e.getBounds(),S=g.getBounds();let L;L=i-y/2-u(0,_(i-y/2,m-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const M=pl.TOP;d===_l?(this.drawCircleTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")):d===ul?(this.drawHeaderTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-headermode-bg)"),b.setFill("var(--rm-tooltip-headermode-color)")):(this.drawLineTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")),s-=w+v,i=u(0,_(i-=y/2,m-y)),s=u(0,_(s,f-w)),this.transEx(i,s,x,!1),0===x&&this.internalSetStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.prop("hideDelay"):Xr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,o){const n=null!=i?H(e,i):{},a=H(e,s),h=t.animate([n,a],{duration:r,fill:"none"});h&&o&&h.addEventListener("finish",o)}(this.dom,"opacity",void 0,0,200,(()=>{this.internalSetStyle("visibility","hidden")}))}drawHeaderTooltip(t,e,i,s,r,o){const n=this._textView,a=this._radius,h=this._topHeight,l=r===pl.BOTTOM,c=this.drawPanelPath(t,e,i,s,r,o),d=l?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=n.bbox();t+=(i-_.width)/2,e+=(s-_.height+(l?-h:h))/2,n.trans(t,e),this._top.setPath(d),this._border.setPath(c),this._back.setPath(c)}drawCircleTooltip(t,e,i,s,r,o){const n=this._textView,a=n.bbox(),h=this.drawPanelPath(t,e,i,s,r,o),l=this._circleRadius,c=t+this._circlePaddingX+l,d=e+this._circlePaddingY+a.height/2-l+l,_=["M",c+l,d,"A",l,l,0,0,1,c,d+l,"A",l,l,0,0,1,c-l,d,"A",l,l,0,0,1,c,d-l,"A",l,l,0,0,1,c+l,d,"Z"];t+=this._circlePaddingX+this._gap+2*l,e+=this._circlePaddingY,n.trans(t,e),this._top.setPath(_),this._border.setPath(h),this._back.setPath(h)}drawLineTooltip(t,e,i,s,r,o){const n=this._textView;n.bbox();const a=this.drawPanelPath(t,e,i,s,r,o),h=i-2*this._linePaddingX1,l=this._lineWidth,c=t+this._linePaddingX1,d=e+this._linePaddingY,_=this._lineWidth/2,u=["M",c+_,d,"L",c+h-_,d,"Q",c+h,d,c+h,d+_,"L",c+h,d+l-_,"Q",c+h,d+l,c+h-_,d+l,"L",c+_,d+l,"Q",c,d+l,c,d+l-_,"L",c,d+_,"Q",c,d,c+_,d,"Z"];t+=this._linePaddingX2,e+=this._linePaddingY+this._lineGap+this._lineWidth,n.trans(t,e),this._top.setPath(u),this._border.setPath(a),this._back.setPath(a)}calcBounds(t,e){const i=this._textView.bbox();let s=0,r=0;return"header"===t?(s=u(e.prop("minWidth")||0,i.width+16),r=u(e.prop("minHeight")||0,i.height+12)):"circle"===t?(s=u(e.prop("minWidth")||0,i.width+2*this._circlePaddingX+this._gap+2*this._circleRadius),r=u(e.prop("minHeight")||0,i.height+2*this._circlePaddingY)):(s=u(e.prop("minWidth")||0,i.width+2*this._linePaddingX2),r=u(e.prop("minHeight")||0,i.height+2*this._linePaddingY+this._lineWidth+this._lineGap)),{w:s,h:r}}drawPanelPath(t,e,i,s,r,o){const n=this._tailSize,a=this._radius,h=[];return h.push("M",t+a,e),this._tailVisible&&r===pl.BOTTOM&&(h.push("L",t+i/2-n/2+o,e),h.push("L",t+i/2+o,e-n),h.push("L",t+i/2+n/2+o,e)),h.push("L",t+i-a,e),h.push("Q",t+i,e,t+i,e+a),this._tailVisible&&r===pl.LEFT&&(h.push("L",t+i,e+s/2-n/2+o),h.push("L",t+i+n,e+s/2+o),h.push("L",t+i,e+s/2+n/2+o)),h.push("L",t+i,e+s-a),h.push("Q",t+i,e+s,t+i-a,e+s),this._tailVisible&&r===pl.TOP&&(h.push("L",t+i/2+n/2+o,e+s),h.push("L",t+i/2+o,e+s+n),h.push("L",t+i/2-n/2+o,e+s)),h.push("L",t+a,e+s),h.push("Q",t,e+s,t,e+s-a),this._tailVisible&&r===pl.RIGHT&&(h.push("L",t,e+s/2+n/2+o),h.push("L",t-n,e+s/2+o),h.push("L",t,e+s/2-n/2+o)),h.push("L",t,e+a),h.push("Q",t,e,t+a,e),h}}gl.CLASS_NAME="rm-tooltip";class ml extends da{constructor(t){super(t,ml.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new Ut(t);this.add(e),e.add(this._boxLayer=new Ut(t)),this._boxes=new _a(this._boxLayer,ji,"rm-color-scale-box"),e.add(this._splitLayer=new Ut(t)),this._splits=new _a(this._splitLayer,ka,"rm-color-scale-split"),e.add(this._markerLabel=new ia(t,void 0)),e.add(this._marker=new Kt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new Ut(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new Ut(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new Ut(t,"rm-color-scale-null")),this._tickLines=new _a(this._tickLineLayer,ka),this._tickLabels=new _a(this._tickLabelLayer,ia),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 o=e.marker,n=e.tick,a=this._tickLen=+n.line.prop("length")||0,h=n.line,l=n.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.prop("reversed"),_=this._inverted=e.prop("inverted"),u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(o.visible)&&(this._markerSize=o.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(o,c,d,this._markerSize),this._markerLabel.setVisible(o.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==n.prop("minVisible")),e>1){t.last.setVisible(!1!==n.prop("maxVisible"));for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==n.prop("minVisible")),i>1){e.last.setVisible(!1!==n.prop("maxVisible"));for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,o=this._rScale,n=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-n.width)/2);break;case"right":c=Math.max(p,p+_-n.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-o.x,g-o.y)}$_getFillId(t){return`${ml.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,i){const s=t.createElementNS(e,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(t.createElementNS(e,"stop")),s.appendChild(t.createElementNS(e,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Ht.setAttrs(t,i?ml.VERT_FILL_I:ml.VERT_FILL):Ht.setAttrs(t,i?ml.HORZ_FILL_I:ml.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=[],o=e.getSteps();if(e.prop("solidFill"))if(o)this._boxes.prepare(o.length,((t,e)=>{t.internalSetStyle("fill",o[e]._color1)}));else{const t=this._stepCount,i=e.minColor,s=e.endColor;this._boxes.prepare(t,((e,r)=>{e.internalSetStyle("fill",Ge.interpolate(i,s,(r+1)/t).toString())}))}else if(o)o.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][vi]=e})),r.forEach((t=>{const e=t[vi];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(r.length,((t,e)=>{t.internalSetStyle("fill",this.$_getFillUrl(e))}));else{this._boxes.prepare(1);const o=this.$_createGradient(t,0);r.push(o),this.$_setDir(o,i,s),this.$_fillStops(o,e.minColor,e.endColor),this._boxes.first.internalSetStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new ji(t,"rm-color-scale-box")),e.add(this._nullLabel=new ia(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 o=this._markerSize,n=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",n),i?(h=s?t-o+1:o-1,l=(n?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(n?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-o+1:o),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,o=this._inverted,n=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=o?f+u:f,a>0&&(r?n.trans(0,y):n.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(o?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=o?m:m+u,a>0&&(r?n.trans(b,0):n.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((o?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,(o?e:i-1-e)*_,p,_):t.setBounds((o?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=n.tx,e=p,f=o?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=n.ty,i=g,o&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.prop("color")&&this._nullBar.setFill(t.prop("color")),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,o)}}ml.SCALE_CLASS="rm-color-scale",ml.SCALE_FILL="rm-color-scale-fill",ml.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},ml.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},ml.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},ml.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class fl extends Zt{constructor(t,e,i){super(t,fl.STYLE),this.add(this._back=new ji(t,fl.BACK_STYLE)),this.add(this._textView=new Ze(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,i){this.internalSetStyleOrClass(i),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),r=getComputedStyle(this._back.dom),o=(new Rt).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(o.left+s.width/2,o.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+o.left+o.right,height:s.height+o.top+o.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}fl.STYLE="rm-button",fl.BACK_STYLE="rm-button-background";class bl extends fl{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class yl extends na{}class wl extends yl{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new bl(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new bl(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new bl(t,"-",(()=>this.chart().body.zoomByFactor(-this.model.getZoomFactor()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,i,s){const r=this.chart().body.zoom,o=this._szBtn=e.getButtonSize(),n=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.prop("showReset"))?3:2;let h=0,l=0;return this._btnHome.setBoolData(Si,r<=100),this._btnDec.setBoolData(Si,r<=100),(this._vertical=e.vertical)?(h=o.width,l+=a*o.height+(a-1)*n):(l=o.height,h+=a*o.width+(a-1)*n),{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 xl extends yl{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)[Ci]),!0}_doMeasure(e,i,s,r){let o=this._btnBack,n=0,a=0;if("text"===i.prop("type")){null==o||o.remove(),this._textViews||(this._textViews=new _a(this,Ze,"rm-drilldown-text"),this._seperators=new _a(this,Ze,"rm-drilldown-separator"));const e=i.chart.firstVisible,s=this._history=e.getHistory();this._textViews.prepare(s.length,((e,i)=>{e.text=s[i].displayName(),e.anchor=t.TextAnchor.START,e[Ci]=s[i]})),this._seperators.prepare(s.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),o||this.add(o=this._btnBack=new bl(e,"<",(()=>{i.chart.drillup()}))),o.layout();const t=o.bbox();n=t.width,a=t.height}return{width:n,height:a}}_doLayout(t){if("text"===this.model.prop("type")){const t=this.model.prop("itemGap"),e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class vl extends da{constructor(t){super(t,vl.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new Ut(t);this.add(e),e.add(this._bubbleLayer=new Ut(t)),e.add(this._lineLayer=new Ut(t)),e.add(this._labelLayer=new Ut(t))}_doMeasure(t,e,i,s){const r=e.chart,o=this._steps=e.getSteps(r.width,r.height),n=o.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,o),this.$_layoutBubbles(2*n,o),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,o=this._rScale,n=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-n.width)/2);break;case"right":c=Math.max(p,p+_-n.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-o.x,g-o.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;Zt.fit(t,this._bubbleLayer,this._bubbles,r,bh,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Zt.fit(t,this._lineLayer,this._lines,r,ka,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Zt.fit(t,this._labelLayer,this._labels,r,ia,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const o=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-o.rd,o.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.prop("length")||0);this._lines.forEach(((i,o)=>{const n=e[o];i.setHLine(t-2*n.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.prop("length")+(i.tick.label.prop("offset")||0);this._labels.forEach(((s,o)=>{const n=e[o];s.setText(i.tick.label.getText(n.label)),s.trans(r,t-2*n.rd-s.bbox().height/2)}))}}}vl.SCALE_CLASS="rm-bubble-scale";class Cl extends da{constructor(t){super(t,Cl.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Cl.SCALE_CLASS="rm-map-scale";class Sl extends Ut{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new Ut(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new Ut(t,"rm-mapregion-body-labels"))}prepare(t,e,i){const s=e.chart,r=s.map;if(r){const{h1:i,h2:o}=r,n=e.scroll%360;this._h1=i+n,this._h2=o,this.$_prepareSeries(t,s,n),this._seriesViews.forEach((e=>{e.prepareLayout(t)}))}}layout(t,e){const i=t.chart,s=i.map,r=this.width,o=this.height;if(s){const{wMap:e,hMap:s,scale:n,tx:a,ty:h}=t.prepareLayout(this.width,this.height);this._transformInfo={tx:a,ty:h,scale:n,vx:0,vy:0};const l=`translate(${a}px, ${h}px) scale(${n}, ${-n})`,c=e*n,d=s*n;this._seriesViews.forEach((t=>{var e,i;t._scale=n,t.model.needMapScale()?(t._pointLayer.internalSetStyle("transform",l),t._calloutContainer.visible&&t._calloutContainer.internalSetStyles({transform:l})):t.trans(a,h),t.move(a,h),t.resize(c,d),t.render(r,o,this._transformInfo),null===(e=t._labelContainer)||void 0===e||e.trans(a,h),null===(i=t.secondLabelContainer())||void 0===i||i.trans(a,h)})),i.getProjection()}const n=this._clip;n&&n.parent&&n.width===r&&n.height===o||(n&&n.dom.remove(),this._clip=this.clipRect(0,0,r,o))}$_prepareSeries(t,e,i){const s=e.visibleSeries,r=this._seriesMap,o=this._seriesViews,n=this._h1,a=this._h2;o.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),o.length=0,s.forEach((e=>{const s=!r[e.hash],h=r[e.hash]||rl(t,e);h.parent||(h.$_setInRegion(),this._seriesContainer.add(h),this._labelsContainer.add(h._labelContainer),this._labelsContainer.add(h.secondLabelContainer())),r[e.hash]=h,o.push(h),h._h1=n,h._h2=a,s&&(e._optionsDirty=!0),h.prepareModel(t,e,i)}))}}class Ll extends aa{constructor(t){super(t,Ll.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new Sl(t)),this.add(this._targetView=new ji(t,"rm-mapregion-target")),this.add(this._connectorView=new Kt(t,"rm-mapregion-connector"))}update(t,e){this.measure(this.doc,this.model,t,e),this._layoutView(0,0,t,e,this._rTarget)}_layoutView(t,e,i,s,r){this._rTarget=r,this.resizeByMeasured(),this.layout(this.model.getPosition(t,e,i,s,this.width,this.height))}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=Dn.defaults.width:r.width=r.height),isNaN(r.height)&&(r.height=r.width),this._deflatePaddings(r),r}_doLayout(t){const e=this._rTarget,i=t.x||0,s=t.y||0;this.trans(i,s),this._background.resize(this.width,this.height),e.x-=i,e.y-=s,this._targetView.setRect(e),this._connectorView.setPath(this.$_getConnector(e)),this._bodyView.resize(this.width-1,this.height-1),this._bodyView.prepare(this.doc,this.model,this.chart().body),this._bodyView.layout(this.model,this.chart().body)}$_getConnector(t){const e=0+this.width,i=0+this.height;let s;return s=0>t.x?i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[0,0,t.x+t.width,t.y,0,i,t.x+t.width,t.y+t.height]:i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[e,0,t.x,t.y,e,i,t.x,t.y+t.height],`M ${s[0]} ${s[1]} L ${s[2]} ${s[3]} M ${s[4]} ${s[5]} L ${s[6]} ${s[7]}`}}Ll.CLASS_NAME="rm-mapregion";class Ml extends ha{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new dl(t,!1)),this.add(this.subtitleView=new dl(t,!0))}_doMeasure(t,e,i,s){const r=e._title,o=e._subtitle;let n,a=0,h=0,l=0,c=0,d=this.titleView,_=i,p=0,g=0;switch(d.setVisible(r.isVisible())?(n=d.measure(t,r,i,s),h=this._hTitle=n.height,a=this._wTitle=n.width):d.setModel(r),(d=this.subtitleView).setVisible(o.isVisible())?(n=d.measure(t,o,i,s),c=this._hSub=n.height,l=this._wSub=n.width,g=+o.prop("titleGap")||0):d.setModel(o),o.prop("position")){case"left":case"right":p=u(h,c),_=a+g+l;break;default:p=h+g+c,_=u(_,a+l)}return p>0&&(p+=this.titleView.visible?m(r.prop("gap"),0):m(o.prop("gap"),0)),{width:_,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,o=s&&s.visible?this._wTitle>t.wMap||"chart"===s.prop("alignBase")?t.wChart:t.wMap:0,n=r&&r.visible?this._wSub>t.wMap||"chart"===r.prop("alignBase")?t.wChart:t.wMap:0;let a=this._wTitle>t.wMap||s&&"chart"===s.prop("alignBase")?0:t.xMap,h=this._wSub>t.wMap||r&&"chart"===r.prop("alignBase")?0:t.xMap;if(o>0&&n>0){const t=(t,e,i)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},l=()=>{const e=u(this._hTitle,this._hSub);p=u(p,p+t(s,e,this._hTitle)),f=u(f,f+t(r,e,this._hSub))},c=(t,e,i)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},d=()=>{if(g=u(g,g+c(s,o,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":b=g;break;case"right":b=g+this._wTitle-this._wSub;break;default:b=g+(this._wTitle-this._wSub)/2}else b=u(b,b+c(r,n,this._wSub))},_=m(r.prop("titleGap"),0);let p=0,g=a,f=0,b=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"left":g=b+this._wSub+_,l();break;case"right":switch(b=g+this._wTitle+_,r.prop("align")){case"center":b=u(b,b+(n-this._wTitle-this._wSub)/2);break;case"right":b=u(b,h+n-this._wSub)}l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}break;case"right":switch(r.prop("position")){case"left":switch(g+=o-this._wTitle,r.prop("align")){case"center":b+=(o-this._wTitle-this._wSub)/2;break;case"right":b=g-_-this._wSub}l();break;case"right":b+=n-this._wSub,g=b-_-this._wTitle,l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}break;default:switch(r.prop("position")){case"left":switch(g+=(o-this._wTitle)/2,r.prop("align")){case"left":break;case"center":b+=(g-b-this._wSub)/2;break;case"right":b=g-_-this._wSub}l();break;case"right":switch(g+=(o-this._wTitle)/2,r.prop("align")){case"left":b=g+this._wTitle+_;break;case"center":b=g+this._wTitle+_,b+=(n-b-this._wSub)/2;break;case"right":b+=n-_-this._wSub}l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}}e.resizeByMeasured().layout().trans(g,p),i.resizeByMeasured().layout().trans(b,f)}else if(o>0||n>0){const t=o?s:r,l=o?e:i,c=o||n,d=o?this._wTitle:this._wSub;let _=o?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":_+=c-d;break;default:_+=(c-d)/2}l.trans(_,0)}}_doLocateInner(t,e,i){}}class Al extends da{constructor(t){super(t,Al.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new Ut(t,"rm-map-widget-group-widget-layer"))}getView(t){return this._dic.get(t)}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),o=this._gap=8,n=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new oa;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),n.forEach(((r,o)=>{r.measure(t,e.getWidget(o),i,s),this._dic.set(r.model,r)})),r?(n.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),n.length>1&&(a.height+=(n.length-1)*o)):(n.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),n.length>1&&(a.width+=(n.length-1)*o)),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,o=this._paddings,n=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+o.left,d=r.top+o.top;let _,u,p=this.width-c-r.right-o.right,g=this.height-d-r.bottom-o.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.prop("align")){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.prop("align")){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.prop("align")){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+n})):a.forEach((t=>{switch(t.model.prop("verticalAlign")){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+n}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return this._dic.clear(),e.forEach((e=>{let o=null==s?void 0:s.find((t=>t.model===e));o?(r.push(o),s.splice(s.indexOf(o),1)):(o=new(Pl[e._type()])(t),i.add(o),r.push(o))})),null==s||s.forEach((t=>t.remove())),r}}Al.GROUP_CLASS="rm-map-widget-group";const Pl={legend:pa,colorScale:ml,bubbleScale:vl,group:Al};class kl extends ha{constructor(t,e){super(t),this._loc=e,this._horz=e==tt.TOP||e==tt.BOTTOM,this._vert=e==tt.LEFT||e==tt.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){let e=this._views.get(t);if(!e)for(const i of this._views.values())if(i instanceof Al&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,i){return r(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof pa&&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 o=this._gap=m(+e.global.prop("widgetGap"),0),n=new oa;return this._horz?(r.forEach((t=>{n.width+=t.mw,n.height=u(n.height,t.mh)})),n.width+=r.size>0?(r.size-1)*o:0):this._vert?(r.forEach((t=>{n.width=u(n.width,t.mw),n.height+=t.mh})),n.height+=r.size>0?(r.size-1)*o:0):r.forEach((t=>{n.width+=t.mw,n.height+=t.mh})),n}_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,o=this.height,n=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(n,a),a+=t.height+s;o-=t,a=o;for(const t of this._ends)a-=t.height,t.trans(n,a),a-=s;o-=i,a=t+Math.max(0,Math.ceil((o-r)/2));for(const t of this._centers)t.trans(n,a),a+=t.height+s}else if(this._horz){let t=0,i=0,o=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)o+=t.width;o+=e(this._centers);for(const t of this._starts)t.trans(n,a),n+=t.width+s;r-=t,n=r;for(const t of this._ends)n-=t.width,t.trans(n,a),n-=s;r-=i,n=t+Math.max(0,Math.ceil((r-o)/2));for(const t of this._centers)t.trans(n,a),n+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=i.mw,o=i.mh;let n=+s.prop("offsetX")||0,a=0,h=0;switch(s.prop("align")){case"right":a+=t-r-n;break;case"center":a+=(t-r)/2+n;break;default:a+=n}switch(n=+s.prop("offsetY")||0,s.prop("verticalAlign")){case"bottom":h+=e-o-n;break;case"middle":h+=(e-o)/2+n;break;default:h+=n}i.trans(a,h).resize(r,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(Pl[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.prop("align")){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.prop("verticalAlign")){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class Il extends na{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Ze(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.prop("offsetX")||0,o=+t.prop("offsetY")||0;let n=0,a=0;switch(t.prop("verticalAlign")){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+o;break;default:a=e.y+o}switch(t.prop("align")){case"right":n=e.right-i-r;break;case"center":n=e.x+(e.width-i)/2+r;break;default:n=e.x+r}return{x:n,y:a}}locateOuter(t,e,i){const s=t.prop("location"),r=this.width,o=this.height,n=+t.prop("offsetX")||0,a=+t.prop("offsetY")||0;let h=0,l=0;switch(s){case"left":h=n;break;case"right":h=e-r-n;break;case"top":l=a;break;default:l=i-o-a}if("left"===s||"right"===s)switch(t.prop("verticalAlign")){case"top":l=a;break;case"bottom":l=i-o;break;default:l=(i-o)/2+a}else switch(t.prop("align")){case"left":h=n;break;case"center":h=(e-r)/2+n;break;default:h=e-r-n}return{x:h,y:l}}_doMeasure(t,e,i,s){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.bbox()}}class Nl extends Ut{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this._mapRegionViews=[],this._mapRegionMap=new Map,this.add(this._annotationContainer=new Ut(t,"rm-annotations")),this.add(this._bodyView=new cl(t,this)),this.add(this._mapRegionContainer=new Ut(t,"rm-mapregions")),this.add(this._titleSectionView=new Ml(t)),this.add(this._widgetLayer=new Ut(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new Ut(t,"rm-front-annotations")),this.add(this._zoomPanelView=new wl(t)),this.add(this._drilldownPanelView=new xl(t)),this.add(this._mapScaleView=new Cl(t)),this.add(this._creditView=new Il(t)),this.add(this._tooltipView=new gl(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,o=this._bodyView;let n,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible))switch(n=this._creditView.measure(t,r,a,h),r.prop("location")){case"body":break;case"right":case"left":a-=n.width+(+r.prop("offsetX")||0)+(+r.prop("gap")||0);break;default:h-=n.height+(+r.prop("offsetY")||0)+(+r.prop("gap")||0)}n=this._titleSectionView.measure(t,e,a,h),h-=n.height,o.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(tt)){const o=l[r];let n=this._widgetMap[r];if(o.length>0){n?n.setVisible(!0):(n=new kl(t,r),this._widgetLayer.add(n),this._widgetMap[r]=n);const l=n._setWidgets(o,i,s).measure(t,e,a,h);if(l){const t=e.global.getWidgetSectionGap(r);r===tt.BOTTOM||r===tt.TOP?h-=l.height+t:r!==tt.RIGHT&&r!==tt.LEFT||(a-=l.width+t)}}else n&&n.setVisible(!1)}o.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this.$_prepareMapRegions(t,e.getMapRegions()),this._mapRegionViews.forEach(((e,r)=>{e.measure(t,this._mapRegions[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const o=this._bodyView;let n=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){h.resizeByMeasured();const t=h.width+(+a.prop("offsetX")||0)+(+a.prop("gap")||0),e=h.height+(+a.prop("offsetY")||0)+(+a.prop("gap")||0);switch(a.prop("location")){case"body":break;case"right":s-=t;break;case"left":s-=t,c+=t;break;case"top":r-=e,d+=e;break;default:r-=l=e}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=n=_.height);const u=this._widgetMap;for(const o in u){const n=u[o];if(n.visible){o===tt.RIGHT||o===tt.LEFT?(n.resize(n.mw,i),n.layout()):o===tt.TOP||o===tt.BOTTOM?(n.resize(e,n.mh),n.layout()):n.resize(n.mw,n.mh);const a=t.global.getWidgetSectionGap(o);switch(o){case tt.BOTTOM:r-=n.height+a;break;case tt.TOP:r-=n.height+a,d+=n.height+a;break;case tt.RIGHT:s-=n.width+a;break;case tt.LEFT:s-=n.width+a,c+=n.width+a}}}const p=dt.create(c,d,s,r);if(h.visible){const t="body"===a.prop("location")?h.locateInner(a,p):h.locateOuter(a,e,i);h.transp(t)}o.trans(p.x,p.y),o.resize(p.width,p.height),o.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case tt.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case tt.TOP:d=n+0,c=(e-s.width)/2;break;case tt.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case tt.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this.$_layoutMapRegions(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:o}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},n=this._model.chart._tooltip.isFollowPointer(t),a=(n?s.x:r)-this.tx,h=(n?s.y:o)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model&&this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),o=this._bodyView.mouseToMap(r,!1);let n;i instanceof Oh&&(n=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),n||(n=this._model.map.findByCoord(o)),r.coord=o,r.area=null==n?void 0:n.id,r.chart=this._model.wrapper,this._model.click(r)}}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}zoomChanged(t,e){this._bodyView.zoomChanged(t,e)}isAnimating(){}onScrollStart(){this.bodyView().onScrollStart()}onRotationStart(){this.bodyView().onRotationStart()}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);o.forEach((t=>{r.get(t.model)||t.remove()})),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ol(t,e);(!1===e.prop("front")?i:s).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,o,n,a;this._annotationViews.forEach((i=>{if("container"===i.model.prop("scope"))r=-s.left,o=-s.top,n=t+s.left+s.right,a=e+s.top+s.bottom;else r=o=0,n=t,a=e;i._layoutView(this,r,o,n,a)}))}$_prepareMapRegions(t,e){const i=this._mapRegionContainer,s=this._mapRegionMap,r=this._mapRegionViews;for(const t of s.keys())e.indexOf(t)<0&&s.delete(t);r.forEach((t=>{s.get(t.model)||t.remove()})),r.length=0,(this._mapRegions=e).forEach((e=>{const o=s.get(e)||new Ll(t);i.add(o),s.set(e,o),r.push(o)}))}$_layoutMapRegions(t,e,i){const s=this._bodyView,r=this.tx+s.tx,o=this.ty+s.ty,n=this.control._padding;let a,h,l,c;this._mapRegionViews.forEach((i=>{const d=s.boundsByCoord(i.model.prop("bounds")[0],i.model.prop("bounds")[1]);if("container"===i.model.prop("scope"))a=-n.left,h=-n.top,l=t+n.left+n.right,c=e+n.top+n.bottom;else a=h=0,l=t,c=e;d.x+=r,d.y+=o,i._layoutView(a,h,l,c,d)}))}$_layoutPanel(t,e){const i=t.model,s=i.prop("offsetX")||0,r=i.prop("offsetY")||0,o=t.width,n=t.height;let a=e.x,h=e.y;switch(i.prop("verticalAlign")){case"bottom":h+=e.height-r-n;break;case"middle":h+=(e.height-n)/2+r;break;default:h+=r}switch(i.prop("align")){case"right":a+=e.width-s-o;break;case"center":a+=(e.width-o)/2+s;break;default:a+=s}t.trans(a,h)}}var El;!function(t){t.EXPORT="$$realmap_export"}(El||(El={}));class Tl extends Yt{constructor(t,e){super(t,e),this._isLoading=!1,this.addElement(this._chartView=this._createChartView(t)),this.addElement(this._errorView=new Ze(t,"rm-error-view")),this._chart=new qn(null,((t,e)=>{this.changeModel(t,e)})),this._errorView.visible=!1}_createChartView(t){return new Nl(t)}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e,i){this._chartView.zoomChanged(e,i),this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this.$_export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i},!1)}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===El.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}setLoading(t){this._isLoading=t}showErrorView(e="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=t.TextLayout.MIDDLE,this._errorView.text=e,this._errorView.stain();const{width:i,height:s}=this._errorView.bbox(),r=16+i/2,o=16+s/2;this._errorView.trans(r,o)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new ra(this)}_doBeforeRender(t){this._chart&&t.internalResetStyleOrClass(this._chart.global.prop("style"))}_doRender(t){const e=this.model,i=this._chartView,s=t.width,r=t.height;this._setBackgroundStyle(e.global.prop("backgroundStyle")),e&&(this.setResizeDelay(e.global.prop("resizeDelay")),e.prepareRender(),this.$_loadModules()),this.loaded||i.clean(),i.measure(this.doc(),e,s,r),i.setRect(t),i.layout(),e&&e.afterRender()}_doAfterRender(){var t;if(this._chartView.bodyView().afterRender(),null===(t=this._chart)||void 0===t?void 0:t._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}isLoading(){return this._isLoading}_doWheel(t){var e;return!(null===(e=this.model)||void 0===e?void 0:e.global.prop("wheelDisabled"))}$_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}$_export(t){if(!this.model||!this.chart.exporter.isCompose())return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(e,t)}}}const Vl={chartControl:Tl};class Dl{static getVersion(){return"1.1.12"}static setLicenseKey(t){Ft.code=t}static setDebugging(t){Zt.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static getDistance(t,e){return ht.getDistance(t,e)}static setGlobals(t){Object.assign(Vl,t)}static createChart(t,e,i,s=!0,r){v.loadConfigAsync(i,!0);const o=new Vl.chartControl(t,e);return Dl.loadChart(o,i,s,r),o.chart[Xn]=o,o.chart}static async createChartAsync(t,e,i,s=!0,r){const o=new Zn(t,e);o.show();let n=null;try{await v.loadConfigAsync(i),n=new Vl.chartControl(t,e),n.setLoading(!0),n.chart[Xn]=n,Dl.loadChart(n,i,s,r)}catch(t){Un.handleChartInitError(t,n)}finally{null==n||n.setLoading(!1),o.hide(),o.dispose()}return n.chart}static preset(t,e){return Pr.createStockInset(t,e)}static loadChart(t,e,i,r){t.chart.load(s(e)?e:{},i,r)}}class Rl{constructor(){this._moduleMap=new Map}static getInstance(){return Rl.instance||(Rl.instance=new Rl),Rl.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Rl.instance=null,Rl.ModuleNames={realchart:"realchart"};const $l=Dl.getVersion,Ol=Dl.setDebugging,Fl=Dl.setLogging,Bl=Dl.setGlobals,zl=Dl.getDistance,jl=Dl.createChart,Gl=Dl.createChartAsync,Hl=Dl.preset,Wl=Dl.setLicenseKey;t.Annotation=$i,t.AnnotationView=ma,t.BandSeriesType="band",t.BarSeries=wo,t.BarSeriesView=hh,t.Body=zn,t.BodyView=cl,t.BubbleSeries=Ps,t.BubbleSeriesView=ch,t.ChartAnnotationType="chart",t.ChartControl=Tl,t.ChartElement=na,t.ChartItem=ai,t.ChartObject=Hn,t.ChartView=Nl,t.CircleElement=bh,t.CircleGauge=Io,t.CircleGaugeView=fh,t.ClockGauge=zo,t.ClockGaugeView=xh,t.Color=Ge,t.ColorRanger=$s,t.CoordBaseSeries=gs,t.Credits=xi,t.DEG_RAD=I,t.DataPoint=qi,t.DataPointLabel=Qi,t.Dom=Ht,t.DragTracker=Jn,t.ElementPool=_a,t.Exporter=Us,t.ExternalModuleManager=Rl,t.FeatureSeriesType="feature",t.FigureSeries=Ho,t.FigureSeriesView=Ch,t.GLPointSeriesType="glpoint",t.HeatmapSeriesType="heatmap",t.HtmlAnnotation=Qr,t.HtmlAnnotationView=el,t.HtmlSeries=Zo,t.HtmlSeriesView=sl,t.ImageAnnotation=to,t.ImageAnnotationView=Ka,t.ImageElement=Wn,t.ImageSeries=qo,t.ImageSeriesView=Lh,t.LayerElement=Ut,t.Legend=Ds,t.LineElement=ka,t.LineSeries=tn,t.LineSeriesView=Ph,t.MapArea=Or,t.MapAxis=hr,t.MapAxisBandGuide=rr,t.MapAxisGuide=ir,t.MapAxisLineGuide=sr,t.MapAxisRangeGuide=or,t.MapChart=qn,t.MapCrosshair=ar,t.MapSeries=hn,t.MapSeriesType="map",t.MapSeriesView=Oh,t.MapTool=ra,t.MarkerSeries=fs,t.MarkerSeriesPoint=ms,t.MarkerSeriesPointView=Ga,t.MarkerSeriesView=Ha,t.ORG_ANGLE=k,t.OrthogonalSparkSeries=vs,t.PI=A,t.PI_2=P,t.PanelSeries=pn,t.PanelSeriesView=Gh,t.PathElement=Kt,t.PieSeries=fn,t.PieSeriesView=Yh,t.PinSeries=wn,t.PinSeriesView=Uh,t.PointElement=Oa,t.PointLabelView=Ta,t.PointSeries=Mn,t.PointSeriesView=qh,t.PointViewPool=Ea,t.PolyLineElement=Ia,t.RAD_DEG=N,t.RectElement=ji,t.RegionSeriesType="region",t.RmElement=Zt,t.RouteSeries=kn,t.RouteSeriesType=zi,t.RouteSeriesView=Jh,t.SVGNS=e,t.SankeySeriesType="sankey",t.SectionView=ha,t.SectorElement=dh,t.Series=ds,t.SeriesAnimation=th,t.SeriesView=za,t.ShapeAnnotation=eo,t.ShapeAnnotationView=Ja,t.Size=oa,t.SparkSeries=ws,t.Subtitle=Ur,t.TableSeriesType="table",t.TextAnnotation=io,t.TextAnnotationView=Qa,t.TextElement=Ze,t.TiledWebSeriesType="tiledweb",t.Title=Zr,t.TrackSeriesType="track",t.Utils=ht,t.ValuePoint=us,t.ValueSeries=ps,t.VectorSeriesType="vector",t.WaffleSeries=Nn,t.WaffleSeriesView=tl,t._isIE=at,t.absv=p,t.assignObj=l,t.calcPercent=Y,t.ceil=V,t.copyObj=g,t.cos=c,t.createChart=jl,t.createChartAsync=Gl,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=ri,t.fixnum=D,t.floor=T,t.getDistance=zl,t.getVersion=$l,t.incv=w,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=s,t.isString=n,t.maxv=u,t.minv=_,t.parseCoord=function(t){if(r(t))return[+t[0],+t[1]];if(n(t)){const e=t.split(Ai);return[+e[0],+e[1]]}if(s(t)){if(t&&!isNaN(t.lon)&&!isNaN(t.lat))return[t.lon,t.lat];if(!isNaN(t.x)&&!isNaN(t.y))return[t.x,t.y]}return[0,0]},t.parsePercentSize=W,t.pickNum=m,t.pickProp=b,t.pickProp3=y,t.pixel=O,t.preset=Hl,t.rectToSize=ct,t.setDebugging=Ol,t.setGlobals=Bl,t.setLicenseKey=Wl,t.setLogging=Fl,t.sin=d}));
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",i=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,o=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,c=Math.cos,d=Math.sin,_=Math.min,u=Math.max,p=Math.abs,g=function(t){if(t&&"object"==typeof t&&!r(t))return l({},t)},m=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},f=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},b=function(t,e){return void 0!==t?t:e},y=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},w=(t,e,i)=>t+(e-t)*i;class x{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}x._debugging=!1;class v{static async loadConfigAsync(t,e=!1){if(t&&!t.map&&console.warn("지도 설정이 비어 있습니다. map 옵션을 지정하세요."),t&&t.map){if(n(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const i=r(t.map)?t.map:[t.map];for(const t of i){const i=s(t.source),r=t.url&&n(t.url);i||r?i||(r&&e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url)):console.warn("지도 소스가 지정되지 않았습니다. source 옵션을 사용하거나 url옵션을 지정하세요. 만약 url 옵션을 사용한다면, 반드시 RealMap.createChartAsync()로 생성해야 합니다.")}}if(t&&t.series){const i=r(t.series)?t.series:[t.series];for(const t of i)if(!s(t.data)&&!r(t.data)&&t.dataUrl&&n(t.dataUrl))if(e)console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl);else{const e=await this.fetchJson(t.dataUrl);delete t.dataUrl,r(e)&&o(t.dataFilter)?t.data=e.filter(t.dataFilter):t.data=e}}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const C={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 S=C.ko;const L=void 0,M="%".charCodeAt(0),A=Math.PI,P=2*A,k=-A/2,I=A/180,N=180/A;function E(t){return t>P?t%P:t}const T=Math.floor,V=Math.ceil;function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function F(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const i={};return i[t]=e,i}function W(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===M&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;q(S.invalidSizeValue,t)}}return{size:s,fixed:i}}function Y(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const Z={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},U=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var X;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(X||(X={}));const q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),i=m(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]);return{l:isNaN(o)?isNaN(s)?i:s:o,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const it="undefined"!=typeof navigator?navigator.userAgent:"",st=it?navigator.appVersion:"",rt=!!it.match(/Trident.*rv\:11\./),ot=-1!==(null==st?void 0:st.indexOf("MSIE 10")),nt=-1!==(null==st?void 0:st.indexOf("MSIE 9")),at=rt||ot||nt;let ht=class t{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(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(_(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),o=new Date(r,s,1).getDay(),n=new Date(r,s+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!r(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(r(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-et}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=u(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=u(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=r(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(e,i){const s=+new Date;i(),t.log(e,+new Date-s+"ms")}static clamp(t,e,i){return u(e,_(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=u(e,t)),isNaN(i)||(t=_(i,t)),t}static makeIntArray(t,e){const i=new Array(u(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=p(t);if(s>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*I,s=(e[1]-t[1])*I,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*I)*Math.cos(e[0]*I)*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=_(e,t[s]),i=u(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(null!=e&&""!==e&&(this.isObject(t)||r(t))){const i=String(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),o=10**Math.floor(Math.log10(r)),n=r/o;let a;a=n<=1?1:n<=2?2:n<=5?5:10,a*=o;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(D(h+t*a));return l}};ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];const lt=Object.freeze({x:0,y:0,width:0,height:0});function ct(t){return{width:t.width,height:t.height}}class dt{static create(t,e,i,s){const r=arguments.length;return ht.isObject(t)?new dt(t.x,t.y,t.width,t.height):r<2?new dt(t,t,t,t):r<3?new dt(t,e,t,e):new dt(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new dt(this.x,this.y,this.width,this.height)}getInner(){return new dt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}dt.Empty=new dt,dt.Temp=new dt;const _t={inOutSine:t=>-(c(A*t)-1)/2};class ut{constructor(){this.delay=0,this.duration=ut.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=_(1,u(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return isNaN(t)||(this.duration=t),this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,i=null){this._started&&this._stop(),this.duration=m(t,ut.DURATION),this.delay=e||0,this._easing=_t[i],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}ut.DURATION=700,ut.SHORT_DURATION=300;const pt=Object.prototype.hasOwnProperty,gt=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},mt=Array.isArray,ft=Math.min,bt=Math.max,yt=Math.abs;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const wt="undefined"!=typeof navigator?navigator.userAgent:"",xt=wt?navigator.appVersion:"";wt.match(/Trident.*rv\:11\./),xt?.indexOf("MSIE 10"),xt?.indexOf("MSIE 9");const vt=(new Date).getTime(),Ct=class t{static setLogging(t){this.LOGGING=t}static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static warn(...t){this.LOGGING&&console.warn(...t)}static warnIf(t,...e){this.LOGGING&&t&&console.warn(...e)}static now(){return+new Date}static parseDate(t,e){const i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(ft(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),o=new Date(r,s,1).getDay(),n=new Date(r,s+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-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&&!mt(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return mt(t)?t:void 0}static makeArray(t,e=!1){return null!=t?mt(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return mt(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(mt(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 mt(t)?t:null!=t?[t]:null}static copyArray(t){return mt(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNum(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNum(t,e=0){const i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-vt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=bt(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=bt(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const i=mt(e)?[]:{};for(let s of Object.keys(e))i[s]=t.deepClone(e[s]);return i}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return bt(e,ft(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=bt(e,t)),isNaN(i)||(t=ft(i,t)),t}static makeIntArray(t,e){const i=new Array(bt(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=yt(t);if(s>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],i=t[0];for(let s=1;s<t.length;s++)e=ft(e,t[s]),i=bt(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||mt(t))?e.split(".").reduce(((t,e)=>t?t[e]:void 0),t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let o=0;o<s;o++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};Ct.LOGGING=!1,Ct.week_days=["일","월","화","수","목","금","토"],Ct.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],Ct.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];let St=Ct;const Lt=["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"],Mt=["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"],At=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(St.startsWith(e,"rgb(")&&St.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(St.startsWith(e,"rgba(")&&St.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(St.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return"string"==typeof e?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,o=.5){const n=new t(null);return r<o?(n.r=Math.ceil(e.r+(i.r-e.r)*(r/o)),n.g=Math.ceil(e.g+(i.g-e.g)*(r/o)),n.b=Math.ceil(e.b+(i.b-e.b)*(r/o)),n.a=(i.a+e.a)/2):(n.r=Math.ceil(i.r+(s.r-i.r)*((r-o)/(1-o))),n.g=Math.ceil(i.g+(s.g-i.g)*((r-o)/(1-o))),n.b=Math.ceil(i.b+(s.b-i.b)*((r-o)/(1-o))),n.a=(s.a+i.a)/2),n}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};At.TRANSPARENT=new At("rgba(0,0,0,0)"),At.WHITE=new At("rgb(255,255,255)"),At.BLACK=new At("rgb(0,0,0)"),At.COLORS=function(){const t={};for(let e=0;e<Lt.length;e++)t[Lt[e]]=Mt[e];return t}();let Pt=0;class kt{constructor(){this._hash=++Pt,this._disposed=!1,this._disposing=!1}dispose(){return this._disposed||this._disposing||(this._disposing=!0,this._doDispose(),this._disposed=!0),null}_doDispose(){}get hash(){return this._hash}get disposing(){return this._disposing}get orphaned(){return this._disposed}_throwError(t){throw new Error(t)}}class It extends Error{}const Nt=function(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(mt(t)&&mt(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Nt(t[i],e[i]))return!1;return!0}if(gt(t)&&gt(e)){const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;for(const s of i){if(!pt.call(e,s))return!1;if(!Nt(t[s],e[s]))return!1}return!0}return!1},Et=function(t,e){const i=gt(t)?t:{};for(const t in e)if(pt.call(e,t)){let s=e[t];mt(s)?i[t]=s.slice(0):s instanceof Date?i[t]=new Date(s):gt(s)?i[t]=Et(i[t],s):i[t]=s}return i},Tt=class t extends kt{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}_doDispose(){this._children&&(this._children.forEach((t=>t.dispose())),this._children=void 0)}prop(t,e){const i=this._op[t];return void 0!==i?i:void 0!==e?e:this.constructor.defaults[t]}num(t,e){return function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t}(this._op[t],e,this.constructor.defaults[t])}bool(t,e,i=!1){const s=this._op[t];return void 0===s?e??this.constructor.defaults[t]??i:Boolean(s)}propAt(t,e){const i=this._resolvePath(t);if(-1!==i)return 0===i?this.prop(t,e):i.rest?i.child.propAt(i.rest,e):void 0}numAt(t,e){const i=this._resolvePath(t);return-1===i?NaN:0===i?this.num(t,e):i.rest?i.child.numAt(i.rest,e):NaN}boolAt(t,e,i=!1){const s=this._resolvePath(t);return-1!==s&&(0===s?this.bool(t,e,i):!!s.rest&&s.child.boolAt(s.rest,e,i))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){const t=e[r];s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);return e?e.saveOptions():this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t){return this.clearOptions(!0),this.$_load(t)}saveOption(t){return this._children&&this._children.has(t)?this._findChild(t).saveOptions():this._op[t]}saveOptions(t,e=!1,i=!1){const s={};let r,o;return mt(t)?r=t:gt(t)&&(r=Object.keys(t),o=t),this._doSave(s,r,this.constructor.defaults,e,i,o),s}saveTo(t,e,i=!1,s=!1){let r,o;return mt(e)?r=e:gt(e)&&(r=Object.keys(e),o=e),this._doSave(t,r,this.constructor.defaults,i,s,o),t}updateOptions(t,e=!0){const i=this._op;let s,r;if(void 0!==t&&!this._doSetSimple(i,t)){const e={};for(const i in t)this._findChild(i)?(s??=[]).push(i):t[i]!==this.prop(i)&&(this.$_validateOptions(i,t[i]),e[i]=t[i],(r??=[]).push(i));Et(i,e)}return this._doApply(i),s?.forEach((e=>this._findChild(e).updateOptions(t[e]))),e&&this._optionChanged(r),this}updateOption(t,e,i=!0,s=!1){const r=this._findChild(t);if(r)r.updateOptions(e);else{const r=this._op;(s||e!==this.prop(t))&&(this.$_validateOptions(t,e),mt(e)?e=e.slice(0):e instanceof Date?e=new Date(e):gt(e)&&(e=Et({},e)),r[t]=e,this._doApply(r),i&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r="boolean"!=typeof s||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(t,e=!0){const i=this._op,s=this._findChild(t);return s?s.clearOptions(!0):pt.call(i,t)&&(delete i[t],this._doApply(i),e&&this._optionChanged(t)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);return-1===r?this:0===r?this.updateOption(t,e,i,s):r.rest?r.child.updateAt(r.rest,e,i,s):(r.child.updateOptions(e,i),this)}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}removeAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.removeAt(i.rest,e):(i.child.clearOptions(!0,e),this)}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach((t=>e(t))),i._doApply(i._op)}(this),e&&this._optionChanged(),this}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))Nt(s[t],r[t])&&delete s[t];t&&i._children&&i._children.forEach((t=>e(t)))}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e._init(),e}_findChild(t){return this._children?.get(t)}_isChildCollection(t){return!1}_getChildItem(t,e){}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._findChild(i);if(r)return{child:r,rest:s};if(s&&this._isChildCollection(i)){const t=s.indexOf("."),e=t<0?s:s.substring(0,t),r=this._getChildItem(i,e);if(r)return{child:r,rest:t<0?"":s.substring(t+1)}}return e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_doLoad(t,e){for(const i in e)if(pt.call(e,i)){let s,r=e[i];this._doLoadProp(i,r)||((s=this._findChild(i))?s.$_load(r):mt(r)?t[i]=r.slice(0):r instanceof Date?t[i]=new Date(r):gt(r)?t[i]=Object.assign({},r):t[i]=r)}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doApply(t){}_doSave(t,e,i,s,r,o){const n=this._op,a=e&&e.length>0,h=a?e:Object.keys(n);for(const e of h){if(this._children?.has(e))continue;const s=pt.call(n,e);if(!s&&!r)continue;const o=s?n[e]:i[e],a=i[e];!r&&Nt(o,a)||this._doSaveProp(e,o)||(mt(o)?t[e]=this._doSaveArray(e,o)||o.slice():void 0!==o&&(t[e]=o))}this._children?.forEach(((i,n)=>{if(a&&e.indexOf(n)<0)return;const h=null!=o&&pt.call(o,n);if(s||h){const e=h&&gt(o[n])?o[n]:void 0,s=i.saveOptions(e,!0,r);(r||Object.keys(s).length>0)&&(t[n]=s)}}))}_doSaveProp(t,e){return!1}_doSaveArray(e,i){return i.map((e=>e instanceof t?e.saveOptions([],!0):e))}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof It?e:new It(`Invalid value for option "${t}": ${e.message}`)}}_doValidateOptions(t,e){}};Tt.defaults={};let Vt=Tt;class Dt extends kt{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 Rt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new Rt(t,t,t,t):new Rt(t,t,e,e):new Rt(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 Rt(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=m(t.paddingLeft,0),this.right=m(t.paddingRight,0),this.top=m(t.paddingTop,0),this.bottom=m(t.paddingBottom,0),this}applyMargin(t){return this.left=m(t.marginLeft,0),this.right=m(t.marginRight,0),this.top=m(t.marginTop,0),this.bottom=m(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 $t;Rt.Empty=Object.freeze(new Rt),Rt.Temp=new Rt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}($t||($t={}));const Ot={name:"RealMap",version:"1.1.13",license:"enterprise",code:""},Ft={name:"RealMap",version:"1.1.13",license:"enterprise",code:null};class Bt{static decode(t){const e=Bt.CHARS,i=Bt.PAD;let s=t.split(""),r=[],o=s.length;for(;s[--o]==i;);for(let t=0;t<o;){let i=e.indexOf(s[t++])<<18;t<=o&&(i|=e.indexOf(s[t++])<<12),t<=o&&(i|=e.indexOf(s[t++])<<6),t<=o&&(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}}Bt.PAD="=",Bt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class zt{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 o=e.s0[255&t];let n=(o>>16)+(r>>16)+((65535&o)+(65535&r)>>16)<<16|(65535&o)+(65535&r)&65535;return n=(n>>16^s>>16)<<16|65535&(65535&n^65535&s),(n>>16)+(i>>16)+((65535&n)+(65535&i)>>16)<<16|(65535&n)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=zt.xor,s=zt.union;let r=t.left,o=t.right;r=i(r,e.p[0]),o=i(o,i(s(r,e),e.p[1])),r=i(r,i(s(o,e),e.p[2])),o=i(o,i(s(r,e),e.p[3])),r=i(r,i(s(o,e),e.p[4])),o=i(o,i(s(r,e),e.p[5])),r=i(r,i(s(o,e),e.p[6])),o=i(o,i(s(r,e),e.p[7])),r=i(r,i(s(o,e),e.p[8])),o=i(o,i(s(r,e),e.p[9])),r=i(r,i(s(o,e),e.p[10])),o=i(o,i(s(r,e),e.p[11])),r=i(r,i(s(o,e),e.p[12])),o=i(o,i(s(r,e),e.p[13])),r=i(r,i(s(o,e),e.p[14])),o=i(o,i(s(r,e),e.p[15])),r=i(r,i(s(o,e),e.p[16])),t.right=r,t.left=i(o,e.p[17])}static _decryptBlock(t,e){const i=zt.xor,s=zt.union;let r=t.left,o=t.right;r=i(r,e.p[17]),o=i(o,i(s(r,e),e.p[16])),r=i(r,i(s(o,e),e.p[15])),o=i(o,i(s(r,e),e.p[14])),r=i(r,i(s(o,e),e.p[13])),o=i(o,i(s(r,e),e.p[12])),r=i(r,i(s(o,e),e.p[11])),o=i(o,i(s(r,e),e.p[10])),r=i(r,i(s(o,e),e.p[9])),o=i(o,i(s(r,e),e.p[8])),r=i(r,i(s(o,e),e.p[7])),o=i(o,i(s(r,e),e.p[6])),r=i(r,i(s(o,e),e.p[5])),o=i(o,i(s(r,e),e.p[4])),r=i(r,i(s(o,e),e.p[3])),o=i(o,i(s(r,e),e.p[2])),r=i(r,i(s(o,e),e.p[1])),t.right=r,t.left=i(o,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=zt.kb,s=zt._encryptBlock;let r,o,n,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*zt.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,n=c.p.length;r<n;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(o=0,n=c["s"+r].length;o<n;)s(l,c),c["s"+r][o++]=l.left,c["s"+r][o++]=l.right;return c}static decrypt(t,e){const i=zt._decryptBlock;let s=zt._init(e),r=[],o=Bt.decode(t),n=o.length>>3,a=0,h={left:null,right:null};for(let t=0;t<n;t++){h.left=o[a]*zt.POW24|o[a+1]*zt.POW16|o[a+2]*zt.POW8|o[a+3],h.right=o[a+4]*zt.POW24|o[a+5]*zt.POW16|o[a+6]*zt.POW8|o[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)}}zt.POW2=Math.pow(2,2),zt.POW3=Math.pow(2,3),zt.POW4=Math.pow(2,4),zt.POW8=Math.pow(2,8),zt.POW16=Math.pow(2,16),zt.POW24=Math.pow(2,24),zt.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 jt{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 o=r.split(".").length,n=r.indexOf("*");if(o>=2&&o<=4&&n>=2){const t=r.substring(0,n);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=zt.decrypt(t,"dkdl"+this._getLDKey(zt.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],o=s[1];o&&o.length>0&&(e[r]=o)}return e}}let Gt=651212;class Ht{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static isChildOf(t,e){let i=t;for(;i;){if(i.classList.contains(e))return i;i=i.parentElement}}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,o=e.documentElement,n=i.pageYOffset||o.scrollTop||r.scrollTop,a=i.pageXOffset||o.scrollLeft||r.scrollLeft,h=o.clientTop||r.clientTop||0,l=o.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+n-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 o=t.style;o.left=e+"px",o.top=i+"px",o.width=s+"px",o.height=r+"px"}static setBoundsEx(t,e,i,s,r){const o=t.style;!isNaN(e)&&(o.left=e+"px"),!isNaN(i)&&(o.top=i+"px"),!isNaN(e)&&(o.width=s+"px"),!isNaN(e)&&(o.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;)Ht.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,o="none"){const n={},a={};return n[e]=i,a[e]=s,t.animate([n,a],{duration:r,fill:o})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+Gt++}static 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){x.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!at&&t.setAttribute("vector-effect","non-scaling-stroke")}static isIntersectRectPath(t,e,i=1){const s=t.getBBox(),r=e.getBBox(),o=t.getCTM(),n=e.getCTM();if(!o||!n)return console.warn("CTM is null — element may not be in DOM or in an <svg> tree"),!1;const a=[new DOMPoint(s.x,s.y).matrixTransform(o),new DOMPoint(s.x+s.width,s.y).matrixTransform(o),new DOMPoint(s.x,s.y+s.height).matrixTransform(o),new DOMPoint(s.x+s.width,s.y+s.height).matrixTransform(o)],h=[new DOMPoint(r.x,r.y).matrixTransform(n),new DOMPoint(r.x+r.width,r.y).matrixTransform(n),new DOMPoint(r.x,r.y+r.height).matrixTransform(n),new DOMPoint(r.x+r.width,r.y+r.height).matrixTransform(n)],l=Math.min(...a.map((t=>t.x))),c=Math.max(...a.map((t=>t.x))),d=Math.min(...a.map((t=>t.y))),_=Math.max(...a.map((t=>t.y))),u=Math.min(...h.map((t=>t.x))),p=Math.max(...h.map((t=>t.x))),g=Math.min(...h.map((t=>t.y))),m=Math.max(...h.map((t=>t.y)));if(c<u||p<l||_<g||m<d)return!1;const f=e.getTotalLength(),b=t.ownerSVGElement.createSVGPoint();for(let t=0;t<=f;t+=i){const{x:i,y:s}=e.getPointAtLength(t);b.x=i,b.y=s;const r=b.matrixTransform(n);if(r.x>=l&&r.x<=c&&r.y>=d&&r.y<=_)return!0}const y=n.inverse();for(const t of a){const i=t.matrixTransform(y);if(e.isPointInFill(i))return!0}return!1}}const Wt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Yt extends kt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this.$_updateBlockDrag(t),this._doTouchStart(t),null===(e=this._tool)||void 0===e||e.touchStart(t)},this._touchMoveHandler=t=>{var e;t.touches.length<2&&this._scrolling?t.preventDefault():(this._doTouchMove(t),null===(e=this._tool)||void 0===e||e.touchMove(t))},this._touchEndHandler=t=>{var e;this._doTouchEnd(t),null===(e=this._tool)||void 0===e||e.touchEnd(t)},this._pointerDownHandler=t=>{var e;this.$_updateBlockDrag(t),this._doPointerDown(t)||null===(e=this._tool)||void 0===e||e.pointerDown(t)},this._pointerMoveHandler=t=>{var e;this._doPointerMove(t),null===(e=this._tool)||void 0===e||e.pointerMove(t)},this._pointerUpHandler=t=>{var e;this._doPointerUp(t),null===(e=this._tool)||void 0===e||e.pointerUp(t),this._blockDrag=!0},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t),this._blockDrag=!0},this._pointerLeaveHandler=t=>{var e;this._doPointerLeave(t),null===(e=this._tool)||void 0===e||e.pointerLeave(t)},this._keyPressHandler=t=>{var e;this._doKeyPress(t),null===(e=this._tool)||void 0===e||e.keyPress(t)},this._wheelHandler=t=>{var e;this._doWheel(t)&&(null===(e=this._tool)||void 0===e||e.wheel(t))},function(){const t=location.hostname;let e;try{if(e=Ft.code||realMapLic,!e)return!1}catch(t){return!1}const i=jt.decrypt(e);if("RealMap"!=i.name||"RealMap"!==Ot.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Ot.license!=$t.Developer&&!jt.includedDomains(s,t.toLowerCase(),r))return!1;const o=i.lic.toLowerCase();if(!Object.values($t).includes(o))return!1;if(Ot.code=i.code,Ot.license=i.lic,o==$t.Evaluation||o==$t.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||Yt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(this._dom),this._inited=!0,this._blockDrag=!0,this.invalidate(!0)):console.error("need license!")}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Ht.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)}isLoading(){return!1}isDraggable(){return!this._blockDrag}clearDefs(){const t=Array.from(this._defs.children).filter((t=>"true"===t.dataset.essential));for(const e of t)this._defs.removeChild(e);Ht.clearChildren(this._defs);for(const e of t)this._defs.appendChild(e)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}removeElement(t){this._root.removeChild(t)}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}hasDef(t){return!!this._defs.querySelector("#"+t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new ee(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,Zt.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,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler),this.$_addListener(this.doc(),"pointermove",this._pointerMoveHandler),this.$_addListener(this.doc(),"pointerup",this._pointerUpHandler)}_unresigterEventHandlers(t){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler),this.doc().removeEventListener("pointermove",this._pointerMoveHandler),this.doc().removeEventListener("pointerup",this._pointerUpHandler)}_prepareRenderers(t){}_initControl(t,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=t.getElementById(i),this._container instanceof HTMLDivElement||q(S.invalidOuterDiv,i);const r=this._container.ownerDocument,o=this._dom=r.createElement("div");Object.assign(o.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)"}),o.className=s,this._container.appendChild(o);const n=this._svg=r.createElementNS(e,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",n.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),n.appendChild(h),o.appendChild(n),this._root=new Xt(this),n.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),o.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),o.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,i){let s=t.createElementNS(e,"filter");s.dataset.essential="true";const r=t.createElementNS(e,"feDropShadow");s.setAttribute("id",Yt.SHADOW_FILTER),r.setAttribute("dx","0"),r.setAttribute("dy","4"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.4"),r.setAttribute("stdDeviation","2"),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=Ht.getPadding(this._root.dom),s=i.left,r=i.top,o=this._svg.clientWidth-s-i.right,n=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:o,height:n});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(o-t.width)/2+"px",a.style.top=r+(n-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender()}ht.log("render in "+(+new Date-t)+"ms.")}}_setBackgroundStyle(t){Object.assign(this._dom.style,t)}setDebug(t){this._debugger.textContent=t,this.invalidateLayout()}_doBeforeRender(t){}_doAfterRender(){}_doClick(t){}_doDblClick(t){}_doTouchStart(t){}_doTouchMove(t){return!0}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){return!0}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),i):this.invalidateLayout())}$_updateBlockDrag(t){const e=t.target&&!0===this.dom().contains(t.target);this._blockDrag=!e}}Yt.CLASS_NAME="rm-control",Yt.SHADOW_FILTER="rm-shadow-filter",Yt._animatable=!0;class Zt extends kt{static createElement(t,i){return t.createElementNS(e,i)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,o){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,o);e.add(s),i.push(s)}}constructor(t,i,s=L){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,s||"g"),(this._styleName=i)&&this.setAttr("class",i),this._doInitStyles()}_doInitStyles(){}_doDispose(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom.style.display=this._visible?"":"none"),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}append(t){if(t){const e=t._parent;t._parent=this,this._dom.appendChild(t._dom),e!=this&&t._doAttached(this)}return t}addAll(...t){t.forEach((t=>this.add(t)))}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent?this._parent.removeChild(this):this._dom.remove(),this}appendElement(t,i){const s=t.createElementNS(e,i);return this._dom.appendChild(s),s}insertElement(t,i,s){const r=t.createElementNS(e,i);return this._dom.insertBefore(r,s),r}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}setAttrEx(t,e){return z(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return dt.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=ht.isValidNum(t)?t:this._tx,e=ht.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&ht.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}hasSavedStyles(){return void 0!==this._saveStyle||void 0!==this._saveClass}saveStyles(){let t=this._dom.getAttribute("style"),e=this._dom.getAttribute("class");t||(t=""),e||(e=""),this._saveStyle=t,this._saveClass=e}restoreStyles(){null!=this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",""===this._saveStyle&&(this._styles={}),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(U(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}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(s(t)){const e=this.dom.style;for(let i in t)e.setProperty(U(i),this._styles[i]=t[i],"important")}}resetStyles(t){this.clearStyles(),this.internalSetStyles(t)}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let i=!1;if(t){for(let s in t)if(s in Wt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(m(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Wt){const i=Wt[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let i=!1;return t in Wt&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=b(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}hasClip(){return this.hasAttr("clip-path")}setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}clipRect(t,e,i,s,r=0){const o=this.control.clipBounds(t,e,i,s,r);return this.setClip(o),o}clipPath(t){const e=this.control.clip(new ie(this.doc).setPath(t));return this.setClip(e),e}createClipId(t){return"url(#"+(t.id||t)+")"}sort(t){t.forEach((t=>t&&this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}onScrollStart(){}onScrollEnd(){}onRotationStart(){}onRotationEnd(){}_testing(){return Zt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(ht.isValidNum(e)||ht.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),ht.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")");const r=ht.getNum(this._scaleX,1),o=ht.getNum(this._scaleY,1);1===r&&1===o||s.push("scale("+r+" "+o+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}Zt.TESTING=!1,Zt.DEBUGGING=!1,Zt.ASSET_KEY="_asset_",Zt.TEMP_KEY="_temp_";class Ut extends Zt{constructor(t,e=void 0){super(t,e,"g")}}class Xt extends Zt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class qt extends Zt{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 Kt extends Zt{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 Jt extends Zt{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 Qt extends Zt{constructor(t){super(t,L,"mask");const e=this._id=ht.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class te extends Zt{constructor(t){super(t,L,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ee extends te{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,o=0,n=0){super(t);const a=this._rect=new Zt(t,null,"rect");a.setAttr("fill","none"),o>0&&a.setAttr("rx",String(o)),n>0&&a.setAttr("ry",String(n)),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 ie extends te{constructor(t,e){super(t),this._path=new Kt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var se;!function(t){t.SIDO="sido"}(se||(se={}));const re="shuffle",oe="random";var ne;class ae{constructor(t){this.source=t}hasDef(){return!0}}class he extends ae{getElement(t,e){throw new Error("Method not implemented.")}}he.TYPE="shape";class le extends ae{getElement(t,e){throw new Error("Method not implemented.")}}le.TYPE="image";class ce extends ae{_setStops(t,i){const s=t.createElementNS(e,"stop"),o=t.createElementNS(e,"stop"),n=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=r(n)?n[0]:n,l=r(n)&&n.length>1?n[1]:"white",c=r(a)?a[0]:a,d=r(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",h),s.setAttribute("stop-opacity",c),o.setAttribute("offset","1"),o.setAttribute("stop-color",l),o.setAttribute("stop-opacity",d),i.appendChild(s),i.appendChild(o)}}class de extends ce{getElement(t,i){const s=t.createElementNS(e,"linearGradient");let{x1:r,x2:o,y1:n,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),i.dir){case"up":n=1;break;case"right":o=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",n),s.setAttribute("x2",o),s.setAttribute("y2",a),s}}de.TYPE="lineargradient";class _e extends ce{getElement(t,i){const s=t.createElementNS(e,"radialGradient");return B(i.cx)||s.setAttribute("cx",i.cx),B(i.cy)||s.setAttribute("cy",i.cy),B(i.r)||s.setAttribute("r",i.r),this._setStops(t,s),s}}_e.TYPE="radialgradient";class ue extends ae{getElement(t,i){const r=t.createElementNS(e,"pattern"),o=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+i.pattern>=0){const t=ne.STOCK[+i.pattern%ne.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(i.pattern)&&(a=i.pattern,c=i.width||i.height||20,d=i.height||i.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),h&&l(o.style,h),i.style&&l(o.style,i.style),_&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const i=t.createElementNS(e,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return i.transform&&r.setAttribute("patternTransform",i.transform),r.append(o),r}}ne=ue,ue.TYPE="pattern",ue.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}],ue.SELECT=Object.assign(ne.STOCK[4],{id:"rm-selected-area-fill",pattern:ne.STOCK[4].path,transform:"scale(0.5)"});class pe extends ae{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===oe?this._index=-1:(t.mode===re&&ht.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=r(e.colors)?e.colors:[]}}pe.TYPE="colors";class ge extends ae{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||ge.SIZE,height:e.height||e.width||ge.SIZE})}}ge.TYPE="images",ge.SIZE=20;class me{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(s(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new ue(ue.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(Zt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(Zt.ASSET_KEY,"1"),e.addDef(s)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ue.TYPE:r(t.colors)?e=pe.TYPE:r(t.images)?e=ge.TYPE:null!=t.url?e=le.TYPE:null!=t.path&&(e=he.TYPE)),e)switch(e.toLowerCase()){case he.TYPE:return new he(t);case le.TYPE:return new le(t);case de.TYPE:return new de(t);case _e.TYPE:return new _e(t);case ue.TYPE:return new ue(t);case pe.TYPE:return new pe(t);case ge.TYPE:return new ge(t)}}}}const fe="0".charCodeAt(0),be="#".charCodeAt(0),ye=",".charCodeAt(0),we="s".charCodeAt(0),xe="a".charCodeAt(0),ve=".".charCodeAt(0);class Ce{static getFormatter(t){let e=Ce.Formatters[t];return e||(Ce.Formatters[t]=e=new Ce(t)),e}static get Default(){return Ce.getFormatter(Ce.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){for(let i=0;i<e;i++){const e=t.charCodeAt(i);e!==fe&&e!==be&&e!==ve&&e!==ye&&e!==we&&e!==xe&&q(`Invalid number format: ${t}`,t)}const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===fe;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===be;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===fe;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ye){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===we){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===xe){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}Ce.DEFAULT_FORMAT="",Ce.Formatters={};const Se=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Le=[".","/","-",":"],Me="Z".charCodeAt(0),Ae="z".charCodeAt(0),Pe="A".charCodeAt(0),ke="a".charCodeAt(0),Ie="y".charCodeAt(0),Ne="M".charCodeAt(0),Ee="m".charCodeAt(0),Te="W".charCodeAt(0),Ve="w".charCodeAt(0),De="d".charCodeAt(0),Re="H".charCodeAt(0),$e="h".charCodeAt(0),Oe="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(S.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||S.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,o=i.length;r<o;r++){var n=i[r],a=n.length;switch(n.charCodeAt(0)){case Ie:s+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case Ne:s+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case De:s+=a>1?j(t.getDate()):t.getDate();break;case Te:s+=a>1?j(ht.weekOfYear(t,e)+1):ht.weekOfMonth(t,e,!0)+1;break;case Ve:s+=a>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case Re:s+=a>1?j(t.getHours()):t.getHours();break;case $e:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?j(e):e}else s+=a>1?j(t.getHours()):t.getHours();break;case Ee:s+=a>1?j(t.getMinutes()):t.getMinutes();break;case Fe:s+=a>1?j(t.getSeconds()):t.getSeconds();break;case ke:case Pe:t.getHours()<12?s+=S.am:s+=S.pm;break;case Oe:let i=t.getMilliseconds();s+=3==a?G(i):2==a?j(i):i.toString().substring(0,a);break;default:s+=n}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let o=i.charAt(r);if(Le.indexOf(o)>=0)e.push(o),r++;else{let n=r++;for(;r<s&&i.charAt(r)==o;)r++;if(o=i.substring(n,r),Se.indexOf(o)<0){let e=o.charCodeAt(0);(e>=Pe&&e<=Me||e>=ke&&e<=Ae)&&q(S.invalidDateFormat,t)}e.push(o)}if(r<s&&ht.isWhiteSpace(o=i.charAt(r)))for(e.push(o);r<s&&ht.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||S.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Be.Formatters={};const ze=["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"],je=["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 Ge{static create(t){return n(t)?new Ge(t):void 0}static isBright(t){return new Ge(t).isBright()}static getContrast(t,e,i){return new Ge(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Ge(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=(e.a+t.a)/2,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(ht.startsWith(t,"rgba(")&&ht.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(ht.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Ge.COLORS[t]&&this.$_parseNumber(Ge.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 Ge(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 He,We,Ye;Ge.COLORS=function(){const t={};for(let e=0;e<ze.length;e++)t[ze[e]]=je[e];return t}(),t.TextAnchor=void 0,(He=t.TextAnchor||(t.TextAnchor={})).START="start",He.MIDDLE="middle",He.END="end",t.TextLayout=void 0,(We=t.TextLayout||(t.TextLayout={})).TOP="top",We.MIDDLE="middle",We.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ye||(Ye={}));class Ze extends Zt{constructor(e,i=L){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","middle")}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.bbox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=s-i.height;break;default:r=Math.ceil(s)}this.setAttr("y",r)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=Math.max(0,t),(e=Math.min(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,o=0,n=i.length;do{r=Math.ceil((o+n)/2);s.getSubStringLength(0,r)>t?n=r-1:o=r}while(o<n);for(this.text=i.substring(0,o)+"…";o>0&&this.calcWidth()>t;)this.text=i.substring(0,--o)+"…"}setContrast(t,e,i){return this.internalSetStyleOrClass(Ge.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in Wt||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i&&this.layoutText(),i}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this.dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e&&this.layoutText(),e}clearDom(){super.clearDom(),this._dirty=!0}bbox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Ue="$_TH",Xe="$_TW";class qe{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 o=e.callback(t,i[r+1]);if("number"==typeof o&&!isNaN(o)||"bigint"==typeof o)try{const t=i[r+3]?Ce.getFormatter(i[r+3]):e.numberFormatter;t&&(o=t.toStr(o))}catch(t){console.warn(`Failed to apply number format "${i[r+3]}" to ${o}:`,t)}else if(o instanceof Date)try{const t=i[r+3]?Be.getFormatter(i[r+3]):e.timeFormatter;t&&(o=t.toStr(o,e.startOfWeek||0))}catch(t){console.warn(`Failed to apply date format "${i[r+3]}" to ${o}:`,t)}else null==o&&(o=i[r+2]||"");s=s.replace(i[r],o)}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),o=r.substring(2,r.length-1),n=o.indexOf(";");if(n>0){const t=o.indexOf(";",n+1);t>=n?this._literals.push(r,o.substring(0,n),o.substring(n+1,t),o.substring(t+1)):this._literals.push(r,o.substring(0,n),o.substring(n+1),L);const e=this._literals.length-2;0===this._literals[e].length&&(this._literals[e]=L)}else this._literals.push(r,o,L,L);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ke extends qe{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,o=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,o),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],o=e.indexOf(s,r+7);o>0&&o<i&&t.setAttribute("style",e.substring(r+7,o))}}}class Je extends Ke{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 Qe={t:class extends Ke{tag(){return"</t>"}},b:class extends Ke{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ke{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Je};class ti{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 qe).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 Qe){const e=t.indexOf(">",s+2);if(e>=0){const o="</"+i+">",n=t.indexOf(o,e+1);if(n>=0){const e=t.substring(s,n+o.length);r=(new Qe[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 ei=/<br.*?>|\r\n|\n/;class ii{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,i,s,r,o,n=!0){const a=t.doc,h=m(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];t.clearDom(),r=r||t;const p=t.getStyle("writing-mode"),g=p===K||p===J;for(let i=0;i<c;i++){const s=l[i];let p=0,m=0,f=null;for(let[h,l]of s.words.entries()){const d=0===i&&0===h,_=i===c-1&&h===s.words.length-1,b=l.prepareSpan(t.appendElement(a,"tspan"),r,o);if(r instanceof Vt){const t=d&&n&&r.prop("prefix")||"",e=_&&n&&r.prop("suffix")||"";b.textContent=t+(b.textContent||"")+e}const y=b.getBBox();if(b[Xe]=y.width,b[Ue]=y.height,g?(p=u(p,b[Xe]),m+=b[Ue]):(p+=b[Xe],m=u(m,b[Ue])),f||(f=b),l instanceof Je){const i=a.createElementNS(e,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),t.appendDom(i)}}_.push(f),s[Ue]=m*h,s[Xe]=p*h,d.push(0==i?s[Xe]/2:s[Xe])}if(c>0){let e=l[0];for(let i=1;i<_.length;i++)if(_[i]){let s=0,r=0;if(g?null!=_[i-1]&&(s=Math.floor(e[Xe]-t.getAscent(e[Xe]))+t.getAscent(l[i][Xe])):r=e[Ue]-t.getAscent(e[Ue])+t.getAscent(l[i][Ue]),null==_[0]&&_[i]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[i]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();s+=o.width,r[Xe]=o.width,r[Ue]=e[Ue]=o.height,_[0]=r}switch(p){case K:_[i].setAttribute("dx",String(s)),_[i].setAttribute("y","0");break;case J:_[i].setAttribute("dx",String(-s)),_[i].setAttribute("y","0");break;default:_[i].setAttribute("x","0"),_[i].setAttribute("dy",String(r))}e=l[i]}if(g){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=_,r=s[Xe];if(e)s.setAttribute("dx",String(p===J?i-r/2:r/2));else switch(p){case K:s.setAttribute("x",String((i-r)/-2));break;case J:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(l[0][Ue])}}layout(e,i,s,r,o){const n=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===K||l===J)switch(a=o.left+(s-o.left-o.right-n.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,h=o.top+(r-o.top-o.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=n.height-o.bottom;break;default:e.anchor=t.TextAnchor.START,h=o.top}else switch(h=o.top+(r-o.top-o.bottom-n.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=o.left+(s-o.left-o.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-o.right;break;default:e.anchor=t.TextAnchor.START,a=o.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(ei);for(let t of i)e.push((new ti).parse(t))}}}let si=0;const ri=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},oi=["__proto__","constructor","prototype"],ni=function(t,e){const o=s(t)?t:{};for(const t in e)if(i.call(e,t)&&!oi.includes(t)){let i=e[t];r(i)?o[t]=i.slice(0):i instanceof Date?o[t]=new Date(i):s(i)?o[t]=ni(o[t],i):o[t]=i}return o};class ai extends Vt{constructor(t){super(),this.chart=t,si++}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this.prop("visible")}_doSetSimple(t,e){return h(e)?(t.visible=e,!0):super._doSetSimple(t,e)}_addChild(t,e){return super._addChild(t,e)}_doLoad(t,e){var i;if(null!=(null==e?void 0:e.template)){const t=null===(i=this.chart)||void 0===i?void 0:i.assignTemplates;t&&(e=t(e))}super._doLoad(t,e)}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,s=!0){if(!t)return this;let r=this._op.style,o=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&i.call(r,t)&&(delete r[t],o=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),o=!0),o&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,e=!1,i=!0){let r=!1,o=this._op.style;if(e&&o&&(delete this._op.style,r=!0,o=this._style=void 0),s(t)){o||(o=this._style=this._op.style={});for(const e in t){let i=t[e];o[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete o[e]:o[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._optionChanged()),this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=W(this[i]=s,!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t,e){}_doAfterRender(){}}ai.REFRESHED="refreshed",ai.defaults=ri(Vt.defaults,{visible:!0});class hi{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 li extends ai{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=m(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?Ce.getFormatter(t):null)}_setText(t){t!==this._text&&this.prepareRich(this._text=t);const e=this.prop("lineHeight");return!isNaN(e)&&this._richTextImpl&&(this._richTextImpl.lineHeight=e),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,o,n=!0){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,o,n),e&&this._richTextImpl.build(e,i,s,r,o,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ii),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.prop("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(t.text)}$_getNumberText(t,e,i){if(ht.isValidNum(t)){const s=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(r=o+r),a&&(r+=a),r}getNumberText(t,e,i,s){let r="";if(ht.isValidNum(t)){const o=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?o?this._numberFormatter.toStrEx(o.value,s)+o.symbol:this._numberFormatter.toStrEx(t,s):o?o.value+o.symbol:String(t)}const o=this.prop("prefix"),n=this.prop("suffix");return o&&(r=o+r),n&&(r+=n),r}}li.defaults=ri(ai.defaults,{effect:"none",autoContrast:!1,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ci extends li{getIconPos(){const t=this.prop("iconPosition");return"default"===t?this.getDefaultIconPos():t}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof ge&&(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 ge?i.getImage(s):s}return this._root+t}}}ci.defaults=ri(li.defaults,{iconPosition:"default",iconGap:2});class di extends ai{}di.defaults=ri(li.defaults,{});class _i extends ci{getDisplay(t){const e=this.prop("display");return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return m(this.prop("gap"),t?10:5)}_isVisible(){return this.prop("visible")&&!!this.prop("text")}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}_i.defaults=ri(ci.defaults,{display:"auto"});class ui extends ai{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){const t=this.prop("order");return isNaN(t)?1/0:t}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){this._addChild("background",this._background=new di(this.chart)),this._addChild("title",this._title=new _i(this.chart)),this._addChild("footer",this._footer=new _i(this.chart))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=b(e.location,"bottom")}}ui.defaults=ri(ai.defaults,{offsetX:0,offsetY:0});class pi extends ui{}class gi extends ui{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this.prop("direction")}}gi.defaults=ri(ui.defaults,{direction:"vertical"});class mi extends hi{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(t)?this._dic[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,i=this._items=[],o=this._dic={};if(r(t))t.forEach(((t,s)=>{i.push(this.$_loadItem(e,t,s))}));else if(s(t))i.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const s={};h(t)&&(s.visible=t),i.push(this.$_loadItem(e,s,0))}i.forEach((t=>{t.prop("name")&&(o[t.prop("name")]=t)}))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s.init(),s._setIndex(i),s.loadOptions(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class fi extends mi{_collectionProp(){return"widgetGroup"}_createWidget(t){return new gi(t)}beforeRender(){this._collectVisibles()}}class bi extends ai{constructor(){super(...arguments),this.index=-1,this._offsetX=0,this._offsetY=0}get name(){return this._name}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:(this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX)||0,y:(this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY)||0}}getSize(t,e){let i,s;return isNaN(i)&&(i=Y(this._widthDim,t)),isNaN(s)&&(s=Y(this._heightDim,e)),{width:i,height:s}}getPosition(t,e,i,s,r,o){let n,a,h;switch(n=this.getOffset(r,o),a=t,this.prop("align")||this._getDefaultAlign()){case"center":a+=(i-r)/2+n.x;break;case"right":a+=i-n.x-r;break;default:a+=n.x}switch(n=n||this.getOffset(r,o),h=e,this.prop("verticalAlign")){case"middle":h+=(s-o)/2-n.y;break;case"bottom":h+=s-n.y-o;break;default:h+=n.y}return{x:a,y:h}}_doApply(t){const e=this,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`${this._getNamePrefix()} ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_getDefaultAlign(){return"left"}}bi.defaults=ri(ai.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class yi extends hi{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const i=this.chart,o=this._items=[],n=this._map={};r(t)?t.forEach(((t,s)=>{o.push(this._loadItem(i,t,s,e))})):s(t)&&o.push(this._loadItem(i,t,0,e)),o.forEach((t=>{t.name&&(n[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender()}))}}class wi extends pi{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}wi.defaults=ri(ui.defaults,{});class xi extends ai{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}xi.defaults=ri(ai.defaults,{text:"RealMap v1.1.13",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const vi="_model_",Ci="_tag_",Si="disabled",Li="rm-legend-item-marker",Mi=Object.freeze([0,0]),Ai=/s\+/;function Pi(t){return isFinite(t[0]+t[1])}function ki(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function Ii(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const o of t){const t=o.map((t=>t[0])),n=o.map((t=>t[1]));e=_(e,...t),i=_(i,...n),s=u(s,...t),r=u(r,...n)}return{h1:e,v1:i,h2:s,v2:r}}const Ni=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Ei=.001,Ti=Math.PI;class Vi{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,o){return r>0?o>0?(r=_(-s/2,i/2,r),["M",t,e-(o=_(-s/2,i/2,o)),"v",s+o+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-o,"a",o,o,0,0,1,-o,o,"h",2*o-i,"a",o,o,0,0,1,-o,-o,"Z"]):["M",t,e,"v",s+(r=_(-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"]:o>0?["M",t,e-(o=_(-s/2,i/2,o)),"v",s+o,"h",i,"v",-s-o,"a",o,o,0,0,1,-o,o,"h",2*o-i,"a",o,o,0,0,1,-o,-o,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=_(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,o,n,a=!1){const h=E(p(o-r)),l=2*Ti-h<.01,_=h-Ti<.01?0:1,u=n?1:0,g=c(r),m=d(r),f=c(o-=l?u?Ei:-.001:0),b=d(o),y=[];return y.push("M",t+i*g,e+s*m,"A",i,s,0,_,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,o,n,a){const h=E(p(n-o)),l=2*Ti-h<Ei;let _=h-Ti<Ei?0:1;const u=a?1:0,g=c(o),m=d(o),f=c(n-=l?u?Ei:-.001:0),b=d(n),y=i*r,w=s*r,x=[];return x.push("M",t+i*g,e+s*m,"A",i,s,0,_,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,_,1-u,t+y*g,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 o=t+i/2,n=e+s/2+(s/2-s/2*d(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,_=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",o+a*c(r),n+h*d(r));for(let t=0;t<5;t++)g.push("L",o+a*c(r),n+h*d(r),"L",o+l*c(r+p),n+_*d(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Vi[e](0,0,2*i,2*s);break;default:r=Vi.circle(i,s,_(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,o=["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&&o.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),o}}const Di={minimumZoom:200,maximumZoom:1600},Ri={};class $i extends bi{static register(...t){t.forEach((t=>{Ri[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"annotation",this._type())),super._doLoad(t,e)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}$i.defaults=ri(bi.defaults,{front:!1});class Oi extends yi{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof $i)return e}load(t,e){super.load(t,e)}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):void 0}))}_loadItem(t,e,i,s){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a.init(),a.index=i,a.loadOptions(e),a}}const Fi="geo",Bi="chart",zi="route";class ji extends Zt{static create(t,e,i,s,r,o,n=0){return new ji(t,e,{x:i,y:s,width:r,height:o,r:n})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}class Gi{constructor(t,e){}}const Hi="@_rm_state_",Wi="@_rm_add_",Yi="@_rm_update_",Zi="@_rm_delete_";let Ui=0;const Xi=[0,0];class qi{constructor(t){this.source=t,this.inset=Xi,this.pid=Ui++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.chart.coordOfArea(this.id)),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[Hi]=t:delete this[Hi]}_isAdding(){return this[Hi]===Wi}_isUpdating(){return this[Hi]===Yi}_isDeleting(){return this[Hi]===Zi}_isStatic(){const t=this[Hi];return t!==Wi&&t!==Zi}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){var i,s,o,n,a,h;const l=t.prop("fields");if(r(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(i=t._idFielder)||void 0===i?void 0:i.call(t,e),this.name=null===(s=t._nameFielder)||void 0===s?void 0:s.call(t,e),this.color=null===(o=t._colorFielder)||void 0===o?void 0:o.call(t,e),this.coord=[null===(n=t._lonFielder)||void 0===n?void 0:n.call(t,e),null===(a=t._latFielder)||void 0===a?void 0:a.call(t,e)],this.value=null===(h=t._valueFielder)||void 0===h?void 0:h.call(t,e)}_readObject(t,e){var i;if(this.id=b(t._idFielder(e),e.id),this.name=b(t._nameFielder(e),e.name),this.color=b(t._colorFielder(e),e.color),this.className=e.className,r(e.coord))this.coord=[+e.coord[0],+e.coord[1]];else if(n(e.coord)){const t=e.coord.split(Ai);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const s=t._lonFielder(e),r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);isNaN(s)||isNaN(r)||(this.coord=[s,r])}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=this.id&&t.chart.coordOfArea(this.id)),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=r(e.callout)&&this.$_parseCallout(e.callout),r(this.callout)||(this.offset=r(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),r(t)&&(e=[],a(t[0])?e.push(t):t.forEach((t=>{if(r(t))e.push(t.slice(0,2));else if(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 Ki{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Ji={};class Qi extends ci{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}getValue(t,e){const i=this.prop("textField");if(n(i)){const e=t.getProp(i);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return o(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}_doApply(t){super._doApply(t),o(t.positionCallback)?this._getPosition=t=>{const e=this.prop("positionCallback"),i=this.prop("position");return e({point:t,chart:this.chart.wrapper})||i||Qi.DEFAULT_POSITION}:this._getPosition=()=>this.prop("position")||Qi.DEFAULT_POSITION}}Qi.DEFAULT_POSITION="auto",Qi.defaults=ri(ci.defaults,{visible:!0,position:Qi.DEFAULT_POSITION});class ts extends ai{}ts.defaults=ri(ai.defaults,{shape:"circle",radius:2.5});class es extends ai{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),this._addChild("anchorPoint",this._anchorPoint=new ts(this.chart))}get anchorPoint(){return this._anchorPoint}}es.defaults=ri(ai.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class is{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 ss extends ut{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class rs extends ut{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class os extends ss{_init(t){super._init(t),t._setState(Wi)}}class ns extends ss{_init(t){super._init(t),t._setState(Zi),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class as extends ss{_init(t){super._init(t),t._setState(Yi)}}class hs extends rs{_init(t){t.forEach((t=>{t._setState(Wi),t._setVrate(0)}))}}class ls extends rs{_init(t){t.forEach((t=>{t._setState(Zi),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class cs extends rs{_init(t){t.forEach((t=>{t._setState(Yi),t._setVrate(0)}))}}class ds extends ai{static register(...t){t.forEach((t=>{Ji[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}getProp(t,e){return this.prop(t,e)}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 Ki(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new is(this.$_createPointArgs(),this.chart.wrapper),this._addChild("pointLabel",this._pointLabel=this._createLabel(this.chart)),this._addChild("callout",this._callout=new es(this))}_createLabel(t){return new Qi(t)}getTooltipText(t,e){var i;const s=this.prop("tooltipText"),r=this.prop("tooltipCallback");return"function"==typeof r?(this._getPointArgs(this._pointArgs,e),null!==(i=r(this._pointArgs))&&void 0!==i?i:n(s)?s:ds.defaultTooltipText):"boolean"==typeof s?s?ds.defaultTooltipText:null:s}getTooltipParam(t,e,i){return ds.getPointTooltipParam(t,e,i)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this.prop("label")||this.name}_type(){return this.constructor.type}get index(){return this._index}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}get cluster(){return null}displayName(){return this.prop("label")||this.name||`Series${this.index}`}get data(){return this._data}$_setData(t,e){if(t!==this._data||e!==this._dataPath)return this._data=ht.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}get needAnimate(){return this._needAnimate}set needAnimate(t){this._needAnimate=t}get dataLoaded(){return this._dataLoaded}set dataLoaded(t){this._dataLoaded=t}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}needTranslate(){return!0}contains(t){return this._points.contains(t)}isExcluded(t){return!1}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e&&e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?{isCallbackExecuted:!0,label:s}:{label:i,isCallbackExecuted:!1}}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){const e=this.prop("styleCallback");if("function"==typeof e)return e(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if("function"==typeof this.pointLabel.prop("styleCallback"))return this.pointLabel.prop("styleCallback")(this._getPointArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.prop("zoomLevel");return this._pointLabel.isVisible()&&this.pointLabelCount()>0&&(isNaN(t)||this.chart.body.zoom>=t)}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!0===e.visible)}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.prop("layoutOnly")}getLegendSources(t,e){this._legend===t&&e.push(this)}getLabelOff(){return m(this._pointLabel.prop("offset"),this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){return this.$_setData(t,this.prop("dataPath"))&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s;const r=this.$_addPoint(t,-1);return this._points.insert(e,r),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(r._prev={},r._prev.ani=new os(this,r,(t=>{var e;null===(e=this.prop("onPointAdded"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(s=this.prop("onPointAdded"))||void 0===s||s(this._getPointArgs(this._pointArgs,r)),r}addPointList(t,e=-1,i=500){var s;if(!r(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new hs(this,o,(t=>{var e;null===(e=this.prop("onPointListAdded"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(s=this.prop("onPointListAdded"))||void 0===s||s(this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r;a(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 ns(this,t,(t=>{var e;this._points.remove(t),null===(e=this.prop("onPointRemoved"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(r=this.prop("onPointRemoved"))||void 0===r||r(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];a(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new ls(this,t,(t=>{var e;this._points.removeAll(t),null===(e=this.prop("onPointListRemoved"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(i=this.prop("onPointListRemoved"))||void 0===i||i(this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s;if(n(t)?t=this._points.pointById(t):a(t)&&(t=this._points.get(t)),t instanceof qi&&this._points.contains(t)){let r=t._prev;return r&&r.ani&&r.ani.stop(),r=t.updateValues(this,e),r&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?r.ani=new as(this,t,(t=>{var e;null===(e=this.prop("onPointUpdated"))||void 0===e||e(this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(s=this.prop("onPointUpdated"))||void 0===s||s(this._getPointArgs(this._pointArgs,t))),!!r}return!1}updatePointList(t,e,i=300){var s;const r=this.$_points(t).filter((t=>this._points.contains(t)));r.length>0&&(r.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new cs(this,r,(t=>{var e;null===(e=this.prop("onPointListUpdated"))||void 0===e||e(this._getPointListArgs(t))})).setDuration(i).start():null===(s=this.prop("onPointListUpdated"))||void 0===s||s(this._getPointListArgs(r)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){const e=this.prop("onPointClick");if(e)return this._getPointArgs(this._pointArgs,t),e(this._pointArgs)}show(t=!1,e=!0){this.visible&&!t||(e?this.chart.requestShowSeries(this,!0):this.visible=!0)}hide(t=!0){this.visible&&(t?this.chart.requestShowSeries(this,!1):this.visible=!1)}getCalloutShape(t){return this.callout.anchorPoint.prop("shape")||"circle"}canSelect(){return!1}select(t){t&&(t.setSelected(!0),this.$_bringToFront(t),this.chart._selectionChanged(this,[t]))}unselect(t){t.setSelected(!1),this.chart._selectionChanged(this,[t])}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0),this.$_bringToFront(t);this.chart._selectionChanged(this,e)}unselectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!1);this.chart._selectionChanged(this,e)}$_bringToFront(t){t instanceof qi&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0)}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_isPointsDirty(){return this._dataSourceDirty}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._isPointsDirty()){const t=this._doLoadData(this._data);this.$_loadPoints(t),this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))}else this._optionsDirty||this._dataDirty?(this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);this._visPoints.forEach((t=>t._excluded=this.isExcluded(t))),super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let s,h,l;this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,o(i)?s=i:r(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),s?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||s(this._getPointArgs(this._pointArgs,t))})):l instanceof pe?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e++)}$_addPoint(t,e){const i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return o(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 ji.create(t,Li,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"series",this._type())),super._doLoad(t,e)}_doLoadData(t){if(t instanceof Gi);else if(r(t))return t}$_loadPoints(t){var e;this._doLoadPoints(t),null===(e=this.prop("onPointsLoaded"))||void 0===e||e(this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){const e=this._pointLabel.prop("textCallback"),i=this._pointLabel.prop("visibleCallback");this._pointLabelCallback=o(e)?e:null,this._pointLabelVisCallback=o(i)?i:null,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:_(s,e),i=isNaN(i)?s:u(s,i))})),{min:e,max:i}}}ds.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",ds.defaults=ri(ai.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:ds.defaultTooltipText,loadAnimation:"default",legend:0});class _s extends hi{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const i=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(i,t,e)})):s(t)&&this.$_loadItem(i,t,0)}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.prop("legend"),null)))),this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t,e){const i=this.$_loadItem(this.chart,t,this._items.length);return i&&(i.needAnimate=e),i}remove(t){let e;if(t instanceof ds?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>t._setIndex(e))),e}$_loadItem(t,e,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const o=new r(t);return o.init(),o.isDataSeries()&&o._setIndex(i,t._seriesIndex++),o.loadOptions(e),this.$_addSeries(o,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 us extends qi{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_readArray(t,e){super._readArray(t,e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:w(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}_valuesChanged(t){const e=super._valuesChanged(t),i=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],s=this.value!==t.value;return e||s||i}}class ps extends ds{_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")}}ps.defaults=ri(ds.defaults,{valueField:"value"});class gs extends ps{isExcludedCoord(t){if(this._excludes)for(let e=0;e<this._excludes.length;e++){const i=this._excludes[e];if(t[0]>=i[0][0]&&t[0]<=i[1][0]&&t[1]>=i[1][1]&&t[1]<=i[0][1])return!0}}isExcluded(t){return this.isExcludedCoord(t.coord)}_doApply(t){if(super._doApply(t),i.call(t,"excludeBounds")){const i=t.excludeBounds,s=[];if(e=i,Array.isArray(e)&&e.length>0)for(let t=0;t<i.length;t+=2){const e=i[t],o=i[t+1];if(r(e)&&r(o)){const t=+e[0],i=+e[1],r=+o[0],n=+o[1];isNaN(t)||isNaN(i)||isNaN(r)||isNaN(n)||s.push([[_(t,r),u(i,n)],[u(t,r),_(i,n)]])}}this._excludes=s.length>0?s:void 0}var e}}gs.defaults=ri(ps.defaults,{});class ms extends us{}class fs extends gs{}fs.defaults=ri(gs.defaults,{});class bs extends us{getPoints(t,e,i){const s=t.length,r=[];const o=i-e;for(let i=0;i<s;i++){const n=t[i],a=5+i/(s-1)*90,h=10+(isNaN(n)||0==o?80:80*(1-(n-e)/o));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=r(this.values)?this.values.reduce(((t,e)=>t+m(e,0)),0):0:this._sum}_readArray(t,e){super._readArray(t,e),this.$_initValues(t)}_readObject(t,e){super._readObject(t,e),this.$_initValues(t)}$_initValues(t){var e;const i=this.value;if(r(i)){const s=t.getProp("nullAsBase"),r=null!==(e=t.getProp("baseValue"))&&void 0!==e?e:0,o=s?r:NaN;this.values=i.map((t=>null==t?o:t))}else this.values=isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ys{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return ji.create(t,Li,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class ws extends gs{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t);const e=this.prop("categories");this._categories=this.$_parseCategories(e)}_createValueFielder(t){const e=this.prop("valueFields");return r(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this.prop("legendByCategory")&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new ys(t.name,t.color)))}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{const i=e;t=Math.max(t,i.values?i.values.length:0)})),t<2)return[this._calcedColor];{const e=Ge.create("white"),i=Ge.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=Ge.interpolate(e,i,r/(2*t)).toString();return s}}}ws.defaults=ri(gs.defaults,{position:"top"});class xs extends bs{}class vs extends ws{_doInit(t){super._doInit(t),this._addChild("baseLine",this._baseLine=new ai(this.chart))}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=ht.getMinMax(t),s=i.base=this.prop("baseValue");if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=m(this._minValue,i.min),e=m(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 m(Y(this._paddingDim,t),0)}_doApply(t){super._doApply(t);const e=this.prop("width"),i=this.prop("height"),s=this.prop("minValue"),r=this.prop("maxValue"),o=this.prop("valueDomain");this._width=m(+e,vs.DEF_WIDTH),this._height=m(+i,vs.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+s,this._maxValue=+r,this._pointDomain="point"===o}}vs.DEF_WIDTH=80,vs.DEF_HEIGHT=50,vs.defaults=ri(ws.defaults,{width:vs.DEF_WIDTH,height:vs.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Cs extends us{}class Ss extends gs{_doApply(t){super._doApply(t),this._width=m(+t.width||+t.size||+t.height,Ss.DEF_SIZE),this._height=m(+t.height||+t.size||+t.width,Ss.DEF_SIZE)}}Ss.DEF_SIZE=60,Ss.defaults=ri(gs.defaults,{size:Ss.DEF_SIZE});class Ls extends Ss{getValueRate(t){return(m(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=this.num("minValue"),this._maxValue=this.num("maxValue")}_doPrepareRender(t){let e=m(this._minValue,1/0),i=m(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t,r=s.getValue();s.isNull||isNaN(r)||(e=_(e,r),i=u(i,r))})),this._min=e,this._max=i}}Ls.defaults=ri(Ss.defaults,{minValue:10});class Ms extends ms{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}}class As extends Qi{}As.defaults=ri(Qi.defaults,{visible:!1});class Ps extends fs{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new As(this.chart))}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:Y(this._minSizeDim,t),max:Y(this._maxSizeDim,t)}}getRadius(t,e,i){if(isNaN(t))return 0;let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"===this.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return m(this._subLabel.prop("offset"),0)}_doApply(t){super._doApply(t);const e=this.prop("minValue"),i=this.prop("maxValue"),s=this.prop("alignToSurface");this._setDims(t,"minSize","maxSize"),this._extMin=+e,this._extMax=+i,this._alignToSurface=s}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ms(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 o=r.getValue();r.isNull||isNaN(o)||(isNaN(i)&&(t=_(t,o)),isNaN(s)&&(e=u(e,o)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}Ps.type="bubble",Ps.defaults=ri(fs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class ks extends ai{}ks.defaults=ri(wi.defaults,{length:10});class Is extends ci{getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Is.defaults=ri(wi.defaults,{offset:4});class Ns extends ai{_doInit(t){this._line=this._addChild("line",new ks(this.chart)),this._label=this._addChild("label",new Is(this.chart))}get line(){return this._line}get label(){return this._label}}Ns.defaults=ri(wi.defaults,{});class Es extends wi{_doInit(t){super._doInit(t),this._tick=this._addChild("tick",new Ns(this.chart))}get tick(){return this._tick}getSteps(t,e){const i=this._series,s=this._steps;if(i instanceof Ps){let{min:r,max:o}=i.getPixelMinMax(_(t,e));isNaN(this.prop("minRadius"))||(r=this.prop("minRadius")),isNaN(this.prop("maxRadius"))||(o=this.prop("maxRadius")),s.forEach((t=>{t.rd=i.getRadius(t.value,r,o)}))}else if(s.length>0){const t=m(this.prop("minRadius"),10),e=m(this.prop("maxRadius"),50)-t,i=s[0].value,r=s[s.length-1].value-i;s.forEach((s=>{s.rd=t+e*(s.value-i)/r}))}return s}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){this._op;const t=this.prop("steps"),e=[];if(r(t)&&t.length>0){const i=this.tick.label;t.forEach((t=>{s(t)?e.push({value:+t.value,label:t.label||i.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:i.getText(+t),rd:0})}))}return e}}Es.defaults=ri(wi.defaults,{});class Ts extends mi{_collectionProp(){return"bubbleScale"}_createWidget(t){return new Es(t)}beforeRender(){this._collectVisibles()}}class Vs extends ai{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Vs.MARKER_SIZE=10;class Ds extends pi{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this.prop("layout")||"body"===t)return this.prop("layout");switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=this.prop("maxWidth"))!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=W(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=W(t,!0))}(this.prop("maxHeight"))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new Vs(this,t))),this.prop("reversed")&&(this._items=this._items.reverse())}}Ds.defaults=ri(ui.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:Vs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class Rs extends mi{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new Ds(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class $s{constructor(t){this._color1=Ge.create(t.minColor),this._color2=Ge.create(t.maxColor),this._logger=ht.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return Ge.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return y(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class Os extends ai{_doInit(t){this._label=this._addChild("label",new li(this.chart))}get label(){return this._label}getMarkerSize(){return m(this.prop("size"),7)}}Os.defaults=ri(ai.defaults,{size:7});class Fs extends ai{}Fs.defaults=ri(ai.defaults,{length:6});class Bs extends ci{getDefaultIconPos(){}}Bs.defaults=ri(ci.defaults,{});class zs extends ai{_doInit(t){this._line=this._addChild("line",new Fs(this.chart)),this._label=this._addChild("label",new Bs(this.chart))}get line(){return this._line}get label(){return this._label}}zs.defaults=ri(ai.defaults,{});class js{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||Vs.MARKER_SIZE;return ji.create(t,Li,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,o=this.to;if(i&&s)return Ge.interpolate(i,s,(t-r)/(o-r)).toString();return y(s,e,i).brighten(1-(t-r)/(o-r)).toString()}}class Gs extends ai{}Gs.defaults=ri(ai.defaults,{});class Hs extends ai{getLabel(){var t;return null!==(t=this.prop("label"))&&void 0!==t?t:"No Data"}getGap(){return m(+this.prop("gap"),0)}}Hs.defaults=ri(ai.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const Ws=Ge.create("#000");class Ys extends wi{_doInit(t){super._doInit(t);const e=this.chart;this._marker=this._addChild("marker",new Os(e)),this._stepLine=this._addChild("stepLine",new Gs(e)),this._tick=this._addChild("tick",new zs(e)),this._nullStep=this._addChild("nullStep",new Hs(e))}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(this._logger&&(i=this._logger(i)),r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=this._min?r[0]._color1.toString():s.toString()}return Ge.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this.nullStep.prop("visible"))return this.nullStep.prop("color")}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get endColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this.prop("layout")){case"horizontal":case"vertical":return this.prop("layout");default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?Y(this._barLengthDim,e):e,s=m(this.prop("barWidth"),12)):(s=this._barLengthDim?Y(this._barLengthDim,t):t,r=m(this.prop("barWidth"),12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,o=s?s.length:r?r.length-1:0,n=e?o+1:o,a=[];if(e&&(t-=i),o>0)for(let e=0;e<o;e++)a.push((e+1)/n*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 o,n=[];if(e){o=e.length,n.push({pos:e[0].from=m(e[0].from,s)});for(let t=1;t<o;t++)n.push({pos:e[t].from=m(e[t].from,e[t-1].to)});n.forEach(((t,i)=>t.label=e[i].label)),n.push({pos:e[o-1].to=m(e[o-1].to,r)})}else if(i){o=i.length,n.push({pos:i[0]});for(let t=1;t<o-1;t++)n.push({pos:i[t]});n.push({pos:i[o-1]})}else n=[{pos:s},{pos:r}];const a=this._logBase;return o=n.length-1,n.forEach(((e,i)=>{if(null==e.label){const s=this._logger?Math.pow(a,e.pos):e.pos;e.label=t.getNumberText(s,!1,!1,0===i?"trunc":i===o?"ceil":void 0)}})),n}getSteps(){return this._steps}getLegendSources(t){"legend"!==this.prop("display")&&"both"!==this.prop("display")||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||Ws,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t);const e=this.prop("colors"),i=this.prop("minColor"),s=this.prop("maxColor");this._setDim(t,"barLength"),this._minColor=Ge.create(i),this._maxColor=t.maxColor&&Ge.create(s),this._colors=this.$_parseColorStops(e)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this.prop("name")}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(r(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:Ge.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:Ge.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+this.prop("minValue"),this._max=+this.prop("maxValue"),this._logger=ht.getLogger(this._logBase=this.prop("logBase")),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?Ge.interpolate(this._minColor,this._endColor,parseFloat(t)/100):Ge.create(t)}$_buildSteps(){const t=this.prop("solidFill"),e=this.prop("steps"),i=[],s=this._min,o=this._max;let n=s,a=o;if(this._valueSteps=null,r(e)&&e.length>0){let s="0%";e.forEach(((r,o)=>{var h;let l,c,d=this.$_parseValue(r.from,n,a),_=this.$_parseValue(r.to,n,a);if(0===o&&isNaN(d)&&(d=n),o===e.length-1&&isNaN(_)&&(_=a),r.fromColor&&r.toColor)l=this.$_parseColor(r.fromColor),c=this.$_parseColor(s=r.toColor);else if(t){let t=r.toColor||r.fromColor||r.color;t=0===o?t||"0%":t||"100%",c=l=this.$_parseColor(t)}else l=this.$_parseColor(r.fromColor||s),c=this.$_parseColor(s=(null!==(h=r.toColor)&&void 0!==h?h:r.color)||"100%");i.push(new js(d,_,l,c,r.label))}))}else if(n>=a)i.push(new js(n,a,t?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(n)&&!isNaN(a)){const e=this.prop("logBase"),s=this._logger&&n>=0&&a-n>=e?this._logger:null,r=this._valueSteps=[],o=Math.max(1,m(this.prop("stepCount"),1));if(s&&(n=s(n),a=s(a)),this.prop("integralSteps"))r.push(...ht.normalizeToSteps([n,a],o+1));else{const t=(a-n)/o;r.push(n);for(let e=1;e<o;e++)r.push(D(r[e-1]+t));r.push(D(a))}if(this._min=r[0],this._max=r[o],t){const t=this._minColor,e=this._endColor,s=r.length-1;for(let o=1;o<=s;o++){const n=Ge.interpolate(t,e,o/s);i.push(new js(r[o-1],r[o],n,n,void 0))}}}return i.length>1?i:void 0}}Ys.defaults=ri(ai.defaults,{display:"scale",minColor:"#fff",layout:"auto",barWidth:12,barLength:"40%"});class Zs extends mi{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.prop("display")))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new Ys(t)}beforeRender(){this._collectVisibles()}}class Us extends ai{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e){this._module&&this._module.exportToImage(t,e)}}Us.defaults=ri(ai.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1});class Xs extends ai{_doSetSimple(t,e){return ht.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Xs.defaults=ri(ai.defaults,{});class qs extends ai{_doInit(t){this._addChild("line",this._line=new Xs(this.chart)),this._addChild("lonLine",this._lonLine=new Xs(this.chart)),this._addChild("latLine",this._latLine=new Xs(this.chart))}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this.prop("fitTo")}getLonStep(){return Math.max(0,f(this._lonLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}getLatStep(){return Math.max(0,f(this._latLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}_doApply(t){super._doApply(t)}$_defaultStep(){return 10}}qs.defaults=ri(ai.defaults,{visible:!1,fitTo:"map"});class Ks extends ai{}Ks.defaults=ri(ai.defaults,{visible:!1});class Js extends ai{}Js.defaults=ri(ai.defaults,{visible:!1});class Qs extends li{getText(t,e){let i=this.prop("suffix");if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this.prop("prefix")&&(i=this.prop("prefix")+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=this.prop("dirSymbols")}}Qs.defaults=ri(li.defaults,{dirSymbols:"NSEW",suffix:"°°"});class tr extends ai{_doInit(t){this._addChild("line",this._line=new Js(this.chart)),this._addChild("label",this._label=new Qs(this.chart))}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,f(this.prop("lonInterval"),this.prop("interval"),1))|0}getLatInterval(){return Math.max(1,f(this.prop("latInterval"),this.prop("interval"),1))|0}_doApply(t){super._doApply(t);const e=this.prop("positions");this._positions=r(e)?e:[]}}tr.defaults=ri(ai.defaults,{visible:!1,positions:["top","right"],interval:1});class er extends ci{getDefaultIconPos(){return"left"}}er.defaults=ri(ci.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ir extends ai{_doInit(t){this._addChild("label",this._label=new er(this.chart))}get label(){return this._label}}ir.defaults=ri(ai.defaults,{front:!0,zindex:0});class sr extends ir{}sr.defaults=ri(ir.defaults,{});class rr extends ir{}rr.defaults=ri(ir.defaults,{});class or extends ir{}or.defaults=ri(ir.defaults,{});class nr extends ai{}nr.defaults=ri(ai.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class ar extends ai{constructor(t){super(t.chart),this.axis=t}_doInit(t){this._addChild("flag",this._flag=new nr(this.chart)),this._args={chart:this.chart.wrapper,axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag;let i=Ce.getFormatter(e.prop("numberFormat")).toStr(t);const s=e.prop("prefix"),r=e.prop("suffix");return s&&(i=s+i),r&&(i+=r),i}moved(t,e,i){}_doSetSimple(t,e){return o(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}ar.defaults=ri(ai.defaults,{visible:!1});class hr extends ai{constructor(){super(...arguments),this._guides=[]}_doInit(t){this._addChild("line",this._line=new Ks(this.chart)),this._addChild("leftLine",this._leftLine=new Ks(this.chart)),this._addChild("rightLine",this._rightLine=new Ks(this.chart)),this._addChild("topLine",this._topLine=new Ks(this.chart)),this._addChild("bottomLine",this._bottomLine=new Ks(this.chart)),this._addChild("equatorLine",this._equatorLine=new Ks(this.chart)),this._addChild("meridianLine",this._meridianLine=new Ks(this.chart)),this._addChild("grid",this._grid=new qs(this.chart)),this._addChild("tick",this._tick=new tr(this.chart)),this._addChild("crosshair",this._crosshair=new ar(this))}get line(){return this._line}get leftLine(){return this._leftLine}get rightLine(){return this._rightLine}get topLine(){return this._topLine}get bottomLine(){return this._bottomLine}get equatorLine(){return this._equatorLine}get meridianLine(){return this._meridianLine}get grid(){return this._grid}get tick(){return this._tick}get crosshair(){return this._crosshair}get guides(){return this._guides.slice()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),i.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}const e=this.prop("lonInterval"),s=this.prop("latInterval"),o=this.prop("interval");this._lonInterval=Math.max(1,f(e,o,10)),this._latInterval=Math.max(1,f(s,o,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new or(this.chart):"line"===t.type?new sr(this.chart):"band"===t.type?new rr(this.chart):new sr(this.chart),i.init(),i.loadOptions(t),e.push(i)}))}}function lr(t,e){const[i,s]=t;let r=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){const[n,a]=e[t],[h,l]=e[o];a>s!=l>s&&i<(h-n)*(s-a)/(l-a)+n&&(r=!r)}return r}function cr(t,e){let i=!1;lr(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)lr(t,e[s])&&(i=!i);return i}hr.defaults=ri(ai.defaults,{interval:5});class dr{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,o=(e+s)/2,n={minLon:t,minLat:o,maxLon:r,maxLat:s},a={minLon:r,minLat:o,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:o},l={minLon:r,minLat:e,maxLon:i,maxLat:o};this.children=[new dr(n,this.capacity),new dr(a,this.capacity),new dr(h,this.capacity),new dr(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 _r{constructor(t,e){var i;this.worldBBox=t,this.root=new dr(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 cr(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(cr(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const ur="37630",pr={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"},gr={area:ur,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"},mr={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"},fr={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"},br={area:ur,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"},yr={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"},wr={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},xr={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},vr={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 Cr{constructor(t){this.id=t}}class Sr extends Cr{constructor(t,e){super(t),this.props=e}}class Lr extends Sr{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],o=[];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());o.push(i)}r[i]=o,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=Ii(this.polygons[t]),r=Ii(this.polygons[e]);let o,n,a=0,h=0;if((o=s.h1-r.h2)>0&&(n=r.v1-s.v2,o>n&&(a=-o*i,h=n*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 Mr{constructor(t,e,i){this.name=t,this.closed=i,r(e)&&e.length>=2&&(this.border=[ht.makeArray(e[0]),ht.makeArray(e[1])])}}class Ar extends Cr{constructor(t,e){super(t),this.polygon=e}}class Pr extends kt{static createStockInset(t,e){let i,r=!1;switch(t){case"제주":case"제주도":i=pr;break;case"제주_B":case"제주도_B":i=pr,r=!0;break;case"울릉":case"울릉도":i=gr;break;case"울릉_B":case"울릉도_B":i=gr,r=!0;break;case"백령":case"백령도":i=mr;break;case"백령_B":case"백령도_B":i=mr,r=!0;break;case"읍면동_제주":case"읍면동_제주도":i=fr;break;case"읍면동_제주_B":case"읍면동_제주도_B":i=fr,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":i=br;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":i=br,r=!0;break;case"읍면동_백령":case"읍면동_백령도":i=yr;break;case"읍면동_백령_B":case"읍면동_백령도_B":i=yr,r=!0;break;default:if(!t)return void console.warn("등록된 Inset 프리셋이 존재하지 않습니다.");switch(t.toLowerCase()){case"alaska":i=wr;break;case"hawaii":i=xr;break;case"okinawa":i=vr;break;case"okinawa_b":i=vr,r=!0}}return i&&(h(e)?i=Object.assign({visible:e},i):s(e)&&(i=Object.assign({},i,e)),r&&i.border&&delete i.frame),i}constructor(t,e){var i,o,h;super(),this._excludes={};const l=null!==(i=t.source)&&void 0!==i?i:t.map,c=t.insets,d=r(c)?c:s(c)||n(c)?[c]:void 0;this.name=t.name,this.enabled=b(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=s(null==l?void 0:l.meta)?ht.deepClone(l.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=Q(null!==(h=t.padding)&&void 0!==h?h:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this.bounds=r(t.bounds)&&4===t.bounds.length&&t.bounds.every(a)?t.bounds:void 0,this._excludes={},r(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},d&&d.length>0&&d.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?Pr.createStockInset(t.substring(1),!1):Pr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,name:t.name,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&ht.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new Mr(t.name,t.border,!0===t.closed))})),l&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(l,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class kr{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}get h1(){return((-180+this._scroll)%360+540)%360-180}get scroll(){return this._scroll}set scroll(t){this._scroll=((t||0)%360+540)%360-180,this._sec&&(this._sec._scroll=this._scroll>0?(this._scroll-360)%360:(this.scroll+360)%360),this.second=0===this._scroll?void 0:this._sec}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this._sec&&(this._sec._offset=this._offset)}prepareSecond(){return this._sec=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}projectCoord(t){if(this.second){const e=this._scroll,i=t[0];return i>=-180+e&&i<=180+e?this.project(t):this.second.project(t)}return this.project(t)}getVisible(t){if(this.isVisible(t))return this.projectCoord(t)}inSecond(t){return this.second&&(t<-180+this._scroll||t>180+this._scroll)}isClipping(){return!0}getScrolledLon(t){return((t+this._scroll)%360+540)%360-180}}const Ir=90,Nr=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Er extends kr{constructor(){super(),this._rotation=[0,0],this._r=Ir,this.bounds={x1:-90,x2:Ir,y1:-90,y2:Ir},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Nr(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Nr(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;Nr(-90-t),Nr(90-t),Nr(90+e),Nr(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*I,r=[Math.cos(s)*Math.sin(e*I)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Ir,i=t[1]/Ir,s=Math.sqrt(e*e+i*i),r=Math.asin(s),o=Math.sin(r),n=Math.cos(r),a=[Math.atan2(e*o,s*n)/I,Math.asin(s&&i*o/s)/I];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}inSecond(t){return!1}_rotate(t){const e=this._rotation[0]*I,i=(this._rotation[1]||0)*I,s=Math.cos(i),r=Math.sin(i),o=Math.cos(0),n=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*I+e,h=t[1]*I,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*o-u*n,c*s-_*r)/I,Math.asin(u*o+d*n)/I]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,o=Math.cos(r);let n=Math.cos(s)*o,a=Math.sin(s)*o,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*n+_*a-p*d*h,y:-u*_*n+d*a+p*_*h,z:p*n+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class Tr extends Pr{static loadMap(t,e){if(s(t)){const i=t.source;if(s(i)&&"Topology"===i.type&&s(i.objects)&&r(i.arcs))return new Tr(t,e);const o=t.map;if(s(o)&&"Topology"===o.type&&s(o.objects)&&r(o.arcs))return new Tr(t,e)}}_doLoad(t,e){const i=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>i(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(s(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let o=0,n=0;const a=r.map((r=>((r=r.slice())[0]=(o+=r[0])*t+i,r[1]=(n+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const s=d[t].geometries;if(r(s)&&s.forEach((t=>{const e=new Sr(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=i(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};r(e.excludeInternal)?e.excludeInternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":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)}))}))}})),ht.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};r(e.excludeExternal)?e.excludeExternal.forEach((e=>{r(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):r(e)&&1===e.length?t[e[0]]="":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)}))}))}})),ht.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,o=[],n=[];e.forEach((t=>{t instanceof Sr&&(i[0].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)))}));const a=o.flat(1/0),h=n.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 Ar(r.name,e))}}e.push(...s)}}function Vr(t,e){const{atan2:i,cos:s,sin:r,sqrt:o}=Math,n=t[1]*I,a=t[0]*I,h=e[1]*I,l=e[0]*I,c=h-n,d=l-a,_=r(c/2)*r(c/2)+s(n)*s(h)*r(d/2)*r(d/2),u=2*i(o(_),o(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(n)*s(a)+c*s(h)*s(l),_=t*s(n)*r(a)+c*s(h)*r(l),p=i(t*r(n)+c*r(h),o(d*d+_*_)),g=i(_,d);m.push([g/I,p/I])}}return m}function Dr(t,e){const i=t._base,s=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 Or?o=i:i[0]>=0&&(l=e.readBounds(i),h=s||h)}if(n(t.frame)&&t.frame.length>0){const e=Q(t.frame);let{h1:i,v1:r,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=_(i,o[t].h1),r=_(r,o[t].v1),n=u(n,o[t].h2),a=u(a,o[t].v2);const c=i+h[0]-e.l,d=n+h[0]+e.r,p=a+h[1]+e.t,g=r+h[1]-e.b;t.box=[[c,p],[d,p],[d,g],[c,g]],t.bounds=s?{h1:c-s[0],h2:d-s[0],v1:g-s[1],v2:p-s[1]}:{h1:c,h2:d,v1:g,v2:p}}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=_(t,o[e].h1),i=_(i,o[e].v1),s=u(s,o[e].h2),r=u(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 o=0;o<2;o++){const n=i[2*r+o],a=+n;if(isNaN(a)){const i=n.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===o?e.h1:e.v1))}else s.push(a+(0===o?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else r(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=s?{h1:l.h1-s[0],h2:l.h2-s[0],v1:l.v1-s[1],v2:l.v2-s[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const Rr=Math.min,$r=Math.max;class Or extends kt{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,o=this.v2;t[0].forEach((t=>{i=Rr(i,t[0]+e[0]),s=$r(s,t[0]+e[0]),r=Rr(r,t[1]+e[1]),o=$r(o,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=o}$_readInset(t,e){const i=t.coord,s=t.offset;let o=[0,0];return r(i)&&i.length>0&&(o[0]=isNaN(i[0])?0:+i[0]-e.h1,o[1]=isNaN(i[1])?0:+i[1]-e.v1),r(s)&&s.length>0&&(o[0]+=m(s[0],0),o[1]+=m(s[1],0)),t.off=o}$_toPath(t,e,i,s){const r=t.isGlobe,o=e[0].slice();if(i){for(let t=0;t<o.length;t++)o[t]=o[t].slice(0);o.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let n=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=o.map((e=>{const i=t.project(e);return i.outside||(n=Rr(n,i[0]),a=$r(a,i[0]),h=Rr(h,i[1]),l=$r(l,i[1])),i}));let d;if(this.x1=n,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=Vr(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(o),d=[];for(let r=0;r<c.length;r++){const n=o[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=n,o.push(n),c.push(a)),s&&i){Vr(i,n).forEach((e=>d.push(t.project(e))))}d.push(a),i=n,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 o of t)this.source.polygons[o][0].forEach((t=>{e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const o of t)for(const t of o)e=Rr(e,t[0]),i=$r(i,t[0]),s=Rr(s,t[1]),r=$r(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){const i=t.second;let s;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,r=!e||!1!==e.visible;if(e){if(r)if(this._insetChilds){let t=1/0,i=1/0;this.source.polygons.forEach(((e,s)=>{this._insetChilds.indexOf(s)>=0&&e[0].forEach((e=>{t=Rr(t,e[0]),i=Rr(i,e[1])}))})),s=this.$_readInset(e,{h1:t,v1:i}),this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Mi)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Mi))):this.$_readBound(this.source.polygon,Mi),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Mi))):this.$_readBound(this.source.polygon,Mi);s&&(this._insetChilds?(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,Mi)}))):(this.h1+=s[0],this.h2+=s[0],this.v1+=s[1],this.v2+=s[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;const o=t.inSecond(this.h1),n=o?i:t,a=o?t:i,h=o!==t.inSecond(this.h2);let l="",c="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?r&&(l+=this.$_toPath(n,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))):(l+=this.$_toPath(n,t,null,!0),h&&(c+=this.$_toPath(a,t,null,!0)))})):r&&this.source.polygons.forEach(((t,e)=>{l+=this.$_toPath(n,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))})):r&&(l=this.$_toPath(n,this.source.polygon,s,!0),h&&(c=this.$_toPath(a,this.source.polygon,s,!0))),this._path=l+c}return e.internals&&this.$_readInternal(t,this._insetChilds?Mi:s),e.externals&&this.$_readExternal(t,this._insetChilds?Mi:s),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Or;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Fr extends kt{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 Br extends kt{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 Br)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new _r({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,r(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof Tr&&this.source.internals}get hasExternals(){return this.source instanceof Tr&&this.source.externals}get hasBorders(){return this.source instanceof Tr&&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&&ki(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 o=this._areas[r],n=o.inset;let{h1:a,h2:h,v1:l,v2:c}=o.readBounds();if(null==n?void 0:n.coord){const[t,e]=n.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 Er)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=Ir,this.y2=Ir;else{let i=1/0,s=-1/0,r=1/0,o=-1/0,n=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=Rr(i,c.h1),s=$r(s,c.h2),r=Rr(r,c.v1),o=Rr(90,$r(o,c.v2)),n=Rr(n,c.x1),a=$r(a,c.x2),h=Rr(h,c.y1),l=$r(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof Pr){const e=this.source.paddings;r-=e.b,o+=e.t,i-=e.l,s+=e.r;const c=t.project([i,o]),d=t.project([s,r]);h=Math.min(d[1],h-e.b),l=Math.max(c[1],l+e.t),n=Math.min(c[0],n-e.l),a=Math.max(d[0],a+e.r)}o>83.63&&this.source.alignArctic&&(o=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,o])[1]),(this._world=i<=-180&&s>=180)&&(n=Math.min(n,-a),a=Math.max(-n,a)),this.h1=$r(-180,i),this.v1=$r(-90,r),this.h2=Rr(180,s),this.v2=Rr(90,o),this.x1=n,this.y1=h,this.x2=a,this.y2=l;const c=this.source instanceof Pr?this.source.bounds:void 0;c&&4===c.length?this.$_setBoundsByOption(c,t):this.$_hasArea()?this._world=this.h1<=-180&&this.h2>=180:this.$_setBoundaryByWorld(t),this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_hasArea(){return 0!==this._areas.length}$_setBoundaryByWorld(t){this.h1=-180,this.v1=-90,this.h2=180,this.v2=90;const e=t.project([this.h1,this.v2]),i=t.project([this.h2,this.v1]),s=t.project([this.h1,this.v1]),r=t.project([this.h2,this.v2]);this.x1=Math.min(e[0],i[0],s[0],r[0]),this.x2=Math.max(e[0],i[0],s[0],r[0]),this.y1=Math.min(e[1],i[1],s[1],r[1]),this.y2=Math.max(e[1],i[1],s[1],r[1]),this._world=!0}$_setBoundsByOption(t,e){let i=t[0],s=t[1],r=t[2],o=t[3],n=e.project([i,o]),a=e.project([r,s]),h=e.project([i,s]),l=e.project([r,o]);if([n,a,h,l].every((t=>function(t){if(!t)return!1;const e=isFinite(t[0]+t[1]),i=-180<=t[0]&&t[0]<=180,s=-90<=t[1]&&t[1]<=90;return e&&i&&s}(t))))this.h1=i,this.v1=s,this.h2=r,this.v2=o;else{if(this.$_hasArea())return;this.$_setBoundaryByWorld(e)}this.x1=Math.min(n[0],a[0],h[0],l[0]),this.x2=Math.max(n[0],a[0],h[0],l[0]),this.y1=Math.min(n[1],a[1],h[1],l[1]),this.y2=Math.max(n[1],a[1],h[1],l[1]),this._world=t[0]<=-180&&t[2]>=180}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const o=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,o=r&&r[s];if(!o)continue;const n=t.readPolygonBounds(o);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=n),t.mainLandBounds.x1=Rr(t.mainLandBounds.x1,n.x1),t.mainLandBounds.x2=$r(t.mainLandBounds.x2,n.x2),t.mainLandBounds.y1=Rr(t.mainLandBounds.y1,n.y1),t.mainLandBounds.y2=$r(t.mainLandBounds.y2,n.y2)}t.mainLandBounds||(t.mainLandBounds=o)}$_load(t){var e;const i=t.insets,s=t.idKey,o=null!==(e=t.nameKey)&&void 0!==e?e:"name",n=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 Sr){const r=b(e.props[s],e.id);if(r&&t.included(r)){const t=i[r],s=new Or(e,t);t&&(delete i[r],t._area=s,_.push(t)),h&&h.indexOf(r)>=0?(l.unshift(s),s.dummy=!0):l.push(s),c[s.id=r]=s,s.name=b(e.props[o],e[o])}}else if(e instanceof Ar){const t=new Fr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const s=c[t[i]];if(s){const o=e.polygons[i];s.inset=e,s._insetChilds=r(o)?o:[o],e._parent=t[i],e._base=s._insetChilds,e._area=s,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=r(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(r(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],s=e._children=[];if(r(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=Rr(t,r.h1),s=Rr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const r of e.children){const e=c[r];if(e){const o=e.inset={area:r,offset:i};t.push(e),o._area=e,s.push(o)}}_.push(e)}}if(n&&!isNaN(+t.dokdo)){const e=c[n.group];if(e){const i=+t.dokdo;if(e.source=new Lr(e.source,i,+n.index,+n.parent),0===i){const t=+n.index;for(const e of _)if(e._parent===n.group&&r(e._base)){const i=e._base;i.indexOf(t)>=0&&(e._base=i.filter((e=>e!==t)))}}}}this.reset(),_.forEach((t=>Dr(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 Br(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class zr extends ci{getText(t){return ht.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}zr.defaults=ri(wi.defaults,{offset:4});class jr extends wi{_doInit(t){super._doInit(t),this._label=this._addChild("label",new zr(this.chart))}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}jr.defaults=ri(wi.defaults,{visible:!1});class Gr extends ai{getItemGap(){var t;return null!==(t=this.prop("itemGap"))&&void 0!==t?t:Gr.ITEM_GAP}}Gr.ITEM_GAP=4,Gr.defaults=ri(ai.defaults,{offsetX:8,offsetY:8,itemGap:3});class Hr extends Gr{get vertical(){return"vertical"===this.prop("direction")}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this.prop("buttonWidth"))&&void 0!==t?t:this.prop("buttonHeight"))&&void 0!==e?e:Hr.BUTTON_SIZE,height:null!==(s=null!==(i=this.prop("buttonHeight"))&&void 0!==i?i:this.prop("buttonWidth"))&&void 0!==s?s:Hr.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this.prop("zoomFactor"))&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.body.prop("zoomable")&&(this.chart.body.isZoomed||this.prop("showAlways"))}}Hr.BUTTON_SIZE=24,Hr.defaults=ri(Gr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Wr extends Gr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Wr.defaults=ri(Gr.defaults,{type:"text",align:"left",verticalAlign:"top"});class Yr extends kt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,i=!1){const s=e.filter(Boolean);let r;return i&&(r=this.clear()),this._items.push(...s),t.selectList(s),this._owner.selectionItemAdded(s),this._changed(),r}remove(t,e){const i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,1),t.unselect(e),this._owner.selectionItemRemoved([e]),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,[e])}_changed(){this._owner.selectionChanged([this])}}class Zr extends ai{isVisible(){return this.visible&&!B(this.prop("text"))}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Zr.defaults=ri(ai.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Ur extends Zr{}Ur.defaults=ri(Zr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Xr extends ai{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=b(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?Ce.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)}}Xr.defaults=ri(ai.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:25,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",mode:"line"});const qr=/(.*)/,Kr=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))');class Jr{static getFormatter(t){let e=Jr.Formatters[t];return e||(Jr.Formatters[t]=e=new Jr(t)),e}constructor(t){this._pattern=qr,this._replace="$1",this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(Kr);if(e.length>1){let t=e[0].trim(),i=e[1].trim();t&&i&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==i.charAt(0)&&(i=t.substr(1,i.length-2)),i&&(this._pattern=new RegExp(t,e[2]||""),this._replace=i)))}}}}Jr.Formatters={};class Qr extends $i{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(this._paramRegx,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(e[0]):this._params[e[0]];if(void 0===i&&(i=e[1]),e.length>3)switch(e[3]){case"t":i=Jr.getFormatter(e[2]).toStr(String(i));break;case"d":if(n(i))i=new Date(i);else{const t=parseFloat(i);isNaN(t)||(i=new Date(t))}i instanceof Date&&(i=Be.getFormatter(e[2]).toStr(i,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(i);isNaN(t)||(i=Ce.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=Jr.getFormatter(e[2]).toStr(String(i))):i=Ce.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this.prop("visible")&&!z(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({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=o(i)?i:null}}Qr.type="html",Qr.defaults=ri($i.defaults,{});class to extends $i{_isVisible(){return this.prop("visible")&&!z(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}to.type="image",to.defaults=ri($i.defaults,{});class eo extends $i{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||eo.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}eo.type="shape",eo.defaults=ri($i.defaults,{width:64,height:64,shape:"square"});class io extends $i{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this.prop("visible")&&!z(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?Ce.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Be.getFormatter(t):void 0)}(t.timeFormat)}}io.type="text",io.defaults=ri($i.defaults,{text:"Text"});class so extends kr{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 ro=1.340264,oo=-.081106,no=893e-6,ao=.003796,ho=Math.sqrt(3)/2,lo=74.03120656864502;class co extends kr{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=I,i=Math.asin(ho*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)*lo/(ho*(ro+3*oo*s+r*(7*no+9*ao*s))),i*lo*(ro+oo*s+r*(no+ao*s))]}backward(t){const e=t[0]/lo,i=t[1]/lo,s=180/Math.PI;let r,o,n,a,h,l=i;for(let t=0;t<12&&(r=l*l,o=r*r*r,n=l*(ro+oo*r+o*(no+ao*r))-i,a=ro+3*oo*r+o*(7*no+9*ao*r),l-=h=n/a,!(Math.abs(h)<1e-9));++t);r=l*l,o=r*r*r;const c=s*ho*e*(ro+3*oo*r+o*(7*no+9*ao*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/ho);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const _o=63.78137,uo=Math.PI/180;class po extends kr{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*uo);return[_o*(t[0]+this.offset[0]-this.scroll)*uo,_o*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(_o*uo),(2*Math.atan(Math.exp((t[1]-this.offset[1])/_o))-Math.PI/2)/uo]}}const go=Math.PI/4,mo=Math.PI/180,fo=63.78137;class bo extends kr{project(t){return[(t[0]+this.offset[0]-this.scroll)*mo*fo,79.7267125*Math.log(Math.tan(go+.4*(t[1]+this.offset[1])*mo))]}backward(t){return[(t[0]-this.offset[0])/fo/mo,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/fo*.8))-go)/mo]}}class yo extends xs{}class wo extends vs{_doInit(t){super._doInit(t),this._addChild("subLabel",this._subLabel=this._createLabel(this.chart))}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this.prop("barOrder")}getFieldColors(){return this._fieldColors}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new yo(t)}_defLabelOff(){return this.$_isLabelCenter()?wo.LABEL_OFFSET_CENTER:wo.LABEL_OFFSET_AUTO}_createLegendMarker(t,e){return ji.create(t,Li,0,0,e,e,2)}setCalcedColor(t,e){if(super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories){const t=this.prop("fieldColors");r(t)?this._fieldColors=t:this._fieldColors=this._splitColors()}}$_isLabelCenter(){return"center"===this.pointLabel.prop("position")}}wo.LABEL_OFFSET_CENTER=0,wo.LABEL_OFFSET_AUTO=2,wo.type="bar",wo.defaults=ri(vs.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class xo extends ai{constructor(t){super(t.chart),this.gauge=t}}class vo extends xo{}vo.defaults=ri(ai.defaults,{visible:!1});class Co extends xo{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Co.defaults=ri(ai.defaults,{});class So extends xo{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}So.defaults=ri(ai.defaults,{thickness:"100%",stroked:!1});class Lo extends xo{getExtents(t){return{radius:Y(this._radiusDim,t,0),length:Y(this._lengthDim,t,0),offset:Y(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Lo.defaults=ri(ai.defaults,{visible:!1,radius:3,length:"100%",offset:0});class Mo extends xo{getRadius(t){return Y(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}Mo.defaults=ri(ai.defaults,{visible:!1,radius:5});class Ao extends li{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:Y(this._offsetXDim,t,0),y:Y(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ao.defaults=ri(li.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class Po{constructor(){this.setCenterX(Io.DEF_CENTER),this.setCenterY(Io.DEF_CENTER),this.setRadius(Io.DEF_RADIUS),this.setInnerRadius(Io.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=W(b(t,Io.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(b(t,Io.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(b(t,Io.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(b(t,Io.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),i=_(e,this._innerDim?Y(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?Y(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=m(t%360,0),s=u(0,_(360,m(e,360)));this._startRad=k+I*i,this._handRad=I*i,this._sweepRad=I*s}}class ko extends Cs{_readObject(t,e){super._readObject(t,e)}}class Io extends Ls{_doInit(t){super._doInit(t),this._face=this._addChild("face",new vo(this)),this._rim=this._addChild("rim",new Co(this)),this._valueRim=this._addChild("valueRim",new So(this)),this._hand=this._addChild("hand",new Lo(this)),this._pin=this._addChild("pin",new Mo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Ao(this.chart)),this._props=new Po}get face(){return this._face}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}_createPoint(t){return new ko(t)}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}_doPrepareRender(t){super._doPrepareRender(t),this._props.prepareAngles(this.prop("startAngle"),this.prop("sweepAngle"))}}Io.DEF_CENTER="50%",Io.DEF_RADIUS="50%",Io.DEF_INNER="80%",Io.type="gauge",Io.defaults=ri(Ls.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class No extends ai{constructor(t){super(t.chart),this.gauge=t}}class Eo extends No{getThickness(t){return Y(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Eo.defaults=ri(ai.defaults,{thickness:3});class To extends No{getLength(t){return Y(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}To.defaults=ri(ai.defaults,{thickness:1.5,length:"55%"});class Vo extends To{}Vo.defaults=ri(To.defaults,{thickness:1,length:"80%"});class Do extends To{}Do.defaults=ri(To.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Ro extends No{}Ro.defaults=ri(ai.defaults,{length:5});class $o extends No{}$o.defaults=ri(ai.defaults,{step:1,offset:0});class Oo extends No{}Oo.defaults=ri(ai.defaults,{radius:4});class Fo extends li{}Fo.defaults=ri(li.defaults,{text:"RealMap",position:"top"});class Bo extends Cs{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=m(e.time,NaN),this.timezone=m(e.timezone,NaN)}}class zo extends Ss{_doInit(t){super._doInit(t),this._face=this._addChild("face",new ai(this.chart)),this._rim=this._addChild("rim",new Eo(this)),this._hourHand=this._addChild("hourHand",new To(this)),this._minuteHand=this._addChild("minuteHand",new Vo(this)),this._secondHand=this._addChild("secondHand",new Do(this)),this._tick=this._addChild("tick",new Ro(this)),this._tickLabel=this._addChild("tickLabel",new $o(this)),this._pin=this._addChild("pin",new Oo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Fo(this.chart))}get face(){return this._face}get rim(){return this._rim}get hourHand(){return this._hourHand}get minuteHand(){return this._minuteHand}get secondHand(){return this._secondHand}get tick(){return this._tick}get tickLabel(){return this._tickLabel}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}getExtents(t,e,i){const s=_(t,e)*i;return{cx:Y(this._centerXDim,t,t/2),cy:Y(this._centerYDim,e,e/3),rd:Y(this._radiusDim,s,s/2)}}_createPoint(t){return new Bo(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=W(b(e._centerX=t,zo.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=W(b(e._centerY=i,zo.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=W(b(e._radius=s,zo.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}zo.DEF_CENTER="50%",zo.DEF_RADIUS="50%",zo.type="clock",zo.defaults=ri(Ss.defaults,{centerX:zo.DEF_CENTER,centerY:zo.DEF_CENTER,radius:zo.DEF_RADIUS,active:!0,size:70});class jo extends ms{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Go extends ai{getSize(){return{width:this.prop("width"),height:this.prop("height")}}}Go.defaults=ri(ai.defaults,{});class Ho extends gs{_doInit(t){super._doInit(t),this._innerLabel=this._addChild("innerLabel",new Qi(this.chart)),this._innerImage=this._addChild("innerImage",new Go(this.chart))}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this.prop("figure")}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this.prop("width"),i=this.prop("height");return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(this.prop("figureBox"))}_createPoint(t){return new jo(t)}_defLabelOff(){return 2}getValueRange(){return{min:this._minValue,max:this._maxValue}}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._visPoints,{min:s,max:r}=this._calcMinMax(i);this._minValue=s,this._maxValue=r}$_calcBox(t){if(r(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}Ho.type="figure",Ho.defaults=ri(gs.defaults,{position:"top"});class Wo extends us{_readObject(t,e){super._readObject(t,e)}}class Yo extends Qi{}Yo.defaults=ri(ds.defaults,{visible:!1});class Zo extends ps{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}getSize(){return{width:+this._op.htmlWidth,height:+this._op.htmlHeight}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t,e){return e.replace(this._paramRegx,((e,i)=>this.$_apply(t,i)))}_createLabel(t){return new Yo(t)}_createPoint(t){return new Wo(t)}_createFielders(t){super._createFielders(t),this._htmlFielder=this._createFielder(t.htmlField||"html")}_defLabelOff(){return 2}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},ht.isObject(i)?i:null,this._userParams),this._paramCallback=o(i)?i:null}$_apply(t,e){const i=e.split(";");let s=b(this._paramCallback?this._paramCallback(i[0]):this._params[i[0]],t.getParam(i[0]));if(void 0===s&&(s=i[1]),i.length>3)switch(i[3]){case"t":s=Jr.getFormatter(i[2]).toStr(String(s));break;case"d":if(n(s))s=new Date(s);else{const t=parseFloat(s);isNaN(t)||(s=new Date(t))}s instanceof Date&&(s=Be.getFormatter(i[2]).toStr(s,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(s);isNaN(t)||(s=Ce.getFormatter(i[2]).toStr(t))}else if(i.length>2){const t=+s;isNaN(t)?s&&(s=Jr.getFormatter(i[2]).toStr(String(s))):s=Ce.getFormatter(i[2]).toStr(t)}return s||""}}Zo.DEF_SIZE=100,Zo.type="html",Zo.defaults=ri(ds.defaults,{position:"center"});class Uo extends Qi{}Uo.defaults=ri(Qi.defaults,{visible:!1});class Xo extends qi{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class qo extends ds{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Uo(t)}_createPoint(t){return new Xo(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this.prop("rootUrl")||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}qo.type="image",qo.defaults=ri(ds.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Ko extends Zt{constructor(t,e){super(t,Li),this.add(this._area=new Kt(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new Kt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class Jo extends xs{}class Qo extends ai{}Qo.defaults=ri(vs.defaults,{visible:!1});class tn extends vs{_doInit(t){super._doInit(t),this._addChild("area",this._area=new Qo(this.chart))}get area(){return this._area}_createPoint(t){return new Jo(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Ko(t,e)}}tn.type="line",tn.defaults=ri(vs.defaults,{});class en extends us{_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?b(super.getParam(t),this.area.source.props[t]):super.getParam(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class sn extends ai{}sn.defaults=ri(ai.defaults,{enabled:!0,autoMapChange:!0});class rn extends ai{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)}}rn.defaults=ri(ai.defaults,{});class on extends ai{constructor(t,e){super(e.chart),this.name=t,this.series=e}}on.defaults=ri(ai.defaults,{visible:!1});class nn extends ci{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(o(i.textCallback)){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if("function"==typeof this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(o(this._op.visibleCallback))return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}nn.defaults=ri(ci.defaults,{visible:void 0});class an extends Qi{}an.defaults=ri(Qi.defaults,{visible:!1,hoverColor:"white"});class hn extends ps{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),this._drilldown=this._addChild("drilldown",new sn(this.chart)),this._insetLabel=this._addChild("insetLabel",new nn(this.chart)),this._internalBorder=this._addChild("internalBorder",new on(null,this)),this._externalBorder=this._addChild("externalBorder",new on(null,this))}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t){return this._map.get(t)}pointOf(t){return this._areaPts.get(t.id)}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 en||(t=this.pointById(t)),t.center||t.area.getCenter()}getValueRange(){return{min:this._minValue,max:this._maxValue}}getDetailed(){return this._detailed?this._detail:this}showDetail(){this._detail&&!this._detailed&&(this._detailed=!0,this._detail.show(!0,!0),this.hide(!0))}showParent(){this._parent&&this._parent._detail===this&&(this.hide(!0),this._parent._detailed=!1,this._parent.show(!0,!0))}isMapSeries(){return!0}_createLabel(t){return new an(t)}$_createDetail(){return this._detail||(this._detail=new hn(this.chart),this._addChild("detail",this._detail),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),s(e.detail)&&this.$_createDetail().loadOptions(e.detail)}_doApply(t){if(this.getDetailed()||(s(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),i.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(r(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new en(t)}_getPointArgs(t,e){return super._getPointArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:r(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,s(e.colorRange)){const t=g(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new $s(t)}else this._colorRanger=null===(i=t.getColorScale(this.getColorScale()))||void 0===i?void 0:i.getRanger()}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,i=(r(t)?t[0]:t)||"id",s=(r(t)?t.length>1?t[1]:t[0]:t)||"id",o="id"===s,n=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{const e=t;e.area=o?n[e[s]]:n[e.source[s]],e.area&&a.set(e.area.id,e)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ge(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t){t&&(t.setSelected(!0),this.chart._selectionChanged(this,[t]))}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0);this.chart._selectionChanged(this,e)}isEmpty(t){return 0===this.map.areaCount}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new rn(t.name,this);i.init(),i.loadOptions(t),e.push(i)}))}}hn.type="map",hn.defaults=ri(ps.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class ln extends Qi{}ln.defaults=ri(Qi.defaults,{visible:!1});class cn extends us{}class dn extends ai{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 ii),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}dn.defaults=ri(ai.defaults,{});class _n extends dn{getMinSize(t){return Y(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}_n.defaults=ri(dn.defaults,{text:"${name}"});class un extends dn{}un.defaults=ri(dn.defaults,{text:"${value}"});class pn extends gs{_doInit(t){super._doInit(t),this._header=this._addChild("header",new _n(this)),this._divider=this._addChild("divider",new ai(this.chart)),this._body=this._addChild("body",new un(this))}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:m(this._width,ht.clampEx(t,this._minWidth,this._maxWidth)),height:m(this._height,ht.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new ln(t)}_createPoint(t){return new cn(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t);const e=this.prop("orientation"),i=this.prop("minWidth"),s=this.prop("minHeight");this._vertical="horizontal"!==e,this._minWidth=+i,this._minHeight=+s}}pn.DEF_MIN_WIDTH=80,pn.DEF_MIN_HEIGHT=50,pn.type="panel",pn.defaults=ri(gs.defaults,{orientation:"vertical",minWidth:pn.DEF_MIN_WIDTH,minHeight:pn.DEF_MIN_HEIGHT,position:"top"});class gn extends bs{}class mn{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class fn extends ws{getRadius(t){return m(Y(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}getFieldColors(){return this._fieldColors}_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=m(this.prop("startAngle")%360,0),s=u(0,_(360,m(this.prop("totalAngle"),360)));this._startRad=k+I*i,this._totalRad=I*s}setCalcedColor(t,e){this._op,super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories&&(r(this.prop("fieldColors"))?this._fieldColors=this.prop("fieldColors"):this._fieldColors=this._splitColors())}$_parseThresholds(t){return r(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new mn(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new mn(t.value,t.radius,t.style)]:void 0}}fn.type="pie",fn.defaults=ri(ws.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class bn extends Kt{constructor(t,e){super(t,Li),this._rd=e,this.setPath(Vi.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 yn extends ms{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class wn extends fs{getExt(t,e){const i=m(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t);const e=this.prop("radius"),i=this.prop("innerRadius");this._rd=m(e,wn.DEF_RADIUS),this._innerRd=m(i,0)}_createPoint(t){return new yn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new bn(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ge(this._calcedColor)}getColorScale(){return this.prop("colorScale")}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);this._minValue=r,this._maxValue=o,this._colorRanger=null===(i=t.getColorScale(this.prop("colorScale")))||void 0===i?void 0:i.getRanger()}}wn.DEF_RADIUS=9,wn.type="pin",wn.defaults=ri(fs.defaults,{radius:wn.DEF_RADIUS,innerRadius:0,position:"top"});class xn extends Zt{constructor(t,e){super(t,Li),this._size=e,this.add(this._marker=new Kt(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);Vi.setShape(this._marker,this._shape,e,e)}}class vn extends ai{get acitve(){return this.visible&&this._runner&&this._runner.active}get clusters(){return this.visible&&this._runner?this._runner.clusters:null}run(t,e,i,s,r,o){t.forEach((t=>t.cluster=null)),this._runner="grid"===this._op.algorithm?new Sn:new Cn,this._runner.prepare(this,e,i).run(this,t,s,r,o)}stop(){}updateClusters(){this._runner.updateClusers()}clear(){var t;null===(t=this._runner)||void 0===t||t.clear()}isVisible(t){return this.acitve&&t.points.length>1||!this.acitve&&t.points.length>=this._op.minDensity}getRange(t){const e=this._ranges;if(e){const i=t.points.length;for(const t of e)if(i>=t.from&&i<t.to)return t}return{radius:this._op.radius}}isExpandable(){return!1!==this._op.expandable}_doApply(t){super._doApply(t),t.distance=m(t.distance,40),t.minDensity=m(t.minDensity,2),t.maxIteration=m(t.maxIteration,100),t.stepDuration=m(t.stepDuration,50),t.radius=m(t.radius,15),this._ranges=this.$_parseRanges(t.ranges)}$_parseRanges(t){const e=[];if(r(t)&&t.length){const i=this._op.radius;let r=-1/0;t.forEach(((t,o)=>{if(s(t)){const s={from:m(r,t.from),to:m(t.to,1/0),radius:m(t.radius,i),color:t.color};e.push(s),r=s.to}e.length>1&&e.sort(((t,e)=>t.from-e.from))}))}return e.length>0?e:null}}vn.defaults=ri(ai.defaults,{visible:!1,distance:40,minDensity:2,maxIteration:100,stepDuration:50,zoomLimit:300,radius:15});class Cn{constructor(){this._ani=null}get active(){return this._clusters&&this._clusters.length>0&&!this._completed}get clusters(){return this._clusters}prepare(t,e,i){return this}run(t,e,i,s,r){const o=this._clusters=this.$_buildDensitySeeds(t,e);if(o.length>0&&!this._completed){const n=this.$_iterate(t,e,o),a=e=>{if(e-this._last>=t.prop("stepDuration")){const t=n.next();t.done?r(o):(s(t.value.step,t.value.clusters),this._ani=requestAnimationFrame(a)),this._last=e}else o.forEach((t=>{t.points.forEach((t=>t.moves+=1/Cn.MOVE_STEPS))})),s(-1,null),this._ani=requestAnimationFrame(a)};this._completed=!1,i(o),a(this._last=performance.now())}else this._completed=!0}stop(){null!==this._ani&&(cancelAnimationFrame(this._ani),this._ani=null),this._completed=!0}updateClusers(){this._clusters&&this.$_updateCentroids(this._clusters)}clear(){this._clusters&&(this._clusters.forEach((t=>{t.points.forEach((t=>t.cluster=void 0))})),this._clusters=null)}$_buildDensitySeeds(t,e){const i=2*t.prop("distance"),s=new Map;for(const t of e){const e=`${Math.floor(t.px/i)},${Math.floor(t.py/i)}`;s.has(e)||s.set(e,[]),s.get(e).push(t),t.cluster=null,t.moves=1}const r=[];for(const t of s.values()){const e=t.reduce(((t,e)=>t+e.px),0)/t.length,i=t.reduce(((t,e)=>t+e.py),0)/t.length;r.push({cx:e,cy:i,points:[],prevs:[]})}return r}$_assignPoints(t,e,i,s){s*=s,i.forEach((t=>{t.prevs=t.points,t.points=[]}));for(const r of e){let e=i[0],o=1/0;for(const t of i){const i=(r.px-t.cx)**2+(r.py-t.cy)**2;i<o&&(o=i,e=t)}(r.px-e.cx)**2+(r.py-e.cy)**2<=s&&(e.points.push(r),e.points.length>=t.prop("minDensity")&&e.points.forEach((t=>{t.cluster!==e&&(t.cluster=e,t.moves=0)})))}this._completed=!0;for(const t of i)if(!ht.equalArrays(t.points,t.prevs)){this._completed=!1;break}for(const t of i)for(const e of t.points)this._completed?e.moves=1:e.moves+=1/Cn.MOVE_STEPS}$_updateCentroids(t){for(const e of t){const t=e.points.length;t>0&&(e.cx=e.points.reduce(((t,e)=>t+e.px),0)/t,e.cy=e.points.reduce(((t,e)=>t+e.py),0)/t)}}*$_iterate(t,e,i){for(let s=0;s<t.prop("maxIteration")&&!this._completed;s++)this.$_assignPoints(t,e,i,t.prop("distance")),this.$_updateCentroids(i),yield{step:s,clusters:i}}}Cn.MOVE_STEPS=10;class Sn{get active(){return!1}get clusters(){return null}prepare(t,e,i){return this}run(t,e,i,s,r){}stop(){}updateClusers(){}clear(){}}class Ln extends ms{_readObject(t,e){super._readObject(t,e)}}class Mn extends fs{constructor(t){super(t),this._shape=t.getNextPointShape()}_doInit(t){super._doInit(t),this._cluster=this._addChild("cluster",new vn(this.chart))}getShape(){return this.prop("shape")||this._shape}getRadius(){return this.prop("radius")}setLegendMarkerStyle(t){this._stroke&&(t.internalSetStyle("stroke",this._stroke),t.internalSetStyle("stroke-width",this._strokeWidth))}get cluster(){return this._cluster}_createPoint(t){return new Ln(t)}_defLabelOff(){return 2}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(),_(e,2*this.prop("radius"))),i}}Mn.type="point",Mn.defaults=ri(fs.defaults,{radius:5,position:"center"});class An extends Zt{constructor(t,e){super(t,Li),this.add(this._line=new Kt(t)),this.add(this._arrow=new Kt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=$(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,o="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),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 Pn extends qi{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return l(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,s;const o=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(s=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==s?s:[],this.path=null!=e.path?o(e.path):void 0,this.imageUrl=e.imageUrl||t.imageFielder(e)}}class kn extends ds{get imageFielder(){return this._imageFielder}getImageUrl(t,e=!0){const i=e?this._root:"";return t.imageUrl?i+t.imageUrl:this._imageUrl?i+this._imageUrl:null}getRouteMode(){return this.chart.isGlobe?Fi:this._op.routeMode}getLineWidth(){return m(this._op.lineWidth,0)}getCurvePoint(t,e,i){const s=this.chart.getProjection(),r=t.getProp("curveFactor")||this._op.curveFactor,o=s.scroll;let n;return s.scroll=0,n=0===r?[e,i].map((t=>s.project(t))):this.$_getCurvePointBycurveFactor(e,i,r),s.scroll=o,n}needMapScale(){return!0}_createPoint(t){return new Pn(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;s(e)&&(t=t.map((t=>{const i=l({},t);if(r(i.coords)){const t=i.coords.slice();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 An(t,e)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_doApply(t){super._doApply(t),this._root=this._op.imageRootUrl||"",this._imageUrl=this._op.imageUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}$_getCurvePointBycurveFactor(t,e,i){const s=this.chart.getProjection(),r=e[0]-t[0]>0?1:-1,o=s.project(t),n=s.project(e),a=n[0]-o[0],h=n[1]-o[1],l=(o[0]+n[0])/2,c=(o[1]+n[1])/2,d=Math.sqrt(a*a+h*h),_=l+-h/d*i*r,u=c+a/d*i*r,p=a/d,g=h/d,m=d/8;return[[_-p*m,u-g*m],[_+p*m,u+g*m]]}}kn.type=zi,kn.defaults=ri(ds.defaults,{routeMode:"geo",lineType:"air",arrowDisplay:"always",arrowWidth:5,arrowLength:13,curveFactor:0,imageWidth:42,imageHeight:42});class In extends bs{}class Nn extends ws{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),o={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(o);else this.$_fillColFirst(o);return{grid:s,count:r,rows:o.rows,cols:o.cols}}_createPoint(t){return new In(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Nn.ROW_COUNT,this._colCount=t.colCount||Nn.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Nn.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Nn.CELL_SIZE,this._gap=m(t.gap,Nn.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=r(t.values)?t.values.reduce(((t,e)=>t+m(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*m(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 o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,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=o,t.cols=n}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,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=o,t.cols=n}}Nn.ROW_COUNT=10,Nn.COL_COUNT=10,Nn.THRESHOLD=1,Nn.CELL_SIZE=5,Nn.GAP=2,Nn.type="waffle",Nn.defaults=ri(ws.defaults,{rowCount:Nn.ROW_COUNT,colCount:Nn.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Nn.THRESHOLD,cellSize:Nn.CELL_SIZE,gap:Nn.GAP});class En extends Pr{static loadMap(t,e){return s(t)&&s(t.source)&&r(t.source.features)||s(t)&&s(t.map)&&r(t.map.features)?new En(t,e):s(t)&&r(t.bounds)&&4===t.bounds.length&&t.bounds.every(a)?new En({...t,map:{features:[]}},e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Sr(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 Tn extends ai{}class Vn extends ai{}class Dn extends bi{constructor(t,e){super(t),this.inBody=e,this._zoom=100,this._panX=0,this._panY=0,this.scroll=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))}}_doInit(t){t.target=(this._target=new Tn(this.chart)).init(),t.connector=(this._connector=new Vn(this.chart)).init()}get target(){return this._target}get connector(){return this._connector}prepareLayout(t,e){return this.$_prepareLayout(t,e)}refresh(){}_getNamePrefix(){return"mapregion"}_doPrepareRender(t,e){const i=this._map=t.map,s=t.getProjection(),r=e.bounds,o=Math.abs(r[0][0]-r[1][0]),n=Math.abs(r[0][1]-r[1][1]),a=Math.abs(i.x2-i.x1)/o,h=Math.abs(i.y2-i.y1)/n,l=[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2],[c,d]=s.project(l);this._zoom=100*Math.min(a,h),s.isGlobe||(t.body.isScrollable()?this.scroll=l[0]:this._panX=c-i.cx,this._panY=-d+i.cy)}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:o,y2:n}=i,a=this._wMap=r-s,h=n-o,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=m(this._panX*d,0),u=m(this._panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(o+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=o+h/2-b/2-this._panY;return this._vRect=dt.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}}Dn.defaults=ri(ai.defaults,{width:200});class Rn extends yi{getRegion(t){const e=this._map[t];if(e instanceof Dn)return e}_loadItem(t,e,i,s){const r=new Dn(t,s);return r.init(),r.index=i,r.loadOptions(e),r}}class $n extends ut{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=m(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 On extends ut{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=m(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 Fn extends ai{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}Fn.defaults=ri(ds.defaults,{visible:void 0,globeFill:"lightblue"});const Bn={zoom:1,panX:1,panY:1};class zn extends ai{constructor(t){super(t),this._prj=(new so).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=dt.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new Oi(this)}_doInit(t){super._doInit(t),this._addChild("mapBackground",this._mapBackground=new Fn(this.chart))}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){var t;return(null===(t=this._map)||void 0===t?void 0:t.isWorld)&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof Er?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Er?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){return this._prj.scroll}set scroll(t){this.updateOption("scroll",t)}get movable(){return!1!==this.prop("movable")}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this.prop("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.chart.globalMapBound,e=[t.x1+(t.x2-t.x1)/2,t.y1+(t.y2-t.y1)/2];return this._prj?this._prj.backward(e):e}get map(){return this._map}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}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.chart.globalMapBound,r=i.getYRange(s.v1,s.v2),o=i.project([s.h1,r[0]]),n=i.project([s.h2,r[1]]),a=this._wMap=n[0]-o[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=this.$_calculateRate(t,e,a,l),d=this._scale=this._zoom/100*c,_=m(this.prop("panX")*d,0),u=m(this.prop("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*a/360,g=t/2-(o[0]+a/2)*d-(this._panX+p)*d,f=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=dt.create(w,x,b,y),{scale:d,wMap:a,hMap:l,tx:g,ty:f}}$_prepareLayout(t,e){const i=this.chart.globalMapBound,{x1:s,x2:r,y1:o,y2:n}=i,a=this._wMap=r-s,h=n-o,l=this.$_calculateRate(t,e,a,h),c=this._zoom/100,d=this._scale=c*l,_=m(this.prop("panX")*d,0),u=m(this.prop("panY")*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,g=e/2+(o+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=o+h/2-b/2-this._panY;return this._vRect=dt.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}$_calculateRate(t,e,i,s){const r=Math.min(t/i,e/s);return 0!==r?r:1}getPoint(t){return this._points[t]}toVisible(t){if(this.isFlatWorld)return this._prj.getVisible(t);{const e=this._prj.getVisible(t);if(e&&this._vRect.contains(e[0],e[1]))return e}}isScrollable(){var t;return this.prop("scrollable")&&(null===(t=this.map)||void 0===t?void 0:t.isWorld)}setZoom(t,e=300){let i,r;a(e)?r=e:o(e)?(i=e,r=300):s(e)&&(i=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new $n(this,t,r,i).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}zoomByFactor(t,e=!0){if(!isNaN(t)){const i=this.zoom;e?this.setZoom(i+i*t/100):this.zoom=i+i*t/100}}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new On(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){var r;const o={...Di,...s},n=null===(r=this.map)||void 0===r?void 0:r.areaOf(t);if(!n)return;const a=n.getCenter(),{x1:h,x2:l,y1:c,y2:d}=n.mainLandBounds,{zoom:_}=this.calcZoomInfo([h,c],[l,d],e),u=Math.min(o.maximumZoom,Math.max(o.minimumZoom,_));new On(this,u,a,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:o}=this.calcZoomInfo(t,e,s);try{new On(this,o,r,i,null).start()}catch(t){console.error(t)}}calcZoomInfo(t,e,i){const s=this.map,r=Math.abs(e[0]-t[0]),o=Math.abs(e[1]-t[1]),n=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=Math.abs(s.x2-s.x1)/r*i,h=Math.abs(s.y2-s.y1)/o*i;return{center:n,zoom:100*Math.min(a,h)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this.chart.globalMapBound,i=e.x1+(e.x2-e.x1)/2,s=e.y1+(e.y2-e.y1)/2,[r,o]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(0!==this.scroll||this.isScrollable()?this.scroll=t[0]:this.panX=r-i,this.panY=-o+s)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Bn;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 Bn)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,o;const a=this;var h;super._doApply(t),i.call(t,"annotations")&&(h=t.annotations)!==a._anns&&(a._anns=h,a._annotations.load(h,!0));const l=this._zoom;let c=function(t){if(void 0!==t&&t!==a._projection){switch(a._projection=t,a._projection.toLowerCase()){case"orthographic":a.scroll=0,a.panX=0,a.panY=0,a._prj=new Er;break;case"equalearth":a._prj=(new co).prepareSecond();break;case"miller":a._prj=(new bo).prepareSecond();break;case"mercator":a._prj=(new po).prepareSecond();break;default:a._prj=(new so).prepareSecond()}return!0}}(t.projection);const d=this._prj;if(d&&(c||void 0!==t.scroll&&t.scroll!==this._rawScroll)){d.scroll=t.scroll,this._rawScroll=t.scroll,c=!0;const i=null===(e=this.chart)||void 0===e?void 0:e.firstMapSeries;i&&i.setOptionsDirty(!0)}d instanceof Er&&(c=d.setRotation(t.rotationX,t.rotationY)||c),function(t){void 0!==t&&(a._zoom=Math.max(100,m(t,100)))}(t.zoom);const _=this._points={};r(t.points)&&t.points.forEach((t=>{r(t)&&t.length>=3&&n(t[0])?_[t[0]]=[t[1],t[2]]:s(t)&&n(t.id)&&(_[t.id]=r(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(c&&this.chart.projectionChanged(),this._zoom!==l&&(this.chart.zoomChanged(this._zoom,l),null===(o=this.prop("onZoomChanged"))||void 0===o||o({chart:this.chart.wrapper,zoom:this._zoom,oldZoom:l})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}zn.defaults=ri(ai.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:5});class jn extends hn{}class Gn extends ai{constructor(){super(...arguments),this._widgetGaps=new Rt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=this.prop("widgetSectionGap");n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}Gn.defaults=ri(ai.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,resizeDelay:50,wheelDisabled:!1,animatable:!0,clickable:!0,hoverable:!0,draggable:!0});class Hn extends Dt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Ni.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new me,this._series=new _s(this),this._annotations=new Oi(this),this._mapRegions=new Rn(this),this._widgetGroups=new fi(this),this._legends=new Rs(this),this._colorScales=new Zs(this),this._bubbleScales=new Ts(this),(this._global=new Gn(this)).init(),(this._axis=new hr(this)).init(),(this._body=new zn(this)).init(),(this._exporter=new Us(this)).init(),(this._title=new Zr(this)).init(),(this._subtitle=new Ur(this)).init(),(this._zoomPanel=new Hr(this)).init(),(this._drilldownPanel=new Wr(this)).init(),(this._mapScale=new jr(this)).init(),(this._credits=new xi(this)).init(),(this._tooltip=new Xr(this)).init(),this._op=Object.assign({},Hn.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},s(t)?this._load(t):this._initOptions(),this._selection=new Yr(this)}_initOptions(){return this._op=Object.assign({},Hn.defaults)}get wrapper(){return this._wrapper}get exporter(){return this._exporter}get options(){return this._op}get global(){return this._global}get isGlobe(){return this.getProjection().isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return n(t)&&Ji[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ri[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return this._global.prop("animatable")}hoverable(){return this._global.prop("hoverable")}clickable(){return this._global.prop("clickable")}draggable(){return this._global.prop("draggable")}loadAnimatable(){return this._loadAnimatable}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i;this._fireEvent("onModelChanged",t,"selection");new is({series:t},this._wrapper)._points=e,null===(i=this._global.prop("onSelectionChanged"))||void 0===i||i({chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new so).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this.$_resetGlobalMapBound(),this._fireEvent("onProjectionChanged",this.body._prj)}zoomChanged(t,e){this._fireEvent("onZoomChanged",t,e)}mapChanged(t){this._fireEvent("onMapChanged",t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,i){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this._op.type}get legend(){return this._legends.first}get credits(){return this._credits}get globalMapBound(){return this._globalMapBound}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof Br?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 hn))}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 hn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}isEmpty(){return!this.map}coordOfArea(t){var e,i;return(null===(i=null===(e=this._baseMap)||void 0===e?void 0:e.areaOf(t))||void 0===i?void 0:i.getCenter())||Mi}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 a(t)?this._series.get(t):this._series.getSeries(t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}mapRegionByName(t){return this._mapRegions.getRegion(t)}_collectWidgets(){const t={};for(const e of Object.values(tt))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(tt)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,i){const r=this._bases[e];let o;return s(r.base)&&ni(o={},r.base),s(r[i])&&(o||(o={}),ni(o,r[i])),o?ni(o,t):t}_setProperties(t,e=!0){const i=this._op;for(const e in Hn.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const e=this._op;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(b(t.asset,t.assets)),this._global.loadOptions(t.chart),this._body.loadOptions(t.body);const i=r(t.map)&&4===t.map.length&&t.map.every(a)?{bounds:t.map}:t.map,o=r(i)?i:s(i)?[i]:null;if(r(o)&&o.forEach(((t,e)=>{if(!1!==t.enabled){const i=Tr.loadMap(t,e)||En.loadMap(t,e);if(!i)return;const s=i&&new Br(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),0===this._maps.length){const t=new Br(this,new En({map:{features:[]}},0),0);this._maps.push(t)}return this.setBaseMap(void 0),this.$_resetGlobalMapBound(),this.$_resolveGrid(t),this._axis.loadOptions(t.axis),this._title.loadOptions(t.title),this._subtitle.loadOptions(t.subtitle),this._zoomPanel.loadOptions(t.zoomPanel),this._drilldownPanel.loadOptions(t.drilldownPanel),this._credits.loadOptions(t.credits),this._tooltip.loadOptions(t.tooltip),this._seriesIndex=0,this._series.load(t.series,jn),!1===this._global.prop("alwaysMap")||0!==this._series.count&&this._series.get(0).isMapSeries()||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._mapRegions.load(t.mapRegions||t.mapRegion,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale.loadOptions(t.mapScale),this._exporter.loadOptions(t.exporting),this._loading=!1,this}$_resolveGrid(t){if(!(1===this._maps.length&&0===this._maps[0].areaCount&&this.globalMapBound))return;const e=this.globalMapBound;t.axis||(t.axis={}),"boolean"==typeof t.axis.grid?t.axis.grid={visible:!!t.axis.grid}:t.axis.grid||(t.axis.grid={});const i=t.axis.grid;i.visible=!0;let s=Hn.DEFAULT_GRID_STEP;if("orthographic"!==this._body.prop("projection")){const t=Math.min(Math.abs(e.h2-e.h1),Math.abs(e.v2-e.v1));for(const e of Hn.ZOOM_STEP_MAP)if(t<=e.diff){s=e.step;break}}void 0!==s&&(i.line||(i.line={}),"number"!=typeof i.line&&void 0===i.line.step&&(i.line.step=s))}$_loadTemplates(t){const e=this._bases;if(s(t)){const i=this._templates={};for(const e in t){const r=t[e];s(r)&&(i[e]=l({},r))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let i=this._templates[e];if(i)return ni(ni({},i),t)}else r(e)&&e.forEach((e=>{let i=this._templates[e];return i?ni(ni({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._widgetGroups.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._mapRegions.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){if("chart"===e){this._global.updateOptions(t[e],!1);continue}const i=this[e];(i instanceof ai||i instanceof hi||i instanceof me)&&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,e);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof hn&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.prop("enabled"))return;s.prop("dataUrl")&&(s.updateOption("data",await fetch(s.prop("dataUrl")).then((t=>t.json()))),s.removeOption("dataUrl"));const r=t.map,o=this.getMap(s.prop("map"))||r;i.prop("autoMapChange")&&o!==r&&this.setBaseMap(o),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof hn&&t.parent))return;const e=t.drilldown;if(!e.prop("enabled"))return;const i=t.parent,s=this.map;e.prop("autoMapChange")&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return o(this._global.prop("onClick"))}click(t){var e;null===(e=this._global.prop("onClick"))||void 0===e||e(t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof pi){const i=t.get(e.prop("group"),e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}$_resetGlobalMapBound(){const t={x1:0,x2:0,y1:0,y2:0,h1:0,h2:0,v1:0,v2:0};let e=1/0,i=-1/0,s=1/0,r=-1/0,o=1/0,n=-1/0,a=1/0,h=-1/0;if(this._maps.forEach((t=>{isFinite(t.x1)&&(e=Math.min(e,t.x1)),isFinite(t.x2)&&(i=Math.max(i,t.x2)),isFinite(t.y1)&&(s=Math.min(s,t.y1)),isFinite(t.y2)&&(r=Math.max(r,t.y2)),isFinite(t.h1)&&(o=Math.min(o,t.h1)),isFinite(t.h2)&&(n=Math.max(n,t.h2)),isFinite(t.v1)&&(a=Math.min(a,t.v1)),isFinite(t.v2)&&(h=Math.max(h,t.v2))})),isFinite(e))this._globalMapBound={x1:e,x2:i,y1:s,y2:r,h1:o,h2:n,v1:a,v2:h};else{const e=this._baseMap;this._globalMapBound=e?{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,h1:e.h1,h2:e.h2,v1:e.v1,v2:e.v2}:t}}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s;null===(s=this._body.prop("onHoverArea"))||void 0===s||s({chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i;null===(i=this._body.prop("onClickArea"))||void 0===i||i({chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}Hn.ZOOM_STEP_MAP=[{diff:1,step:.2},{diff:10,step:1},{diff:50,step:5}],Hn.DEFAULT_GRID_STEP=10,Hn.defaults={type:"map",startOfWeek:0},ds.register(hn,Mn,wn,wo,fn,Ho,Ps,kn,qo,tn,pn,Nn,Zo,Io,zo),$i.register(to,eo,io,Qr);class Wn extends Zt{constructor(t,e,i=!1){super(t,e,"image"),this._dirty=!0,this._bounds=lt,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},i&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Yn extends Zt{constructor(t,e){super(t,Yn.STYLE),this._spinnerWrapper=new Zt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Wn(t,"rm-loading-spinner",!0)),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=Yn.LOADING_SPINNER,this._spinner.width=Yn.SPINNER_LENGTH,this._spinner.height=Yn.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-Yn.SPINNER_LENGTH/2,t.height/2-Yn.SPINNER_LENGTH/2)}}Yn.STYLE="rm-loading-indicator",Yn.BACK_STYLE="rm-loading-background",Yn.SPINNER_LENGTH=64,Yn.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class Zn{constructor(t,e){this._visible=!1,this._doc=t,this._container="string"==typeof e?t.getElementById(e):e,this._svg=t.createElementNS("http://www.w3.org/2000/svg","svg"),this._svg.style.position="absolute",this._svg.style.top="0",this._svg.style.left="0",this._svg.style.width="100%",this._svg.style.height="100%",this._svg.style.pointerEvents="none",this._svg.style.zIndex="9999",this._loadingElement=new Yn(t),this._svg.appendChild(this._loadingElement.dom),this._setVisible(!1)}show(){this._visible||(this._container.appendChild(this._svg),this._setVisible(!0),this._layout())}hide(){this._visible&&(this._setVisible(!1),this._svg.parentNode===this._container&&this._container.removeChild(this._svg))}dispose(){var t;this.hide(),null===(t=this._loadingElement)||void 0===t||t.dispose(),this._loadingElement=null,this._svg=null}_setVisible(t){this._visible=t,this._loadingElement.visible=t}_layout(){const t=this._container.clientWidth,e=this._container.clientHeight,i=Zn.LOADING_VIEW_LENGTH;this._loadingElement.layout({width:i,height:i});const s=t/2-i/2,r=e/2-i/2;this._loadingElement.trans(s,r)}}Zn.LOADING_VIEW_LENGTH=128;class Un{static handleChartInitError(t,e){throw console.error(t),null==e||e.showErrorView(null==t?void 0:t.message),t}}const Xn="$ctrl";class qn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Hn(t,this),this._loaded=s(t),null==e||e(this._obj,null)}get type(){return this._obj.type}get body(){return this._obj.body}get assets(){return this._obj._assets}get map(){return this._obj.map}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get series(){return this._obj.firstVisible}get firstMapSeries(){return this._obj.firstMapSeries}get legend(){return this._obj.legend}get credits(){return this._obj._credits}get colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}get widgetGroup(){return this._obj.widgetGroup}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}get global(){return this._obj.global}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart ";ht.LOGGING&&console.time(s);let o=this._obj,n=o;this._loaded?(o.dispose(),n=this._obj=new Hn(null,this)):(this._loaded=!0,o=null),n._load(t),n._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",si),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,n,o)}return this}async loadAsync(t,e=!1,i){var r;const o=this[Xn];if(!s(t))return this;const n=o.doc(),a=o.dom().parentElement,h=new Zn(n,a);h.show();try{o.setLoading(!0),o.hideErrorView();const s="load chart ";ht.LOGGING&&console.time(s),await v.loadConfigAsync(t);let n=this._obj,a=n;return this._loaded?(n.dispose(),a=this._obj=new Hn(null,this)):(this._loaded=!0,n=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,ht.log("chart-items:",si),ht.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,n),this}catch(t){Un.handleChartInitError(t,o)}finally{o.setLoading(!1),h.hide(),h.dispose()}}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,i){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof hn?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof hn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof hn?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof hn&&this._obj.drillup(e)}destroy(){var t;this.$_disposed||this.$_disposing||(this.$_disposing=!0,this[Xn]=null===(t=this[Xn])||void 0===t?void 0:t.dispose(),this._obj=null,this.$_disposed=!0)}isDestroying(){return this.$_disposing||this.$_disposed}}class Kn{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}pointerDown(t){let e;return e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=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._clickX,this._clickY,i,s,t.shiftKey)&&(this._clearTouchEffects(),i===this._prevX&&s===this._prevY||!this.control.isDraggable()?this._stopEvent(t):this.$_doDrag(t,e,i,s))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this._pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i&&this.control.isDraggable()?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,s){return null}$_startDrag(t,e,i,s,r,o){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i,o)),!!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 o=i[s-2];if(r.t-o.t<=100)for(let t=s-3;t>=0&&(o=i[t],!(r.t-o.t>100));t--);const n=o.x,a=o.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-o.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,o=Math.round(180*Math.atan2(l-a,h-n)/Math.PI);if(o<0&&(o=360+o),r=o>45&&o<=135?X.DOWN:o>135&&o<=225?X.LEFT:o>225&&o<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class Jn extends kt{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 Qn extends Jn{_doStart(t,e,i,s,r){return this.control.chartView().onRotationStart(),!0}_doDrag(t,e,i,s,r){const o=this.control.model.body;o.rotationX+=(s-e)/2,o.rotationY-=(r-i)/2}}class ta extends Jn{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,this.control.chartView().onScrollStart(),super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const o=this.control.model.body,n=this._oldX-(s-this._xStart)/o.scale,a=this._oldY-(r-this._yStart)/o.scale;if(o.isScrollable()){const t=360;o.scroll+=t/(o.calcedMapWidth*o.scale)*(e-s)}else o.panX=n;return o.panY=a,!0}$_mapView(){return this.control.model.body}}class ea extends Zt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return ea.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ea.IGNORE_ATTRS={width:"",height:""};class ia extends ea{constructor(e,i){super(e,i),this.add(this._text=new Ze(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.prop("effect");return this._model=e,this._text.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new ji(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(e.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Ze(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),i?this._icon||(this.add(this._icon=new Wn(t)),this._icon.url=i,this._icon.width=e.prop("width"),this._icon.height=e.prop("height")||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.prop("autoContrast")&&this._text.setContrast(t,this._model.prop("darkStyle")||"rm-label-dark",this._model.prop("lightStyle")||"rm-label-light"),this._outline&&this._outline.parent){const t=Ge.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._text,i=this._outline,s=this._icon;let r=0;const o=e.bbox(),n=o.width,a=o.height;let h,l=n,c=a,d=0,_=0,u=0,p=0;if(this._box=void 0,s){const t=s.bbox();switch(r=m(this._model.prop("iconGap"),0),d=t.width,_=t.height,this._model.getIconPos()){case"left":case"right":l+=r+d,c=Math.max(_,a);break;default:c+=r+_,l=Math.max(d,n)}}if(this._back&&this._back.parent&&(h=getComputedStyle(this._back.dom),u=parseFloat(h.paddingLeft)||0,p=parseFloat(h.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(h.paddingRight)||0),c+p+(parseFloat(h.paddingBottom)||0),h.rx)),s)switch(this._model.getIconPos()){case"left":s.trans(u,(c-_)/2),u+=d+r,l-=d+r;break;case"right":s.trans(u+l-d,(c-_)/2),l-=d+r;break;case"top":s.transX((l-d)/2),p+=_+r;break;case"bottom":s.trans((l-d)/2,p+a+r)}switch(h||(h=getComputedStyle(e.dom)),h.textAlign){case"center":u+=l/2,e.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,e.anchor=t.TextAnchor.END;break;default:e.anchor=t.TextAnchor.START}return e.trans(u,p),i&&(i.anchor=e.anchor,i.setAttr("y",e.getAttr("y")),i.trans(u,p)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class sa extends Jn{constructor(t,e,i,s){super(t),this.mode=i,this.shift=s,this._body=e}_doStart(t,e,i,s,r){const o=this.control.getBounds(),n=this._body.getBackBounds();this._xStart=u(0,e-n.x+o.x),this._yStart=u(0,i-n.y+o.y),this._body.addFeedback(this._feedback=new ji(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new ia(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new ia(this.control.doc(),"rm-bounds-tracker-tag"));const a=new ai(this._body.chart());return a.init(),a.loadOptions({effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}),this._fromTag.setModel(document,a,null,null),this._toTag.setModel(document,a,null,null),!0}_hideFeedback(){this._feedback.remove(),this._fromTag.remove(),this._toTag.remove()}_doCompleted(t,e,i){const s=this.$_calcBound(e,i),{from:r,to:o}=this._body.boundsToMap(s,!1,!0);if("zoom"===this.mode)this._body.model.zoomToBounds(r,o);else{const t=this._body.firstMap;if(t){const e=t.chart(),i=t.getIntersectedAreas(this._feedback.dom);this.shift||e.selection.clear(),e.selection.add(t.model,i.map((t=>t.point)),!1)}}}_doDrag(t,e,i,s,r){const o=this.$_calcBound(s,r),{from:n,to:a}=this._body.boundsToMap(o,!1,!0),h=Ce.getFormatter(",0.000");return this._feedback.setRect(o),this._fromTag.setText(`(${h.toStr(n[0])}°, ${h.toStr(n[1])}°)`).layout(),this._fromTag.trans(o.x-this._fromTag.bbox().width/2,o.y-this._fromTag.bbox().height-4),this._toTag.setText(`(${h.toStr(a[0])}°, ${h.toStr(a[1])}°)`).layout(),this._toTag.trans(o.x+o.width-this._toTag.bbox().width/2,o.y+o.height+4),!0}$_calcBound(t,e){const i=this.control.getBounds(),s=this._body.getBackBounds(),r=this.control.width(),o=this.control.height();return t=u(0,_(r,t-s.x+i.x)),e=u(0,_(o,e-s.y+i.y)),{x:_(this._xStart,t),y:_(this._yStart,e),width:p(this._xStart-t),height:p(this._yStart-e)}}}class ra extends Kn{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.$_chart().map&&this.$_chart().hoverable()&&(this.dragging?this.dragTracker instanceof ta&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target))}_doClick(t){const e=this.$_chart();if(!e.clickable())return;const i=t.target,s=t.shiftKey,r=at?t.ctrlKey:t.metaKey,o=this.$_chartView(),n=e.global.prop("clickAction"),a=o.getButton(i);let h,l,c;if(a)a.click();else if(h=o.legendByDom(i))if(h.source instanceof qi){const t=h.source;e.seriesByPoint(t)}else h.source.canHide()&&(h.source.visible=!h.source.visible);else if(i===this._clickElement){const a=this._pointerToPoint(t);if(a.x-=o.tx,a.y-=o.ty,l=o.seriesByDom(i))l.click(i,a);else if(c=o.creditByDom(i))c.click(i);else if(o.drilldownPanelView().click(i))return;switch(n){case"select":l&&l.model.canSelect()&&(r?l.toggleSelect(i,a):l.select(i,a,!s));break;case"drilldown":this.$_drildown(e,t,o)}o.click(t,i,l)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.global.prop("dblClickAction");"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.prop("zoomable")){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=m(Math.max(1,e.prop("wheelZoomFactor")),5);return e.zoom,e.zoomByFactor(-i/s,!1),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,s){const r=this.$_chart(),o=r.global.prop("dragAction");if(r.draggable())return"zoom"===o||"select"===o?new sa(this.control,this.$_chartView().bodyView(),o,s):r.isGlobe?new Qn(this.control):r.body.isScrollable()||r.body.movable?new ta(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=this._pointerToPoint(e),o=e.target,n=i.bodyView().getSeries(s).pointByDom(o,r);n&&n.point instanceof en&&t.drilldown(t.firstMapSeries,n.point.area.id)}}}class oa{static empty(){return new oa}static create(t=0,e=0){return new oa(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 oa(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+"}"}}oa.EMPTY=new oa;class na extends Zt{constructor(t,e=L){super(t,e,"g"),Zt.DEBUGGING&&(this.add(this._debugRect=new ji(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.internalSetStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Zt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ji(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 aa extends na{constructor(t,e,i){super(t,e),this._margins=new Rt,this._paddings=new Rt,this.add(this._background=new ji(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 o=this._paddings;o.applyPadding(r);const n=this._doMeasure(t,e,i,s);if(n.width+=o.left+o.right,n.height+=o.top+o.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=n.width+=t.left+t.right,this.mh=n.height+=t.top+t.bottom}return this.mw=n.width,this.mh=n.height,n}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 ha extends ea{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 la extends ia{constructor(t){super(t,"rm-map-widget-title")}}class ca extends ia{constructor(t){super(t,"rm-map-widget-footer")}}class da extends aa{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new la(t)),this.add(this._footerView=new ca(t))}_setBackgroundStyle(t){t.setVisible(this.model.background.visible)&&t.internalSetStyleOrClass(this.model.background._style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.prop("text")),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class _a extends kt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDispose(){this._owner=null,this._creator=null,super._doDispose()}get owner(){return this._owner}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,o=this._views;for(let t of o)t.parent;for(t=Math.max(0,t);o.length>t;)r.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(s);o.push(e),i&&i(e,o.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 ua extends na{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new ji(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Ze(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.prop("markerVisible"))?this._marker.bbox():lt,o=ct(this._label.bbox());return this._gap=m(e.legend.prop("markerGap"),0),{width:r.width+this._gap+o.width,height:u(r.height,o.height)}}_doLayout(t){const e=this._rMarker,i=m(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 pa extends da{constructor(t){super(t,pa.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new _a(this,ua)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=m(e.prop("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,r);const n=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?n.height=Math.max(n.height,this._rTitle.height):n.width=Math.max(n.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?n.height=Math.max(n.height,this._rFooter.height):n.width=Math.max(n.width,this._rFooter.width)),n}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("sameTextColor"),s=this._sizes,r=t.prop("itemsAlign"),o=t.prop("lineGap")||0,n=t.prop("itemGap")||0,a=this._margins,h=this._paddings,l=this._vertical,c=this._titleView,d=this._footerView,_=this._rTitle,u=c.visible?_.height:0,p=c.visible?_.width:0,g=this._rFooter,m=d.visible?g.height:0,f=d.visible?g.width:0,b=d.visible?this._gapFooter:0;let y,w,x,v=a.left+h.left,C=a.top+h.top,S=this.width-v-a.right-h.right,L=this.height-C-a.bottom-h.bottom;if(c.visible)if(this._inTitle){switch(w=C,t.title.prop("verticalAlign")){case"top":break;case"bottom":w+=L-u;break;default:w+=(L-u)/2}c.trans(v,w),v+=p,S-=p}else{switch(t.title.prop("align")){case"center":y=Math.max(v,v+(S-_.width)/2);break;case"right":y=Math.max(v,v+S-_.width);break;default:y=v}c.trans(y,C),C+=u,L-=u}const M=v,A=C;if(d.visible){if(this._inFooter){switch(y=M+S-f,w=C,t.footer.prop("verticalAlign")){case"top":break;case"bottom":w+=L-m;break;default:w+=(L-m)/2}S-=f+b}else{switch(w=C+L-m,t.footer.prop("align")){case"center":y=Math.max(v,v+(S-g.width)/2);break;case"right":y=Math.max(v,v+S-g.width);break;default:y=v}L-=m+b}d.trans(y,w)}this._itemViews.forEach((t=>{var e;const s=t.model.source,r=s.legendColor();t._marker.setColor(r),null===(e=s.setLegendMarkerStyle)||void 0===e||e.call(s,t._marker),i&&s.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{if(l){const i=this._wMarkers;t.forEach((t=>{t.mw=s[e],t.resizeByMeasured().layout(i[e])})),C=A,"center"!==r&&"end"!==r||(x=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1),C+="center"===r?(L-x)/2:L-x),t.forEach((t=>{t.trans(v,C),C+=t.height+n})),v+=s[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),v=M,"center"!==r&&"end"!==r||(x=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1),v+="center"===r?(S-x)/2:S-x),t.forEach((t=>{t.trans(v,C),v+=t.width+n})),C+=s[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,o){const n=e.items(),a=this._itemViews,h=e.prop("itemGap")||0,l=e.prop("lineGap")||0,c=a.count,d=this._rowViews=[],_=this._sizes=[];let p,g,m,f;a.forEach(((i,s)=>{i.setMarker(n[s].source.legendMarker(t,+e.prop("markerSize")||Vs.MARKER_SIZE)),i.measure(t,n[s],r,o)}));let b=0,y=0;if(i){for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),g=f.mh,y++,b++):(g+=h+f.mh,g<=o?(m.push(f),y++,b++):y=0);this._wMarkers=[],p=g=0,d.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=u(i,t.mw),r=u(r,t._rMarker.width),t._col=e})),s+=h*(t.length-1),g=u(g,s),p+=i,_.push(i),this._wMarkers.push(r)})),p+=l*(d.length-1)}else{for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),p=f.mw,y++,b++):(p+=h+f.mw,p<=r?(m.push(f),y++,b++):y=0);p=g=0,d.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=u(i,t.mh)})),e+=h*(t.length-1),p=u(p,e),g+=i,_.push(i)})),g+=l*(d.length-1)}return this._titleView.visible&&(this._inTitle?p+=this._rTitle.width:g+=this._rTitle.height),this._footerView.visible&&(this._inFooter?p+=this._rFooter.width+this._gapFooter:g+=this._rFooter.height+this._gapFooter),{width:p,height:g}}}pa.LEGEND_CLASS="rm-legend";const ga={};class ma extends aa{static register(...t){t.forEach((t=>{ga[t[0].type]=t[1]}))}constructor(t,e){super(t,ma.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 o=s.tx,n=s.ty;switch(this._op.align){case"left":o-=this.width+t.x;break;case"right":o+=i+t.x;break;default:o+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":n+=(r-this.height)/2+t.y;break;case"bottom":n+=r+t.y;break;default:n-=this.height+t.y}return{x:o,y:n}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doLayout(t){const e=this.model.prop("rotation");this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}ma.CLASS_NAME="rm-annotation";class fa{static interpolate(t,e){if(e instanceof Er==!1)return t;const i=[];let s=null,r=null,o=!1;for(let n=0;n<t.length;n++){const a=t[n],h=e.project(a);if(h.outside)o=!0;else{if(s||(s=a,t.push(a)),o&&r){const t=Vr(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,o=!1}}return i}}class ba{static box(t,e,i,s,r){const o=Math.floor(Math.abs(i-t)/20),n=this.boxPoints(t,e,i,s,o);return this.coordsToPath(ba.toPixelCoord(r,n))}static ellipse(t,e,i,s,r,o=40){const n=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,o);return this.coordsToPath(ba.toPixelCoord(r,n))}static geoCircle(t,e,i,s,r,o=!1,n=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,n);let h=this.toPixelCoord(r,a);return o&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Er?fa.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 o=e;for(;o<=i&&(r.push([o,t]),o+s<=i);)o+=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 o=i;for(;o>=e&&(r.push([o,t]),o-s>=e);)o-=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 o=e;for(;o<=i&&(r.push([t,o]),o+s<=i);)o+=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 o=i;for(;o>=e&&(r.push([t,o]),o-s>=e);)o-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const o=[],[n,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),o.push(...this.horizontalLineToRight(h,n,a,r)),o.push(...this.verticalLineToUp(a,h,l,r)),o.push(...this.horizontalLineToLeft(l,n,a,r)),o.push(...this.verticalLineToDown(n,h,l,r)),o}static arcCoords(t,e,i,s,r,o,n,a=64){const h=2*Math.PI,l=o-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?n?-h:h:l;c||(n&&d>0&&(d-=h),!n&&d<0&&(d+=h));const _=d/a,u=[];for(let o=0;o<=a;o++){const n=r+_*o;u.push([t+Math.cos(n)*Math.abs(i),e+Math.sin(n)*Math.abs(s)])}return u}}class ya extends Kt{renderLat(t,e,i,s,r){const o=r.second,n=o?2:1;let a="";for(let h=0;h<n;h++){const n=0===h?r:o;let l=n.project([e,t]);if(a+=Pi(l)?`M${l[0]},${l[1]}`:"",n.latElliptic){const r=t=>{l=n.project(t),Pi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},o=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+o;for(;h<=i-o+1e-9;)r([h,t]),h+=o;e<i&&r([i,t])}else l=n.project([i,t]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLatGlobe(t,e,i,s,r){let o,n=e,a=r.project([n,t]);for(;a.outside&&n<=i;)n+=s,a=r.project([n,t]);if(n<i){let e=`M${a[0]},${a[1]}`;for(n+=s;n<=i;)a=r.project([n,t]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}renderLon(t,e,i,s,r){const o=r.second,n=o?2:1;let a="";for(let h=0;h<n;h++){const n=0===h?r:o;let l=n.project([t,e]);if(a+=Pi(l)?`M${l[0]},${l[1]}`:"",n.lonElliptic){const r=t=>{l=n.project(t),Pi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},o=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+o;for(;h<=i-o+1e-9;)r([t,h]),h+=o;e<i&&r([t,i])}else l=n.project([t,i]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLonGlobe(t,e,i,s,r){let o,n=e,a=r.project([t,n]);for(;a.outside&&n<=i;)n+=s,a=r.project([t,n]);if(n<i){let e=`M${a[0]},${a[1]}`;for(n+=s;n<=i;)a=r.project([t,n]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=s;this.setPath(e),this.setVisible(!0)}else this.setVisible(!1)}}class wa extends na{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new _a(this,ya),this._lonPool=new _a(this,ya)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{Ht.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{Ht.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,e.x1),y1:Math.max(-90,e.y1),x2:Math.min(180,e.x2),y2:Math.min(90,e.y2),latStep:e.latStep,lonStep:e.lonStep}}_doMeasure(t,e,i,s){return oa.create(i,s)}_doLayout(t){const e=this.model,i=e.chart,s=e.line,r=e.lonLine,o=e.latLine,n=i.getProjection();n.second;const a=n.isGlobe,h=this._bounds;let l;Ht.setImportantStyle(this.dom.style,"pointer-events","none"),Ht.setImportantStyle(this.dom.style,"fill","none");const c=h.x1,d=h.x2;let _=h.latStep;if(l=i.axis.latInterval,a)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(o._style),t.renderLatGlobe(h.y1+e*_,c,d,l,n)}));else{const t=Math.ceil(h.y1/_)*_;this._latPool.forEach(((e,i)=>{const r=t+i*_;(e.visible=r<=h.y2&&r>=h.y1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(o._style),e.renderLat(r,c,d,l,n))}))}const u=h.y1,p=h.y2;if(_=h.lonStep,l=i.axis.lonInterval,a)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLonGlobe(h.x1+e*_,u,p,l,n)}));else{const t=Math.ceil(h.x1/_)*_;this._lonPool.forEach(((e,i)=>{const o=t+i*_;(e.visible=o<=h.x2&&o>=h.x1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(r._style),e.renderLon(o,u,p,l,n))}))}}}class xa extends Ut{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new Ut(t,"rm-axis-tick-labels")),this._labelPool=new _a(this._labelLayer,Ze)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),o=e.getLatInterval(),n=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*o,h=1+((i.x2-i.x1)/n|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,o,n,a,h,l=0,c=s.x1,d=s.y1;(o=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,o.forEach(((s,o)=>{n=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(n[0]*i,n[1]*-i),c+=r})),l+=this._topCount),(o=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(o.forEach(((t,e)=>{})),l+=this._bottomCount),(o=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),o.forEach(((e,s)=>{n=t.project([a,h]),e.text=h+"°",e.trans(n[0]*i-e.bbox().width/2,n[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(o=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(o.forEach(((t,e)=>{})),l+=this._leftCount)}}}class va extends na{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new wa(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,o=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(r,o),this._gridView.measure(t,r,i,s)),oa.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.globalMapBound,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:o,y1:n,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:n,x2:o,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 Ca extends ia{}class Sa extends na{constructor(t,e){super(t),this.add(this._pathView=new Kt(t)),e.add(this._labelView=new Ca(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof or?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.prop("type"),s=this._pathView,r=this._labelView;let o,n=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(e.label.prop("text")),"range"===i){const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderRange(e,t,r),s.internalSetStyle("strokeWidth",`${i}px`)}else if("band"===i){n||(this.add(n=this._fromView=new Kt(this.doc)),this.add(a=this._toView=new Kt(this.doc))),n.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),n.internalSetStyle("fill","none"),n.internalSetStyle("transform",t.trans),a.internalSetStyle("fill","none"),a.internalSetStyle("transform",t.trans);const i=(parseFloat(getComputedStyle(n.dom).strokeWidth)||1)/t.tf.scale;n.internalSetStyle("strokeWidth",`${i}px`),a.internalSetStyle("strokeWidth",`${i}px`),o=this.$_renderBand(e,t,r),s.internalSetStyle("stroke","none")}else{const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderLine(e,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${i}px`)}s.setPath(o).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:o,lonInterval:n}=e;let a;if("lat"===t.prop("axis")){const r=t.prop("position"),n=s.h1,h=s.h2;a=ba.horizontalLineToRight(r,n,h,o),this.$_renderLatLabel(n,r,e,i)}else{const o=t.prop("position"),h=s.v1,l=s.v2;a=ba.verticalLineToUp(o,h,l,n),this.$_renderLonLabel(o,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return ba.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:o,lonInterval:n}=e;let a=[];if("lat"===t.prop("axis")){const h=Math.min(t.prop("from"),t.prop("to")),l=Math.max(t.prop("from"),t.prop("to")),c=s.h1,d=s.h2;a.push(...ba.horizontalLineToRight(h,c,d,o));const _=[...a];this._fromView.setPath(ba.coordsToPath(_.map((t=>r.project(t))))),a.push(...ba.verticalLineToUp(d,h,l,n));const u=ba.horizontalLineToLeft(l,c,d,o);a.push(...u),this._toView.setPath(ba.coordsToPath(u.map((t=>r.project(t))))),a.push(...ba.verticalLineToDown(c,h,l,n)),this.$_renderLatLabel(c,l,e,i)}else{const n=Math.min(t.prop("from"),t.prop("to")),h=Math.max(t.prop("from"),t.prop("to")),l=s.v1,c=s.v2;a.push(...ba.verticalLineToUp(n,l,c,o));const d=[...a],_=ba.verticalLineToDown(h,l,c,o);a.push(..._),this._fromView.setPath(ba.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(ba.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(n,c,r,e.tf,i)}return ba.coordsToPath(ba.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=e;let r;const[o,n]=t.prop("from"),[a,h]=t.prop("to");if(t.prop("elliptic")){const t=[Math.min(o,a),Math.min(n,h)],e=Math.abs(a-o),i=Math.abs(h-n);r=ba.ellipse(t[0],t[1],e,i,s)}else r=ba.box(o,n,a,h,s);if(i.visible){const t=Math.min(o,a),r=Math.max(n,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:o,tf:n}=i;let a=0,h=0;const l=s.bbox(),c=r.project([o.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*n.scale+n.tx+16,h=d[1]*-n.scale+n.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let o=0,n=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,o=l*s.scale+s.tx,n=c*-s.scale+s.ty+a.height/2,"line"===this.model.prop("type")?o+=t>=0?-a.width-6:6:o+=6,r.trans(o,n)}}class La extends ea{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new ji(t,"rm-crosshair-flag-back")),this.add(this._text=new Ze(t))}prepare(t){this.internalResetStyleOrClass(t._style),this._back.internalResetStyleOrClass(t.prop("backgroundStyle"))}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,o,n){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(o-l.width,Math.max(0,n.tx+h[0]*n.scale-l.width/2)),Math.max(0,n.ty-a[1]*n.scale-l.height))}renderLatFlag(t,e,i,s,r,o){const n=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,o.tx+n[0]*o.scale-a.width),Math.max(0,Math.min(r-a.height,o.ty-n[1]*o.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),o=e.rotationY<=0,n=e.project([0,o?90:-90]);this.trans(s.tx+n[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-n[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,o,n,a){const h=e.project([i,s]),l=e.project([n,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(o-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class Ma extends na{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new ya(t,"rm-crosshair-line")),this.add(this._lonLine=new ya(t,"rm-crosshair-line")),Ht.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Ht.setImportantStyle(this._latLine.dom.style,"fill","none"),Ht.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Ht.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new La(t)),this.add(this._lonFlag=new La(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.internalSetStyle("transform",e),this._lonLine.internalSetStyle("transform",e),this._latLine.internalSetStyle("strokeWidth",`${i}px`),this._lonLine.internalSetStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag),this._lonFlag.prepare(this.model.flag),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.globalMapBound,o=t[0],n=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(!(_<=o&&o<=u&&p<=n&&n<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(),y=b instanceof Er?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,o=r.chart.globalMapBound,n=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof Er;_?l.renderLonGlobe(h,n,a,e,s):l.renderLon(h,n,a,e,s);const u=this.calcTopY(i,o,s,n),p=r.chart.getProjection().getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,o=r.chart.globalMapBound,n=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 Er;u?l.renderLatGlobe(h,n,a,e,s):l.renderLat(h,n,a,e,s);const p=u?90-s.rotationX:n,g=s.project(t),m=this.calcRightX(i,s,_,o,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 o=[NaN,NaN];const n=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){o=t;break}r[0]+=n}return Number.isNaN(o[1])?s:o[1]}calcRightX(t,e,i,s,r){const o=[(i.width-t.vx-t.tx)/t.scale,r];let n=e.backward(o);return Number.isNaN(n[0])?s.x2:n[0]}}const Aa="rm_map_globe_fill";class Pa extends Kt{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,o){const n=e.map,a=this.parent,h=e.body.projection;n||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,o,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=Vi.rectangle(i,s,r,o);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof Er)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,o,n){const a=e.prop("globeFill"),h=Math.max(s,r)/2;let l=!this.control.hasDef(Aa);return i=Vi.circle(o+h,n+h,h),a!==this._globeFill&&(this.control.removeDef(Aa),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${Aa})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:Aa,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new _e(i).getElement(t,i)),this._globeFill=e}}class ka extends Kt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){ht.isNum(t)?this.setPath(Vi.line(t,e,i,s)):t&&this.setPath(Vi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(Vi.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(Vi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(Vi.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(Vi.line(e,t,i,t))}}class Ia extends Kt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){ht.isNum(t[0])?this.setPath(Vi.lines(...t)):r(t[0])?this.setPath(Vi.lines3(...t)):this.setPath(Vi.lines2(...t))}}var Na;class Ea extends _a{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Ta extends ia{constructor(t){super(t,"rm-point-label")}}class Va extends Ut{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new _a(this,Ta),new _a(this,Ta)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,o){const{label:n,isCallbackExecuted:a}=r.getPointText(s,i,o.prop("text"));e.point=s,e.setModel(t,o,null,null),e._text.internalResetStyleOrClass(o._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),n?(o.prepareRich(n),o.buildSvg(e._text,e._outline,NaN,NaN,o,o.getTextDomain(s),!a)):(e.setText(o.getText(o.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),o=this._labels,n=i.getLabeledPoints(),a=this._maps,h=s[0]._style;o[0].prepare(n.length),a[0]={},o[1].prepare(r>1?n.length:0),a[1]={},n.forEach(((r,n)=>{for(let h=0;h<r.labelCount();h++){const l=o[h].get(n);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.internalSetStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){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 Da extends ea{constructor(t){super(t),this.add(this._line=new Ia(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Kt(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new Kt(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.series,o=this._anchor,n=this._line;if(this._dummy.setPath(Vi.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=za.getDrawer(t.series.getCalloutShape(e)),n=t.anchorPoint.prop("radius");o.internalClearStyleAndClass(),t.prop("useSeriesColor")&&o.internalSetStyleOrClass(r._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(s(n,n)),o.trans(i[0],i[1])}return n.internalClearStyleAndClass(),t.prop("useSeriesColor")&&this._line.internalSetStyleOrClass(r._style),n.internalSetStyleOrClass(t._style),n.setLines(i,!1),s&&t.prop("usePointColor")&&(o.visible&&o.setFill(s),n.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Ra extends Qt{constructor(t){super(t),this.add(this._back=new ji(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Kt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(Vi.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(Vi.rect(t).concat(Vi.rect(e))):this._mask.setPath(Vi.rect(t)),this}}class $a extends Ut{constructor(t,e){super(t,e),this._callouts=new _a(this,Da),this._map={},this.add(this._maskLayer=new Ut(t)),this._masks=new _a(this._maskLayer,Ra),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,o=t.getLabeledPoints(),n=i._style,a=this._map={};r.prepare(o.length,(t=>{})),s.prepare(o.length),o.forEach(((t,i)=>{const o=s.get(i);o.setVisible(e.isPointCalloutVisible(t))&&(o.setAttr("mask",`url(#${r.get(i).id}`),o.index=i,a[t.pid]=o)})),this.internalSetStyleOrClass(n)}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 Oa extends Jt{constructor(t,e=!1){super(t,za.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){za.seriesOf(this).setPointLabelVisible(this.point,!1)}return e}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const o=.35,n={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}),n.x=-c.x*_*o,n.y=-c.y*_*o;const i=u+a.x,g=p+a.y,m=t[r].x+n.x,f=t[r].y+n.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*o,a.y=c.y*_*o,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.internalSetStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.internalSetStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Fa extends Ut{}const Ba={};class za extends na{static register(...t){t.forEach((t=>{Ba[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof Na)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Vi[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,o)=>({x:t-=i.width/2,y:e+=r+o}),top:(t,e,i,s,r,o)=>({x:t-=i.width/2,y:e-=r+o+i.height}),right:(t,e,i,s,r,o)=>({x:t+=s+o,y:e-=i.height/2}),left:(t,e,i,s,r,o)=>({x:t-=s+o+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,o)=>({x:t-=i.width/2,y:e-=i.height/2+o})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverPts=[],this._inRegion=!1,s&&this.addDom(this._defs=Zt.createElement(t,"defs")),this.add(this._pointLayer=new Ut(t)),this._pointLayer.add(this._pointContainer=new Fa(t,"rm-series-points")),this.add(this._calloutContainer=new $a(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}resolveBoundsClip(t,e,i,s,r){return t}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e,i){const s=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,r=this._labelContainer,o=this._calloutContainer;this._scroll=i,this.setModel(e),this.internalSetStyle("pointerEvents",e.prop("disabled")?"none":""),e instanceof hn?this.setData("index",e._seriesIndex%10):this.setData("index",e._seriesIndex%12),null==r||r.setVisible(e.isPointLabelsVisible()),o.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),r&&r.visible&&r.prepare(t,this),o.visible&&o.prepare(t,this)):(r&&r.visible&&(null==r?void 0:r.isEmpty())&&r.prepare(t,this),o.visible&&o.isEmpty()&&o.prepare(t,this)),isNaN(this._aniOpacity)||this.internalSetStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e,i){const s=this.model;if(this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),!(s instanceof hn)&&!s.isEmpty(!0)&&this.chart().animatable()){const t=s&&s.prop("loadAnimation"),e=!this.control.loaded&&this.chart().loadAnimatable();this._runShowEffect(t&&(e||s.dataLoaded||s.needAnimate)&&!s.isEmpty(!0))}s.dataLoaded=!1,s.needAnimate=!1}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t,e,i,s){var r;return null===(r=this._getPointPool())||void 0===r?void 0:r.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}defaultAnimation(){return"grow"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}pointByDom(t,e){return this._getPointPool().elementOf(t)}click(t,e){const i=this.pointByDom(t,e);if(i)i.point?!0!==this.model.pointClicked(i.point)&&this._doPointClicked(i):this._doPointClicked(i);else{const e=this.model.cluster;if(e&&e.isExpandable()){const e=this._clusterOfDom(ja.isClusterView(t));if(e){const t=e._cluster.points;let i=t[0],s=i.lon,r=i.lon,o=i.lat,n=i.lat;for(let e=1;e<t.length;e++)i=t[e],s=_(s,i.lon),r=u(r,i.lon),o=_(o,i.lat),n=u(n,i.lat);const a=.1*(r-s),h=.1*(n-o);this.chart().body.zoomToBounds([s-a,o-a],[r+a,n+h])}}}}_clusterOfDom(t){}select(t,e,i){const s=this.pointByDom(t,e);s&&this.chart().selection.add(this.model,[s.point],i)}toggleSelect(t,e){const i=this.pointByDom(t,e);i&&this.chart().selection.toggle(this.model,i.point)}runPointAddAnimation(t){}setPointLabelVisible(t,e){const i=this._labelViews();if(!i)return;const s=i.get(t,0);s&&s.setVisible(e)}zoomChanged(t,e){}get growRate(){return this._growRate}_createLabelContainer(t,e){return new Va(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 m(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&ht.log("CLICKED: ",t.point.name,t.point.getValue())}}Na=za,za.POINT_CLASS="rm-point",za.DATA_HOVER="hover",za.DATA_UNHOVER="unhover",za.LEGEND_MARKER="rm-legend-item-marker",za._drawers=Object.assign({circle:t=>Vi.circle(0,0,t)},Na._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ja extends Zt{static isClusterView(t){return Ht.isChildOf(t,this.CLASS_NAME)}constructor(t){super(t,"rm-point-cluster"),this.add(this._shape=new Kt(t)),this.add(this._label=new Ze(t,"rm-point-cluster-label"))}setCluster(t){this._cluster=t}render(t,e){const i=[],s=P-.001;let r=0;this._cluster.points.forEach((t=>{t.moves>=1&&r++})),t--,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=3,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=2,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s),"Z"),this._shape.setPath(i.join(" ")),this._label.text=String(r),this._label.transY(-this._label.bbox().height/2),e&&this.internalSetStyle("fill",e)}}ja.CLASS_NAME="rm-point-cluster";class Ga extends Oa{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class Ha extends za{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}}class Wa extends Oa{prepare(t,e){return this.point=t,this._ext=ht.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Ya extends za{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.prop("minSize")}}}class Za extends Wa{constructor(t){super(t,!0),this.add(this._contentLayer=new Ut(t)),this.add(this._baseLine=new ka(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class Ua extends Ya{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,m(t._minValue,i.min)),i.max=Math.max(i.max,m(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.prop("inverted");let r=s?e._height:e._width;const o=e.getPadding(r);this._ext.inverted=s,this._ext.pad=o,this._ext[s?"height":"width"]=r-2*o}}class Xa extends Oa{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class qa extends za{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Ka extends ma{constructor(t){super(t,Ka.CLASS_NAME),this.add(this._imageView=new Wn(t)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.prop("imageUrl"),this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ka.CLASS_NAME="rm-image-annotation";class Ja extends ma{constructor(t){super(t,Ja.CLASS_NAME),this.add(this._shapeView=new Kt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),Vi.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)}}Ja.CLASS_NAME="rm-shape-annotation";class Qa extends ma{constructor(e){super(e,Qa.CLASS_NAME),this.add(this._textView=new Ze(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ii}_doMeasure(t,e,i,s){const r=e.getSize(i,s),o=this._textView;e.prop("writingMode")&&this._textView.setStyle("writingMode",e.prop("writingMode")),e.prop("textOrientation")&&this._textView.setStyle("textOrientation",e.prop("textOrientation")),this._deflatePaddings(r),this._richText.setFormat(e.prop("text")),this._richText.build(o,i,s,null,e._domain);const n=ct(this._textView.bbox());return{width:m(r.width,n.width),height:m(r.height,n.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)}}Qa.CLASS_NAME="rm-text-annotation";class th{static reveal(t,e){new ih(t,e)}static grow(t,e){new rh(t,e)}static spread(t,e){new oh(t,e)}static fadeIn(t){new eh(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 eh extends th{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:ut.DURATION,fill:"none"})}}class ih extends th{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:ut.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,i){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class sh extends ut{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Zt}_stop(){super._stop(),this._series=null}}class rh extends sh{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class oh extends sh{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class nh extends Kt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,o){this.x=t,this.setPath(Vi.bar(t-i/2,e,i,-s,r,o))}}class ah extends Za{constructor(t){super(t),this._groupCenter=null,this._bars=new _a(this._contentLayer,nh)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}getGroupCenter(){return this._groupCenter}render(t,e,i,s,r,o,n){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c,base:d}=t.getPointExtents(i,e),_=i.length,u=r/_,p=u*s.barWidth,g=s.barWidth>1&&!s.overflow,m=s.pad,f=c===l||isNaN(d)?0:(d-l)/(c-l)*o,b=o-f;let y=1/0,w=-1/0,x=1/0,v=-1/0,C=!1;this._bars.forEach(((e,s)=>{const d=i[s];if(e.setVisible(!isNaN(d))){const i=((c!==l?(d-l)/(c-l)*o:0)-f)*n;let _=m+u*s+(u-p)/2;g&&(_+p>m+r&&(_=m+r-p),_=Math.max(_,m)),e.setPath(Vi.bar(_,b,p,-i,0,0));const S=_+p/2,L=b-i/2,M=p/2,A=Math.abs(i)/2;S-M<y&&(y=S-M),S+M>w&&(w=S+M),L-A<x&&(x=L-A),L+A>v&&(v=L+A),C=!0,e.internalClearStyleAndClass(),a[s]&&a[s].color?e.setFill(a[s].color):h&&e.setFill(h[s%h.length]);const P=t._style;P&&"string"!=typeof P&&P.stroke&&e.setStroke(P.stroke)}})),this._groupCenter=C?{cx:(y+w)/2,cy:(x+v)/2,halfW:(w-y)/2,halfH:(v-x)/2}:null,this._renderBaseLine(t.baseLine,!1,this.width,b)}}class hh extends Ua{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._hoverBar=null,this._bars=new Ea(this._pointContainer,ah)}_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,m(this.growRate,1))}_doReset(){this._hoverBar=null}_doPointerMoved(t,e,i){var s,r,o,n;const a=this._bars.elementOf(i)||null;if(a!==this._hoverBar&&((null===(s=this._hoverBar)||void 0===s?void 0:s.point)&&(null===(o=null===(r=this._labelContainer)||void 0===r?void 0:r.get(this._hoverBar.point,0))||void 0===o||o._text.restoreStyles()),this._hoverBar=a,null==a?void 0:a.point)){const t=this.model.pointLabel.prop("hoverStyle"),e=null===(n=this._labelContainer)||void 0===n?void 0:n.get(a.point,0);e&&t&&(e._text.saveStyles(),e._text.internalSetStyleOrClass(t))}return!0}_runShowEffect(t){t&&th.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 o=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,o)}))}$_layoutBars(t,e,i){const s=this.model,r=s.pointLabel,o=s._width,n=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=this._labelViews(),p=s.getCallout(),g=this._calloutViews(),m={pad:this._ext.pad,barWidth:s.prop("barWidth"),overflow:s.prop("overflow")};let f,b;this._bars.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"center"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let C,S,L,M,A,P;if(p&&(C=r.getCallout(y))&&(S=C.map((t=>l.project(t))),f=S[S.length-1]),r.xPos=L=f[0],r.yPos=M=f[1],L*=c[0],M*=c[1],b=e(L,M,o,n),t.resize(o,n),t.render(s,a&&h,r.values,m,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),u&&(A=u.get(r,0))&&A.setVisible(t._static)){const e=_(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,b,o,n,A))}if(g&&S&&(P=g.get(r))&&P.setVisible(t._static)){const e=S.flat().map(((t,e)=>t*c[e%2]));g.setMask(P,e).setBounds(t.tx,t.ty,o,n),P.render(p,r,e,t.getFill())}}}))}$_resolveLabelPosition(t,e,i,s,r,o){const n=this._getLabelPositioner(e,"bottom");let a=i.x+s/2,h=i.y+r/2,l=s/2,c=r/2;if("center"===e){const e=t.getGroupCenter();e&&(a=i.x+e.cx,l=e.halfW,h=i.y+e.cy,c=e.halfH)}return n(a,h,o.bbox(),l,c,this.model.getLabelOff())}}class lh extends Ga{tooltipColor(){return getComputedStyle(this.dom).fill}}class ch extends Ha{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new Ea(t,lh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=(t,e,i)=>{t.setPath(p(e,e)),t.trans(i.x,i.y).rotate(l)},r=(t,e,i)=>{if(h instanceof Er){const s=h.r,r=this.chart().width,o=i[1]*Math.PI/180,n=e/2*(360/r),a=n/Math.cos(o),l=n;h.r=Ir*this._scale;const c=ba.geoCircle(i[0],i[1],a,l,h,!0);h.r=s,t.setPath(c),t.trans(0,0).rotate(0)}else s(t,e,C)},o=this.model,n=o.pointLabel,a=o.chart,h=a.getProjection(),l=+o.prop("rotation")||0,c=[this._scale,-this._scale],d=o.prop("position"),u=this._getLabelPositioner(o.subLabel.prop("position"),"right"),p=za.getDrawer(o.getShape()),g=this._labelViews(),m=o.getLabelOff(),f=o.getSubLabelOff(),b=o.getCallout(),y=this._calloutViews(),{min:w,max:x}=o.getPixelMinMax(_(a.width,a.height));let v,C;const S=n.getPosition;this._markers.forEach(((t,e)=>{const n=t.point,a=[n.lon,n.lat];if(t.setVisible(!n.isNull&&null!=(v=h.getVisible(a)))){const e=this._getPointPositioner(n.position||d,"center");let l,_,p,L,M,A,P=(t._radius=o.getRadius(n.getValue(),w,x))*n.vrate()*i;if(b&&(l=n.getCallout(a))&&(_=l.map((t=>h.project(t))),v=_[_.length-1]),n.xPos=p=v[0],n.xPos=L=v[1],p*=c[0],L*=c[1],C=e(p,L,2*P,2*P),C.x+=P,C.y+=P,this.model.alignToSurface?r(t,P,a):s(t,P,C),g){if(M=g.get(n,0)){let e=this._getLabelPositioner(S(n),"center");this._layoutLabel(M,t.dom).transp(e(C.x,C.y,M.bbox(),P,P,m))}(M=g.get(n,1))&&this._layoutLabel(M,t.dom).transp(u(C.x,C.y,M.bbox(),P,P,f))}if(y&&_&&(A=y.get(n))&&A.setVisible(t._static)){const e=_.flat().map(((t,e)=>t*c[e%2]));y.setMask(A,e).setCircle(e[e.length-2],e[e.length-1],P),A.render(b,n,e,t.getFill())}}}))}}class dh extends Kt{static create(t,e,i,s,r,o,n,a,h=!0){return new dh(t,e,{cx:i,cy:s,rx:r,ry:o,innerRadius:0,start:n,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,o,n,a,h,l=!0){return new dh(t,e,{cx:i,cy:s,rx:r,ry:o,innerRadius:n,start:a,angle:h,clockwise:l})}constructor(t,e=L,i=L){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 Vi.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 Vi.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 _h=function(t){return isNaN(t)?0:t};class uh{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return a(t)?this._path.push("M",_h(t),_h(e)):this._path.push("M",_h(t.x),_h(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",_h(t),_h(e)):this._path.push("m",_h(t.x),_h(t.y)),this}movep(t,e){return a(t)?this._path.push("M",F(t),F(e)):this._path.push("M",F(t.x),F(t.y)),this}line(t,e){return a(t)?this._path.push("L",_h(t),_h(e)):this._path.push("L",_h(t.x),_h(t.y)),this}linep(t,e){return a(t)?this._path.push("L",F(t),F(e)):this._path.push("L",F(t.x),F(t.y)),this}curve(t,e,i,s,r,o){return this._path.push("C",t,e,i,s,r,o),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",_h(t[e]),_h(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",_h(t[e].x),_h(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 ph extends Kt{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 uh;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 gh=class extends Kt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new uh).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class mh extends Xa{constructor(t){super(t),this.add(this._faceView=new dh(t,"rm-circle-gauge-face")),this.add(this._rimView=new dh(t,"rm-circle-gauge-rim")),this.add(this._valueView=new dh(t,"rm-circle-gauge-value")),this.add(this._textView=new Ze(t,"rm-circle-gauge-text")),this.add(this._handContainer=new Ut(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 ph(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 gh(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),o=this._size=_(e,i),n=t._props.getExtents(o*this.point._aniRate());this.$_renderBackground(t,r,n),this.$_renderValue(t,r,n,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,o=t._props,n=o._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:n,angle:o._sweepRad,clockwise:t.prop("clockwise")}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const o=t._props,n=s.getValue(),a=t.getValueRate(n)*r,h=t.valueRim.getThickness(i.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,r=i.value+(s.prop("stroked")?0:h/2),n=this._valueView;n.internalResetStyleOrClass(s._style),s.prop("stroked")&&(n.setFill("none"),n.internalSetStyle("strokeWidth",O(h))),n.setBoolData("stroked",s.prop("stroked")),n.setSectorEx({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:(r-h)/r,start:o._startRad,angle:o._sweepRad*a,clockwise:t.prop("clockwise")},s.prop("stroked"))}if(l.visible){const i=t.gaugeLabel;l.text=i.getNumberText(n,!1,!1,void 0),i.buildSvg(l,null,NaN,NaN,t,i._domain);const s=l.bbox(),r=i.getOffset(this.width,this.height);l.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class fh extends qa{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new Ea(t,mh)}_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&&th.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.pointLabel,o=s.chart.getProjection(),n=[this._scale,-this._scale],a=s.prop("position"),h=this._labelViews(),l=s.getLabelOff(),c=s.getCallout(),d=this._calloutViews(),_=r.getPosition;let u,p,g;this._gauges.forEach(((r,m)=>{const f=r.point,b=[f.lon,f.lat];if(r.setVisible(!f.isNull&&null!=(u=o.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"top");let y,w,x,v,C,S;if(c&&(y=f.getCallout(b))&&(w=y.map((t=>o.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=n[0],v*=n[1],r.render(s,t,e,i*f.vrate()),p=r._size,g=m(x,v,p,p),r.trans(g.x,g.y),h&&(C=h.get(f,0))&&C.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(C,r.dom).transp(t(g.x+p/2,g.y+p/2,C.bbox(),p/2,p/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)}}))}}class bh extends Zt{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 yh extends ut{constructor(t,e){super(),this.view=t,this.gauge=e}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.gauge,this.view._exts),!0}}class wh extends Xa{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new bh(e,"rm-clock-gauge-face")),this.add(this._rimView=new dh(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Ze(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new Ut(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new Ut(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Kt(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new Kt(e,"rm-clock-gauge-minute")),this.add(this._secondView=new Kt(e,"rm-clock-gauge-second")),this.add(this._pinView=new bh(e,"rm-clock-gauge-pin")),this._tickViews=new _a(this._tickContainer,ka,"rm-clock-gauge-tick"),this._tickLabelViews=new _a(this._tickLabelContainer,Ze,"rm-clock-gauge-tick-label")}prepare(e,i){const s=Math.round(12/u(1,Math.floor(i.tickLabel.prop("step"))||1));this._tickViews.prepare(i.tick.visible?12:0),this._tickLabelViews.prepare(i.tickLabel.visible?s:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=i.prop("timezoneCallback")}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.prop("active")&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),p(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.prop("animatable")&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const i=this._labelView,s=this._faceView,r=this._rimView,o=this._tickLabelViews,n=this._pinView,{cx:a,cy:h,rd:l}=e,_=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.prop("length")||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-_/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-_;let g=p-u,m=k,f=P/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+c(m)*p,h+d(m)*p,a+c(m)*g,h+d(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!o.isEmpty){const e=12/o.count,i=P/12*e;m=k,o.get(0).text="12",g=p-(u+t.tickLabel.prop("offset")||0),g-=.5*o.get(0).bbox().height,o.forEach(((s,r,o)=>{s.text=String(0===r?12:r*e),s.trans(a+c(m)*g,h+d(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}n.setVisible(t.pin.visible)&&(n.setCircle(a,h,t.pin.prop("radius")||2),n.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.prop("position")?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=f(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(),o=i.getSeconds(),n=s>=12,{cx:a,cy:h,rd:l}=e,c=new uh;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=P*(s/12+r/60/12+o/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=P*(r/60+o/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?P*(this._aniSec+this._secRate)/60:P*o/60,u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),n&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*N),this._prevSec=o)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new yh(this,t);i.duration=t.secondHand.prop("duration")||200,i.start()}}}class xh extends qa{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new Ea(t,wh)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=i.pointLabel,r=this.model.chart.getProjection(),o=[this._scale,-this._scale],n=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),d=s.getPosition;let u,p,g;this._gauges.forEach(((s,m)=>{const f=s.point,b=[f.lon,f.lat];if(s.setVisible(!f.isNull&&null!=(u=r.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;if(l&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=o[0],v*=o[1],s.render(i,t,e),p=_(t,e),g=m(x,v,p,p),s.trans(g.x,g.y),a&&(C=a.get(f,0))&&C.setVisible(f._isStatic())){const t=this._getLabelPositioner(d(f),"bottom");this._layoutLabel(C,s.dom).transp(t(g.x+p/2,g.y+p/2,C.bbox(),p/2,p/2,h))}c&&w&&(S=c.get(f))&&S.setVisible(f._isStatic())&&S.render(l,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}class vh extends Oa{constructor(t){super(t,!0),this.add(this._back=new Ut(t)),this._back.add(this._figure=new qt(t)),this._back.add(this._textView=new ia(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,o=s.prop("text");this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=Zt.createElement(t,"use"),this._textView.dom),Ht.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!o)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(o),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t,e){const i=this._image,s=this._textView,r=this._rBox=this._figure.bbox();if(this._aniScale(this._back,e),i){const t=i.getBBox();let e,s,o,n;t.width>r.width?(e=(t.width-r.width)/2,r.width=t.width):o=(r.width-t.width)/2,t.height>r.height?(s=(t.height-r.height)/2,r.height=t.height):n=(r.height-t.height)/2,Ht.setAttrs(this._figure.dom,{x:e,y:s}),Ht.setAttrs(i,{x:o,y:n})}if(s.visible){const t=s.bbox(),e=Ht.getPadding(s._text.dom),i=r.width-e.left-e.right,o=r.height-e.top-e.bottom;s.trans(e.left+(i-t.width)/2,(o-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Ch extends za{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new Ea(this._pointContainer,vh)}$_createFigure(t){const e=Zt.createElement(t,"symbol");return e.append(Zt.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=Zt.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const s=e.figureBox,o=e.innerImage;Ht.setAttr(this._figure,"viewBox",s?`0 0 ${s[0]} ${s[1]}`:null),Ht.setAttr(this._figure.firstElementChild,"d",r(e.path)?e.path.join(" "):e.path),Ht.setAttrs(this._image,{href:o.prop("url"),width:o.prop("width"),height:o.prop("height")}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&th.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()},o=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,n=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,o,n)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(),i=this.model,s=i.pointLabel,r=[this._scale,-this._scale],o=+i.prop("rotation")||0,n=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=l&&"label"===l.prop("mode"),d=this._calloutViews(),_=s.getPosition,u=i.innerImage.prop("minSize"),p=i.getValueRange();let g,m;this._figures.forEach(((i,s)=>{const f=i.point,b=[f.lon,f.lat];if(i.setVisible(!f.isNull&&null!=(g=e.getVisible(b)))){const s=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S,L,M;l&&(y=f.getCallout(b))&&(w=y.map((t=>e.project(t))),c||(g=w[w.length-1])),f.xPos=x=g[0],f.yPos=v=g[1],x*=r[0],v*=r[1];const A=isNaN(u)?1:(f.value-p.min)/(p.max-p.min);if(i.render(A,t),L=i._rBox,m=s(x,v,L.width,L.height),i.trans(m.x,m.y).rotate(o),a&&(C=a.get(f,0))&&C.setVisible(i._static))if(this._layoutLabel(C,i.dom),M=C.bbox(),c&&w){const t=w.flat().map(((t,e)=>t*r[e%2])),e=this._getLabelPositioner("center","center");C.transp(e(t[t.length-2],t[t.length-1],M,0,0,h))}else{const t=this._getLabelPositioner(_(f),"bottom");C.transp(t(m.x+L.width/2,m.y+L.height/2,M,L.width/2,L.height/2,h))}if(d&&w&&(S=d.get(f))&&S.setVisible(i._static)){const t=w.flat().map(((t,e)=>t*r[e%2]));L.x=i.tx,L.y=i.ty,M&&(M.x=t[t.length-2],M.y=t[t.length-1]),d.setMask(S,t).setRects(L,M),S.render(l,f,t,i.getFill())}}}))}}class Sh extends Oa{constructor(t){super(t,!0),this.add(this._imageView=new Wn(t))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Lh extends za{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new Ea(this._pointContainer,Sh)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.prop("imageWidth"),s=t.prop("imageHeight");this._images.prepare(e.length,((r,o)=>{const n=r.point=e[o];r.setImage(t.getUrl(n),i,s),this._setPointStyle(r,t,n)}))}_layoutPoints(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=+e.prop("rotation")||0,o=[this._scale,-this._scale],n=e.prop("position"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews(),d=i.getPosition;let _,u;this._images.forEach(((e,i)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(_=s.getVisible(g)))){const i=this._getPointPositioner(p.position||n,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>s.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=o[0],y*=o[1],e.render(t),v=e._rBox,u=i(b,y,v.width,v.height),e.trans(u.x,u.y).rotate(r),h&&(w=h.get(p,0))&&w.setVisible(e._static)){const t=this._getLabelPositioner(d(p),"bottom");w.layout().transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,a))}if(c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*o[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}class Mh{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:ut.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}let Ah=class extends Za{constructor(t){super(t),this._contentLayer.addAll(this._back=new ji(t),this._area=new Kt(t,"rm-line-series-area"),this._line=new Kt(t,"rm-line-series-line"),this._lowLine=new Kt(t))}render(t,e,i,s,r,o){const{min:n,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,n,a,s,r,o),c=i.length,d=c>2&&t.prop("curved"),_=new uh;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,o){const n=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<n;i++){const d=t[i],_=h+i/(n-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*o-e)/c)*r);a.push({x:_,y:u})}return a}};class Ph extends Ua{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new Ea(this._pointContainer,Ah)}_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,m(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Mh(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=s.pointLabel,o=s._width,n=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.prop("position"),_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews();let f,b;this._lines.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"top"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let C,S,L,M,A,P;if(g&&(C=r.getCallout(y))&&(S=C.map((t=>l.project(t))),f=S[S.length-1]),r.xPos=L=f[0],r.yPos=M=f[1],L*=c[0],M*=c[1],b=e(L,M,x,v),t.render(s,a&&h,r.values,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),p&&(A=p.get(r,0))&&A.setVisible(t._static)){const t=this._getLabelPositioner(_(r),"bottom");A.layout().transp(t(b.x+x/2,b.y+v/2,A.bbox(),x/2,v/2,u))}if(m&&S&&(P=m.get(r))&&P.setVisible(t._static)){const e=S.flat().map(((t,e)=>t*c[e%2]));m.setMask(P,e).setBounds(t.tx,t.ty,o,n),P.render(g,r,e,t.getFill())}}}))}}class kh{static interpolate(t,e){const i=Math.max(1,Math.ceil(Math.abs(e-t))),s=[];for(let r=0;r<=i;r++)s.push(t+(e-t)*r/i);return s}}const Ih="rm-map-series-id-";class Nh extends Oa{static idClass(t){return Ih+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Ih))return e.substring(17)}constructor(t){super(t)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i,s,r,o){var n;const a=this.point;if(r){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.internalSetStyleOrClass(e);else{const e=!this.point||a.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(Nh.idClass(this.model))}a&&(a.isSelected()&&!this.hasSavedStyles()?(this.saveStyles(),this.internalSetStyles({strokeWidth:"var(--rm-map-series-selected-stroke-width)",filter:"var(--rm-map-series-selected-filter)"}),this.internalSetStyleOrClass(i),this.strokeView||(this.strokeView=new Eh(this.doc,s)),this.strokeView.render(this,i),this.strokeView.attachToOwner()):a.isSelected()||!this.hasSavedStyles()||o||(this.restoreStyles(),null===(n=this.strokeView)||void 0===n||n.detachFromOwner()))}reset(){this.model=null}}class Eh extends Kt{constructor(t,e){super(t,"rm-map-series-hover"),this._owner=e}render(t,e){this._area=t;const i=t.dom,s=e&&"string"==typeof e;this.copyPath(),s?this.internalSetStyleOrClass(e):this.internalSetStyles({stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,filter:i.style.filter}),t.internalSetStyles({stroke:"none",strokeWidth:"0"})}refresh(){this._area&&this.copyPath()}attachToOwner(){this._owner.add(this)}detachFromOwner(){this._owner.removeChild(this)}_doInitStyles(){super._doInitStyles(),this.setClass("rm-point"),this.setAttr("vector-effect","non-scaling-stroke"),this.setBoolData("virtual",!0),this.ignorePointer()}copyPath(){this.setPath(this._area.path())}}class Th extends Kt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Vh extends Kt{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 Dh extends Kt{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 o=1;o<t.length;o++)e=_(e,t[o][0]),s=u(s,t[o][0]),i=_(i,t[o][1]),r=u(r,t[o][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 o=e.project([s[0],s[1]]);this._pts=[o],i=`M${o[0]} ${o[1]}`;for(let t=2;t<r;t+=2)o=e.project([s[t],s[t+1]]),i+=` L${o[0]} ${o[1]}`,this._pts.push(o);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class Rh extends ia{constructor(t){super(t,"rm-point-label rm-point-inset")}}class $h extends Ut{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new _a(this,Rh),new _a(this,Rh)],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(),o=i.pointLabelCount(),n=this._labels,a=this._maps;n[0].prepare(r.length),a[0].clear(),n[1].prepare(o>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{for(let h=0;h<o;h++){const o=n[h].get(r);o.setVisible(!0)&&(this.$_prepareInsetLabel(t,o,e[h],s,i),a[h].set(i,o))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const o=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)),o?(i.prepareRich(o),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class Oh extends za{constructor(t){super(t,"rm-map-series",!0,!1),this._boundsClip=null,this._areas={},this._insetLabelContainer=new $h(t),this._areaPool=new Ea(this._pointContainer,Nh),this._insetPool=new _a(this._pointContainer,Dh),this._hoverStrokeView=new Eh(t,this._pointContainer)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e;let i=t;const s=this._hoverArea;if(i&&(null===(e=i.model)||void 0===e?void 0:e.selected)&&(i=null),i!==s){const t=this.model;if(s){const t=this.getPointLabel(s);s.restoreStyles(),null==t||t._text.restoreStyles(),this._hoverStrokeView.detachFromOwner()}if(!i||i.point||t.prop("nullHovering")||(i=void 0),this._hoverArea=i,i){const t=this.getPointLabel(i);i.saveStyles(),null==t||t._text.saveStyles(),this.setHoverStyle(i,t),this._hoverStrokeView.render(i,this.model.prop("hoverStyle")),this._hoverStrokeView.attachToOwner()}i!=s&&t.chart._hoverAreaChanged(t,null==i?void 0:i.model,null==s?void 0:s.model)}}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=this.dom.contains(e)&&Nh.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}getIntersectedAreas(t){const e=[];return this._areaPool.forEach((i=>{Ht.isIntersectRectPath(t,i.dom,.4)&&e.push(i)})),e}needClip(){return!0}resolveBoundsClip(t,e,i,s,r){var o,n,a;const h=this.model.map,l=null==h?void 0:h.source;if(!(l instanceof Pr&&l.bounds)||h.isWorld)return null===(o=this._boundsClip)||void 0===o||o.remove(),this._boundsClip=null,t;if(r.isGlobe)return null===(n=this._boundsClip)||void 0===n||n.remove(),this._boundsClip=null,t;const c=h.h1,d=h.v1,_=h.h2,u=h.v2,p=(t,o)=>{const[n,a]=r.project([t,o]);return[n*e+i,-a*e+s]},g=[];kh.interpolate(c,_).forEach((t=>g.push(p(t,u)))),kh.interpolate(u,d).slice(1).forEach((t=>g.push(p(_,t)))),kh.interpolate(_,c).slice(1).forEach((t=>g.push(p(t,d)))),kh.interpolate(d,u).slice(1).forEach((t=>g.push(p(c,t))));const m=`M${g[0][0]},${g[0][1]} `+g.slice(1).map((t=>`L${t[0]},${t[1]}`)).join(" ")+" Z";return this._boundsClip&&this._boundsClip.dom.parentElement?this._boundsClip.setPath(m):(null===(a=this._boundsClip)||void 0===a||a.remove(),this._boundsClip=this.control.clip(new ie(this.doc).setPath(m))),this._boundsClip}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e,i){super.prepareModel(t,e,i);const s=this._insetLabelContainer;s.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?s.visible&&s.prepare(t,this):s.visible&&!s.isEmpty&&s.prepare(t,this)}_doPrepeare(t,e,i){const s=e.map,r=e.internalBorder._style,o=e.externalBorder._style,n=e.getMapBorders(),a=e.prop("bringToFront")?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new Ut(t,"rm-map-series-internals")),this._internalPool=new _a(this._internalContainer,Th)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new Ut(t,"rm-map-series-externals")),this._externalPool=new _a(this._externalContainer,Th)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&n.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new Ut(t,"rm-map-series-borders")),this._borderPool=new _a(this._borderContainer,Vh))),this._areaPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i),r=t.point=e.pointOf(s);t.setModel(s),r?(s.dummy||this._setPointStyle(t,e,r),a&&a.push(t)):t.internalClearStyleAndClass(),Ht.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(r)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"external"),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(o)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(n.length,((t,e)=>{const i=n[e];t.setModel(i),Ht.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),a&&a.length!==e.areaCount&&a.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Ht.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){return this.hoverArea=this.areaOfDom(i),!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){super.onScrollEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}onRotationStart(){super.onRotationStart(),this.hoverArea=null}onRotationEnd(){super.onRotationEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}$_layoutAreas(t,e){const i=this.chart(),s=i.isDirty,r=i.body,o=this.model,n=o.map,a=i.getProjection(),h=this._areas={},l=this._insets,c=o.prop("allAreas"),d=this._labelViews(),_=this._insetLabelContainer.visible?this._insetLabelContainer:null,u=o.insetLabel,p=o.prop("nullStyle"),g=o.prop("dummyStyle"),m=o.prop("selectStyle")||o.prop("selectedStyle"),f=this._scale,b=this._areaPool;b.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,n=d&&e&&d.get(e,0);if(h[i.id]=t,t.setVisible(i.visible&&(c||!!e)&&!o.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(p,g,m,this._pointContainer,s,a),n){const i=r.toVisible(o.getCenter(e));if(n.setVisible(!!i)){s&&this._layoutLabel(n,t.dom);const r=n.bbox();let[o,a]=i;e.xPos=o,e.yPos=a,o*=f,a*=-f,o-=r.width/2,a-=r.height/2,n.trans(o,a)}}}else n&&n.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=l[e];if(t.setVisible(!1!==i.visible)){const e=h[i.area],l=_&&!u.hideInsetLabel(i)&&_.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(d&&(c=d.get(e.point,0),c&&o.isPointLabelVisible(e.point))){const t=o.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const s=r.toVisible(t),n=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=f,e*=-f,t-=n.width/2,e-=n.height/2,c.trans(t,e)}}t.render(i,a)}}else{const e=i._base;if(e)if(e[0]instanceof Or){for(const t of e){if(!t.visible||o.isHiddenArea(t.id))return;if(d){const e=h[t.id];if(c=e&&d.get(e.point,0),c&&c.visible){const t=o.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const s=r.toVisible(t),n=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=f,e*=-f,t-=n.width/2,e-=n.height/2,c.trans(t,e)}}}}t.render(i,a)}else if(e[0]>=0){const e=n.areaOf(i._parent);e&&e.visible&&!o.isHiddenArea(e.id)&&t.render(i,a)}}if(l&&l.setVisible(!c)){s&&l.layout();const e=t.center,i=l.bbox();let[r,o]=e;r*=f,o*=-f,r-=i.width/2,o-=i.height/2,l.trans(r,o)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const i=this.model.prop("hoverColor"),s=this.model.prop("hoverStyle");t.internalSetStyles({filter:Oh.DefaultHoverFilter,strokeWidth:Oh.DefaultHoverStrokeWidth}),t.internalSetStyleOrClass(s),i&&t.internalSetStyle("fill",i),t.point||t.internalSetStyles({fill:"var(--rm-null-area-fill)",stroke:"var(--rm-null-area-stroke)"});const r=this.model.pointLabel.prop("hoverStyle");r&&(null==e||e._text.internalSetStyleOrClass(r))}}Oh.DefaultHoverFilter="var(--rm-map-series-hover-filter)",Oh.DefaultHoverStrokeWidth="var(--rm-map-series-hover-stroke-width)";class Fh extends na{constructor(t,e,i){super(t,e),this._paddings=new Rt,this.add(this._background=new Kt(t,i)),this.add(this._textView=new Ze(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=e.prop("text");r?(e.prepareRich(r),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const n=this._textView.bbox();let a=this.model.prop("backgroundStyle");o(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+n.width,this.mw=c.height=l.top+l.bottom+n.height,c}_doLayout(e){const i=this._textView,s=this.width;let r=0;this._renderBackgrouond(this._background,s,this.height,e);switch(getComputedStyle(i.dom).textAlign){case"center":r+=s/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=s,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}i.trans(r,this._paddings.top)}}class Bh extends Fh{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Vi.bar(0,i,e,-i,s,0))}}class zh extends Fh{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(Vi.bar(0,i,e,-i,0,s))}}class jh extends Oa{constructor(t){super(t,!0),this.add(this._back=new Ut(t)),this._back.addAll(this._borderView=new ji(t),this._headerView=new Bh(t),this._bodyView=new zh(t),this._divider=new ka(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,o){const n=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(n).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(n).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,o)}}class Gh extends za{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new Ea(this._pointContainer,jh)}_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&&th.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,o=r.chart.getProjection(),n=[this._scale,-this._scale],a=r.prop("position"),h=this._getLabelPositioner(r.pointLabel.prop("position"),"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=m(u.rx,0);let g,f,b;this._panels.forEach(((u,m)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=o.getVisible(w)))){const m=this._getPointPositioner(y.position||a,"top");let x,v,C,S,L,M;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>o.project(t))),g=v[v.length-1]),y.xPos=C=g[0],y.yPos=S=g[1],C*=n[0],S*=n[1],u.render(t,r,e,i,p,s),f=u._rBox,b=m(C,S,f.width,f.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+f.width/2,b.y+f.height/2,L.bbox(),f.width/2,f.height/2,c)),_&&v&&(M=_.get(y))&&M.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*n[e%2]));f.x=u.tx,f.y=u.ty,_.setMask(M,t).setRects(f),M.render(d,y,t,u.getFill())}}}))}}class Hh extends dh{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Wh extends Wa{constructor(t){super(t,!0),this._sectors=new _a(this,Hh,null,.5),this._rdRate=1,this.add(this._circle=new bh(t)),this._circle.internalSetStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,o=0;if(e){this.$_calcAngles(t,[0],s);const n=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.prop("clockwise");let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:o,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),n[0]&&n[0].color&&a.setFill(n[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,o,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=e.length,r=t.prop("clockwise")?1:-1,o=e.reduce(((t,e)=>t+e),0),n=t._totalRad*i;let a=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),s>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=a,a+=t.angle=r*e*n}}));else if(1==s){const t=this._sectors.get(0);t.start=a,t.angle=n}}$_layoutSectors(t,e,i,s,r){const o=t._categories||[],n=t.getFieldColors(),a=t.prop("clockwise");this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const h=t.value;if(isNaN(h))t.setVisible(!1);else{const h=t.start;let l=0,c=0;t.trans(l,c).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:h,angle:p(t.angle),clockwise:a}),t.internalClearStyleAndClass(),o[r]&&o[r].color?t.setFill(o[r].color):n&&t.setFill(n[r%n.length])}}))}}class Yh extends Ya{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new Ea(this._pointContainer,Wh)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.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 o=i.prepare(e[r],s);this._setPointStyle(i,t,o)}))}$_layoutPies(t,e,i){const s=this.model,r=s.pointLabel,o=s.chart.getProjection(),n=[this._scale,-this._scale],a=s.prop("position"),h=r.getPosition,l=s.getLabelOff(),c=this._labelViews(),d=s.getCallout(),_=this._calloutViews(),u=s.getRadius(Math.min(t,e)),p=s.hasThreshold(),g=this._inRegion;let m,f;this._pies.forEach(((t,e)=>{const r=t.point,b=[r.lon,r.lat];if(t.setVisible(!r.isNull&&(g&&r._excluded||!g&&!r._excluded)&&null!=(m=o.getVisible(b)))){const e=this._getPointPositioner(r.position||a,"top"),g=u*t._rdRate;let y,w,x,v,C,S;if(d&&(y=r.getCallout(b))&&(w=y.map((t=>o.project(t))),m=w[w.length-1]),r.xPos=x=m[0],r.yPos=v=m[1],x*=n[0],v*=n[1],f=e(x,v,2*g,2*g),f.x+=g,f.y+=g,t.render(s,p&&s.getThreshold(r.getSum()),g,i*r.vrate()),t.trans(f.x,f.y),c&&(C=c.get(r,0))){const e=this._getLabelPositioner(h(r),"bottom");this._layoutLabel(C,t.dom).transp(e(f.x,f.y,C.bbox(),g,g,l))}if(_&&w&&(S=_.get(r))&&S.setVisible(t._static)){const e=w.flat().map(((t,e)=>t*n[e%2]));_.setMask(S,e).setCircle(e[e.length-2],e[e.length-1],g),S.render(d,r,e,t.getFill())}}}))}}class Zh extends Ga{constructor(t){super(t,!0),this.add(this._pin=new Kt(t))}render(t){this._pin.setPath(Vi.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new bh(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 Uh extends Ha{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new Ea(t,Zh)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(),i=this._getGrowRate(),s=this.model,r=s.pointLabel,o=[this._scale,-this._scale],n=+s.prop("rotation")||0,a=s.prop("position"),h=r.getPosition;s.pointLabel.prop("position");const l=this._labelViews(),c=s.getLabelOff(),d=s.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((r,g)=>{const m=r.point,f=[m.lon,m.lat];if(r.setVisible(!m.isNull&&null!=(u=e.getVisible(f)))){const g=this._getPointPositioner(m.position||a,"top"),b=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,M;if(d&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),m.xPos=C=u[0],m.yPos=S=u[1],C*=o[0],S*=o[1],p=g(C,S,y,w),t&&r.render(b),r.trans(p.x+y/2,p.y+w).rotate(n),l&&(L=l.get(m,0))&&L.setVisible(r._static)){t&&this._layoutLabel(L,r.dom);const e=this._getLabelPositioner(h(m),"bottom");L.transp(e(p.x+y/2,p.y+w/2,L.bbox(),y/2,w/2,c))}_&&v&&(M=_.get(m))&&M.setVisible(r._static)&&M.render(d,m,v.flat().map(((t,e)=>t*o[e%2])),null)}}))}}class Xh extends Ga{}class qh extends Ha{constructor(t){super(t,"rm-point-series",!0,!0),this._pointLayer.add(this._clusterContainer=new Ut(t,"rm-point-clusters"))}_createMarkers(t){return new Ea(t,Xh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){const e=this.model;t&&(this._runClustering(e)||th.grow(this))}_doViewRateChanged(t){this.$_layoutMarkers(t)}zoomChanged(t,e){this._runClustering(this.model)}_runClustering(t){const e=t.cluster;if(e.stop(),t._visPoints.forEach((t=>t.cluster=null)),e.visible&&(isNaN(e.prop("zoomLimit"))||t.chart.body.zoom<e.prop("zoomLimit")))return e.run(t._visPoints,this.width,this.height,(e=>{this.$_prepareClusters(t,e)}),((t,e)=>{this.$_layoutMarkers(this._getGrowRate())}),(t=>{this.$_layoutMarkers(this._getGrowRate())})),!0;t.chart.body.zoom>=e.prop("zoomLimit")&&e.clear()}_clusterOfDom(t){if(t)return this._clusterPool.find((e=>e.containsDom(t)))}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()})),t.cluster.clusters&&this.$_prepareClusters(t,t.cluster.clusters)}$_layoutMarkers(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=Math.max(0,e.getRadius()),o=[this._scale,-this._scale],n=+e.prop("rotation")||0,a=e.prop("position"),h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews(),_=e.cluster.acitve;let u,p;const g=i.getPosition;this._markers.forEach(((i,m)=>{var f;const b=i.point,y=[b.lon,b.lat];if(i.setVisible(!b.isNull&&(!_&&!b.cluster||_||b.moves<1)&&null!=(u=s.getVisible(y)))){const m=this._getPointPositioner(b.position||a,"center"),w=(null!==(f=i._radius)&&void 0!==f?f:r)*b.vrate(),x=w*t,v=za.getDrawer(e.getShape());let C,S,L,M,A,P;if(c&&(C=b.getCallout(y))&&(S=C.map((t=>s.project(t))),u=S[S.length-1]),b.xPos=L=u[0],b.yPos=M=u[1],L*=o[0],M*=o[1],p=m(L,M,2*w,2*w),p.x+=w,p.y+=w,b.px=p.x,b.py=p.y,b.cluster&&_&&b.moves>0&&(p.x=p.x+(b.cluster.cx-p.x)*Math.min(1,b.moves),p.y=p.y+(b.cluster.cy-p.y)*Math.min(1,b.moves)),i.setPath(v(x,x)),i.trans(p.x,p.y).rotate(n),h&&(A=h.get(b,0))&&A.setVisible(i._static)){this._layoutLabel(A,i.dom);let t=this._getLabelPositioner(g(b),"bottom");A.transp(t(p.x,p.y,A.bbox(),w,w,l))}if(d&&S&&(P=d.get(b))&&P.setVisible(i._static)){const t=S.flat().map(((t,e)=>t*o[e%2]));d.setMask(P,t).setCircle(t[t.length-2],t[t.length-1],w),P.render(c,b,t,null)}}})),this.$_layoutClusters()}$_prepareClusters(t,e){const i=t.cluster,s=i._style;this._clusterContainer.setBoolData("disabled",!i.isExpandable()),i.acitve&&!this._clusterPool&&(this._clusterPool=new _a(this._clusterContainer,ja)),this._clusterPool&&this._clusterPool.prepare(e.length,((t,i)=>{t.setCluster(e[i]),t.internalClearStyleAndClass(),t.internalSetStyles(s)}))}$_layoutClusters(){const t=this.model.cluster;this._clusterPool&&(t.updateClusters(),this._clusterPool.forEach((e=>{const i=e._cluster;if(e.setVisible(t.isVisible(i))){const s=t.getRange(i);e.render(s.radius,s.color),e.trans(i.cx,i.cy)}})))}}class Kh extends Oa{constructor(t){super(t,!0),this._arrowClipPath=null,this.add(this._line=new Kt(t)),this.add(this._arrow=new Kt(t)),this.add(this._secondArrow=new Kt(t)),this.add(this._image=this.$_createImage(t)),this.add(this._secondImage=this.$_createImage(t)),this._arrow.setStyleOrClass("rm-route-series-line"),this._arrow.setStyleOrClass("rm-route-series-arrow"),this._secondArrow.setStyleOrClass("rm-route-series-line"),this._secondArrow.setStyleOrClass("rm-route-series-arrow"),this._image.setStyleOrClass("rm-route-series-image"),this._secondImage.setStyleOrClass("rm-route-series-image")}get line(){return this._line}get arrow(){return this._arrow}get secondArrow(){return this._secondArrow}get image(){return this._image}get secondImage(){return this._secondImage}prepare(t){this._checkStatic();const e=t.getImageUrl(this.point,!1);e?this.point.imageUrl||(this.point.imageUrl=e):this.point.imageUrl=null}isEmpty(t,e,i){return t.length<=1||0===e.length||0===i.length}clear(){this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),this._secondImage.setVisible(!1)}render(t,e,i,s,r,o,n){if(i.length<=1||0===s.length||0===r.length)return this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),void this._secondImage.setVisible(!1);const a=t,h=i[i.length-2],l=i[i.length-1],c=$(Math.atan2(l[1]-h[1],l[0]-h[0]))-90,d=this.$_buildLinePath(s,r,o);if(this._line.setPath(d),this._arrow.setVisible(n)){this.$_drawArrow(this._arrow,l,a,e,c),this.$_drawImage(t,this.point,this._image,a,l,e);const s=this.$_createClipBoundary(t,l,a,e);let r=null,n=c;if(-1!==o){this._secondArrow.setVisible(!0);const s=i[o],h=o>0?i[o-1]:i[0];n=$(Math.atan2(s[1]-h[1],s[0]-h[0]))-90,this.$_drawArrow(this._secondArrow,s,a,e,n),this.$_drawImage(t,this.point,this._secondImage,a,s,e),r=this.$_createClipBoundary(t,s,a,e)}else this._secondArrow.setVisible(!1),this._secondImage.setVisible(!1);this.$_applyArrowClipping(i,o,s,c,l,r,n)}else this._arrowClipPath&&this._line.setClip(null)}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this._secondArrow.setVisible(!1),this}$_createInnerRect(t,e,i){const{minX:s,maxX:r,minY:o,maxY:n}=t,a=i[0],h=i[1],l=R(e),c=Math.cos(l),d=Math.sin(l),_=(t,e)=>{const i=t-a,s=e-h;return[a+i*c-s*d,h+i*d+s*c]},u=_(s,o),p=_(r,o),g=_(r,n),m=_(s,n);return`M ${u[0]} ${u[1]} L ${p[0]} ${p[1]} L ${g[0]} ${g[1]} L ${m[0]} ${m[1]} Z`}$_drawArrow(t,e,i,s,r){const o=i.prop("arrowWidth"),n=i.prop("arrowLength"),a=[`M ${e[0]} ${e[1]}`,`L ${e[0]-o*s} ${e[1]-n*s}`,`L ${e[0]+o*s} ${e[1]-n*s} Z`].join(" ");t.setPath(a),t.setRotation(e[0],e[1],r)}$_drawImage(t,e,i,s,r,o){const n=s.prop("imageWidth")*o,a=s.prop("imageHeight")*o;if(!e.imageUrl)return;const h=r[0]-n/2,l=r[1]-a/2;i.setVisible(!0),i.internalSetStyles({width:`${n}px`,height:`${a}px`,transformOrigin:`${n/2}px ${a/2}px`,transform:`translate(${h}px, ${l}px) scaleY(-1)`})}$_createClipBoundary(t,e,i,s){const r=i.prop("arrowWidth"),o=i.prop("arrowLength"),n=Math.max(r*s,t.getLineWidth()/2);return{minX:e[0]-n,maxX:e[0]+n,minY:e[1]-o*s,maxY:e[1]+5}}$_applyArrowClipping(t,e,i,s,r,o,n){let a="M -10000 -10000 L 10000 -10000 L 10000 10000 L -10000 10000 Z "+this.$_createInnerRect(i,s,r);if(o){const i=t[e];a+=" "+this.$_createInnerRect(o,n,i)}this._arrowClipPath?this._arrowClipPath.setPath(a):(this._arrowClipPath=this._line.clipPath(a),this._arrowClipPath.setAttr("clip-rule","evenodd"))}$_buildLinePath(t,e,i){const s=[];let r=0;for(let o=0;o<t.length;o++){const n=`${t[o][0]},${t[o][1]}`;if(-1!==i&&o===i+1){for(let t=o-1;t>=r;t--)s.push(`L ${e[t][0]},${e[t][1]}`);s.push("Z"),r=o,s.push(`M ${n}`)}else s.push(o===r?`M ${n}`:`L ${n}`)}for(let i=t.length-1;i>=r;i--)s.push(`L ${e[i][0]},${e[i][1]}`);return s.push("Z"),s.join(" ")}$_createImage(t){const e=new Wn(t);return e.setVisible(!1),e}}class Jh extends za{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new Ea(this._pointContainer,Kh,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t.line.setFill(e),t.arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(m(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"fill"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._pointContainer.setStroke("none"),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(t),i.line.setStroke("none"),Ht.setNoScale(i.line.dom),i.arrow.setStroke("none"),Ht.setNoScale(i.arrow.dom),i.image.setAttr("href",t.getImageUrl(r)||""),i.secondImage.setAttr("href",t.getImageUrl(r)||"")}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.prop("arrowDisplay");t=m(t,1),this._lines.forEach(((i,o)=>{this.$_layoutLine(i,e,s,r,t*i.point.vrate())}))}}$_layoutLine(t,e,i,s,o){const a=t.point,h=e.getRouteMode();let l=[];const c=this.chart().isGlobe,d=[a.lon1,a.lat1],_=[a.lon2,a.lat2];if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t.line.setPath(s.join(" "))}else{if(h===Bi)l=this.$_genCubicBezierPath(a,d,_,Jh.INTERPOLATION);else l=this.$_genGcnPath(d,_,Jh.INTERPOLATION);const r="none"!==s&&(o<1||"moving"!==s);let n=e.getLineWidth();n/=this._scale;!c&&this.$_checkBoundaryCrossing(l)?this.$_renderDuplicatedPaths(t,e,i,l,n,o,r):this.$_renderSinglePath(t,e,i,l,n,o,r)}}$_renderSinglePath(t,e,i,s,r,o,n){const a=s.map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(a.length=a.length*o|0);const{topPath:h,bottomPath:l}=this.$_generateOffsetPaths(a,0,r/2);t.render(e,1/this._scale,a,h,l,-1,n)}$_renderDuplicatedPaths(t,e,i,s,r,o,n){const a=this.model.chart.body.scroll,h=s.map((t=>t[0])),l=Math.min(...h);let c;Math.max(...h)>180+a?c=-360:l<-180+a&&(c=360);const d=s.map((t=>[t[0]+c,t[1]])),_=s.map((t=>i.project(t))).filter((t=>!t.outside)),u=d.map((t=>i.project(t))).filter((t=>!t.outside));if(o<1&&(_.length=_.length*o|0,u.length=u.length*o|0),0===_.length||0===u.length)return void t.clear();const p=[..._,...u],{topPath:g,bottomPath:m}=this.$_genSplitedOffsetPath(_,u,r/2);t.render(e,1/this._scale,p,g,m,_.length-1,n)}$_checkBoundaryCrossing(t){if(t.length<2)return!1;const e=this.chart().body.scroll,i=-180+e,s=180+e,r=t.map((t=>t[0])),o=Math.min(...r),n=Math.max(...r);return o<i||n>s}$_genSplitedOffsetPath(t,e,i){const{topPath:s,bottomPath:r}=this.$_generateOffsetPaths(t,0,i),{topPath:o,bottomPath:n}=this.$_generateOffsetPaths(e,0,i);return{topPath:[...s,...o],bottomPath:[...r,...n]}}$_genGcnPath(t,e,i){const s=[];let r=t[0];for(let o=0;o<=i;o++){const n=o/i,a=this.interpolate(t,e,n,r);s.push(a),r=a[0]}return s}$_genCubicBezierPath(t,e,i,s){const r=[],o=this.model.chart.getProjection(),n=this.model.chart.body.scroll,[a,h]=this.model.getCurvePoint(t,e,i);o.scroll=0;const l=o.project(e),c=o.project(i),d=a,_=h;let u=e[0];for(let t=0;t<=s;t++){const e=t/s,i=this.$_cubicBezier(l,d,_,c,e),n=o.backward(i);let a=n[0];const h=a-u;h>180?a-=360:h<-180&&(a+=360);const p=[a,n[1]];r.push(p),u=a}return o.scroll=n,r}$_cubicBezier(t,e,i,s,r){const o=r*r,n=o*r,a=1-r,h=a*a,l=h*a;return[l*t[0]+3*h*r*e[0]+3*a*o*i[0]+n*s[0],l*t[1]+3*h*r*e[1]+3*a*o*i[1]+n*s[1]]}interpolate(t,e,i,s){const r=R(t[1]),o=R(t[0]),n=R(e[1]),a=R(e[0]),h=Math.acos(Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos(a-o)),l=Math.sin((1-i)*h)/Math.sin(h),c=Math.sin(i*h)/Math.sin(h),d=l*Math.cos(r)*Math.cos(o)+c*Math.cos(n)*Math.cos(a),_=l*Math.cos(r)*Math.sin(o)+c*Math.cos(n)*Math.sin(a),u=l*Math.sin(r)+c*Math.sin(n),p=Math.sqrt(d*d+_*_+u*u),g=Math.asin(u/p);let m=$(Math.atan2(_,d));if(void 0!==s){const t=m-s;t>180?m-=360:t<-180&&(m+=360)}return[m,$(g)]}$_getNormalVector(t,e){let i;if(0===e){i=[t[1][0]-t[0][0],t[1][1]-t[0][1]]}else if(e===t.length-1){i=[t[e][0]-t[e-1][0],t[e][1]-t[e-1][1]]}else{i=[t[e+1][0]-t[e-1][0],t[e+1][1]-t[e-1][1]]}const s=Math.sqrt(i[0]*i[0]+i[1]*i[1]);return 0===s?[0,1]:[-i[1]/s,i[0]/s]}$_generateOffsetPaths(t,e,i){if(t.length<2)return{topPath:[],bottomPath:[]};const s=[],r=[];for(let o=0;o<t.length;o++){const n=t[o];let a=e+(i-e)*(o/(t.length-1));const h=1/this._scale;a=Math.max(a,h);const l=this.$_getNormalVector(t,o),c=[n[0]+l[0]*a,n[1]+l[1]*a],d=[n[0]-l[0]*a,n[1]-l[1]*a];s.push(c),r.push(d)}return{topPath:s,bottomPath:r}}}Jh.INTERPOLATION=80;class Qh extends Wa{constructor(t){super(t,!0),this._cells=new _a(this,Kt)}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(Vi.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const o=i*r.hCell+(i-1)*r.gap;let n=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[n][a])&&(n++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),o-n*r.hCell-(n>0?n*r.gap:0)),a++}))}}class tl extends Ya{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new Ea(this._pointContainer,Qh)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,m(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&th.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 o=i.prepare(e[r],s);this._setPointStyle(i,t,o)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.pointLabel,o=s.getWaffleInfo(),n=s.chart.getProjection(),a=+s.prop("rotation")||0,h=[this._scale,-this._scale],l=s.prop("position"),c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.prop("gap")},p=s.getCallout(),g=this._calloutViews();let m,f,b;this._waffles.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(m=n.getVisible(y)))){const e=this._getPointPositioner(r.position||l,"top");let w,x,v,C,S,L;if(p&&(w=r.getCallout(y))&&(x=w.map((t=>n.project(t))),m=x[x.length-1]),r.xPos=v=m[0],r.yPos=C=m[1],v*=h[0],C*=h[1],t.render(s,u,o,i*r.vrate()),f=t.bbox(),b=e(v,C,f.width,f.height),t.trans(b.x,b.y).rotate(a),_&&(S=_.get(r,0))&&S.setVisible(t._static)){const e=this._getLabelPositioner(c(r),"bottom");this._layoutLabel(S,t.dom).transp(e(b.x+f.width/2,b.y+f.height/2,S.bbox(),f.width/2,f.height/2,d))}g&&x&&(L=g.get(r))&&L.setVisible(t._static)&&L.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class el extends ma{constructor(t){super(t,el.CLASS_NAME),this.add(this._foreignObj=new Zt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=el.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.getSize(i,s),o=this._htmlView;let n=e.prop("html")||"";const a=(n.startsWith("#")||n.startsWith("."))&&t.querySelector(n);return this._htmlView.style.width=isNaN(r.width)?"max-content":"",this._foreignObj.resize(m(r.width,1e4),r.height),n=e.applyParams(a?a.innerHTML:n)||"<div></div>",n!==o.innerHTML&&(o.innerHTML=n),isNaN(r.width)&&(this._foreignObj.width=o.firstElementChild.offsetWidth),isNaN(r.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),a&&this._templateDom!==a&&(this._templateDom=a,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),oa.create(o.firstElementChild.offsetWidth,o.firstElementChild.offsetHeight)}_doLayout(t){super._doLayout(t)}_doDispose(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}el.CLASS_NAME="rm-html-annotation",el.HTML_VIEW_CLASS="rm-html-annotation-view";class il extends Oa{constructor(t){super(t,!0),this.add(this._foreignObj=new Zt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className="rm-html-series-view"}setHtml(t,e,i){const s=this._htmlView,r=m(e,1e4);this._htmlView.style.width=isNaN(e)?"max-content":"",this._foreignObj.resize(r,i),t!==s.innerHTML&&(s.innerHTML=t),isNaN(e)&&(this._foreignObj.width=s.firstElementChild.offsetWidth),isNaN(i)&&(this._foreignObj.height=s.firstElementChild.offsetHeight)}render(t){this._rbox=dt.create(0,0,this._htmlView.firstElementChild.offsetWidth,this._htmlView.firstElementChild.offsetHeight)}}class sl extends za{constructor(t){super(t,"rm-html-series",!0,!1),this._htmlViews=new Ea(this._pointContainer,il),this._observer=new MutationObserver((t=>{this.chart()._optionChanged(this.model)}))}_getPointPool(){return this._htmlViews}_doPrepeare(t,e,i){this.$_prepareHtmls(t,e,this._visPoints)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&th.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareHtmls(t,e,i){const s=e.getSize(),r=e.prop("html")||"",o=(r.startsWith("#")||r.startsWith("."))&&t.querySelector(r);this._htmlViews.prepare(i.length,((t,n)=>{const a=t.point=i[n],h=e.applyParams(a,o?o.innerHTML:r)||"<div></div>";t.setHtml(h,s.width,s.height),this._setPointStyle(t,e,a)})),o&&this._templateDom!==o&&(this._templateDom=o,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(),s=[this._scale,-this._scale],r=this._getLabelPositioner(e.pointLabel.prop("position"),"bottom"),o=e.getLabelOff(),n=this._labelViews(),a=e.getCallout(),h=this._calloutViews();let l,c;this._htmlViews.forEach(((d,_)=>{const u=d.point,p=[u.lon,u.lat];if(d.setVisible(!u.isNull&&null!=(l=i.getVisible(p)))){const _=this._getPointPositioner(e.prop("position"),"center");let g,m,f,b,y,w,x;if(a&&(g=u.getCallout(p))&&(m=g.map((t=>i.project(t))),l=m[m.length-1]),u.xPos=f=l[0],u.yPos=b=l[1],f*=s[0],b*=s[1],d.render(t),x=d._rbox,c=_(f,b,x.width,x.height),d.trans(c.x,c.y),n&&(y=n.get(u,0))&&y.setVisible(d._static)&&y.layout().transp(r(c.x+x.width/2,c.y+x.height/2,y.bbox(),x.width/2,x.height/2,o)),h&&m&&(w=h.get(u))&&w.setVisible(d._static)){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=d.tx,x.y=d.ty,h.setMask(w,t).setRects(x),w.render(a,u,t,d.getFill())}}}))}}function rl(t,e){return new(Ba[e._type()])(t)}function ol(t,e){return new(ga[e._type()])(t)}za.register([hn,Oh],[Mn,qh],[wn,Uh],[wo,hh],[tn,Ph],[fn,Yh],[Ho,Ch],[Nn,tl],[kn,Jh],[Ps,ch],[qo,Lh],[pn,Gh],[Zo,sl],[Io,fh],[zo,xh]),ma.register([io,Qa],[to,Ka],[eo,Ja],[Qr,el]);class nl extends ut{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class al extends ut{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class hl extends Ut{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new Ut(t)),this._axisLayer.add(this.axisView=new va(t,i)),this._axisLayer.add(this.tickLayer=new xa(t))}get firstMap(){for(const t of this.seriesViews)if(t instanceof Oh&&t.visible)return t}prepare(t,e,i){const s=e.visibleSeries,r=this.seriesMap,o=this.seriesViews,n=this._h1,a=this._h2;o.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),o.length=0,s.forEach((e=>{const s=r[e.hash]||rl(t,e);s.parent||(this.add(s),this.labelsContainer.add(s._labelContainer),this.labelsContainer.add(s.secondLabelContainer())),r[e.hash]=s,o.push(s),s._h1=n,s._h2=a,s.prepareModel(t,e,i)})),this.prevViews&&ht.equalArrays(this.prevViews,o)||(this.sort(o),this.labelsContainer.sort(o.map((t=>t._labelContainer)))),this.prevViews=o.slice(0)}prepareLayout(t){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}resetClip(t){this._axisLayer.setClip(t)}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}zoomChanged(t,e){}onScrollStart(){this.seriesViews.forEach((t=>t.visible&&t.onScrollStart()))}onScrollEnd(){this.seriesViews.forEach((t=>t.visible&&t.onScrollEnd()))}onRotationStart(){this.seriesViews.forEach((t=>t.visible&&t.onRotationStart()))}onRotationEnd(){this.seriesViews.forEach((t=>t.visible&&t.onRotationEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class ll extends Ut{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new Ut(t)),this.add(this._labelLayer=new Ut(t))}render(t,e,i,s,r){const o=e.guides.filter((t=>t.prop("front")==this.front));this.$_prepareGuides(t,o),this.$_layoutGuides(t,o,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 Sa(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((o,n)=>{o.measure(t,e[n],s,r),o.layout(i)}))}}class cl extends na{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._zoom=100,this._owner=e,this.add(this._back=new ji(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Pa(t)),this.add(this._contentLayer=new Ut(t,"rm-body-content")),this.add(this._feedbackContainer=new Ut(t,"rm-feedbacks")),this.add(this._crosshairView=new Ma(t)),this._contentLayer.add(this._annotationContainer=new Ut(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new ll(t,!1)),this._contentLayer.add(this._seriesContainer=new hl(t,new Ut(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new ll(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new Ut(t,"rm-front-annotations"))}getAnnotationAnchor(t){return this._annotationMap.get(t)}get firstMap(){return this._seriesContainer.firstMap}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),this._seriesContainer._h1=t+r,this._seriesContainer._h2=s}this.$_prepareSeries(t,e.chart,0),this.$_prepareAnnotations(t,e.getAnnotations())}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(this._mousePos),this._transformInfo),this.model&&(this.model.isScrollable()&&this.onScrollEnd(),this.model.projection.isGlobe&&this.onRotationEnd())}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,i){if(!this.model)return;const s=this.model.chart,r=this._owner.tx,o=this._owner.ty,{sv:n,pv:a}=function(s){let n,a;for(const h of s)h.pointerMoved(t,e,i)&&(n=h,a=h.getPointView(i,t-r,e-o,!0));if(!a)for(const h of s)if(a=h.getPointView(i,t-r,e-o,!0),a){n=h;break}return{sv:n,pv:a}}(this._seriesContainer.seriesViews),h=null==n?void 0:n.model,l=h&&this._owner.getScaleView(s.getColorScale(h.getColorScale()));return(null==a?void 0:a.point)?(this._owner.showTooltip(h,a,this,{x:t,y:e}),null==l||l.setValue(a.point.getValue())):(this._owner.hideTooltip(),null==l||l.setValue(NaN)),this._crosshairView.visible&&s&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!n}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 al(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}zoomChanged(t,e){this._seriesContainer.zoomChanged(t,e)}onScrollStart(){var t;(null===(t=this.model)||void 0===t?void 0:t.isScrollable)&&this._seriesContainer.onScrollStart()}onScrollEnd(){this.model.isScrollable&&this._seriesContainer.onScrollEnd()}onRotationStart(){this.model.projection.isGlobe&&this._seriesContainer.onRotationStart()}onRotationEnd(){this.model.projection.isGlobe&&this._seriesContainer.onRotationEnd()}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),oa.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=this._zoom,o=s._prj,n=s.chart,a=n.axis,h=n.map,l=this.height,c=this.width,{wMap:d,hMap:_,scale:u,tx:p,ty:g}=s.prepareLayout(c,l);let m=this._clip;if(this._back.resize(c,l),this._back.internalResetStyleOrClass(s._style),s.zoom!==r&&(this._zoom=s.zoom),h){this.$_prepareLayoutSeries(i),this._transformInfo={tx:p,ty:g,scale:u,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const t=`translate(${p}px, ${g}px) scale(${u}, ${-u})`,e=d*u,m=_*u,f=[this._seriesContainer],b=(c-e)/2-s.panX*u,y=(l-m)/2-s.panY*u,w=this.$_layoutClip(s,o,c,l,u);this._mapBack.setVisible(n.body.mapBackground.isVisible())&&this._mapBack.render(this.doc,n,b,y,e,m),f.forEach((n=>{const h=n.axisView,d=n.tickLayer;h.setScale(u),h.measure(i,a,c,l),h.resize(c,l),h.trans(p,g),d.setVisible(a.tick.visible)&&(d.prepare(i,a.tick,h.steps),d.resize(c,l),d.setScale(u),d.layout(s.projection),d.trans(p,g)),n.seriesViews.forEach((i=>{var s,n;i._scale=u,i.model.needMapScale()?(i._pointLayer.internalSetStyle("transform",t),i._calloutContainer.visible&&i._calloutContainer.internalSetStyles({transform:t})):i.model.needTranslate()?i.trans(p,g):(i.resize(c,l),i.trans(b,y)),i.move(p,g),i.resize(e,m),i.render(c,l,this._transformInfo),null===(s=i._labelContainer)||void 0===s||s.trans(p,g),null===(n=i.secondLabelContainer())||void 0===n||n.trans(p,g);const a=i.resolveBoundsClip(w,u,p,g,o);i.setClip(i.needClip()?a:null),r!==this._zoom&&i.zoomChanged(this._zoom,r)})),h.layout(),n.resetClip(w)})),this._crosshairView.visible&&this._crosshairView.prepare(u,t);const x={map:h,prj:o,tf:this._transformInfo,trans:t,latInterval:a.latInterval,lonInterval:a.lonInterval};this.$_layoutAxisGuides(i,a,x,c,l)}if(this.$_layoutAnnotations(c,l),m&&m.parent&&m.width===c&&m.height===l||(m&&m.dom.remove(),this._clip=this.clipRect(0,0,c,l)),this._requestShow&&this._requestShow.visible){const t=this.getSeries(this._requestShow);t&&(null===(e=this._requestShow.ani)||void 0===e||e.stop(),(this._requestShow.ani=new nl(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}mouseToMap(t,e=!0,i=!1){if(!this._transformInfo)return[NaN,NaN];const{tx:s,ty:r,scale:o,vx:n,vy:a}=this._transformInfo;let h=t.x-s,l=t.y-r;i||(h-=n,l-=a);const c=h/o,d=l/-o;return this.pointToMap(c,d,e)}boundsToMap(t,e=!0,i=!1){return{from:this.mouseToMap({x:t.x,y:t.y},e,i),to:this.mouseToMap({x:t.x+t.width,y:t.y+t.height},e,i)}}pointToMap(t,e,i){if(!this.model)return[NaN,NaN];const{projection:s,scroll:r}=this.model,o=s.backward([t,e]);return i||0===r||(o[0]=s.getScrolledLon(o[0])),o}mapToPoint(t){t=this.model.chart.getProjection().project(t);const{tx:e,ty:i,scale:s,vx:r,vy:o}=this._transformInfo;return{x:t[0]*s-(r-e),y:t[1]*-s-(o-i)}}boundsByCoord(t,e){const i=this.mapToPoint(t),s=this.mapToPoint(e);return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}$_prepareSeries(t,e,i){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e,i)}$_prepareLayoutSeries(t){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));o.forEach((t=>t.remove())),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ol(t,e);(e.prop("front")?s:i).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r),this._axisGuideContainer.setClip(this._clipMap),this._frontAxisGuideContainer.setClip(this._clipMap)}$_layoutClip(t,e,i,s,r){const o=()=>{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]}`))},n=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.dom.parentElement&&t.width===i&&t.height===s){if(t){if(this._prevPrj!==e){const e=o();t.setPath(e)}n(t),this._contentLayer.hasClip()}}else{const e=o();t&&t.remove(),this._clipMap=this.control.clip(new ie(this.doc).setPath(e)),n(this._clipMap),this._clipMap.resize(i,s)}}else this._clipMap&&(this._clipMap.remove(),this._clipMap=null);return this._clipMap}}class dl extends aa{constructor(t,e){super(t,e?dl.SUBTITLE_CLASS:dl.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Ze(t)),this._richText=new ii}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.prop("text")),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}dl.TITLE_CLASS="rm-title",dl.SUBTITLE_CLASS="rm-subtitle";const _l="circle",ul="header";var pl;!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(pl||(pl={}));class gl extends Zt{constructor(e){super(e,gl.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._gap=8,this._tailVisible=!0,this._circleRadius=6,this._circlePaddingX=12,this._circlePaddingY=5,this._linePaddingX1=5,this._linePaddingX2=6,this._linePaddingY=4,this._lineWidth=2,this._lineGap=4,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Kt(e,"rm-tooltip-back")),this.add(this._top=new Kt(e,"rm-tooltip-top")),this.add(this._border=new Kt(e,"rm-tooltip-border")),this.add(this._textView=new Ze(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Yt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ii,this.close(!0,!1)}show(t,e,i,s,r,o){var n;const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a),c=(null===(n=e.tooltipColor)||void 0===n?void 0:n.call(e))||t._calcedColor,d=h.prop("mode");if(!l)return;const p=h.prop("text")||l.getTooltipText(t,a);if(!p)return;const g=this.control,m=g.contentWidth(),f=g.contentHeight(),b=this._textView;this._richText.setFormat(p),this._richText.build(b,NaN,NaN,null,h.getTextDomain());const{w:y,h:w}=this.calcBounds(d,h);this._top.setFill(c);const x="visible"===this.getStyle("visibility")?300:0,v=h.prop("offset")+this._tailSize,C=e.getBounds(),S=g.getBounds();let L;L=i-y/2-u(0,_(i-y/2,m-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const M=pl.TOP;d===_l?(this.drawCircleTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")):d===ul?(this.drawHeaderTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-headermode-bg)"),b.setFill("var(--rm-tooltip-headermode-color)")):(this.drawLineTooltip(0,0,y,w,M,L),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")),s-=w+v,i=u(0,_(i-=y/2,m-y)),s=u(0,_(s,f-w)),this.transEx(i,s,x,!1),0===x&&this.internalSetStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.prop("hideDelay"):Xr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,o){const n=null!=i?H(e,i):{},a=H(e,s),h=t.animate([n,a],{duration:r,fill:"none"});h&&o&&h.addEventListener("finish",o)}(this.dom,"opacity",void 0,0,200,(()=>{this.internalSetStyle("visibility","hidden")}))}drawHeaderTooltip(t,e,i,s,r,o){const n=this._textView,a=this._radius,h=this._topHeight,l=r===pl.BOTTOM,c=this.drawPanelPath(t,e,i,s,r,o),d=l?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=n.bbox();t+=(i-_.width)/2,e+=(s-_.height+(l?-h:h))/2,n.trans(t,e),this._top.setPath(d),this._border.setPath(c),this._back.setPath(c)}drawCircleTooltip(t,e,i,s,r,o){const n=this._textView,a=n.bbox(),h=this.drawPanelPath(t,e,i,s,r,o),l=this._circleRadius,c=t+this._circlePaddingX+l,d=e+this._circlePaddingY+a.height/2-l+l,_=["M",c+l,d,"A",l,l,0,0,1,c,d+l,"A",l,l,0,0,1,c-l,d,"A",l,l,0,0,1,c,d-l,"A",l,l,0,0,1,c+l,d,"Z"];t+=this._circlePaddingX+this._gap+2*l,e+=this._circlePaddingY,n.trans(t,e),this._top.setPath(_),this._border.setPath(h),this._back.setPath(h)}drawLineTooltip(t,e,i,s,r,o){const n=this._textView;n.bbox();const a=this.drawPanelPath(t,e,i,s,r,o),h=i-2*this._linePaddingX1,l=this._lineWidth,c=t+this._linePaddingX1,d=e+this._linePaddingY,_=this._lineWidth/2,u=["M",c+_,d,"L",c+h-_,d,"Q",c+h,d,c+h,d+_,"L",c+h,d+l-_,"Q",c+h,d+l,c+h-_,d+l,"L",c+_,d+l,"Q",c,d+l,c,d+l-_,"L",c,d+_,"Q",c,d,c+_,d,"Z"];t+=this._linePaddingX2,e+=this._linePaddingY+this._lineGap+this._lineWidth,n.trans(t,e),this._top.setPath(u),this._border.setPath(a),this._back.setPath(a)}calcBounds(t,e){const i=this._textView.bbox();let s=0,r=0;return"header"===t?(s=u(e.prop("minWidth")||0,i.width+16),r=u(e.prop("minHeight")||0,i.height+12)):"circle"===t?(s=u(e.prop("minWidth")||0,i.width+2*this._circlePaddingX+this._gap+2*this._circleRadius),r=u(e.prop("minHeight")||0,i.height+2*this._circlePaddingY)):(s=u(e.prop("minWidth")||0,i.width+2*this._linePaddingX2),r=u(e.prop("minHeight")||0,i.height+2*this._linePaddingY+this._lineWidth+this._lineGap)),{w:s,h:r}}drawPanelPath(t,e,i,s,r,o){const n=this._tailSize,a=this._radius,h=[];return h.push("M",t+a,e),this._tailVisible&&r===pl.BOTTOM&&(h.push("L",t+i/2-n/2+o,e),h.push("L",t+i/2+o,e-n),h.push("L",t+i/2+n/2+o,e)),h.push("L",t+i-a,e),h.push("Q",t+i,e,t+i,e+a),this._tailVisible&&r===pl.LEFT&&(h.push("L",t+i,e+s/2-n/2+o),h.push("L",t+i+n,e+s/2+o),h.push("L",t+i,e+s/2+n/2+o)),h.push("L",t+i,e+s-a),h.push("Q",t+i,e+s,t+i-a,e+s),this._tailVisible&&r===pl.TOP&&(h.push("L",t+i/2+n/2+o,e+s),h.push("L",t+i/2+o,e+s+n),h.push("L",t+i/2-n/2+o,e+s)),h.push("L",t+a,e+s),h.push("Q",t,e+s,t,e+s-a),this._tailVisible&&r===pl.RIGHT&&(h.push("L",t,e+s/2+n/2+o),h.push("L",t-n,e+s/2+o),h.push("L",t,e+s/2-n/2+o)),h.push("L",t,e+a),h.push("Q",t,e,t+a,e),h}}gl.CLASS_NAME="rm-tooltip";class ml extends da{constructor(t){super(t,ml.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new Ut(t);this.add(e),e.add(this._boxLayer=new Ut(t)),this._boxes=new _a(this._boxLayer,ji,"rm-color-scale-box"),e.add(this._splitLayer=new Ut(t)),this._splits=new _a(this._splitLayer,ka,"rm-color-scale-split"),e.add(this._markerLabel=new ia(t,void 0)),e.add(this._marker=new Kt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new Ut(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new Ut(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new Ut(t,"rm-color-scale-null")),this._tickLines=new _a(this._tickLineLayer,ka),this._tickLabels=new _a(this._tickLabelLayer,ia),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 o=e.marker,n=e.tick,a=this._tickLen=+n.line.prop("length")||0,h=n.line,l=n.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.prop("reversed"),_=this._inverted=e.prop("inverted"),u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(o.visible)&&(this._markerSize=o.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(o,c,d,this._markerSize),this._markerLabel.setVisible(o.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==n.prop("minVisible")),e>1){t.last.setVisible(!1!==n.prop("maxVisible"));for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==n.prop("minVisible")),i>1){e.last.setVisible(!1!==n.prop("maxVisible"));for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,o=this._rScale,n=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-n.width)/2);break;case"right":c=Math.max(p,p+_-n.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-o.x,g-o.y)}$_getFillId(t){return`${ml.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,i){const s=t.createElementNS(e,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(t.createElementNS(e,"stop")),s.appendChild(t.createElementNS(e,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Ht.setAttrs(t,i?ml.VERT_FILL_I:ml.VERT_FILL):Ht.setAttrs(t,i?ml.HORZ_FILL_I:ml.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=[],o=e.getSteps();if(e.prop("solidFill"))if(o)this._boxes.prepare(o.length,((t,e)=>{t.internalSetStyle("fill",o[e]._color1)}));else{const t=this._stepCount,i=e.minColor,s=e.endColor;this._boxes.prepare(t,((e,r)=>{e.internalSetStyle("fill",Ge.interpolate(i,s,(r+1)/t).toString())}))}else if(o)o.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][vi]=e})),r.forEach((t=>{const e=t[vi];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(r.length,((t,e)=>{t.internalSetStyle("fill",this.$_getFillUrl(e))}));else{this._boxes.prepare(1);const o=this.$_createGradient(t,0);r.push(o),this.$_setDir(o,i,s),this.$_fillStops(o,e.minColor,e.endColor),this._boxes.first.internalSetStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new ji(t,"rm-color-scale-box")),e.add(this._nullLabel=new ia(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 o=this._markerSize,n=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",n),i?(h=s?t-o+1:o-1,l=(n?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(n?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-o+1:o),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,o=this._inverted,n=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=o?f+u:f,a>0&&(r?n.trans(0,y):n.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(o?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=o?m:m+u,a>0&&(r?n.trans(b,0):n.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((o?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,(o?e:i-1-e)*_,p,_):t.setBounds((o?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=n.tx,e=p,f=o?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=n.ty,i=g,o&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.prop("color")&&this._nullBar.setFill(t.prop("color")),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,o)}}ml.SCALE_CLASS="rm-color-scale",ml.SCALE_FILL="rm-color-scale-fill",ml.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},ml.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},ml.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},ml.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class fl extends Zt{constructor(t,e,i){super(t,fl.STYLE),this.add(this._back=new ji(t,fl.BACK_STYLE)),this.add(this._textView=new Ze(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,i){this.internalSetStyleOrClass(i),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const s=this._textView.bbox(),r=getComputedStyle(this._back.dom),o=(new Rt).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(o.left+s.width/2,o.top+s.height/2-1),this._back.rect={x:0,y:0,width:s.width+o.left+o.right,height:s.height+o.top+o.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}fl.STYLE="rm-button",fl.BACK_STYLE="rm-button-background";class bl extends fl{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class yl extends na{}class wl extends yl{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new bl(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new bl(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new bl(t,"-",(()=>this.chart().body.zoomByFactor(-this.model.getZoomFactor()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,i,s){const r=this.chart().body.zoom,o=this._szBtn=e.getButtonSize(),n=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.prop("showReset"))?3:2;let h=0,l=0;return this._btnHome.setBoolData(Si,r<=100),this._btnDec.setBoolData(Si,r<=100),(this._vertical=e.vertical)?(h=o.width,l+=a*o.height+(a-1)*n):(l=o.height,h+=a*o.width+(a-1)*n),{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 xl extends yl{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)[Ci]),!0}_doMeasure(e,i,s,r){let o=this._btnBack,n=0,a=0;if("text"===i.prop("type")){null==o||o.remove(),this._textViews||(this._textViews=new _a(this,Ze,"rm-drilldown-text"),this._seperators=new _a(this,Ze,"rm-drilldown-separator"));const e=i.chart.firstVisible,s=this._history=e.getHistory();this._textViews.prepare(s.length,((e,i)=>{e.text=s[i].displayName(),e.anchor=t.TextAnchor.START,e[Ci]=s[i]})),this._seperators.prepare(s.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),o||this.add(o=this._btnBack=new bl(e,"<",(()=>{i.chart.drillup()}))),o.layout();const t=o.bbox();n=t.width,a=t.height}return{width:n,height:a}}_doLayout(t){if("text"===this.model.prop("type")){const t=this.model.prop("itemGap"),e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class vl extends da{constructor(t){super(t,vl.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new Ut(t);this.add(e),e.add(this._bubbleLayer=new Ut(t)),e.add(this._lineLayer=new Ut(t)),e.add(this._labelLayer=new Ut(t))}_doMeasure(t,e,i,s){const r=e.chart,o=this._steps=e.getSteps(r.width,r.height),n=o.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,o),this.$_layoutBubbles(2*n,o),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,o=this._rScale,n=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.prop("align")){case"center":c=Math.max(p,p+(_-n.width)/2);break;case"right":c=Math.max(p,p+_-n.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-o.x,g-o.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.prop("verticalAlign")){case"top":break;case"bottom":d+=u-n.height;break;default:d+=(u-n.height)/2}else switch(d=l+u-a.height,t.footer.prop("align")){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;Zt.fit(t,this._bubbleLayer,this._bubbles,r,bh,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Zt.fit(t,this._lineLayer,this._lines,r,ka,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Zt.fit(t,this._labelLayer,this._labels,r,ia,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const o=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-o.rd,o.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.prop("length")||0);this._lines.forEach(((i,o)=>{const n=e[o];i.setHLine(t-2*n.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.prop("length")+(i.tick.label.prop("offset")||0);this._labels.forEach(((s,o)=>{const n=e[o];s.setText(i.tick.label.getText(n.label)),s.trans(r,t-2*n.rd-s.bbox().height/2)}))}}}vl.SCALE_CLASS="rm-bubble-scale";class Cl extends da{constructor(t){super(t,Cl.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Cl.SCALE_CLASS="rm-map-scale";class Sl extends Ut{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new Ut(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new Ut(t,"rm-mapregion-body-labels"))}prepare(t,e,i){const s=e.chart,r=s.map;if(r){const{h1:i,h2:o}=r,n=e.scroll%360;this._h1=i+n,this._h2=o,this.$_prepareSeries(t,s,n),this._seriesViews.forEach((e=>{e.prepareLayout(t)}))}}layout(t,e){const i=t.chart,s=i.map,r=this.width,o=this.height;if(s){const{wMap:e,hMap:s,scale:n,tx:a,ty:h}=t.prepareLayout(this.width,this.height);this._transformInfo={tx:a,ty:h,scale:n,vx:0,vy:0};const l=`translate(${a}px, ${h}px) scale(${n}, ${-n})`,c=e*n,d=s*n;this._seriesViews.forEach((t=>{var e,i;t._scale=n,t.model.needMapScale()?(t._pointLayer.internalSetStyle("transform",l),t._calloutContainer.visible&&t._calloutContainer.internalSetStyles({transform:l})):t.trans(a,h),t.move(a,h),t.resize(c,d),t.render(r,o,this._transformInfo),null===(e=t._labelContainer)||void 0===e||e.trans(a,h),null===(i=t.secondLabelContainer())||void 0===i||i.trans(a,h)})),i.getProjection()}const n=this._clip;n&&n.parent&&n.width===r&&n.height===o||(n&&n.dom.remove(),this._clip=this.clipRect(0,0,r,o))}$_prepareSeries(t,e,i){const s=e.visibleSeries,r=this._seriesMap,o=this._seriesViews,n=this._h1,a=this._h2;o.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),o.length=0,s.forEach((e=>{const s=!r[e.hash],h=r[e.hash]||rl(t,e);h.parent||(h.$_setInRegion(),this._seriesContainer.add(h),this._labelsContainer.add(h._labelContainer),this._labelsContainer.add(h.secondLabelContainer())),r[e.hash]=h,o.push(h),h._h1=n,h._h2=a,s&&(e._optionsDirty=!0),h.prepareModel(t,e,i)}))}}class Ll extends aa{constructor(t){super(t,Ll.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new Sl(t)),this.add(this._targetView=new ji(t,"rm-mapregion-target")),this.add(this._connectorView=new Kt(t,"rm-mapregion-connector"))}update(t,e){this.measure(this.doc,this.model,t,e),this._layoutView(0,0,t,e,this._rTarget)}_layoutView(t,e,i,s,r){this._rTarget=r,this.resizeByMeasured(),this.layout(this.model.getPosition(t,e,i,s,this.width,this.height))}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=Dn.defaults.width:r.width=r.height),isNaN(r.height)&&(r.height=r.width),this._deflatePaddings(r),r}_doLayout(t){const e=this._rTarget,i=t.x||0,s=t.y||0;this.trans(i,s),this._background.resize(this.width,this.height),e.x-=i,e.y-=s,this._targetView.setRect(e),this._connectorView.setPath(this.$_getConnector(e)),this._bodyView.resize(this.width-1,this.height-1),this._bodyView.prepare(this.doc,this.model,this.chart().body),this._bodyView.layout(this.model,this.chart().body)}$_getConnector(t){const e=0+this.width,i=0+this.height;let s;return s=0>t.x?i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[0,0,t.x+t.width,t.y,0,i,t.x+t.width,t.y+t.height]:i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[e,0,t.x,t.y,e,i,t.x,t.y+t.height],`M ${s[0]} ${s[1]} L ${s[2]} ${s[3]} M ${s[4]} ${s[5]} L ${s[6]} ${s[7]}`}}Ll.CLASS_NAME="rm-mapregion";class Ml extends ha{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new dl(t,!1)),this.add(this.subtitleView=new dl(t,!0))}_doMeasure(t,e,i,s){const r=e._title,o=e._subtitle;let n,a=0,h=0,l=0,c=0,d=this.titleView,_=i,p=0,g=0;switch(d.setVisible(r.isVisible())?(n=d.measure(t,r,i,s),h=this._hTitle=n.height,a=this._wTitle=n.width):d.setModel(r),(d=this.subtitleView).setVisible(o.isVisible())?(n=d.measure(t,o,i,s),c=this._hSub=n.height,l=this._wSub=n.width,g=+o.prop("titleGap")||0):d.setModel(o),o.prop("position")){case"left":case"right":p=u(h,c),_=a+g+l;break;default:p=h+g+c,_=u(_,a+l)}return p>0&&(p+=this.titleView.visible?m(r.prop("gap"),0):m(o.prop("gap"),0)),{width:_,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,o=s&&s.visible?this._wTitle>t.wMap||"chart"===s.prop("alignBase")?t.wChart:t.wMap:0,n=r&&r.visible?this._wSub>t.wMap||"chart"===r.prop("alignBase")?t.wChart:t.wMap:0;let a=this._wTitle>t.wMap||s&&"chart"===s.prop("alignBase")?0:t.xMap,h=this._wSub>t.wMap||r&&"chart"===r.prop("alignBase")?0:t.xMap;if(o>0&&n>0){const t=(t,e,i)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},l=()=>{const e=u(this._hTitle,this._hSub);p=u(p,p+t(s,e,this._hTitle)),f=u(f,f+t(r,e,this._hSub))},c=(t,e,i)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},d=()=>{if(g=u(g,g+c(s,o,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":b=g;break;case"right":b=g+this._wTitle-this._wSub;break;default:b=g+(this._wTitle-this._wSub)/2}else b=u(b,b+c(r,n,this._wSub))},_=m(r.prop("titleGap"),0);let p=0,g=a,f=0,b=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"left":g=b+this._wSub+_,l();break;case"right":switch(b=g+this._wTitle+_,r.prop("align")){case"center":b=u(b,b+(n-this._wTitle-this._wSub)/2);break;case"right":b=u(b,h+n-this._wSub)}l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}break;case"right":switch(r.prop("position")){case"left":switch(g+=o-this._wTitle,r.prop("align")){case"center":b+=(o-this._wTitle-this._wSub)/2;break;case"right":b=g-_-this._wSub}l();break;case"right":b+=n-this._wSub,g=b-_-this._wTitle,l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}break;default:switch(r.prop("position")){case"left":switch(g+=(o-this._wTitle)/2,r.prop("align")){case"left":break;case"center":b+=(g-b-this._wSub)/2;break;case"right":b=g-_-this._wSub}l();break;case"right":switch(g+=(o-this._wTitle)/2,r.prop("align")){case"left":b=g+this._wTitle+_;break;case"center":b=g+this._wTitle+_,b+=(n-b-this._wSub)/2;break;case"right":b+=n-_-this._wSub}l();break;case"top":d(),p=f+this._hSub+_;break;default:d(),f=p+this._hTitle+_}}e.resizeByMeasured().layout().trans(g,p),i.resizeByMeasured().layout().trans(b,f)}else if(o>0||n>0){const t=o?s:r,l=o?e:i,c=o||n,d=o?this._wTitle:this._wSub;let _=o?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":_+=c-d;break;default:_+=(c-d)/2}l.trans(_,0)}}_doLocateInner(t,e,i){}}class Al extends da{constructor(t){super(t,Al.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new Ut(t,"rm-map-widget-group-widget-layer"))}getView(t){return this._dic.get(t)}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),o=this._gap=8,n=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new oa;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),n.forEach(((r,o)=>{r.measure(t,e.getWidget(o),i,s),this._dic.set(r.model,r)})),r?(n.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),n.length>1&&(a.height+=(n.length-1)*o)):(n.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),n.length>1&&(a.width+=(n.length-1)*o)),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,o=this._paddings,n=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+o.left,d=r.top+o.top;let _,u,p=this.width-c-r.right-o.right,g=this.height-d-r.bottom-o.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.prop("align")){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.prop("verticalAlign")){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.prop("align")){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.prop("align")){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+n})):a.forEach((t=>{switch(t.model.prop("verticalAlign")){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+n}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return this._dic.clear(),e.forEach((e=>{let o=null==s?void 0:s.find((t=>t.model===e));o?(r.push(o),s.splice(s.indexOf(o),1)):(o=new(Pl[e._type()])(t),i.add(o),r.push(o))})),null==s||s.forEach((t=>t.remove())),r}}Al.GROUP_CLASS="rm-map-widget-group";const Pl={legend:pa,colorScale:ml,bubbleScale:vl,group:Al};class kl extends ha{constructor(t,e){super(t),this._loc=e,this._horz=e==tt.TOP||e==tt.BOTTOM,this._vert=e==tt.LEFT||e==tt.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){let e=this._views.get(t);if(!e)for(const i of this._views.values())if(i instanceof Al&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,i){return r(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof pa&&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 o=this._gap=m(+e.global.prop("widgetGap"),0),n=new oa;return this._horz?(r.forEach((t=>{n.width+=t.mw,n.height=u(n.height,t.mh)})),n.width+=r.size>0?(r.size-1)*o:0):this._vert?(r.forEach((t=>{n.width=u(n.width,t.mw),n.height+=t.mh})),n.height+=r.size>0?(r.size-1)*o:0):r.forEach((t=>{n.width+=t.mw,n.height+=t.mh})),n}_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,o=this.height,n=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(n,a),a+=t.height+s;o-=t,a=o;for(const t of this._ends)a-=t.height,t.trans(n,a),a-=s;o-=i,a=t+Math.max(0,Math.ceil((o-r)/2));for(const t of this._centers)t.trans(n,a),a+=t.height+s}else if(this._horz){let t=0,i=0,o=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)o+=t.width;o+=e(this._centers);for(const t of this._starts)t.trans(n,a),n+=t.width+s;r-=t,n=r;for(const t of this._ends)n-=t.width,t.trans(n,a),n-=s;r-=i,n=t+Math.max(0,Math.ceil((r-o)/2));for(const t of this._centers)t.trans(n,a),n+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=i.mw,o=i.mh;let n=+s.prop("offsetX")||0,a=0,h=0;switch(s.prop("align")){case"right":a+=t-r-n;break;case"center":a+=(t-r)/2+n;break;default:a+=n}switch(n=+s.prop("offsetY")||0,s.prop("verticalAlign")){case"bottom":h+=e-o-n;break;case"middle":h+=(e-o)/2+n;break;default:h+=n}i.trans(a,h).resize(r,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(Pl[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.prop("align")){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.prop("verticalAlign")){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class Il extends na{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Ze(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.prop("offsetX")||0,o=+t.prop("offsetY")||0;let n=0,a=0;switch(t.prop("verticalAlign")){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+o;break;default:a=e.y+o}switch(t.prop("align")){case"right":n=e.right-i-r;break;case"center":n=e.x+(e.width-i)/2+r;break;default:n=e.x+r}return{x:n,y:a}}locateOuter(t,e,i){const s=t.prop("location"),r=this.width,o=this.height,n=+t.prop("offsetX")||0,a=+t.prop("offsetY")||0;let h=0,l=0;switch(s){case"left":h=n;break;case"right":h=e-r-n;break;case"top":l=a;break;default:l=i-o-a}if("left"===s||"right"===s)switch(t.prop("verticalAlign")){case"top":l=a;break;case"bottom":l=i-o;break;default:l=(i-o)/2+a}else switch(t.prop("align")){case"left":h=n;break;case"center":h=(e-r)/2+n;break;default:h=e-r-n}return{x:h,y:l}}_doMeasure(t,e,i,s){return this._textView.text=e.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.bbox()}}class Nl extends Ut{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this._mapRegionViews=[],this._mapRegionMap=new Map,this.add(this._annotationContainer=new Ut(t,"rm-annotations")),this.add(this._bodyView=new cl(t,this)),this.add(this._mapRegionContainer=new Ut(t,"rm-mapregions")),this.add(this._titleSectionView=new Ml(t)),this.add(this._widgetLayer=new Ut(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new Ut(t,"rm-front-annotations")),this.add(this._zoomPanelView=new wl(t)),this.add(this._drilldownPanelView=new xl(t)),this.add(this._mapScaleView=new Cl(t)),this.add(this._creditView=new Il(t)),this.add(this._tooltipView=new gl(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,o=this._bodyView;let n,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible))switch(n=this._creditView.measure(t,r,a,h),r.prop("location")){case"body":break;case"right":case"left":a-=n.width+(+r.prop("offsetX")||0)+(+r.prop("gap")||0);break;default:h-=n.height+(+r.prop("offsetY")||0)+(+r.prop("gap")||0)}n=this._titleSectionView.measure(t,e,a,h),h-=n.height,o.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(tt)){const o=l[r];let n=this._widgetMap[r];if(o.length>0){n?n.setVisible(!0):(n=new kl(t,r),this._widgetLayer.add(n),this._widgetMap[r]=n);const l=n._setWidgets(o,i,s).measure(t,e,a,h);if(l){const t=e.global.getWidgetSectionGap(r);r===tt.BOTTOM||r===tt.TOP?h-=l.height+t:r!==tt.RIGHT&&r!==tt.LEFT||(a-=l.width+t)}}else n&&n.setVisible(!1)}o.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this.$_prepareMapRegions(t,e.getMapRegions()),this._mapRegionViews.forEach(((e,r)=>{e.measure(t,this._mapRegions[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const o=this._bodyView;let n=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){h.resizeByMeasured();const t=h.width+(+a.prop("offsetX")||0)+(+a.prop("gap")||0),e=h.height+(+a.prop("offsetY")||0)+(+a.prop("gap")||0);switch(a.prop("location")){case"body":break;case"right":s-=t;break;case"left":s-=t,c+=t;break;case"top":r-=e,d+=e;break;default:r-=l=e}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=n=_.height);const u=this._widgetMap;for(const o in u){const n=u[o];if(n.visible){o===tt.RIGHT||o===tt.LEFT?(n.resize(n.mw,i),n.layout()):o===tt.TOP||o===tt.BOTTOM?(n.resize(e,n.mh),n.layout()):n.resize(n.mw,n.mh);const a=t.global.getWidgetSectionGap(o);switch(o){case tt.BOTTOM:r-=n.height+a;break;case tt.TOP:r-=n.height+a,d+=n.height+a;break;case tt.RIGHT:s-=n.width+a;break;case tt.LEFT:s-=n.width+a,c+=n.width+a}}}const p=dt.create(c,d,s,r);if(h.visible){const t="body"===a.prop("location")?h.locateInner(a,p):h.locateOuter(a,e,i);h.transp(t)}o.trans(p.x,p.y),o.resize(p.width,p.height),o.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case tt.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case tt.TOP:d=n+0,c=(e-s.width)/2;break;case tt.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case tt.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this.$_layoutMapRegions(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:o}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},n=this._model.chart._tooltip.isFollowPointer(t),a=(n?s.x:r)-this.tx,h=(n?s.y:o)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model&&this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),o=this._bodyView.mouseToMap(r,!1);let n;i instanceof Oh&&(n=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),n||(n=this._model.map.findByCoord(o)),r.coord=o,r.area=null==n?void 0:n.id,r.chart=this._model.wrapper,this._model.click(r)}}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}zoomChanged(t,e){this._bodyView.zoomChanged(t,e)}isAnimating(){}onScrollStart(){this.bodyView().onScrollStart()}onRotationStart(){this.bodyView().onRotationStart()}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);o.forEach((t=>{r.get(t.model)||t.remove()})),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ol(t,e);(!1===e.prop("front")?i:s).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,o,n,a;this._annotationViews.forEach((i=>{if("container"===i.model.prop("scope"))r=-s.left,o=-s.top,n=t+s.left+s.right,a=e+s.top+s.bottom;else r=o=0,n=t,a=e;i._layoutView(this,r,o,n,a)}))}$_prepareMapRegions(t,e){const i=this._mapRegionContainer,s=this._mapRegionMap,r=this._mapRegionViews;for(const t of s.keys())e.indexOf(t)<0&&s.delete(t);r.forEach((t=>{s.get(t.model)||t.remove()})),r.length=0,(this._mapRegions=e).forEach((e=>{const o=s.get(e)||new Ll(t);i.add(o),s.set(e,o),r.push(o)}))}$_layoutMapRegions(t,e,i){const s=this._bodyView,r=this.tx+s.tx,o=this.ty+s.ty,n=this.control._padding;let a,h,l,c;this._mapRegionViews.forEach((i=>{const d=s.boundsByCoord(i.model.prop("bounds")[0],i.model.prop("bounds")[1]);if("container"===i.model.prop("scope"))a=-n.left,h=-n.top,l=t+n.left+n.right,c=e+n.top+n.bottom;else a=h=0,l=t,c=e;d.x+=r,d.y+=o,i._layoutView(a,h,l,c,d)}))}$_layoutPanel(t,e){const i=t.model,s=i.prop("offsetX")||0,r=i.prop("offsetY")||0,o=t.width,n=t.height;let a=e.x,h=e.y;switch(i.prop("verticalAlign")){case"bottom":h+=e.height-r-n;break;case"middle":h+=(e.height-n)/2+r;break;default:h+=r}switch(i.prop("align")){case"right":a+=e.width-s-o;break;case"center":a+=(e.width-o)/2+s;break;default:a+=s}t.trans(a,h)}}var El;!function(t){t.EXPORT="$$realmap_export"}(El||(El={}));class Tl extends Yt{constructor(t,e){super(t,e),this._isLoading=!1,this.addElement(this._chartView=this._createChartView(t)),this.addElement(this._errorView=new Ze(t,"rm-error-view")),this._chart=new qn(null,((t,e)=>{this.changeModel(t,e)})),this._errorView.visible=!1}_createChartView(t){return new Nl(t)}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e,i){this._chartView.zoomChanged(e,i),this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this.$_export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i},!1)}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===El.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}setLoading(t){this._isLoading=t}showErrorView(e="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=t.TextLayout.MIDDLE,this._errorView.text=e,this._errorView.stain();const{width:i,height:s}=this._errorView.bbox(),r=16+i/2,o=16+s/2;this._errorView.trans(r,o)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new ra(this)}_doBeforeRender(t){this._chart&&t.internalResetStyleOrClass(this._chart.global.prop("style"))}_doRender(t){const e=this.model,i=this._chartView,s=t.width,r=t.height;this._setBackgroundStyle(e.global.prop("backgroundStyle")),e&&(this.setResizeDelay(e.global.prop("resizeDelay")),e.prepareRender(),this.$_loadModules()),this.loaded||i.clean(),i.measure(this.doc(),e,s,r),i.setRect(t),i.layout(),e&&e.afterRender()}_doAfterRender(){var t;if(this._chartView.bodyView().afterRender(),null===(t=this._chart)||void 0===t?void 0:t._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}isLoading(){return this._isLoading}_doWheel(t){var e;return!(null===(e=this.model)||void 0===e?void 0:e.global.prop("wheelDisabled"))}$_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}$_export(t){if(!this.model||!this.chart.exporter.isCompose())return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(e,t)}}}const Vl={chartControl:Tl};class Dl{static getVersion(){return"1.1.13"}static setLicenseKey(t){Ft.code=t}static setDebugging(t){Zt.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static getDistance(t,e){return ht.getDistance(t,e)}static setGlobals(t){Object.assign(Vl,t)}static createChart(t,e,i,s=!0,r){v.loadConfigAsync(i,!0);const o=new Vl.chartControl(t,e);return Dl.loadChart(o,i,s,r),o.chart[Xn]=o,o.chart}static async createChartAsync(t,e,i,s=!0,r){const o=new Zn(t,e);o.show();let n=null;try{await v.loadConfigAsync(i),n=new Vl.chartControl(t,e),n.setLoading(!0),n.chart[Xn]=n,Dl.loadChart(n,i,s,r)}catch(t){Un.handleChartInitError(t,n)}finally{null==n||n.setLoading(!1),o.hide(),o.dispose()}return n.chart}static preset(t,e){return Pr.createStockInset(t,e)}static loadChart(t,e,i,r){t.chart.load(s(e)?e:{},i,r)}}class Rl{constructor(){this._moduleMap=new Map}static getInstance(){return Rl.instance||(Rl.instance=new Rl),Rl.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Rl.instance=null,Rl.ModuleNames={realchart:"realchart"};const $l=Dl.getVersion,Ol=Dl.setDebugging,Fl=Dl.setLogging,Bl=Dl.setGlobals,zl=Dl.getDistance,jl=Dl.createChart,Gl=Dl.createChartAsync,Hl=Dl.preset,Wl=Dl.setLicenseKey;t.Annotation=$i,t.AnnotationView=ma,t.BandSeriesType="band",t.BarSeries=wo,t.BarSeriesView=hh,t.Body=zn,t.BodyView=cl,t.BubbleSeries=Ps,t.BubbleSeriesView=ch,t.ChartAnnotationType="chart",t.ChartControl=Tl,t.ChartElement=na,t.ChartItem=ai,t.ChartObject=Hn,t.ChartView=Nl,t.CircleElement=bh,t.CircleGauge=Io,t.CircleGaugeView=fh,t.ClockGauge=zo,t.ClockGaugeView=xh,t.Color=Ge,t.ColorRanger=$s,t.CoordBaseSeries=gs,t.Credits=xi,t.DEG_RAD=I,t.DataPoint=qi,t.DataPointLabel=Qi,t.Dom=Ht,t.DragTracker=Jn,t.ElementPool=_a,t.Exporter=Us,t.ExternalModuleManager=Rl,t.FeatureSeriesType="feature",t.FigureSeries=Ho,t.FigureSeriesView=Ch,t.GLPointSeriesType="glpoint",t.HeatmapSeriesType="heatmap",t.HtmlAnnotation=Qr,t.HtmlAnnotationView=el,t.HtmlSeries=Zo,t.HtmlSeriesView=sl,t.ImageAnnotation=to,t.ImageAnnotationView=Ka,t.ImageElement=Wn,t.ImageSeries=qo,t.ImageSeriesView=Lh,t.LayerElement=Ut,t.Legend=Ds,t.LineElement=ka,t.LineSeries=tn,t.LineSeriesView=Ph,t.MapArea=Or,t.MapAxis=hr,t.MapAxisBandGuide=rr,t.MapAxisGuide=ir,t.MapAxisLineGuide=sr,t.MapAxisRangeGuide=or,t.MapChart=qn,t.MapCrosshair=ar,t.MapSeries=hn,t.MapSeriesType="map",t.MapSeriesView=Oh,t.MapTool=ra,t.MarkerSeries=fs,t.MarkerSeriesPoint=ms,t.MarkerSeriesPointView=Ga,t.MarkerSeriesView=Ha,t.ORG_ANGLE=k,t.OrthogonalSparkSeries=vs,t.PI=A,t.PI_2=P,t.PanelSeries=pn,t.PanelSeriesView=Gh,t.PathElement=Kt,t.PieSeries=fn,t.PieSeriesView=Yh,t.PinSeries=wn,t.PinSeriesView=Uh,t.PointElement=Oa,t.PointLabelView=Ta,t.PointSeries=Mn,t.PointSeriesView=qh,t.PointViewPool=Ea,t.PolyLineElement=Ia,t.RAD_DEG=N,t.RectElement=ji,t.RegionSeriesType="region",t.RmElement=Zt,t.RouteSeries=kn,t.RouteSeriesType=zi,t.RouteSeriesView=Jh,t.SVGNS=e,t.SankeySeriesType="sankey",t.SectionView=ha,t.SectorElement=dh,t.Series=ds,t.SeriesAnimation=th,t.SeriesView=za,t.ShapeAnnotation=eo,t.ShapeAnnotationView=Ja,t.Size=oa,t.SparkSeries=ws,t.Subtitle=Ur,t.TableSeriesType="table",t.TextAnnotation=io,t.TextAnnotationView=Qa,t.TextElement=Ze,t.TiledWebSeriesType="tiledweb",t.Title=Zr,t.TrackSeriesType="track",t.Utils=ht,t.ValuePoint=us,t.ValueSeries=ps,t.VectorSeriesType="vector",t.WaffleSeries=Nn,t.WaffleSeriesView=tl,t._isIE=at,t.absv=p,t.assignObj=l,t.calcPercent=Y,t.ceil=V,t.copyObj=g,t.cos=c,t.createChart=jl,t.createChartAsync=Gl,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=ri,t.fixnum=D,t.floor=T,t.getDistance=zl,t.getVersion=$l,t.incv=w,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=s,t.isString=n,t.maxv=u,t.minv=_,t.parseCoord=function(t){if(r(t))return[+t[0],+t[1]];if(n(t)){const e=t.split(Ai);return[+e[0],+e[1]]}if(s(t)){if(t&&!isNaN(t.lon)&&!isNaN(t.lat))return[t.lon,t.lat];if(!isNaN(t.x)&&!isNaN(t.y))return[t.x,t.y]}return[0,0]},t.parsePercentSize=W,t.pickNum=m,t.pickProp=b,t.pickProp3=y,t.pixel=O,t.preset=Hl,t.rectToSize=ct,t.setDebugging=Ol,t.setGlobals=Bl,t.setLicenseKey=Wl,t.setLogging=Fl,t.sin=d}));